@tangle-network/agent-integrations 0.75.3 → 0.76.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -14
- package/data/bundled-adapter-manifests.json +1 -1
- package/dist/{adapters-CrN3lR4d.js → adapters-Bx-UTWRg.js} +55 -8
- package/dist/{adapters-CrN3lR4d.js.map → adapters-Bx-UTWRg.js.map} +1 -1
- package/dist/{bundled-manifest-data-C7dav10o.js → bundled-manifest-data-BgTJ7dmp.js} +33 -1
- package/dist/{bundled-manifest-data-C7dav10o.js.map → bundled-manifest-data-BgTJ7dmp.js.map} +1 -1
- package/dist/{bundled-manifest-runtime-G6p2i9W-.d.ts → bundled-manifest-runtime-EpjLQKA9.d.ts} +7 -3
- package/dist/bundled-manifest-runtime-EpjLQKA9.d.ts.map +1 -0
- package/dist/{catalog-DmAjfp4i.d.ts → catalog-z4zNeXVL.d.ts} +3 -3
- package/dist/{catalog-DmAjfp4i.d.ts.map → catalog-z4zNeXVL.d.ts.map} +1 -1
- package/dist/catalog.d.ts +1 -1
- package/dist/{cloudbeds-BL5EF3xl.js → cloudbeds-CGSoT275.js} +17 -2
- package/dist/cloudbeds-CGSoT275.js.map +1 -0
- package/dist/connect/index.d.ts +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connectors/adapters/index.d.ts +2 -2
- package/dist/connectors/adapters/index.js +3 -3
- package/dist/connectors/index.d.ts +7 -7
- package/dist/connectors/index.js +8 -7
- package/dist/connectors/oauth.d.ts +2 -2
- package/dist/connectors/oauth.js +7 -205
- package/dist/connectors/oauth.js.map +1 -1
- package/dist/{consumer-BafUQUla.d.ts → consumer-YE5ibTlI.d.ts} +18 -9
- package/dist/consumer-YE5ibTlI.d.ts.map +1 -0
- package/dist/consumer.d.ts +1 -1
- package/dist/consumer.js +1 -1
- package/dist/{core-types-DfCMwTYt.d.ts → core-types-0BenSoZJ.d.ts} +17 -3
- package/dist/core-types-0BenSoZJ.d.ts.map +1 -0
- package/dist/{coverage-catalog-oQiZ8yot.d.ts → coverage-catalog-5LheuThC.d.ts} +2 -2
- package/dist/{coverage-catalog-oQiZ8yot.d.ts.map → coverage-catalog-5LheuThC.d.ts.map} +1 -1
- package/dist/coverage-catalog.d.ts +1 -1
- package/dist/{hub-D13zPQGr.js → hub-Cl8phyJ9.js} +316 -149
- package/dist/hub-Cl8phyJ9.js.map +1 -0
- package/dist/{hub-fmmnwC2s.d.ts → hub-DkiKVWJX.d.ts} +5 -3
- package/dist/hub-DkiKVWJX.d.ts.map +1 -0
- package/dist/hub.d.ts +1 -1
- package/dist/hub.js +1 -1
- package/dist/{index-DbwNiedC.d.ts → index-BFK-G6g1.d.ts} +2 -2
- package/dist/{index-DbwNiedC.d.ts.map → index-BFK-G6g1.d.ts.map} +1 -1
- package/dist/{index-CHD_8Gn2.d.ts → index-BNzWrQM0.d.ts} +3 -3
- package/dist/{index-CHD_8Gn2.d.ts.map → index-BNzWrQM0.d.ts.map} +1 -1
- package/dist/{index-B-VH5b3E.d.ts → index-CkCYzn8f.d.ts} +2 -2
- package/dist/{index-B-VH5b3E.d.ts.map → index-CkCYzn8f.d.ts.map} +1 -1
- package/dist/{index-BKTHRkGz.d.ts → index-WwSnaq5E.d.ts} +11 -2
- package/dist/{index-BKTHRkGz.d.ts.map → index-WwSnaq5E.d.ts.map} +1 -1
- package/dist/{index-CW1fmxQi.d.ts → index-poLalSQ6.d.ts} +3 -3
- package/dist/{index-CW1fmxQi.d.ts.map → index-poLalSQ6.d.ts.map} +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +11 -10
- package/dist/internal/bundled-manifest-runtime.d.ts +1 -1
- package/dist/internal/bundled-manifest-runtime.js +30 -2
- package/dist/internal/bundled-manifest-runtime.js.map +1 -1
- package/dist/mcp.d.ts +2 -2
- package/dist/mcp.js +2 -2
- package/dist/middleware/index.d.ts +1 -1
- package/dist/middleware/index.js +1 -1
- package/dist/{oauth-tzsnaJIb.d.ts → oauth-DoUCpYU_.d.ts} +85 -64
- package/dist/oauth-DoUCpYU_.d.ts.map +1 -0
- package/dist/oauth-protocol-CFrGJlSz.js +195 -0
- package/dist/oauth-protocol-CFrGJlSz.js.map +1 -0
- package/dist/{policy-C9frNJFH.d.ts → policy-C8jynxf9.d.ts} +2 -2
- package/dist/{policy-C9frNJFH.d.ts.map → policy-C8jynxf9.d.ts.map} +1 -1
- package/dist/{registry-CE1iu5zX.d.ts → registry-0xWMSBUu.d.ts} +3 -3
- package/dist/{registry-CE1iu5zX.d.ts.map → registry-0xWMSBUu.d.ts.map} +1 -1
- package/dist/{registry-core-DtFI-9kF.d.ts → registry-core-B1ApiG47.d.ts} +2 -2
- package/dist/{registry-core-DtFI-9kF.d.ts.map → registry-core-B1ApiG47.d.ts.map} +1 -1
- package/dist/registry.d.ts +2 -2
- package/dist/registry.js +1 -1
- package/dist/runtime.d.ts +1 -1
- package/dist/sandbox.d.ts +1 -1
- package/dist/{specs-Dp7I8aL5.js → specs-02Un982U.js} +2 -2
- package/dist/{specs-Dp7I8aL5.js.map → specs-02Un982U.js.map} +1 -1
- package/dist/specs.d.ts +1 -1
- package/dist/specs.js +1 -1
- package/dist/{src-6gBH8WOq.js → src-VFvRn2yV.js} +13 -6
- package/dist/src-VFvRn2yV.js.map +1 -0
- package/dist/{tangle-id-Bq7jkKmE.d.ts → tangle-id-BW5dTiGi.d.ts} +2 -2
- package/dist/{tangle-id-Bq7jkKmE.d.ts.map → tangle-id-BW5dTiGi.d.ts.map} +1 -1
- package/dist/{tangle-id-81ShqJ7k.js → tangle-id-DUsy7I9_.js} +2 -2
- package/dist/{tangle-id-81ShqJ7k.js.map → tangle-id-DUsy7I9_.js.map} +1 -1
- package/dist/{types-W418mSuf.d.ts → types-Bq85dJDW.d.ts} +13 -1
- package/dist/types-Bq85dJDW.d.ts.map +1 -0
- package/dist/{types-BSDXGSi5.js → types-CjrugGcd.js} +13 -7
- package/dist/types-CjrugGcd.js.map +1 -0
- package/dist/webhooks/index.js +1 -1
- package/dist/worker.d.ts +3 -3
- package/package.json +1 -1
- package/dist/bundled-manifest-runtime-G6p2i9W-.d.ts.map +0 -1
- package/dist/cloudbeds-BL5EF3xl.js.map +0 -1
- package/dist/consumer-BafUQUla.d.ts.map +0 -1
- package/dist/core-types-DfCMwTYt.d.ts.map +0 -1
- package/dist/hub-D13zPQGr.js.map +0 -1
- package/dist/hub-fmmnwC2s.d.ts.map +0 -1
- package/dist/oauth-tzsnaJIb.d.ts.map +0 -1
- package/dist/src-6gBH8WOq.js.map +0 -1
- package/dist/types-BSDXGSi5.js.map +0 -1
- package/dist/types-W418mSuf.d.ts.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cloudbeds-BL5EF3xl.js","names":[],"sources":["../src/connectors/webhooks.ts","../src/connectors/adapters/cloudbeds.ts"],"sourcesContent":["/**\n * Inbound webhook signature verifiers — provider-specific HMAC schemes.\n *\n * Each signature scheme is a pure function:\n * (rawBody: string, headers, secret, now?) → boolean\n *\n * Constant-time comparison via `crypto.timingSafeEqual`. Timestamps are\n * checked against a configurable tolerance to bound replay risk; the default\n * mirrors the upstream provider's documented window (Stripe: 5 min, Slack: 5 min).\n *\n * These verifiers are the building blocks for any inbound-webhook receiver\n * (a route + a `verify` call + a per-event handler). They live in this\n * package so every consumer of the integration substrate gets correct\n * verification — not just one product reimplementing it.\n */\n\nimport { createHmac, timingSafeEqual } from 'node:crypto'\n\n/** Default replay-protection window. Providers commonly use 5 minutes. */\nexport const DEFAULT_SIGNATURE_TOLERANCE_SECONDS = 5 * 60\n\n// ─── Stripe ─────────────────────────────────────────────────────────────\n//\n// Stripe signs webhooks with a single header `Stripe-Signature` of the form\n//\n// t=<timestamp>,v1=<sig1>,v1=<sig2>,...\n//\n// where `t` is the Unix timestamp the event was generated, and each `v1`\n// is `HMAC-SHA256(secret, \"<t>.<rawBody>\")`. Multiple `v1` entries appear\n// during secret rotation — any one matching is sufficient.\n//\n// https://stripe.com/docs/webhooks/signatures\n\nexport interface ParsedStripeSignatureHeader {\n t: number\n sigs: string[]\n}\n\nexport function parseStripeSignatureHeader(header: string): ParsedStripeSignatureHeader | null {\n const acc: { ts?: number; sigs: string[] } = { sigs: [] }\n for (const part of header.split(',')) {\n const idx = part.indexOf('=')\n if (idx < 0) continue\n const key = part.slice(0, idx).trim()\n const val = part.slice(idx + 1).trim()\n if (key === 't') {\n const n = Number(val)\n if (Number.isFinite(n)) acc.ts = n\n } else if (key === 'v1') {\n acc.sigs.push(val)\n }\n }\n if (acc.ts === undefined || acc.sigs.length === 0) return null\n return { t: acc.ts, sigs: acc.sigs }\n}\n\nexport interface StripeVerifyOptions {\n /** Replay-protection window in seconds. Default 300. */\n toleranceSeconds?: number\n /** Override `now()` for tests. UTC seconds. */\n now?: number\n}\n\n/** Verify a Stripe webhook signature against the raw request body. */\nexport function verifyStripeSignature(\n rawBody: string,\n signatureHeader: string,\n secret: string,\n options: StripeVerifyOptions = {},\n): boolean {\n const parsed = parseStripeSignatureHeader(signatureHeader)\n if (!parsed) return false\n const tolerance = options.toleranceSeconds ?? DEFAULT_SIGNATURE_TOLERANCE_SECONDS\n const now = options.now ?? Math.floor(Date.now() / 1000)\n if (Math.abs(now - parsed.t) > tolerance) return false\n const expected = createHmac('sha256', secret).update(`${parsed.t}.${rawBody}`).digest('hex')\n const expectedBuf = Buffer.from(expected, 'utf8')\n for (const sig of parsed.sigs) {\n const sigBuf = Buffer.from(sig, 'utf8')\n if (sigBuf.length !== expectedBuf.length) continue\n if (timingSafeEqual(sigBuf, expectedBuf)) return true\n }\n return false\n}\n\n// ─── Slack ──────────────────────────────────────────────────────────────\n//\n// Slack signs request bodies with two headers:\n//\n// X-Slack-Signature: v0=<HMAC-SHA256(secret, \"v0:<ts>:<body>\")>\n// X-Slack-Request-Timestamp: <ts>\n//\n// https://api.slack.com/authentication/verifying-requests-from-slack\n\nexport interface SlackVerifyOptions {\n toleranceSeconds?: number\n now?: number\n}\n\nexport function verifySlackSignature(\n rawBody: string,\n signatureHeader: string,\n timestampHeader: string,\n secret: string,\n options: SlackVerifyOptions = {},\n): boolean {\n if (!signatureHeader.startsWith('v0=')) return false\n const ts = Number(timestampHeader)\n if (!Number.isFinite(ts)) return false\n const tolerance = options.toleranceSeconds ?? DEFAULT_SIGNATURE_TOLERANCE_SECONDS\n const now = options.now ?? Math.floor(Date.now() / 1000)\n if (Math.abs(now - ts) > tolerance) return false\n const expected = 'v0=' + createHmac('sha256', secret).update(`v0:${ts}:${rawBody}`).digest('hex')\n const expectedBuf = Buffer.from(expected, 'utf8')\n const sigBuf = Buffer.from(signatureHeader, 'utf8')\n if (sigBuf.length !== expectedBuf.length) return false\n return timingSafeEqual(sigBuf, expectedBuf)\n}\n\n// ─── Generic HMAC ───────────────────────────────────────────────────────\n//\n// For \"we shipped a webhook URL with a shared HMAC secret\" patterns —\n// covers any custom integration where the operator picks the message\n// format. The signed message is the literal `rawBody` (no timestamp\n// prefix); replay protection is the caller's responsibility (use a\n// nonce header + a small dedup cache).\n\nexport interface GenericHmacVerifyOptions {\n /** sha256 (default) | sha1 | sha512 — matches the algorithm the receiver\n * computed at sign time. */\n algorithm?: 'sha256' | 'sha1' | 'sha512'\n /** Optional prefix the receiver prepends to the signature in the header\n * (e.g., `'sha256='`). Stripped before constant-time comparison. */\n signaturePrefix?: string\n /** Lowercase comparison (most providers emit hex-lowercase). Default true. */\n lowercaseHex?: boolean\n}\n\nexport function verifyHmacSignature(\n rawBody: string,\n signatureHeader: string,\n secret: string,\n options: GenericHmacVerifyOptions = {},\n): boolean {\n const algorithm = options.algorithm ?? 'sha256'\n const prefix = options.signaturePrefix ?? ''\n const lower = options.lowercaseHex ?? true\n let candidate = signatureHeader\n if (prefix) {\n if (!candidate.startsWith(prefix)) return false\n candidate = candidate.slice(prefix.length)\n }\n if (lower) candidate = candidate.toLowerCase()\n const expected = createHmac(algorithm, secret).update(rawBody).digest('hex')\n const expectedBuf = Buffer.from(expected, 'utf8')\n const sigBuf = Buffer.from(candidate, 'utf8')\n if (sigBuf.length !== expectedBuf.length) return false\n return timingSafeEqual(sigBuf, expectedBuf)\n}\n\n// ─── Twilio ─────────────────────────────────────────────────────────────\n//\n// Twilio's webhook signature scheme is unlike Stripe/Slack — it doesn't\n// sign the raw body. It signs the concatenation of:\n//\n// fullUrl + sortedConcatenatedParams\n//\n// where `fullUrl` is the public URL Twilio called (scheme + host + path\n// + query, exactly as Twilio constructed it from your console config),\n// and `sortedConcatenatedParams` is `key1+value1+key2+value2+...` over\n// the alphabetically-sorted keys of the POST body params (form-encoded).\n//\n// For JSON-bodied Twilio webhooks (Conversations API), the body is signed\n// as raw bytes — pass `{ bodyAsRaw: true, rawBody }` for that path.\n//\n// HMAC-SHA1, base64-encoded. Header: `X-Twilio-Signature`.\n//\n// https://www.twilio.com/docs/usage/webhooks/webhooks-security\n\nexport interface TwilioVerifyOptions {\n /** Skip verification when the auth token isn't configured. Useful in\n * dev where the receiver wants to accept any payload. Default `false`\n * — production should always require a configured token. */\n skipWhenAuthTokenMissing?: boolean\n /** When true, sign the raw body instead of the URL-encoded sorted-params\n * reduction. Twilio uses raw-body signing for `application/json`\n * webhook bodies. Default `false`. */\n bodyAsRaw?: boolean\n /** When `bodyAsRaw` is true, the raw body to sign. Ignored otherwise. */\n rawBody?: string\n}\n\n/** Verify a Twilio webhook signature. */\nexport function verifyTwilioSignature(\n input: {\n authToken: string | null | undefined\n signatureHeader: string | string[] | undefined\n fullUrl: string | null | undefined\n params: Record<string, string> | undefined\n },\n options: TwilioVerifyOptions = {},\n): boolean {\n if (!input.authToken) {\n return options.skipWhenAuthTokenMissing === true\n }\n const signature = input.signatureHeader\n if (!signature || Array.isArray(signature)) return false\n if (!input.fullUrl) return false\n\n const data = options.bodyAsRaw === true\n ? input.fullUrl + (options.rawBody ?? '')\n : Object.keys(input.params ?? {})\n .sort()\n .reduce((acc, key) => acc + key + (input.params![key] ?? ''), input.fullUrl)\n\n const expected = createHmac('sha1', input.authToken).update(data).digest('base64')\n const expectedBuf = Buffer.from(expected)\n const sigBuf = Buffer.from(signature)\n if (expectedBuf.length !== sigBuf.length) return false\n return timingSafeEqual(expectedBuf, sigBuf)\n}\n\n// ─── Inbound email ──────────────────────────────────────────────────────\n//\n// Tangle's own inbound-email edge (a Cloudflare Email Routing worker) receives\n// a message, serializes the parsed MIME to a JSON body, and signs it with the\n// connection's per-connection secret before POSTing it to the hub. There is no\n// upstream mail-vendor signature to trust — WE are both signer and verifier —\n// so the scheme is a timestamped HMAC (Slack/Stripe-style) to get replay\n// protection on the captured webhook:\n//\n// X-Tangle-Email-Signature: <HMAC-SHA256(secret, \"<ts>.<rawBody>\") hex>\n// X-Tangle-Email-Timestamp: <unix seconds>\n\nexport interface EmailVerifyOptions {\n /** Replay-protection window in seconds. Default 300. */\n toleranceSeconds?: number\n /** Override `now()` for tests. UTC seconds. */\n now?: number\n}\n\n/** Verify a Tangle inbound-email signature against the raw request body. */\nexport function verifyEmailSignature(\n rawBody: string,\n signatureHeader: string,\n timestampHeader: string,\n secret: string,\n options: EmailVerifyOptions = {},\n): boolean {\n const ts = Number(timestampHeader)\n if (!Number.isFinite(ts)) return false\n const tolerance = options.toleranceSeconds ?? DEFAULT_SIGNATURE_TOLERANCE_SECONDS\n const now = options.now ?? Math.floor(Date.now() / 1000)\n if (Math.abs(now - ts) > tolerance) return false\n const expected = createHmac('sha256', secret).update(`${ts}.${rawBody}`).digest('hex')\n const expectedBuf = Buffer.from(expected, 'utf8')\n const sigBuf = Buffer.from(signatureHeader.toLowerCase(), 'utf8')\n if (sigBuf.length !== expectedBuf.length) return false\n return timingSafeEqual(sigBuf, expectedBuf)\n}\n\n// ─── Header helper ──────────────────────────────────────────────────────\n//\n// Most fastify/express adapters expose request headers as\n// `Record<string, string | string[] | undefined>`. This helper picks the\n// first canonical value for a given name (case-insensitive).\n\nexport function firstHeader(\n headers: Record<string, string | string[] | undefined>,\n name: string,\n): string | undefined {\n const v = headers[name]\n ?? headers[name.toLowerCase()]\n ?? Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1]\n if (Array.isArray(v)) return v[0]\n return typeof v === 'string' ? v : undefined\n}\n","import { requestJson, record, ProviderProtocolError } from '../../http/response-json.js'\nimport {\n type CapabilityMutationResult,\n type ConnectorAdapter,\n type ConnectorInvocation,\n type ResolvedDataSource,\n CredentialsExpired,\n ProviderRateLimited,\n} from '../types.js'\n\n// Every operation below is pinned to the Cloudbeds PMS API v1.3 OpenAPI spec:\n// https://github.com/cloudbeds/openapi-specs/blob/main/src/pms-v1.3-openapi.yaml\nconst API = 'https://api.cloudbeds.com/api/v1.3'\nconst DATE = /^\\d{4}-\\d{2}-\\d{2}$/\nconst PROPERTY_ID = /^[1-9]\\d{0,19}$/\nconst OPERATION_ID = /^[A-Za-z0-9:._-]{1,128}$/\nconst PROVIDER_ID = /^[A-Za-z0-9_-]{1,64}$/\nconst HEADER_NAME = /^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$/\nconst STATUSES = new Set(['not_confirmed', 'confirmed', 'canceled', 'checked_in', 'checked_out', 'no_show'])\nconst ROOM_CONDITIONS = new Set(['clean', 'dirty'])\n// getHousekeepingStatus documents clean/dirty; postHousekeepingStatus also\n// documents `inspected` for properties with that feature, so reads accept it.\nconst REPORTED_ROOM_CONDITIONS = new Set(['clean', 'dirty', 'inspected'])\nconst FRONTDESK_STATUSES = new Set(['check-in', 'check-out', 'stayover', 'turnover', 'unused'])\n\n/**\n * Webhook events the connector subscribes to and the Cloudbeds webhook provider\n * parses. All five are `read:reservation` events in the Cloudbeds webhook guide.\n * `reservation/status_changed` carries created-to-confirmed, `canceled`,\n * `checked_in`, and `checked_out` transitions.\n */\nexport const CLOUDBEDS_WEBHOOK_EVENTS = [\n { object: 'reservation', action: 'created' },\n { object: 'reservation', action: 'status_changed' },\n { object: 'reservation', action: 'dates_changed' },\n { object: 'reservation', action: 'accommodation_changed' },\n { object: 'reservation', action: 'deleted' },\n] as const\n\nfunction boundedString(value: unknown, name: string, max = 256): string {\n if (typeof value !== 'string' || !value.trim() || value.length > max || /[\\u0000-\\u001f\\u007f]/.test(value)) {\n throw new Error(`cloudbeds: invalid ${name}`)\n }\n return value\n}\n\nfunction providerId(value: unknown, name: string): string {\n if (typeof value !== 'string' || !PROVIDER_ID.test(value)) throw new Error(`cloudbeds: invalid ${name}`)\n return value\n}\n\nfunction providerText(value: unknown, max = 256): string | null {\n return typeof value === 'string' && value.length <= max && !/[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]/.test(value) &&\n (max > 256 || !/[\\n\\r\\t]/.test(value)) ? value : null\n}\n\nfunction providerNumber(value: unknown): number | null {\n return typeof value === 'number' && Number.isFinite(value) ? value : null\n}\n\nfunction providerCount(value: unknown): number | null {\n const parsed = typeof value === 'string' && /^\\d{1,4}$/.test(value) ? Number(value) : value\n return Number.isSafeInteger(parsed) && (parsed as number) >= 0 ? parsed as number : null\n}\n\nfunction malformed(what: string): never {\n throw new ProviderProtocolError(`Cloudbeds returned malformed ${what}`, 'invalid_response')\n}\n\nfunction propertyId(source: ResolvedDataSource): string {\n const value = source.metadata.propertyId\n if (typeof value !== 'string' || !PROPERTY_ID.test(value)) {\n throw new Error('cloudbeds: connection requires one numeric propertyId')\n }\n return value\n}\n\nfunction apiKey(source: ResolvedDataSource): string {\n const value = source.credentials\n if (value.kind !== 'api-key' || !value.apiKey || /[\\u0000- \\u007f]/.test(value.apiKey)) {\n throw new Error('cloudbeds: connection requires an API key')\n }\n return value.apiKey\n}\n\nasync function call(source: ResolvedDataSource, path: string, init: RequestInit): Promise<Record<string, unknown>> {\n const key = apiKey(source)\n const headers = { 'x-api-key': key, accept: 'application/json', ...init.headers }\n let result: unknown\n try {\n result = await requestJson(`${API}/${path}`, { ...init, headers }, { maxResponseBytes: 2_000_000 })\n } catch (error) {\n if (error instanceof ProviderProtocolError && error.status === 401) {\n throw new CredentialsExpired('Cloudbeds rejected the API key', source.id)\n }\n if (error instanceof ProviderProtocolError && error.status === 429) {\n throw new ProviderRateLimited('Cloudbeds rate limit (429)', source.id,\n { status: 429, retryAfterMs: error.retryAfterMs })\n }\n throw error\n }\n if (record(result) && result.success === false) {\n throw new ProviderProtocolError('Cloudbeds rejected the request', 'provider_rejected', 422, true)\n }\n if (!record(result) || result.success !== true) {\n throw new ProviderProtocolError('Cloudbeds returned an unsuccessful or malformed response', 'invalid_response')\n }\n return result\n}\n\nconst form = (body: URLSearchParams): RequestInit => ({\n method: 'POST', headers: { 'content-type': 'application/x-www-form-urlencoded' }, body: body.toString(),\n})\n\nfunction date(value: unknown, label: string): string {\n if (typeof value !== 'string' || !DATE.test(value) || Number.isNaN(Date.parse(`${value}T00:00:00Z`)) ||\n new Date(`${value}T00:00:00Z`).toISOString().slice(0, 10) !== value) {\n throw new Error(`cloudbeds: invalid ${label}`)\n }\n return value\n}\n\nfunction providerDate(value: unknown): string {\n try {\n return date(value, 'provider date')\n } catch {\n throw new ProviderProtocolError('Cloudbeds returned an invalid reservation date', 'invalid_response')\n }\n}\n\nfunction nights(startDate: string, endDate: string): number {\n return (Date.parse(`${endDate}T00:00:00Z`) - Date.parse(`${startDate}T00:00:00Z`)) / 86_400_000\n}\n\nfunction page(value: unknown, label: string, fallback: number, max: number): number {\n const selected = value ?? fallback\n if (!Number.isSafeInteger(selected) || (selected as number) < 1 || (selected as number) > max) {\n throw new Error(`cloudbeds: invalid ${label}`)\n }\n return selected as number\n}\n\nfunction money(value: unknown, label: string, allowZero = false): number {\n if (typeof value !== 'number' || !Number.isFinite(value) || value < (allowZero ? 0 : 0.01) ||\n value > 1_000_000 || Math.abs(value * 100 - Math.round(value * 100)) > 1e-7) {\n throw new Error(`cloudbeds: invalid ${label}`)\n }\n return value\n}\n\nfunction pagination(result: Record<string, unknown>, pageSize: number, what: string): unknown[] {\n if (!Array.isArray(result.data) || !Number.isSafeInteger(result.count) || !Number.isSafeInteger(result.total) ||\n (result.count as number) < 0 || (result.total as number) < 0 || result.count !== result.data.length ||\n (result.total as number) < (result.count as number) || (result.count as number) > pageSize) {\n malformed(`${what} pagination`)\n }\n return result.data\n}\n\nfunction distinct(values: Array<string | null>): string[] {\n return [...new Set(values.filter((value): value is string => value !== null))]\n}\n\n// GET /getReservations (security read:reservation).\nfunction reservationQuery(args: Record<string, unknown>, property: string): URLSearchParams {\n const query = new URLSearchParams({ propertyID: property })\n const pairs = [['checkInFrom', 'checkInTo'], ['checkOutFrom', 'checkOutTo']] as const\n let found = false\n for (const [fromKey, toKey] of pairs) {\n if (args[fromKey] === undefined && args[toKey] === undefined) continue\n const from = date(args[fromKey], fromKey)\n const to = date(args[toKey], toKey)\n const days = nights(from, to)\n if (days < 0 || days > 31) throw new Error('cloudbeds: reservation date range must be at most 31 days')\n query.set(fromKey, from)\n query.set(toKey, to)\n found = true\n }\n if (args.status !== undefined) {\n if (typeof args.status !== 'string' || !STATUSES.has(args.status)) throw new Error('cloudbeds: invalid status')\n query.set('status', args.status)\n }\n // In-house guests are bounded by the property's rooms, so `checked_in` alone is allowed.\n if (!found && args.status !== 'checked_in') {\n throw new Error('cloudbeds: an arrival or departure date range is required unless status is checked_in')\n }\n query.set('includeAllRooms', 'true')\n query.set('pageNumber', String(page(args.pageNumber, 'pageNumber', 1, 100_000)))\n query.set('pageSize', String(page(args.pageSize, 'pageSize', 100, 100)))\n return query\n}\n\nfunction reservationRooms(raw: unknown): { roomTypeIds: string[]; roomIds: string[]; roomNames: string[] } {\n if (raw === undefined || raw === null) return { roomTypeIds: [], roomIds: [], roomNames: [] }\n if (!Array.isArray(raw)) malformed('reservation rooms')\n const rooms = raw.map((room: unknown) => {\n if (!record(room) || typeof room.roomTypeID !== 'string' || !PROVIDER_ID.test(room.roomTypeID) ||\n (room.roomID !== undefined && room.roomID !== null && (typeof room.roomID !== 'string' || !PROVIDER_ID.test(room.roomID))) ||\n (room.roomName !== undefined && room.roomName !== null && providerText(room.roomName) === null)) {\n malformed('reservation rooms')\n }\n return { roomTypeId: room.roomTypeID, roomId: typeof room.roomID === 'string' ? room.roomID : null,\n roomName: providerText(room.roomName) }\n })\n return { roomTypeIds: distinct(rooms.map(room => room.roomTypeId)), roomIds: distinct(rooms.map(room => room.roomId)),\n roomNames: distinct(rooms.map(room => room.roomName)) }\n}\n\nfunction reservations(result: Record<string, unknown>, property: string, query: URLSearchParams): Record<string, unknown> {\n const pageSize = Number(query.get('pageSize'))\n const items = pagination(result, pageSize, 'reservation').map((raw: unknown) => {\n if (!record(raw) || raw.propertyID !== property || typeof raw.reservationID !== 'string' || !raw.reservationID ||\n typeof raw.status !== 'string' || !STATUSES.has(raw.status)) {\n throw new ProviderProtocolError('Cloudbeds returned a reservation outside the connected property or with invalid fields', 'invalid_response')\n }\n return {\n propertyId: property,\n reservationId: raw.reservationID,\n status: raw.status,\n arrivalDate: providerDate(raw.startDate),\n departureDate: providerDate(raw.endDate),\n guestId: typeof raw.guestID === 'string' && PROVIDER_ID.test(raw.guestID) ? raw.guestID : null,\n guestName: providerText(raw.guestName),\n balance: providerNumber(raw.balance),\n ...reservationRooms(raw.rooms),\n }\n })\n const pageNumber = Number(query.get('pageNumber'))\n return { reservations: items, pageNumber, pageSize, total: result.total, hasMore: pageNumber * pageSize < (result.total as number) }\n}\n\nasync function readReservation(source: ResolvedDataSource, property: string, reservationId: string): Promise<Record<string, unknown>> {\n const query = new URLSearchParams({ propertyID: property, reservationID: reservationId })\n const result = await call(source, `getReservation?${query}`, { method: 'GET' })\n if (!record(result.data) || result.data.propertyID !== property || result.data.reservationID !== reservationId) {\n throw new ProviderProtocolError('Cloudbeds could not verify the reservation belongs to the connected property', 'invalid_response')\n }\n return result.data\n}\n\nfunction reservationRoom(raw: unknown, assigned: boolean): Record<string, unknown> {\n if (!record(raw) || typeof raw.roomTypeID !== 'string' || !PROVIDER_ID.test(raw.roomTypeID) ||\n (assigned && (typeof raw.roomID !== 'string' || !PROVIDER_ID.test(raw.roomID)))) {\n malformed('reservation rooms')\n }\n return {\n ...(assigned ? { roomId: raw.roomID, roomName: providerText(raw.roomName) } : {}),\n roomTypeId: raw.roomTypeID,\n roomTypeName: providerText(raw.roomTypeName),\n startDate: providerDate(raw.startDate),\n endDate: providerDate(raw.endDate),\n adults: providerCount(raw.adults),\n children: providerCount(raw.children),\n }\n}\n\nfunction balanceDetailed(raw: unknown): Record<string, number | null> | null {\n // The spec declares balanceDetailed as an object or an array of that object.\n const value = Array.isArray(raw) ? (raw.length === 0 ? null : raw.length === 1 ? raw[0] : malformed('balance detail')) : raw\n if (value === null || value === undefined) return null\n if (!record(value)) malformed('balance detail')\n const suggested = typeof value.suggestedDeposit === 'string' && /^-?\\d+(\\.\\d+)?$/.test(value.suggestedDeposit)\n ? Number(value.suggestedDeposit) : providerNumber(value.suggestedDeposit)\n return {\n subTotal: providerNumber(value.subTotal), additionalItems: providerNumber(value.additionalItems),\n taxesFees: providerNumber(value.taxesFees), grandTotal: providerNumber(value.grandTotal),\n paid: providerNumber(value.paid), suggestedDeposit: suggested,\n }\n}\n\n// GET /getReservation (security read:reservation). v1.3 has no payments or\n// transactions read, so balance and balanceDetailed are the paid/owed source.\nfunction reservationDetail(raw: Record<string, unknown>, property: string): Record<string, unknown> {\n if (typeof raw.status !== 'string' || !STATUSES.has(raw.status)) malformed('reservation status')\n if ((raw.assigned !== undefined && !Array.isArray(raw.assigned)) || (raw.unassigned !== undefined && !Array.isArray(raw.unassigned)) ||\n (raw.guestList !== undefined && raw.guestList !== null && !record(raw.guestList))) {\n malformed('reservation detail')\n }\n const assignedRooms = ((raw.assigned ?? []) as unknown[]).map(room => reservationRoom(room, true))\n const unassignedRooms = ((raw.unassigned ?? []) as unknown[]).map(room => reservationRoom(room, false))\n const guests = record(raw.guestList) ? Object.values(raw.guestList) : []\n const mainGuest = guests.find(guest => record(guest) && guest.isMainGuest === true)\n const guestId = record(mainGuest) && typeof mainGuest.guestID === 'string' && PROVIDER_ID.test(mainGuest.guestID)\n ? mainGuest.guestID : null\n const rooms = [...assignedRooms, ...unassignedRooms]\n const sum = (field: 'adults' | 'children') => rooms.every(room => typeof room[field] === 'number')\n ? rooms.reduce((total, room) => total + (room[field] as number), 0) : null\n return {\n propertyId: property,\n reservationId: raw.reservationID,\n status: raw.status,\n arrivalDate: providerDate(raw.startDate),\n departureDate: providerDate(raw.endDate),\n guestId,\n guestName: providerText(raw.guestName),\n adults: sum('adults'),\n children: sum('children'),\n assignedRooms,\n unassignedRooms,\n total: providerNumber(raw.total),\n balance: providerNumber(raw.balance),\n balanceDetailed: balanceDetailed(raw.balanceDetailed),\n source: providerText(raw.source),\n sourceId: providerText(raw.sourceID),\n }\n}\n\n// GET /getGuest (security read:guest). The response carries no property or\n// guest ID, so the pinned propertyID request parameter is the property bound.\nfunction guestDetail(result: Record<string, unknown>, property: string, guestId: string): Record<string, unknown> {\n const raw = result.data\n if (!record(raw) || (raw.firstName !== undefined && typeof raw.firstName !== 'string') ||\n (raw.lastName !== undefined && typeof raw.lastName !== 'string')) {\n malformed('guest')\n }\n const text = (value: unknown) => providerText(value) || null\n return {\n propertyId: property, guestId,\n firstName: text(raw.firstName), lastName: text(raw.lastName),\n email: text(raw.email), phone: text(raw.phone), cellPhone: text(raw.cellPhone),\n country: text(raw.country), nationality: text(raw.guestNationality),\n isAnonymized: raw.isAnonymized === true,\n mergedIntoGuestId: raw.isMerged === true && typeof raw.newGuestID === 'string' && PROVIDER_ID.test(raw.newGuestID)\n ? raw.newGuestID : null,\n }\n}\n\n// GET /getGuestNotes (security read:guest).\nfunction guestNotes(result: Record<string, unknown>, property: string, guestId: string): Record<string, unknown> {\n if (!Array.isArray(result.data)) malformed('guest notes')\n const notes = result.data.map((raw: unknown) => {\n if (!record(raw) || typeof raw.guestNoteID !== 'string' || !PROVIDER_ID.test(raw.guestNoteID) ||\n typeof raw.guestNote !== 'string') {\n malformed('guest notes')\n }\n return { noteId: raw.guestNoteID, note: providerText(raw.guestNote, 4_000), author: providerText(raw.userName),\n createdAt: providerText(raw.dateCreated), modifiedAt: providerText(raw.dateModified) }\n })\n return { propertyId: property, guestId, notes }\n}\n\n// GET /getHousekeepingStatus (security read:housekeeping).\nfunction housekeepingQuery(args: Record<string, unknown>, property: string): URLSearchParams {\n const query = new URLSearchParams({ propertyID: property })\n if (args.roomId !== undefined) query.set('roomIDs', providerId(args.roomId, 'roomId'))\n if (args.roomCondition !== undefined) {\n if (typeof args.roomCondition !== 'string' || !ROOM_CONDITIONS.has(args.roomCondition)) throw new Error('cloudbeds: invalid roomCondition')\n query.set('roomCondition', args.roomCondition)\n }\n query.set('pageNumber', String(page(args.pageNumber, 'pageNumber', 1, 100_000)))\n query.set('pageSize', String(page(args.pageSize, 'pageSize', 100, 500)))\n return query\n}\n\nfunction housekeepingRoom(raw: unknown): Record<string, unknown> {\n if (!record(raw) || typeof raw.roomID !== 'string' || !PROVIDER_ID.test(raw.roomID) ||\n typeof raw.roomCondition !== 'string' || !REPORTED_ROOM_CONDITIONS.has(raw.roomCondition) ||\n typeof raw.roomOccupied !== 'boolean' ||\n (raw.doNotDisturb !== undefined && typeof raw.doNotDisturb !== 'boolean') ||\n (raw.roomBlocked !== undefined && typeof raw.roomBlocked !== 'boolean')) {\n malformed('housekeeping status')\n }\n return {\n roomId: raw.roomID,\n roomName: providerText(raw.roomName),\n roomTypeId: typeof raw.roomTypeID === 'string' && PROVIDER_ID.test(raw.roomTypeID) ? raw.roomTypeID : null,\n roomTypeName: providerText(raw.roomTypeName),\n roomCondition: raw.roomCondition,\n roomOccupied: raw.roomOccupied,\n doNotDisturb: raw.doNotDisturb === true,\n roomBlocked: raw.roomBlocked === true,\n frontdeskStatus: typeof raw.frontdeskStatus === 'string' && FRONTDESK_STATUSES.has(raw.frontdeskStatus) ? raw.frontdeskStatus : null,\n housekeeperId: typeof raw.housekeeperID === 'string' && PROVIDER_ID.test(raw.housekeeperID) ? raw.housekeeperID : null,\n housekeeper: providerText(raw.housekeeper) || null,\n conditionDate: typeof raw.date === 'string' && DATE.test(raw.date) ? raw.date : null,\n }\n}\n\nfunction housekeeping(result: Record<string, unknown>, property: string, query: URLSearchParams): Record<string, unknown> {\n const pageSize = Number(query.get('pageSize'))\n const rooms = pagination(result, pageSize, 'housekeeping').map(housekeepingRoom)\n const roomId = query.get('roomIDs')\n if (roomId && rooms.some(room => room.roomId !== roomId)) malformed('housekeeping status for another room')\n const pageNumber = Number(query.get('pageNumber'))\n return { propertyId: property, rooms, pageNumber, pageSize, total: result.total, hasMore: pageNumber * pageSize < (result.total as number) }\n}\n\n// GET /getRatePlans (security read:rate).\nfunction ratePlanQuery(args: Record<string, unknown>, property: string): URLSearchParams {\n const startDate = date(args.startDate, 'startDate')\n const endDate = date(args.endDate, 'endDate')\n const days = nights(startDate, endDate)\n if (days < 1 || days > 31) throw new Error('cloudbeds: stay must be between 1 and 31 nights')\n const query = new URLSearchParams({ propertyIDs: property, startDate, endDate, detailedRates: 'false' })\n if (args.roomTypeId !== undefined) query.set('roomTypeID', providerId(args.roomTypeId, 'roomTypeId'))\n return query\n}\n\nfunction ratePlans(result: Record<string, unknown>, property: string, query: URLSearchParams): Record<string, unknown> {\n if (!Array.isArray(result.data) || result.data.length > 2_000) malformed('rate plans')\n const roomTypeId = query.get('roomTypeID')\n const rates = result.data.map((raw: unknown) => {\n if (!record(raw) || (raw.propertyID !== undefined && raw.propertyID !== null && String(raw.propertyID) !== property)) {\n throw new ProviderProtocolError('Cloudbeds returned a rate outside the connected property', 'invalid_response')\n }\n if (typeof raw.rateID !== 'string' || !PROVIDER_ID.test(raw.rateID) ||\n (raw.roomRate !== undefined && providerNumber(raw.roomRate) === null) ||\n (raw.totalRate !== undefined && providerNumber(raw.totalRate) === null) ||\n (raw.roomsAvailable !== undefined && (!Number.isSafeInteger(raw.roomsAvailable) || (raw.roomsAvailable as number) < 0))) {\n malformed('rate plans')\n }\n const rowRoomType = typeof raw.roomTypeID === 'string' && PROVIDER_ID.test(raw.roomTypeID) ? raw.roomTypeID : roomTypeId\n if (roomTypeId && rowRoomType !== roomTypeId) malformed('rate plans for another room type')\n return {\n rateId: raw.rateID,\n ratePlanId: typeof raw.ratePlanID === 'string' && PROVIDER_ID.test(raw.ratePlanID) ? raw.ratePlanID : null,\n ratePlanName: providerText(raw.ratePlanNamePublic) || null,\n roomTypeId: rowRoomType,\n // The spec types roomTypeName as an integer; accept the string providers send.\n roomTypeName: providerText(typeof raw.roomTypeName === 'number' ? String(raw.roomTypeName) : raw.roomTypeName),\n roomRate: providerNumber(raw.roomRate),\n totalRate: providerNumber(raw.totalRate),\n roomsAvailable: typeof raw.roomsAvailable === 'number' ? raw.roomsAvailable : null,\n isDerived: raw.isDerived === true,\n }\n })\n return { propertyId: property, startDate: query.get('startDate'), endDate: query.get('endDate'), rates }\n}\n\nfunction formForItem(inv: ConnectorInvocation, property: string): URLSearchParams {\n const args = inv.args\n const reservationId = boundedString(args.reservationId, 'reservationId')\n const appItemId = boundedString(args.appItemId, 'appItemId')\n const itemName = boundedString(args.itemName, 'itemName')\n const itemCategoryName = boundedString(args.itemCategoryName, 'itemCategoryName')\n const itemPrice = money(args.itemPrice, 'itemPrice')\n const itemQuantity = page(args.itemQuantity, 'itemQuantity', 1, 1_000)\n if (!OPERATION_ID.test(inv.idempotencyKey)) throw new Error('cloudbeds: stable bounded idempotencyKey is required')\n if (!Array.isArray(args.taxes) || args.taxes.length > 10) throw new Error('cloudbeds: explicit taxes array is required')\n const form = new URLSearchParams({\n propertyID: property,\n reservationID: reservationId,\n referenceID: inv.idempotencyKey,\n 'items[0][appItemID]': appItemId,\n 'items[0][itemName]': itemName,\n 'items[0][itemCategoryName]': itemCategoryName,\n 'items[0][itemPrice]': itemPrice.toFixed(2),\n 'items[0][itemQuantity]': String(itemQuantity),\n itemPaid: 'false',\n })\n args.taxes.forEach((tax: unknown, index: number) => {\n if (!record(tax)) throw new Error('cloudbeds: invalid tax')\n form.set(`items[0][itemTaxes][${index}][taxName]`, boundedString(tax.taxName, 'taxName'))\n form.set(`items[0][itemTaxes][${index}][taxValue]`, money(tax.taxValue, 'taxValue', true).toFixed(2))\n })\n return form\n}\n\n// POST /postCustomItem (security write:item), after GET /getReservation.\nasync function postFolioItem(inv: ConnectorInvocation, property: string): Promise<CapabilityMutationResult> {\n const body = formForItem(inv, property)\n await readReservation(inv.source, property, body.get('reservationID')!)\n const result = await call(inv.source, 'postCustomItem', form(body))\n if (!record(result.data)) {\n throw new ProviderProtocolError('Cloudbeds returned a malformed folio item receipt', 'invalid_response')\n }\n const soldProductId = typeof result.data.soldProductID === 'string' && result.data.soldProductID\n ? result.data.soldProductID : null\n const notice = providerText(result.data.notice)\n const duplicate = soldProductId === null && notice !== null &&\n /referenceid/i.test(notice) && /nothing was created/i.test(notice)\n if (!soldProductId && !duplicate) {\n throw new ProviderProtocolError('Cloudbeds returned an indeterminate folio item receipt', 'capability_outcome_indeterminate')\n }\n return { status: 'committed', data: { referenceId: inv.idempotencyKey,\n soldProductId,\n transactionId: typeof result.data.transactionID === 'string' ? result.data.transactionID : null,\n duplicate, notice },\n committedAt: Date.now(), idempotentReplay: duplicate }\n}\n\n// POST /postHousekeepingStatus (security write:housekeeping), after GET\n// /getHousekeepingStatus proves the room belongs to the connected property.\n// Cloudbeds toggles the condition when none is sent, so one is always required.\nasync function updateHousekeeping(inv: ConnectorInvocation, property: string): Promise<CapabilityMutationResult> {\n const roomId = providerId(inv.args.roomId, 'roomId')\n const roomCondition = inv.args.roomCondition\n if (typeof roomCondition !== 'string' || !ROOM_CONDITIONS.has(roomCondition)) throw new Error('cloudbeds: invalid roomCondition')\n if (inv.args.doNotDisturb !== undefined && typeof inv.args.doNotDisturb !== 'boolean') throw new Error('cloudbeds: invalid doNotDisturb')\n const query = new URLSearchParams({ propertyID: property, roomIDs: roomId, pageNumber: '1', pageSize: '1' })\n const current = housekeeping(await call(inv.source, `getHousekeepingStatus?${query}`, { method: 'GET' }), property, query)\n const before = (current.rooms as Array<Record<string, unknown>>)[0]\n if (!before) throw new Error('cloudbeds: room is not part of the connected property')\n const body = new URLSearchParams({ propertyID: property, roomID: roomId, roomCondition })\n if (typeof inv.args.doNotDisturb === 'boolean') body.set('doNotDisturb', String(inv.args.doNotDisturb))\n const result = await call(inv.source, 'postHousekeepingStatus', form(body))\n if (!record(result.data) || result.data.roomID !== roomId || result.data.roomCondition !== roomCondition ||\n (typeof inv.args.doNotDisturb === 'boolean' && result.data.doNotDisturb !== undefined && result.data.doNotDisturb !== null &&\n result.data.doNotDisturb !== inv.args.doNotDisturb)) {\n throw new ProviderProtocolError('Cloudbeds returned an indeterminate housekeeping receipt', 'capability_outcome_indeterminate')\n }\n return { status: 'committed', committedAt: Date.now(), idempotentReplay: false, data: {\n propertyId: property, roomId, roomCondition, previousCondition: before.roomCondition,\n doNotDisturb: typeof result.data.doNotDisturb === 'boolean' ? result.data.doNotDisturb : before.doNotDisturb,\n } }\n}\n\n// GET /getWebhooks. Webhook endpoints declare no scope; the subscribed event's\n// object scope applies (read:reservation for every allowed event).\nasync function listWebhooks(source: ResolvedDataSource, property: string): Promise<Array<Record<string, unknown>>> {\n const result = await call(source, `getWebhooks?${new URLSearchParams({ propertyID: property })}`, { method: 'GET' })\n if (!Array.isArray(result.data) || result.data.length > 1_000) malformed('webhook subscriptions')\n return result.data.map((raw: unknown) => {\n if (!record(raw) || typeof raw.id !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(raw.id) || !record(raw.event) ||\n (raw.key !== undefined && raw.key !== null && !record(raw.key))) {\n malformed('webhook subscriptions')\n }\n if (record(raw.key) && raw.key.type === 'property' && String(raw.key.id) !== property) {\n throw new ProviderProtocolError('Cloudbeds returned a webhook subscription outside the connected property', 'invalid_response')\n }\n const data = record(raw.subscriptionData) ? raw.subscriptionData : {}\n return {\n subscriptionId: raw.id,\n object: providerText(raw.event.entity),\n action: providerText(raw.event.action),\n endpointUrl: providerText(data.endpoint ?? data.url, 2_048),\n authHeaderName: record(raw.authHeader) ? providerText(raw.authHeader.name) : null,\n }\n })\n}\n\nfunction webhookEndpoint(value: unknown): string {\n const text = boundedString(value, 'endpointUrl', 2_048)\n let url: URL\n try {\n url = new URL(text)\n } catch {\n throw new Error('cloudbeds: invalid endpointUrl')\n }\n if (url.protocol !== 'https:' || url.username || url.password || url.hash) {\n throw new Error('cloudbeds: endpointUrl must be an https URL without credentials or fragment')\n }\n return text\n}\n\nfunction redact(error: unknown, secret: string | null): unknown {\n if (secret && error instanceof Error && error.message.includes(secret)) {\n error.message = error.message.split(secret).join('[redacted]')\n }\n return error\n}\n\n// POST /postWebhook, after GET /getWebhooks. A matching subscription is reused\n// unless an auth header is supplied, which Cloudbeds rotates on re-post.\nasync function subscribeWebhook(inv: ConnectorInvocation, property: string): Promise<CapabilityMutationResult> {\n const args = inv.args\n const event = CLOUDBEDS_WEBHOOK_EVENTS.find(item => item.object === args.object && item.action === args.action)\n if (!event) throw new Error('cloudbeds: unsupported webhook event')\n const endpointUrl = webhookEndpoint(args.endpointUrl)\n if ((args.authHeaderName === undefined) !== (args.authHeaderValue === undefined)) {\n throw new Error('cloudbeds: authHeaderName and authHeaderValue must be sent together')\n }\n let authHeaderName: string | null = null\n let authHeaderValue: string | null = null\n if (args.authHeaderName !== undefined) {\n if (typeof args.authHeaderName !== 'string' || !HEADER_NAME.test(args.authHeaderName)) throw new Error('cloudbeds: invalid authHeaderName')\n if (typeof args.authHeaderValue !== 'string' || !/^[!-~](?:[ -~]{0,1022}[!-~])?$/.test(args.authHeaderValue)) {\n throw new Error('cloudbeds: invalid authHeaderValue')\n }\n authHeaderName = args.authHeaderName\n authHeaderValue = args.authHeaderValue\n }\n try {\n const existing = (await listWebhooks(inv.source, property)).find(row =>\n row.object === event.object && row.action === event.action && row.endpointUrl === endpointUrl)\n const receipt = { propertyId: property, object: event.object, action: event.action, endpointUrl, authHeaderName }\n if (existing && authHeaderValue === null) {\n return { status: 'committed', committedAt: Date.now(), idempotentReplay: true,\n data: { ...receipt, subscriptionId: existing.subscriptionId, authHeaderName: existing.authHeaderName, existing: true } }\n }\n const body = new URLSearchParams({ propertyID: property, object: event.object, action: event.action, endpointUrl })\n if (authHeaderName && authHeaderValue) {\n body.set('authHeaderName', authHeaderName)\n body.set('authHeaderValue', authHeaderValue)\n }\n const result = await call(inv.source, 'postWebhook', form(body))\n if (!record(result.data) || typeof result.data.subscriptionID !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(result.data.subscriptionID)) {\n throw new ProviderProtocolError('Cloudbeds returned an indeterminate webhook subscription receipt', 'capability_outcome_indeterminate')\n }\n return { status: 'committed', committedAt: Date.now(), idempotentReplay: false,\n data: { ...receipt, subscriptionId: result.data.subscriptionID, existing: existing !== undefined } }\n } catch (error) {\n throw redact(error, authHeaderValue)\n }\n}\n\n// DELETE /deleteWebhook, after GET /getWebhooks proves the subscription is visible to this property.\nasync function deleteWebhook(inv: ConnectorInvocation, property: string): Promise<CapabilityMutationResult> {\n const subscriptionId = inv.args.subscriptionId\n if (typeof subscriptionId !== 'string' || !/^[A-Za-z0-9_-]{1,128}$/.test(subscriptionId)) throw new Error('cloudbeds: invalid subscriptionId')\n const existing = (await listWebhooks(inv.source, property)).find(row => row.subscriptionId === subscriptionId)\n if (!existing) {\n return { status: 'committed', committedAt: Date.now(), idempotentReplay: true,\n data: { propertyId: property, subscriptionId, deleted: false, alreadyAbsent: true } }\n }\n await call(inv.source, `deleteWebhook?${new URLSearchParams({ propertyIDs: property, subscriptionID: subscriptionId })}`, { method: 'DELETE' })\n return { status: 'committed', committedAt: Date.now(), idempotentReplay: false,\n data: { propertyId: property, subscriptionId, deleted: true, alreadyAbsent: false } }\n}\n\nconst PAGE = {\n pageNumber: { type: 'integer', minimum: 1, maximum: 100000 },\n pageSize: { type: 'integer', minimum: 1, maximum: 100 },\n} as const\nconst ID = { type: 'string', pattern: PROVIDER_ID.source } as const\nconst STAY = { startDate: { type: 'string', format: 'date' }, endDate: { type: 'string', format: 'date' } } as const\n\nexport const cloudbedsConnector: ConnectorAdapter = {\n manifest: {\n kind: 'cloudbeds',\n displayName: 'Cloudbeds',\n description: 'Read reservations, guests, housekeeping, rates and room availability for one connected property, update room condition, manage reservation webhooks, and post an approved custom item to a guest folio.',\n auth: { kind: 'api-key', hint: 'Property-scoped Cloudbeds API key with read:reservation, read:room, read:guest, read:housekeeping, write:housekeeping, read:rate and write:item scopes. Set the connection propertyId.' },\n category: 'other',\n defaultConsistencyModel: 'authoritative',\n capabilities: [\n {\n name: 'reservations.list', class: 'read', requiredScopes: ['read:reservation'],\n description: 'List one page of arrivals, departures, or in-house guests (status checked_in with no dates) for the connected property, with room type, room ID and room name lists. Guest requirements are never requested.',\n parameters: { type: 'object', properties: {\n checkInFrom: { type: 'string', format: 'date' }, checkInTo: { type: 'string', format: 'date' },\n checkOutFrom: { type: 'string', format: 'date' }, checkOutTo: { type: 'string', format: 'date' },\n status: { type: 'string', enum: [...STATUSES] },\n ...PAGE,\n } },\n },\n {\n name: 'reservations.get', class: 'read', requiredScopes: ['read:reservation'],\n description: 'Read one reservation of the connected property: status, stay dates, main guest, assigned and unassigned rooms, guest counts, source, total, balance and balanceDetailed (paid and owed amounts; Cloudbeds v1.3 has no payments read).',\n parameters: { type: 'object', properties: { reservationId: { type: 'string', minLength: 1, maxLength: 256 } }, required: ['reservationId'] },\n },\n {\n name: 'guests.get', class: 'read', requiredScopes: ['read:guest'],\n description: 'Read one guest\\'s name, email, phone, country and nationality at the connected property. Identity documents, address and birth date are never returned.',\n parameters: { type: 'object', properties: { guestId: ID }, required: ['guestId'] },\n },\n {\n name: 'guests.notes', class: 'read', requiredScopes: ['read:guest'],\n description: 'Read staff notes on one guest at the connected property.',\n parameters: { type: 'object', properties: { guestId: ID }, required: ['guestId'] },\n },\n {\n name: 'housekeeping.status', class: 'read', requiredScopes: ['read:housekeeping'],\n description: 'Read today\\'s housekeeping status for the connected property: room condition, occupancy, do-not-disturb, front-desk status and housekeeper.',\n parameters: { type: 'object', properties: {\n roomId: ID, roomCondition: { type: 'string', enum: [...ROOM_CONDITIONS] },\n pageNumber: PAGE.pageNumber, pageSize: { type: 'integer', minimum: 1, maximum: 500 },\n } },\n },\n {\n name: 'housekeeping.update', class: 'mutation', cas: 'optimistic-read-verify', externalEffect: false,\n requiredScopes: ['read:housekeeping', 'write:housekeeping'],\n description: 'Verify the room belongs to the connected property, then set today\\'s room condition to clean or dirty and optionally do-not-disturb. Setting an explicit condition is idempotent.',\n parameters: { type: 'object', properties: {\n roomId: ID, roomCondition: { type: 'string', enum: [...ROOM_CONDITIONS] }, doNotDisturb: { type: 'boolean' },\n }, required: ['roomId', 'roomCondition'] },\n },\n {\n name: 'rate-plans.list', class: 'read', requiredScopes: ['read:rate'],\n description: 'Read publicly sellable rate plans and stay rates for 1 to 31 nights at the connected property, optionally for one room type. This does not hold or price a booking.',\n parameters: { type: 'object', properties: { ...STAY, roomTypeId: ID }, required: ['startDate', 'endDate'] },\n },\n {\n name: 'room-types.available', class: 'read', requiredScopes: ['read:room'],\n description: 'Read provider-reported room-type availability for a stay at the connected property. This does not hold or confirm a booking.',\n parameters: { type: 'object', properties: {\n ...STAY,\n rooms: { type: 'integer', minimum: 1, maximum: 10 }, adults: { type: 'integer', minimum: 1, maximum: 20 },\n children: { type: 'integer', minimum: 0, maximum: 20 },\n ...PAGE,\n }, required: ['startDate', 'endDate'] },\n },\n {\n name: 'folio-items.post', class: 'mutation', cas: 'native-idempotency', externalEffect: true,\n requiredScopes: ['read:reservation', 'write:item'],\n description: 'Verify reservation ownership, then post one unpaid custom item to the connected property guest folio. The Hub operation key becomes Cloudbeds referenceID.',\n parameters: { type: 'object', properties: {\n reservationId: { type: 'string', minLength: 1, maxLength: 256 },\n appItemId: { type: 'string', minLength: 1, maxLength: 256 },\n itemName: { type: 'string', minLength: 1, maxLength: 256 },\n itemCategoryName: { type: 'string', minLength: 1, maxLength: 256 },\n itemPrice: { type: 'number', minimum: 0.01, maximum: 1_000_000, multipleOf: 0.01 },\n itemQuantity: { type: 'integer', minimum: 1, maximum: 1000 },\n taxes: { type: 'array', description: 'Explicit tax amounts in the property currency. Use [] only when no tax applies.',\n maxItems: 10, items: { type: 'object', properties: { taxName: { type: 'string', minLength: 1, maxLength: 256 }, taxValue: { type: 'number', minimum: 0, maximum: 1_000_000, multipleOf: 0.01 } }, required: ['taxName', 'taxValue'] } },\n }, required: ['reservationId', 'appItemId', 'itemName', 'itemCategoryName', 'itemPrice', 'taxes'] },\n },\n {\n name: 'webhooks.subscribe', class: 'mutation', cas: 'optimistic-read-verify', externalEffect: true, requiredScopes: ['read:reservation'],\n description: 'Subscribe an https endpoint to one reservation event for the connected property, reusing a matching subscription. An optional auth header is sent by Cloudbeds on every delivery and is never returned.',\n parameters: { type: 'object', properties: {\n object: { type: 'string', enum: ['reservation'] },\n action: { type: 'string', enum: CLOUDBEDS_WEBHOOK_EVENTS.map(event => event.action) },\n endpointUrl: { type: 'string', format: 'uri', maxLength: 2048 },\n authHeaderName: { type: 'string', pattern: HEADER_NAME.source },\n authHeaderValue: { type: 'string', minLength: 1, maxLength: 1024 },\n }, required: ['object', 'action', 'endpointUrl'] },\n },\n {\n name: 'webhooks.list', class: 'read', requiredScopes: ['read:reservation'],\n description: 'List webhook subscriptions visible to the connected property. Auth header values are never returned.',\n parameters: { type: 'object', properties: {} },\n },\n {\n name: 'webhooks.delete', class: 'mutation', cas: 'optimistic-read-verify', externalEffect: true, requiredScopes: ['read:reservation'],\n description: 'Delete one webhook subscription after confirming it is visible to the connected property. A missing subscription is reported as already absent.',\n parameters: { type: 'object', properties: { subscriptionId: { type: 'string', pattern: '^[A-Za-z0-9_-]{1,128}$' } }, required: ['subscriptionId'] },\n },\n ],\n },\n\n async executeRead(inv) {\n const property = propertyId(inv.source)\n const read = async (path: string) => call(inv.source, path, { method: 'GET' })\n let data: Record<string, unknown>\n switch (inv.capabilityName) {\n case 'reservations.list': {\n const query = reservationQuery(inv.args, property)\n data = reservations(await read(`getReservations?${query}`), property, query)\n break\n }\n case 'reservations.get': {\n const reservationId = boundedString(inv.args.reservationId, 'reservationId')\n data = reservationDetail(await readReservation(inv.source, property, reservationId), property)\n break\n }\n case 'guests.get': {\n const guestId = providerId(inv.args.guestId, 'guestId')\n data = guestDetail(await read(`getGuest?${new URLSearchParams({ propertyID: property, guestID: guestId })}`), property, guestId)\n break\n }\n case 'guests.notes': {\n const guestId = providerId(inv.args.guestId, 'guestId')\n data = guestNotes(await read(`getGuestNotes?${new URLSearchParams({ propertyID: property, guestID: guestId })}`), property, guestId)\n break\n }\n case 'housekeeping.status': {\n const query = housekeepingQuery(inv.args, property)\n data = housekeeping(await read(`getHousekeepingStatus?${query}`), property, query)\n break\n }\n case 'rate-plans.list': {\n const query = ratePlanQuery(inv.args, property)\n data = ratePlans(await read(`getRatePlans?${query}`), property, query)\n break\n }\n case 'room-types.available': {\n const query = roomAvailabilityQuery(inv.args, property)\n data = roomAvailability(await read(`getAvailableRoomTypes?${query}`), property, query)\n break\n }\n case 'webhooks.list':\n data = { propertyId: property, subscriptions: await listWebhooks(inv.source, property) }\n break\n default:\n throw new Error(`cloudbeds: unknown read ${inv.capabilityName}`)\n }\n return { data, fetchedAt: Date.now() }\n },\n\n async executeMutation(inv) {\n const property = propertyId(inv.source)\n switch (inv.capabilityName) {\n case 'folio-items.post': return postFolioItem(inv, property)\n case 'housekeeping.update': return updateHousekeeping(inv, property)\n case 'webhooks.subscribe': return subscribeWebhook(inv, property)\n case 'webhooks.delete': return deleteWebhook(inv, property)\n default: throw new Error(`cloudbeds: unknown mutation ${inv.capabilityName}`)\n }\n },\n\n async test(source) {\n try {\n const property = propertyId(source)\n const result = await call(source, `getReservations?${new URLSearchParams({ propertyID: property, status: 'checked_in', pageNumber: '1', pageSize: '1' })}`, { method: 'GET' })\n if (!Array.isArray(result.data)) throw new ProviderProtocolError('Cloudbeds returned malformed reservations', 'invalid_response')\n return { ok: true }\n } catch (error) {\n return { ok: false, reason: error instanceof Error ? error.message : 'Cloudbeds connection failed' }\n }\n },\n}\n\n// GET /getAvailableRoomTypes (security read:room).\nfunction roomAvailabilityQuery(args: Record<string, unknown>, property: string): URLSearchParams {\n const startDate = date(args.startDate, 'startDate')\n const endDate = date(args.endDate, 'endDate')\n const days = nights(startDate, endDate)\n if (days < 1 || days > 31) throw new Error('cloudbeds: stay must be between 1 and 31 nights')\n const children = args.children ?? 0\n if (!Number.isSafeInteger(children) || (children as number) < 0 || (children as number) > 20) {\n throw new Error('cloudbeds: invalid children')\n }\n return new URLSearchParams({ propertyIDs: property, startDate, endDate,\n rooms: String(page(args.rooms, 'rooms', 1, 10)), adults: String(page(args.adults, 'adults', 1, 20)),\n children: String(children), pageNumber: String(page(args.pageNumber, 'pageNumber', 1, 100_000)),\n pageSize: String(page(args.pageSize, 'pageSize', 100, 100)), detailedRates: 'false', includeSharedRooms: 'false' })\n}\n\nfunction roomAvailability(result: Record<string, unknown>, property: string, query: URLSearchParams): Record<string, unknown> {\n if (!Array.isArray(result.data) || !Number.isSafeInteger(result.count) || !Number.isSafeInteger(result.total) ||\n !Number.isSafeInteger(result.roomCount) || (result.count as number) < 0 || (result.count as number) > 1 ||\n (result.total as number) < (result.count as number) || result.count !== result.data.length ||\n (result.roomCount as number) < 0 || (result.count as number) > Number(query.get('pageSize'))) {\n throw new ProviderProtocolError('Cloudbeds returned malformed room availability pagination', 'invalid_response')\n }\n const roomTypes = result.data.flatMap((raw: unknown) => {\n if (!record(raw) || raw.propertyID !== property || !Array.isArray(raw.propertyRooms)) {\n throw new ProviderProtocolError('Cloudbeds returned availability outside the connected property', 'invalid_response')\n }\n return raw.propertyRooms.map((room: unknown) => {\n if (!record(room) || typeof room.roomTypeID !== 'string' || !room.roomTypeID ||\n !Number.isSafeInteger(room.roomsAvailable) || (room.roomsAvailable as number) < 0 ||\n (room.roomRate !== undefined && (typeof room.roomRate !== 'number' || !Number.isFinite(room.roomRate) || room.roomRate < 0))) {\n throw new ProviderProtocolError('Cloudbeds returned malformed room-type availability', 'invalid_response')\n }\n return { roomTypeId: room.roomTypeID, roomTypeName: providerText(room.roomTypeName),\n roomsAvailable: room.roomsAvailable, roomRate: typeof room.roomRate === 'number' ? room.roomRate : null }\n })\n })\n if (roomTypes.length !== result.roomCount) {\n throw new ProviderProtocolError('Cloudbeds returned mismatched room-type count', 'invalid_response')\n }\n return { propertyId: property, startDate: query.get('startDate'), endDate: query.get('endDate'),\n rooms: Number(query.get('rooms')), adults: Number(query.get('adults')), children: Number(query.get('children')),\n roomTypes, pageNumber: Number(query.get('pageNumber')), pageSize: Number(query.get('pageSize')),\n mayHaveMore: Number(query.get('pageNumber')) * Number(query.get('pageSize')) < (result.total as number) }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAmBA,MAAa,sCAAsC;AAmBnD,SAAgB,2BAA2B,QAAoD;CAC7F,MAAM,MAAuC,EAAE,MAAM,CAAC,EAAE;CACxD,KAAK,MAAM,QAAQ,OAAO,MAAM,GAAG,GAAG;EACpC,MAAM,MAAM,KAAK,QAAQ,GAAG;EAC5B,IAAI,MAAM,GAAG;EACb,MAAM,MAAM,KAAK,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK;EACpC,MAAM,MAAM,KAAK,MAAM,MAAM,CAAC,CAAC,CAAC,KAAK;EACrC,IAAI,QAAQ,KAAK;GACf,MAAM,IAAI,OAAO,GAAG;GACpB,IAAI,OAAO,SAAS,CAAC,GAAG,IAAI,KAAK;EACnC,OAAO,IAAI,QAAQ,MACjB,IAAI,KAAK,KAAK,GAAG;CAErB;CACA,IAAI,IAAI,OAAO,KAAA,KAAa,IAAI,KAAK,WAAW,GAAG,OAAO;CAC1D,OAAO;EAAE,GAAG,IAAI;EAAI,MAAM,IAAI;CAAK;AACrC;;AAUA,SAAgB,sBACd,SACA,iBACA,QACA,UAA+B,CAAC,GACvB;CACT,MAAM,SAAS,2BAA2B,eAAe;CACzD,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,YAAY,QAAQ,oBAAA;CAC1B,MAAM,MAAM,QAAQ,OAAO,KAAK,MAAM,KAAK,IAAI,IAAI,GAAI;CACvD,IAAI,KAAK,IAAI,MAAM,OAAO,CAAC,IAAI,WAAW,OAAO;CACjD,MAAM,WAAW,WAAW,UA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DAAuD,kBAAkB;GAE3G,OAAO;IAAE,YAAY,KAAK;IAAY,cAAc,aAAa,KAAK,YAAY;IAChF,gBAAgB,KAAK;IAAgB,UAAU,OAAO,KAAK,aAAa,WAAW,KAAK,WAAW;GAAK;EAC5G,CAAC;CACH,CAAC;CACD,IAAI,UAAU,WAAW,OAAO,WAC9B,MAAM,IAAI,sBAAsB,iDAAiD,kBAAkB;CAErG,OAAO;EAAE,YAAY;EAAU,WAAW,MAAM,IAAI,WAAW;EAAG,SAAS,MAAM,IAAI,SAAS;EAC5F,OAAO,OAAO,MAAM,IAAI,OAAO,CAAC;EAAG,QAAQ,OAAO,MAAM,IAAI,QAAQ,CAAC;EAAG,UAAU,OAAO,MAAM,IAAI,UAAU,CAAC;EAC9G;EAAW,YAAY,OAAO,MAAM,IAAI,YAAY,CAAC;EAAG,UAAU,OAAO,MAAM,IAAI,UAAU,CAAC;EAC9F,aAAa,OAAO,MAAM,IAAI,YAAY,CAAC,IAAI,OAAO,MAAM,IAAI,UAAU,CAAC,IAAK,OAAO;CAAiB;AAC5G"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"consumer-BafUQUla.d.ts","names":["_$__core_types_js0.IntegrationProvider"],"sources":["../src/core-error.ts","../src/approval.ts","../src/actions.ts","../src/runtime.ts","../src/bridge.ts","../src/apps.ts","../src/client.ts","../src/consent.ts","../src/adapter-provider.ts","../src/credentials.ts","../src/discovery.ts","../src/workflow.ts","../src/events.ts","../src/healthcheck.ts","../src/manifest.ts","../src/passthrough.ts","../src/presets.ts","../src/catalog-executor.ts","../src/sandbox.ts","../src/importers.ts","../src/gateway-catalog.ts","../src/activepieces-catalog.ts","../src/activepieces-overrides.ts","../src/activepieces-provider.ts","../src/catalog-freshness.ts","../src/tangle-catalog.ts","../src/integration-kind-aliases.ts","../src/index.ts","../src/consumer.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;KAYY;cAiBC,yBAAyB;WAGzB,MAAM;EAFjB,YACE,iBAC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,mBAAmB;;cAGR,wBAAwB,eAAe;iBAoGpC,wBAAwB,aAAa;;;UC7FpC;EACf,YAAY;EACZ,SAAS;EACT,WAAW;EACX,cAAc;EACd;IACE;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA,aAAa;EACb,aAAa,SAAS,qBAAqB,QAAQ,mBAAmB;EACtE,gBAAgB,SAAS,wBAAwB,QAAQ,yBAAyB;EAClF,gBAAgB,YAAY,mCAAmC,QAAQ,2BAA2B;;iBAGpF,mCAAmC,SAAS,sCAAsC;;;UC1BjF;EACf;EACA;EACA;EACA,mBAAmB;;UAGJ;EACf;EACA;EACA;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,iBAAiB;IACjB,iBAAiB;;EAEnB;IACE;IACA;IACA;IACA;;EAEF;;cAGW;iBAQG,oCAAoC;iBAM9B,iCACpB,UAAS,qCACR,QAAQ;;;cC9BE;cACA;KAED;KACA;UAEK;EACf;EACA;EACA;EACA,UAAU;EACV,MAAM;EACN,aAAa;EACb;EACA,SAAS;IACP;IACA;IACA,MAAM;IACN;;EAEF,UAAU;IACR;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA,UAAU;EACV,MAAM;EACN,YAAY,YAAY;EACxB,SAAS;IACP;IACA;IACA,MAAM;IACN;;EAEF,UAAU;IACR;IACA;IACA;;EAEF;IACE,MAAM;IACN;IACA;;EAEF,QAAQ;EACR;IACE;IACA;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA;EACA;EACA,yBAAyB;;UAGV;EACf;EACA;EACA;EACA,cAAc;EACd;IACE;IACA;IACA,sBAAsB;;;UAIT;EACf,YAAY;EACZ,SAAS;EACT,WAAW;EACX,cAAc;EACd;IACE;IACA;IACA;IACA;IACA;;;UAIa;EACf,YAAY;EACZ,WAAW;EACX,cAAc;EACd,SAAS,YAAY;EACrB;EACA;IACE;IACA;IACA;IACA;IACA;;;UAIa;EACf;EACA,aAAa;EACb,aAAa,SAAS,qBAAqB,QAAQ,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;EACA,UAAU;;EAEV;;UAGe;;EAEf;;EAEA,SAAS;EACT,UAAU;EACV,WAAW;;UAGI;;EAEf;;EAEA,UAAU;;UAGK;;EAEf;;EAEA,SAAS;;EAET;;EAEA;EACA,UAAU;;EAEV;;UAGe;EACf,QAAQ;;;EAGR,KAAK;;UAGU;;EAEf;;EAEA;;EAEA,OAAO;EACP;EACA;;UAGe;;EAEf;;EAEA,aAAa;;EAEb,YAAY;;;;;;cAOD;mBACM;mBACA;mBACA;mBACA;mBACA;mBACA;mBACA;EAEjB,YAAY,SAAS;;;;;;;EA0Cf,gBAAgB,OAAO,uBAAuB,QAAQ;;;;;;EAetD,eAAe,OAAO,sBAAsB,QAAQ;;;;EAyCpD,aAAa,OAAO,oBAAoB,QAAQ;;EAgBhD,WAAW,OAAO,kBAAkB,QAAQ;;;;EAgB5C,qBAAqB,OAAO,4BAA4B,QAAQ;;EAgBhE,gBAAgB;IAAS;MAAmB,QAAQ;UAUlD;UAaM;;iBAkGA,2BACd,SAAS,8BACR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"core-types-DfCMwTYt.d.ts","names":[],"sources":["../src/core-types.ts"],"mappings":";;KAeY;KAWA;KAaA;KACA;UAEK;EACf;EACA;;UAGe;EACf;EACA;EACA,MAAM;EACN;EACA,WAAW;;EAEX;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA,WAAW;EACX;EACA;;UAGe;EACf;EACA;EACA;EACA,UAAU;EACV;EACA;EACA,SAAS;EACT,WAAW;EACX,WAAW;;UAGI;EACf;EACA;EACA;;UAGe;EACf;EACA,OAAO;EACP;EACA;EACA;EACA;EACA;IACE;IACA;IACA;;EAEF,YAAY;EACZ;EACA;EACA;EACA;EACA,WAAW;;UAGI;EACf;EACA,OAAO;EACP;EACA;EACA;;;EAGA;EACA,WAAW;;UAGI;EACf;EACA;EACA;EACA;EACA;EACA,WAAW;;UAGI;EACf;EACA,OAAO;EACP;EACA;EACA;;;EAGA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GA,QAAQ;;;;EAIR,SAAS;;;;;EAKT,cAAc;;;EAGd,kBAAkB;;;EAGlB;;;;;;EAMA,sBAAsB,OAAO,uCAAuC;EACpE,YAAY;;;;;UAMG;EACf,YAAY;EACZ,YAAY;EACZ,aAAa;;UAGE;EACf;EACA,OAAO;EACP,YAAY;EACZ;EACA;EACA,mBAAmB;;UAGJ,oCAAoC,KAAK;EACxD;;;;;UAMe;EACf;EACA,YAAY;EACZ;;;;;;UAOe;EACf,IAAI,KAAK,YAAY,QAAQ,oCAAoC;EACjE,IAAI,KAAK,WAAW,aAAa,uBAAuB;EACxD,QAAQ,KAAK,YAAY;;;;;UAMV;;EAEf;;EAEA;;EAEA;;EAEA,OAAO;;EAEP;;EAEA;;EAEA;;;EAGA;;EAEA,WAAW;;;;;KAMD;EACN;EAAU,OAAO;;EACjB;EAAW;;;;;;UAMA;EACf,IAAI,OAAO,wBAAwB;EACnC,QAAQ,gBAAgB,QAAQ,gCAAgC;EAChE,OAAO,cAAc"}
|
package/dist/hub-D13zPQGr.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hub-D13zPQGr.js","names":["base64UrlEncode"],"sources":["../src/core-error.ts","../src/adapter-provider.ts","../src/credentials.ts","../src/hub.ts"],"sourcesContent":["/**\n * IntegrationError — the runtime error class thrown by the hub, providers,\n * adapters, and runtime helpers. Lives in its own module so any source\n * file can import it without pulling the package barrel (`./index.ts`)\n * and forming a cycle.\n *\n * The richer {@link IntegrationRuntimeError} (in `./errors.ts`) is a\n * separate, structured error type used by consumers wiring custom\n * error → HTTP-status mappings. `IntegrationError` is the legacy/canonical\n * throw shape kept for back-compat with everything that already catches it.\n */\n\nexport type IntegrationErrorRuntimeCode =\n | 'provider_not_found'\n | 'connector_not_found'\n | 'connection_not_found'\n | 'connection_not_active'\n | 'auth_not_supported'\n | 'capability_invalid'\n | 'capability_expired'\n | 'scope_denied'\n | 'action_denied'\n | 'action_not_found'\n | 'trigger_not_found'\n | 'approval_required'\n | 'policy_denied'\n | 'config_missing'\n | 'provider_failure'\n\nexport class IntegrationError extends Error {\n constructor(\n message: string,\n readonly code: IntegrationErrorRuntimeCode,\n ) {\n super(message)\n this.name = 'IntegrationError'\n }\n}\n","import type {\n CapabilityMutationResult,\n CapabilityReadResult,\n ConnectorAdapter,\n ConnectorCredentials,\n ConnectorInvocation,\n OAuth2TokenClientAuthMethod,\n OAuth2UrlTemplateMetadataSpec,\n ResolvedDataSource,\n TokenMetadataSource,\n} from './connectors/types.js'\nimport type {\n CompleteAuthRequest,\n IntegrationActionRequest,\n IntegrationActionResult,\n IntegrationCatalogSource,\n IntegrationConnection,\n IntegrationConnector,\n IntegrationProvider,\n IntegrationProviderKind,\n StartAuthRequest,\n StartAuthResult,\n} from './core-types.js'\nimport { IntegrationError } from './core-error.js'\nimport {\n createOAuthBasicAuthorizationHeader,\n createOAuthTokenRequestHeaders,\n oauthClientCredentialRedactionValues,\n redactOAuthSensitiveText,\n} from './connectors/oauth.js'\n\n/** OAuth client credentials the host resolves at start/exchange time.\n * The lib never reads env or any vault — kept edge-runtime-safe. */\nexport interface OAuthClientCredentials {\n clientId: string\n /** Omit for public clients whose manifest uses tokenClientAuthMethod=none. */\n clientSecret?: string\n}\n\nexport interface ConnectorAdapterProviderOptions {\n id?: string\n kind?: IntegrationProviderKind\n adapters: ConnectorAdapter[]\n resolveDataSource: (connection: IntegrationConnection) => Promise<ResolvedDataSource> | ResolvedDataSource\n /** Invoked when an adapter rotates credentials during executeRead /\n * executeMutation (e.g. an OAuth access token refreshed on expiry). The\n * host re-encrypts + persists the rotated envelope so the next expiry\n * does not force a reconnect. Carries the connection so the host can\n * resolve the secretRef. */\n onCredentialsRotated?: (event: {\n connection: IntegrationConnection\n credentials: ConnectorCredentials\n }) => Promise<void> | void\n /** Resolve OAuth client_id and, for confidential clients, client_secret at\n * start- and exchange-time. Host owns env, vault, and per-tenant\n * overrides. Return null to refuse the flow (lib will throw\n * `config_missing`). The lib never logs the secret nor includes it\n * in thrown error messages. */\n resolveOAuthClient?: (input: { connectorId: string }) =>\n | Promise<OAuthClientCredentials | null>\n | OAuthClientCredentials\n | null\n /** Fetch implementation forwarded to the OAuth token exchange. Default\n * is `globalThis.fetch`. Tests inject a mock. */\n fetchImpl?: typeof fetch\n now?: () => Date\n}\n\nexport function createConnectorAdapterProvider(options: ConnectorAdapterProviderOptions): IntegrationProvider {\n const providerId = options.id ?? 'first-party'\n const now = options.now ?? (() => new Date())\n const fetchImpl = options.fetchImpl ?? (globalThis.fetch?.bind(globalThis) as typeof fetch | undefined)\n const adapters = new Map<string, ConnectorAdapter>()\n for (const adapter of options.adapters) {\n adapters.set(adapter.manifest.kind, adapter)\n }\n return {\n id: providerId,\n kind: options.kind ?? 'first_party',\n listConnectors: () => [...adapters.values()].map((adapter) => manifestToConnector(providerId, adapter)),\n async startAuth(request: StartAuthRequest): Promise<StartAuthResult> {\n const adapter = adapters.get(request.connectorId)\n if (!adapter) {\n throw new IntegrationError(\n `Connector adapter ${request.connectorId} not found.`,\n 'connector_not_found',\n )\n }\n const auth = oauthManifestAuth(adapter.manifest.auth)\n if (!auth) {\n throw new IntegrationError(\n `Connector ${request.connectorId} does not support OAuth2 authorization (auth kind: ${adapter.manifest.auth.kind}).`,\n 'auth_not_supported',\n )\n }\n if ((auth.grantType ?? 'authorization_code') !== 'authorization_code') {\n throw new IntegrationError(\n `Connector ${request.connectorId} uses client_credentials and requires a machine connection path.`,\n 'auth_not_supported',\n )\n }\n const pkce = resolveOAuthPkceMode(auth.pkce, request.connectorId)\n const tokenClientAuthMethod = resolveTokenClientAuthMethod(\n auth.tokenClientAuthMethod,\n request.connectorId,\n )\n if (!options.resolveOAuthClient) {\n throw new IntegrationError(\n `OAuth client resolver missing on adapter provider; cannot start auth for ${request.connectorId}.`,\n 'config_missing',\n )\n }\n const client = await options.resolveOAuthClient({ connectorId: request.connectorId })\n if (\n !client ||\n !client.clientId ||\n (tokenClientAuthMethod !== 'none' && !client.clientSecret)\n ) {\n throw new IntegrationError(\n `OAuth client credentials unavailable for ${request.connectorId}.`,\n 'config_missing',\n )\n }\n if (!auth.authorizationUrl) {\n throw new IntegrationError(\n `Connector ${request.connectorId} uses the ${auth.grantType ?? 'authorization_code'} grant and has no authorization URL to redirect to.`,\n 'auth_not_supported',\n )\n }\n const scopes =\n request.requestedScopes && request.requestedScopes.length > 0\n ? request.requestedScopes\n : auth.scopes\n const url = new URL(resolveOAuthUrlTemplate(\n auth.authorizationUrl,\n request.metadata,\n request.connectorId,\n auth.urlTemplateMetadata,\n ))\n url.searchParams.set('response_type', 'code')\n url.searchParams.set(\n resolveOAuthParameterName(\n auth.authorizationClientIdParam,\n 'client_id',\n request.connectorId,\n ),\n client.clientId,\n )\n url.searchParams.set('redirect_uri', request.redirectUri)\n if (auth.sendScopeParam !== false && scopes.length > 0) {\n url.searchParams.set('scope', scopes.join(auth.scopeSeparator ?? ' '))\n }\n const state = request.state ?? randomState()\n url.searchParams.set('state', state)\n if (auth.extraAuthParams) {\n for (const [key, value] of Object.entries(auth.extraAuthParams)) {\n url.searchParams.set(key, value)\n }\n }\n if (pkce === 'unsupported') {\n url.searchParams.delete('code_challenge')\n url.searchParams.delete('code_challenge_method')\n } else {\n url.searchParams.set(\n 'code_challenge',\n requirePkceChallenge(request.codeChallenge, request.connectorId),\n )\n url.searchParams.set('code_challenge_method', 'S256')\n }\n return {\n providerId,\n connectorId: request.connectorId,\n authUrl: url.toString(),\n state,\n metadata: request.metadata,\n }\n },\n async completeAuth(request: CompleteAuthRequest): Promise<IntegrationConnection> {\n const adapter = adapters.get(request.connectorId)\n if (!adapter) {\n throw new IntegrationError(\n `Connector adapter ${request.connectorId} not found.`,\n 'connector_not_found',\n )\n }\n const auth = oauthManifestAuth(adapter.manifest.auth)\n if (!auth) {\n throw new IntegrationError(\n `Connector ${request.connectorId} does not support OAuth2 authorization (auth kind: ${adapter.manifest.auth.kind}).`,\n 'auth_not_supported',\n )\n }\n if ((auth.grantType ?? 'authorization_code') !== 'authorization_code') {\n throw new IntegrationError(\n `Connector ${request.connectorId} uses client_credentials and requires a machine connection path.`,\n 'auth_not_supported',\n )\n }\n const tokenClientAuthMethod = resolveTokenClientAuthMethod(\n auth.tokenClientAuthMethod,\n request.connectorId,\n )\n const pkce = resolveOAuthPkceMode(auth.pkce, request.connectorId)\n if (!request.code) {\n throw new IntegrationError(\n `Authorization code missing on completeAuth for ${request.connectorId}.`,\n 'config_missing',\n )\n }\n if (!options.resolveOAuthClient) {\n throw new IntegrationError(\n `OAuth client resolver missing on adapter provider; cannot complete auth for ${request.connectorId}.`,\n 'config_missing',\n )\n }\n const client = await options.resolveOAuthClient({ connectorId: request.connectorId })\n if (\n !client ||\n !client.clientId ||\n (tokenClientAuthMethod !== 'none' && !client.clientSecret)\n ) {\n throw new IntegrationError(\n `OAuth client credentials unavailable for ${request.connectorId}.`,\n 'config_missing',\n )\n }\n if (!fetchImpl) {\n throw new IntegrationError(\n 'No fetch implementation available; inject fetchImpl into createConnectorAdapterProvider.',\n 'config_missing',\n )\n }\n const body = new URLSearchParams({\n grant_type: 'authorization_code',\n code: request.code,\n redirect_uri: request.redirectUri,\n })\n const codeVerifier = pkce === 'unsupported'\n ? undefined\n : requirePkceVerifier(request.codeVerifier, request.connectorId)\n if (codeVerifier) body.set('code_verifier', codeVerifier)\n const headers = createOAuthTokenRequestHeaders(auth.tokenRequestHeaders)\n if (tokenClientAuthMethod === 'none') {\n body.set(\n resolveOAuthParameterName(\n auth.tokenClientIdParam,\n 'client_id',\n request.connectorId,\n ),\n client.clientId,\n )\n } else if (tokenClientAuthMethod === 'client_secret_post') {\n body.set(\n resolveOAuthParameterName(\n auth.tokenClientIdParam,\n 'client_id',\n request.connectorId,\n ),\n client.clientId,\n )\n body.set(\n resolveOAuthParameterName(\n auth.tokenClientSecretParam,\n 'client_secret',\n request.connectorId,\n ),\n client.clientSecret!,\n )\n } else {\n const authorization = createOAuthBasicAuthorizationHeader(\n client.clientId,\n client.clientSecret!,\n base64Encode,\n )\n headers.authorization = authorization\n }\n const redactionValues = [\n request.code,\n ...(codeVerifier ? [codeVerifier] : []),\n ...oauthClientCredentialRedactionValues(\n client.clientId,\n client.clientSecret,\n headers.authorization,\n ),\n ]\n const tokenUrl = resolveOAuthUrlTemplate(\n auth.tokenUrl,\n request.metadata,\n request.connectorId,\n auth.urlTemplateMetadata,\n )\n let res: Response\n try {\n res = await fetchImpl(tokenUrl, {\n method: 'POST',\n headers,\n body,\n })\n } catch (cause) {\n const detail = redactOAuthSensitiveText(\n (cause as Error)?.message ?? 'unknown',\n redactionValues,\n )\n throw new IntegrationError(\n `OAuth token exchange transport error for ${request.connectorId}: ${detail}`,\n 'provider_failure',\n )\n }\n if (!res.ok) {\n const text = await res.text().catch(() => '')\n const statusText = redactOAuthSensitiveText(res.statusText, redactionValues)\n const redactedText = redactOAuthSensitiveText(text, redactionValues)\n const detail = `${res.status} ${statusText} — ${redactedText.slice(0, 200)}`\n throw new IntegrationError(\n `OAuth token exchange failed for ${request.connectorId}: ${detail}`,\n 'provider_failure',\n )\n }\n let json: {\n access_token?: string\n refresh_token?: string\n expires_in?: number\n scope?: string\n token_type?: string\n } & Record<string, unknown>\n try {\n json = await res.json()\n } catch {\n throw new IntegrationError(\n `OAuth token exchange returned non-JSON body for ${request.connectorId}.`,\n 'provider_failure',\n )\n }\n if (!json.access_token) {\n throw new IntegrationError(\n `OAuth token exchange returned no access_token for ${request.connectorId}.`,\n 'provider_failure',\n )\n }\n const grantedScopes = typeof json.scope === 'string' && json.scope.length > 0\n ? json.scope.split(/[\\s,]+/).filter(Boolean)\n : []\n const issued = now()\n const issuedIso = issued.toISOString()\n const expiresAt = typeof json.expires_in === 'number' && json.expires_in > 0\n ? new Date(issued.getTime() + json.expires_in * 1000).toISOString()\n : undefined\n // Persist provider-specific token-response fields the connector declared\n // via `auth.tokenMetadata` into the connection metadata (e.g. Gong's\n // per-customer `api_base_url_for_customer`). The captured values win over\n // any same-key request.metadata — the token exchange is authoritative.\n const capturedMetadata = captureTokenMetadata(auth.tokenMetadata, json, request.connectorId)\n return {\n id: randomConnectionId(),\n owner: request.owner,\n providerId,\n connectorId: request.connectorId,\n status: 'active',\n grantedScopes,\n createdAt: issuedIso,\n updatedAt: issuedIso,\n expiresAt,\n metadata: { ...request.metadata, ...capturedMetadata },\n }\n },\n async invokeAction(connection, request) {\n const adapter = adapters.get(connection.connectorId)\n if (!adapter) {\n throw new IntegrationError(`Connector adapter ${connection.connectorId} not found.`, 'connector_not_found')\n }\n const capability = adapter.manifest.capabilities.find((candidate) => candidate.name === request.action)\n if (!capability) {\n throw new IntegrationError(`Capability ${request.action} is not defined by ${connection.connectorId}.`, 'action_not_found')\n }\n const source = await options.resolveDataSource(connection)\n let rotationPersistence = Promise.resolve()\n const persistRotation = (credentials: ConnectorCredentials): Promise<void> => {\n if (!options.onCredentialsRotated) return Promise.resolve()\n rotationPersistence = rotationPersistence.then(() =>\n options.onCredentialsRotated!({ connection, credentials }),\n )\n // Some third-party adapters do not await this callback. Attach a\n // rejection observer immediately, then let the original promise keep\n // its rejection for the adapter or the provider's finally block.\n void rotationPersistence.catch(() => {})\n return rotationPersistence\n }\n const invocation: ConnectorInvocation = {\n source,\n capabilityName: request.action,\n args: toRecord(request.input),\n idempotencyKey: request.idempotencyKey ?? `idem_${connection.id}_${request.action}_${now().getTime()}`,\n expectedEtag: typeof request.metadata?.expectedEtag === 'string' ? request.metadata.expectedEtag : undefined,\n callSessionId: typeof request.metadata?.callSessionId === 'string' ? request.metadata.callSessionId : undefined,\n onCredentialsRotated: options.onCredentialsRotated\n ? persistRotation\n : undefined,\n }\n try {\n if (capability.class === 'read') {\n if (!adapter.executeRead) {\n throw new IntegrationError(`Connector ${connection.connectorId} does not implement reads.`, 'action_not_found')\n }\n const result = await adapter.executeRead(invocation)\n return readResultToAction(request, result)\n }\n if (capability.class === 'mutation') {\n if (!adapter.executeMutation) {\n throw new IntegrationError(`Connector ${connection.connectorId} does not implement mutations.`, 'action_not_found')\n }\n const result = await adapter.executeMutation(invocation)\n return mutationResultToAction(request, result)\n }\n throw new IntegrationError(`Capability ${request.action} is not invokable as an action.`, 'action_not_found')\n } finally {\n // A provider can rotate a refresh token before the requested action\n // fails. Persist that full envelope regardless of the action outcome.\n await rotationPersistence\n }\n },\n }\n}\n\nexport function adapterManifestsToConnectors(\n adapters: ConnectorAdapter[],\n providerId = 'first-party',\n): IntegrationConnector[] {\n return adapters.map((adapter) => manifestToConnector(providerId, adapter))\n}\n\nexport function createConnectorAdapterCatalogSource(options: {\n id?: string\n providerId?: string\n adapters: ConnectorAdapter[]\n precedence?: number\n}): IntegrationCatalogSource {\n const sourceId = options.id ?? 'first-party'\n return {\n id: sourceId,\n precedence: options.precedence,\n connectors: adapterManifestsToConnectors(options.adapters, options.providerId ?? sourceId),\n }\n}\n\nexport function manifestToConnector(providerId: string, adapter: ConnectorAdapter): IntegrationConnector {\n const manifest = adapter.manifest\n const primaryAuth = primaryManifestAuth(manifest.auth)\n const oauthAuth = oauthManifestAuth(manifest.auth)\n return {\n id: manifest.kind,\n providerId,\n title: manifest.displayName,\n category: mapCategory(manifest.category),\n auth: mapAuth(primaryAuth.kind),\n scopes: primaryAuth.kind === 'oauth2' ? primaryAuth.scopes : [],\n actions: manifest.capabilities\n .filter((capability) => capability.class === 'read' || capability.class === 'mutation')\n .map((capability) => ({\n id: capability.name,\n title: titleFromName(capability.name),\n risk: capability.class === 'read' ? 'read' : capability.externalEffect ? 'destructive' : 'write',\n requiredScopes: capability.requiredScopes ?? [],\n dataClass: inferDataClass(manifest.category),\n ...(capability.consistencyModel ? { consistencyModel: capability.consistencyModel } : {}),\n description: capability.description,\n approvalRequired: capability.class === 'mutation',\n inputSchema: capability.parameters,\n })),\n metadata: {\n source: 'first-party-adapter',\n supportTier: 'firstPartyExecutable',\n executable: true,\n oauthPkce: oauthAuth\n ? resolveOAuthPkceMode(oauthAuth.pkce, manifest.kind)\n : undefined,\n authOptions: manifest.auth.kind === 'one_of' ? manifest.auth.options.map((auth) => auth.kind) : [manifest.auth.kind],\n preferredAuth: manifest.auth.kind === 'one_of' ? manifest.auth.preferred : manifest.auth.kind,\n },\n }\n}\n\nfunction readResultToAction(request: IntegrationActionRequest, result: CapabilityReadResult): IntegrationActionResult {\n return {\n ok: true,\n action: request.action,\n output: result.data,\n metadata: {\n etag: result.etag,\n fetchedAt: result.fetchedAt,\n },\n }\n}\n\nfunction mutationResultToAction(request: IntegrationActionRequest, result: CapabilityMutationResult): IntegrationActionResult {\n if (result.status === 'committed') {\n return {\n ok: true,\n action: request.action,\n output: result.data,\n metadata: {\n etagAfter: result.etagAfter,\n committedAt: result.committedAt,\n idempotentReplay: result.idempotentReplay,\n },\n }\n }\n if (result.status === 'conflict') {\n return {\n ok: false,\n action: request.action,\n output: {\n conflict: true,\n message: result.message,\n alternatives: result.alternatives,\n currentState: result.currentState,\n },\n }\n }\n return {\n ok: false,\n action: request.action,\n output: {\n rateLimited: true,\n retryAfterMs: result.retryAfterMs,\n message: result.message,\n },\n }\n}\n\nfunction mapAuth(kind: ConnectorAdapter['manifest']['auth']['kind']): IntegrationConnector['auth'] {\n if (kind === 'one_of') return 'custom'\n if (kind === 'oauth2') return 'oauth2'\n if (kind === 'api-key') return 'api_key'\n if (kind === 'none') return 'none'\n return 'custom'\n}\n\nfunction primaryManifestAuth(auth: ConnectorAdapter['manifest']['auth']): Exclude<ConnectorAdapter['manifest']['auth'], { kind: 'one_of' }> {\n if (auth.kind !== 'one_of') return auth\n return auth.options.find((option) => option.kind === auth.preferred) ?? auth.options[0]\n}\n\nfunction oauthManifestAuth(auth: ConnectorAdapter['manifest']['auth']): Extract<Exclude<ConnectorAdapter['manifest']['auth'], { kind: 'one_of' }>, { kind: 'oauth2' }> | undefined {\n if (auth.kind === 'oauth2') return auth\n if (auth.kind !== 'one_of') return undefined\n return auth.options.find((option): option is Extract<typeof option, { kind: 'oauth2' }> => option.kind === 'oauth2')\n}\n\n/** Resolve the manifest value at the last possible point before an OAuth\n * request. The runtime check matters because adapters can enter through JS or\n * an `any` cast without first passing the static manifest validator. */\nfunction resolveTokenClientAuthMethod(\n value: unknown,\n connectorId: string,\n): OAuth2TokenClientAuthMethod {\n if (value === undefined || value === 'client_secret_post') {\n return 'client_secret_post'\n }\n if (value === 'none' || value === 'client_secret_basic') return value\n throw new IntegrationError(\n `Connector ${connectorId} has an unsupported OAuth token client authentication method.`,\n 'config_missing',\n )\n}\n\nfunction resolveOAuthPkceMode(\n value: unknown,\n connectorId: string,\n): 'required' | 'supported' | 'unsupported' {\n if (value === undefined || value === 'required') return 'required'\n if (value === 'supported' || value === 'unsupported') return value\n throw new IntegrationError(\n `Connector ${connectorId} has an invalid OAuth PKCE posture.`,\n 'config_missing',\n )\n}\n\nfunction requirePkceChallenge(value: string | undefined, connectorId: string): string {\n if (!value || !/^[A-Za-z0-9_-]{43}$/.test(value)) {\n throw new IntegrationError(\n `OAuth PKCE S256 challenge missing or invalid for ${connectorId}.`,\n 'config_missing',\n )\n }\n return value\n}\n\nfunction requirePkceVerifier(value: string | undefined, connectorId: string): string {\n if (!value || !/^[A-Za-z0-9._~-]{43,128}$/.test(value)) {\n throw new IntegrationError(\n `OAuth PKCE verifier missing or invalid for ${connectorId}.`,\n 'config_missing',\n )\n }\n return value\n}\n\nfunction resolveOAuthParameterName(\n value: string | undefined,\n fallback: string,\n connectorId: string,\n): string {\n const name = value ?? fallback\n if (!/^[A-Za-z][A-Za-z0-9_.-]{0,63}$/.test(name)) {\n throw new IntegrationError(\n `Connector ${connectorId} declares an invalid OAuth parameter name.`,\n 'config_missing',\n )\n }\n return name\n}\n\n/** Encodes UTF-8 credentials without importing Node's Buffer, so the adapter\n * provider remains usable in browser and edge runtimes. */\nfunction base64Encode(value: string): string {\n const btoa = globalThis.btoa\n if (typeof btoa !== 'function') {\n throw new IntegrationError(\n 'OAuth client_secret_basic requires a base64 encoder in this runtime.',\n 'config_missing',\n )\n }\n const bytes = new TextEncoder().encode(value)\n let binary = ''\n for (const byte of bytes) binary += String.fromCharCode(byte)\n return btoa(binary)\n}\n\n/** Resolve provider-owned tenant labels embedded in OAuth URLs.\n *\n * Shopify and Gorgias put the merchant name in the hostname. Only one DNS\n * label is accepted for each placeholder, so connection metadata cannot turn\n * a provider URL into an arbitrary credential destination.\n */\nfunction resolveOAuthUrlTemplate(\n template: string,\n metadata: Record<string, unknown> | undefined,\n connectorId: string,\n metadataSpecs?: Readonly<Record<string, OAuth2UrlTemplateMetadataSpec>>,\n): string {\n const placeholders = [...template.matchAll(/\\{([A-Za-z][A-Za-z0-9_]*)\\}/g)]\n let resolved = template\n for (const match of placeholders) {\n const key = match[1]\n const raw = metadata?.[key]\n const metadataSpec = metadataSpecs?.[key]\n if (metadataSpec?.kind === 'base-url') {\n if (typeof raw !== 'string') {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} requires metadata.${key} as a provider base URL.`,\n 'config_missing',\n )\n }\n resolved = resolved.replaceAll(\n match[0],\n resolveOAuthMetadataBaseUrl(raw, metadataSpec, connectorId, key),\n )\n continue\n }\n if (metadataSpec?.kind === 'path-segment') {\n if (!isOAuthPathSegmentPlaceholder(template, match.index ?? -1, match[0])) {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} declares metadata.${key} outside a complete path segment.`,\n 'config_missing',\n )\n }\n if (typeof raw !== 'string' || !isOAuthPathSegment(raw.trim())) {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} requires metadata.${key} as a valid path segment.`,\n 'config_missing',\n )\n }\n resolved = resolved.replaceAll(match[0], encodeURIComponent(raw.trim()))\n continue\n }\n if (typeof raw !== 'string' || !isDnsLabel(raw.trim())) {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} requires metadata.${key} as a valid tenant label.`,\n 'config_missing',\n )\n }\n resolved = resolved.replaceAll(match[0], raw.trim().toLowerCase())\n }\n\n let url: URL\n try {\n url = new URL(resolved)\n } catch {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} is invalid.`,\n 'config_missing',\n )\n }\n if (url.protocol !== 'https:' || url.username || url.password) {\n throw new IntegrationError(\n `OAuth URL for ${connectorId} must be HTTPS without embedded credentials.`,\n 'config_missing',\n )\n }\n return url.toString()\n}\n\nfunction isOAuthPathSegment(value: string): boolean {\n return (\n value !== '.' &&\n value !== '..' &&\n /^[A-Za-z0-9._~-]{1,128}$/.test(value)\n )\n}\n\nfunction isOAuthPathSegmentPlaceholder(\n template: string,\n index: number,\n placeholder: string,\n): boolean {\n if (index < 0) return false\n const schemeIndex = template.indexOf('://')\n const rootEnd = schemeIndex >= 0\n ? schemeIndex + 3\n : template.startsWith('{')\n ? template.indexOf('}') + 1\n : 0\n const pathStart = template.indexOf('/', rootEnd)\n const end = index + placeholder.length\n const queryStart = template.search(/[?#]/)\n return (\n pathStart >= 0 &&\n index >= pathStart &&\n (queryStart < 0 || index < queryStart) &&\n template[index - 1] === '/' &&\n (end === template.length || template[end] === '/' || template[end] === '?' || template[end] === '#')\n )\n}\n\nfunction resolveOAuthMetadataBaseUrl(\n value: string,\n spec: Extract<OAuth2UrlTemplateMetadataSpec, { kind: 'base-url' }>,\n connectorId: string,\n metadataKey: string,\n): string {\n let url: URL\n try {\n url = new URL(value.trim())\n } catch {\n throw invalidOAuthMetadataBaseUrl(connectorId, metadataKey)\n }\n if (\n url.protocol !== 'https:' ||\n url.username ||\n url.password ||\n url.pathname !== '/' ||\n url.search ||\n url.hash\n ) {\n throw invalidOAuthMetadataBaseUrl(connectorId, metadataKey)\n }\n const exactAllowed = spec.allowedBaseUrls?.some((candidate) => sameOrigin(candidate, url)) ?? false\n const suffixAllowed = spec.allowedBaseUrlSuffixes?.some((suffix) =>\n !url.port &&\n suffix.startsWith('.') &&\n url.hostname.toLowerCase().endsWith(suffix.toLowerCase())\n ) ?? false\n const hasExplicitAllowlist = Boolean(\n spec.allowedBaseUrls?.length || spec.allowedBaseUrlSuffixes?.length,\n )\n if (hasExplicitAllowlist && !exactAllowed && !suffixAllowed) {\n throw invalidOAuthMetadataBaseUrl(connectorId, metadataKey)\n }\n if (spec.requirePublicHttps && !isPublicDnsHostname(url.hostname)) {\n throw invalidOAuthMetadataBaseUrl(connectorId, metadataKey)\n }\n return url.origin\n}\n\nfunction invalidOAuthMetadataBaseUrl(connectorId: string, metadataKey: string): IntegrationError {\n return new IntegrationError(\n `OAuth URL for ${connectorId} requires metadata.${metadataKey} as an allowed HTTPS provider root.`,\n 'config_missing',\n )\n}\n\nfunction sameOrigin(candidate: string, actual: URL): boolean {\n try {\n const allowed = new URL(candidate)\n return (\n allowed.protocol === 'https:' &&\n !allowed.username &&\n !allowed.password &&\n allowed.pathname === '/' &&\n !allowed.search &&\n !allowed.hash &&\n allowed.origin === actual.origin\n )\n } catch {\n return false\n }\n}\n\nfunction isPublicDnsHostname(hostname: string): boolean {\n const normalized = hostname.toLowerCase().replace(/^\\[|\\]$/g, '')\n if (\n normalized === 'localhost' ||\n normalized.endsWith('.localhost') ||\n normalized.endsWith('.local') ||\n normalized.endsWith('.internal') ||\n normalized.endsWith('.home.arpa')\n ) {\n return false\n }\n // OAuth redirects to self-hosted instances require a DNS name. Reject\n // literal IP addresses because fetch cannot pin DNS against rebinding.\n if (/^[0-9.]+$/.test(normalized) || normalized.includes(':')) return false\n return normalized.includes('.') && normalized.split('.').every(isDnsLabel)\n}\n\nfunction isDnsLabel(value: string): boolean {\n return value.length > 0 && value.length <= 63 && /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(value)\n}\n\n/** Project the declared `auth.tokenMetadata` mappings out of an OAuth\n * token-response body into connection metadata. Each entry maps a\n * connection-metadata key → the token-response field to read (string\n * shorthand) or `{ field, required }`. Required fields that are absent/empty\n * throw `provider_failure` so the break surfaces at connect; non-required\n * fields are captured if present and otherwise skipped. */\nfunction captureTokenMetadata(\n tokenMetadata: Record<string, TokenMetadataSource> | undefined,\n json: Record<string, unknown>,\n connectorId: string,\n): Record<string, string> {\n if (!tokenMetadata) return {}\n const captured: Record<string, string> = {}\n for (const [metaKey, source] of Object.entries(tokenMetadata)) {\n const field = typeof source === 'string' ? source : source.field\n const required = typeof source === 'string' ? false : source.required === true\n const raw = json[field]\n // Trim string values so capture-side emptiness matches the consumer's\n // emptiness check (e.g. resolveBaseUrl's `.trim()` guard). A whitespace-only\n // value must fail loud here at connect for a required field, not defer the\n // break to first call where the host already looks active.\n const value = typeof raw === 'string' ? raw.trim() : raw\n if (value === undefined || value === null || value === '') {\n if (required) {\n throw new IntegrationError(\n `OAuth token exchange for ${connectorId} did not return required field \"${field}\" for metadata.${metaKey}.`,\n 'provider_failure',\n )\n }\n continue\n }\n captured[metaKey] = String(value)\n }\n return captured\n}\n\nfunction mapCategory(category: ConnectorAdapter['manifest']['category']): IntegrationConnector['category'] {\n if (category === 'comms') return 'chat'\n if (category === 'spreadsheet') return 'database'\n if (category === 'doc') return 'docs'\n if (category === 'commerce') return 'workflow'\n // The manifest taxonomy is richer than the hub-facade taxonomy. Sales/market\n // intelligence and HR/payroll connectors collapse to the nearest hub bucket:\n // contact/company intelligence reads like CRM; the rest have no closer fit.\n if (category === 'sales-intelligence') return 'crm'\n if (category === 'market-intelligence' || category === 'hr') return 'other'\n return category === 'other' ? 'other' : category\n}\n\nfunction inferDataClass(category: ConnectorAdapter['manifest']['category']): 'public' | 'internal' | 'private' | 'sensitive' {\n if (category === 'commerce') return 'sensitive'\n if (category === 'webhook') return 'internal'\n return 'private'\n}\n\nfunction titleFromName(name: string): string {\n return name\n .split(/[._-]/g)\n .filter(Boolean)\n .map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))\n .join(' ')\n}\n\nfunction toRecord(input: unknown): Record<string, unknown> {\n if (input && typeof input === 'object' && !Array.isArray(input)) return input as Record<string, unknown>\n return {}\n}\n\nfunction randomState(): string {\n // 192 bits of entropy — comfortable CSRF margin and stays URL-safe.\n const bytes = new Uint8Array(24)\n globalThis.crypto.getRandomValues(bytes)\n return base64UrlEncode(bytes)\n}\n\nfunction randomConnectionId(): string {\n if (typeof globalThis.crypto?.randomUUID === 'function') {\n return `conn_${globalThis.crypto.randomUUID().replace(/-/g, '')}`\n }\n const bytes = new Uint8Array(16)\n globalThis.crypto.getRandomValues(bytes)\n return `conn_${base64UrlEncode(bytes)}`\n}\n\nfunction base64UrlEncode(bytes: Uint8Array): string {\n let bin = ''\n for (const b of bytes) bin += String.fromCharCode(b)\n // btoa is defined in browsers, workers, and Node ≥ 16.\n const b64 = typeof btoa === 'function' ? btoa(bin) : Buffer.from(bin, 'binary').toString('base64')\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '')\n}\n","import { createConnectorAdapterProvider, type ConnectorAdapterProviderOptions } from './adapter-provider.js'\nimport type {\n ConnectorAdapter,\n ConnectorCredentials,\n ResolvedDataSource,\n} from './connectors/types.js'\nimport type {\n IntegrationConnection,\n IntegrationConnectionStore,\n IntegrationCredentialsRotatedEvent,\n IntegrationOAuthState,\n IntegrationOAuthStateOutcome,\n IntegrationOAuthStateStore,\n IntegrationProvider,\n IntegrationSecretStore,\n SecretRef,\n} from './core-types.js'\n\nexport type {\n IntegrationOAuthState,\n IntegrationOAuthStateOutcome,\n IntegrationOAuthStateStore,\n IntegrationSecretStore,\n}\n\nexport interface ConnectionCredentialResolverOptions {\n secrets: IntegrationSecretStore\n connections?: IntegrationConnectionStore\n adapters?: ConnectorAdapter[]\n now?: () => Date\n markConnectionError?: (connection: IntegrationConnection, error: Error) => Promise<void> | void\n}\n\ninterface CredentialRefreshFlight {\n promise: Promise<ConnectorCredentials>\n cancelled: boolean\n settled: boolean\n waiters: number\n}\n\ninterface CredentialPersistenceLease {\n cancelled: boolean\n}\n\nclass CredentialRefreshRevokedError extends Error {\n constructor() {\n super('Connection was revoked during credential refresh.')\n this.name = 'CredentialRefreshRevokedError'\n }\n}\n\nconst credentialRefreshes = new WeakMap<\n IntegrationSecretStore,\n Map<string, CredentialRefreshFlight>\n>()\nconst credentialPersistences = new WeakMap<\n IntegrationSecretStore,\n Map<string, Set<CredentialPersistenceLease>>\n>()\nconst credentialRevocations = new WeakMap<IntegrationSecretStore, Map<string, number>>()\n\nexport class InMemoryIntegrationSecretStore implements IntegrationSecretStore {\n private readonly secrets = new Map<string, ConnectorCredentials>()\n\n get(ref: SecretRef): ConnectorCredentials | undefined {\n return this.secrets.get(secretKey(ref))\n }\n\n put(ref: SecretRef, credentials: ConnectorCredentials): void {\n this.secrets.set(secretKey(ref), credentials)\n }\n\n delete(ref: SecretRef): void {\n this.secrets.delete(secretKey(ref))\n }\n}\n\n/** Test/dev double for {@link IntegrationOAuthStateStore}. Production hubs\n * inject a durable implementation; this one keeps records in a Map and\n * enforces the single-use + expiry contract. */\nexport class InMemoryIntegrationOAuthStateStore implements IntegrationOAuthStateStore {\n private readonly states = new Map<string, IntegrationOAuthState>()\n\n put(state: IntegrationOAuthState): void {\n this.states.set(state.state, state)\n }\n\n consume(state: string): IntegrationOAuthStateOutcome {\n const record = this.states.get(state)\n this.states.delete(state)\n if (!record) return { ok: false, reason: 'unknown' }\n if (record.expiresAt <= Date.now()) return { ok: false, reason: 'expired' }\n return { ok: true, state: record }\n }\n\n sweep(now: number): void {\n for (const [key, record] of this.states) {\n if (record.expiresAt <= now) this.states.delete(key)\n }\n }\n}\n\nexport function createConnectionCredentialResolver(options: ConnectionCredentialResolverOptions) {\n const now = options.now ?? (() => new Date())\n return async function resolveDataSource(connection: IntegrationConnection): Promise<ResolvedDataSource> {\n const credentials = await resolveConnectionCredentials(connection, {\n secrets: options.secrets,\n connections: options.connections,\n adapters: options.adapters,\n now,\n markConnectionError: options.markConnectionError,\n })\n return {\n id: connection.id,\n projectId: String(connection.metadata?.projectId ?? connection.owner.id),\n publishedAgentId: typeof connection.metadata?.publishedAgentId === 'string' ? connection.metadata.publishedAgentId : null,\n kind: connection.connectorId,\n label: connection.account?.displayName ?? connection.account?.email ?? connection.connectorId,\n consistencyModel: typeof connection.metadata?.consistencyModel === 'string' ? connection.metadata.consistencyModel as never : 'authoritative',\n scopes: connection.grantedScopes,\n metadata: connection.metadata ?? {},\n credentials,\n status: connection.status === 'active' ? 'active' : connection.status === 'revoked' ? 'revoked' : 'error',\n }\n }\n}\n\nexport async function resolveConnectionCredentials(input: IntegrationConnection, options: ConnectionCredentialResolverOptions): Promise<ConnectorCredentials> {\n if (input.status !== 'active') throw new Error(`Connection ${input.id} is ${input.status}.`)\n if (!input.secretRef) return { kind: 'none' }\n const now = options.now ?? (() => new Date())\n const current = await options.secrets.get(input.secretRef)\n if (!current) throw new Error(`Secret ${input.secretRef.provider}/${input.secretRef.id} not found.`)\n if (!isExpiredOauth(current, now)) return current\n\n const adapter = options.adapters?.find((candidate) => candidate.manifest.kind === input.connectorId)\n if (!adapter?.refreshToken) return current\n let refresh: CredentialRefreshFlight | undefined\n try {\n await assertCredentialRefreshActive(input, options, now)\n refresh = acquireCredentialRefresh({\n connectorId: input.connectorId,\n secretRef: input.secretRef,\n secrets: options.secrets,\n now,\n refreshToken: adapter.refreshToken.bind(adapter),\n })\n const refreshed = await refresh.promise\n await assertCredentialRefreshActive(input, options, now, refresh)\n if (options.connections) {\n await options.connections.put({\n ...input,\n status: 'active',\n updatedAt: now().toISOString(),\n expiresAt: refreshed.kind === 'oauth2' && refreshed.expiresAt ? new Date(refreshed.expiresAt).toISOString() : input.expiresAt,\n })\n await assertCredentialRefreshActive(input, options, now, refresh)\n }\n return refreshed\n } catch (error) {\n const err = error instanceof Error ? error : new Error('Credential refresh failed.')\n if (err instanceof CredentialRefreshRevokedError) throw err\n await options.markConnectionError?.(input, err)\n if (options.connections) {\n await options.connections.put({\n ...input,\n status: 'expired',\n updatedAt: now().toISOString(),\n })\n }\n throw err\n } finally {\n if (refresh) {\n releaseCredentialRefresh(\n options.secrets,\n input.connectorId,\n input.secretRef,\n refresh,\n )\n }\n }\n}\n\nfunction acquireCredentialRefresh(input: {\n connectorId: string\n secretRef: SecretRef\n secrets: IntegrationSecretStore\n now: () => Date\n refreshToken: (credentials: ConnectorCredentials) => Promise<ConnectorCredentials>\n}): CredentialRefreshFlight {\n let refreshes = credentialRefreshes.get(input.secrets)\n if (!refreshes) {\n refreshes = new Map()\n credentialRefreshes.set(input.secrets, refreshes)\n }\n const key = credentialRefreshKey(input.connectorId, input.secretRef)\n if (credentialRevocations.get(input.secrets)?.has(key)) {\n throw new CredentialRefreshRevokedError()\n }\n const existing = refreshes.get(key)\n if (existing) {\n existing.waiters += 1\n return existing\n }\n\n let flight: CredentialRefreshFlight\n const promise = Promise.resolve().then(async () => {\n // A prior refresh can settle between the caller's first read and this\n // flight. Re-read before redeeming a provider's rotating refresh token.\n const latest = await input.secrets.get(input.secretRef)\n if (!latest) {\n throw new Error(\n `Secret ${input.secretRef.provider}/${input.secretRef.id} not found.`,\n )\n }\n if (!isExpiredOauth(latest, input.now)) return latest\n const refreshed = await input.refreshToken(latest)\n if (flight.cancelled) throw new CredentialRefreshRevokedError()\n await input.secrets.put(input.secretRef, refreshed)\n if (flight.cancelled) {\n await input.secrets.delete?.(input.secretRef)\n throw new CredentialRefreshRevokedError()\n }\n return refreshed\n })\n flight = {\n promise,\n cancelled: false,\n settled: false,\n waiters: 1,\n }\n refreshes.set(key, flight)\n\n const settle = () => {\n flight.settled = true\n clearCredentialRefresh(input.secrets, key, flight)\n }\n // Observe rejection immediately. Every caller still receives the original\n // rejected promise and applies its connection-specific error transition.\n void promise.then(settle, settle)\n return flight\n}\n\nfunction releaseCredentialRefresh(\n secrets: IntegrationSecretStore,\n connectorId: string,\n secretRef: SecretRef,\n flight: CredentialRefreshFlight,\n): void {\n flight.waiters -= 1\n clearCredentialRefresh(\n secrets,\n credentialRefreshKey(connectorId, secretRef),\n flight,\n )\n}\n\nfunction clearCredentialRefresh(\n secrets: IntegrationSecretStore,\n key: string,\n flight: CredentialRefreshFlight,\n): void {\n if (!flight.settled || flight.waiters !== 0) return\n const refreshes = credentialRefreshes.get(secrets)\n if (refreshes?.get(key) !== flight) return\n refreshes.delete(key)\n if (refreshes.size === 0) credentialRefreshes.delete(secrets)\n}\n\nasync function assertCredentialRefreshActive(\n input: IntegrationConnection,\n options: ConnectionCredentialResolverOptions,\n now: () => Date,\n operation?: CredentialPersistenceLease,\n): Promise<void> {\n const key = input.secretRef\n ? credentialRefreshKey(input.connectorId, input.secretRef)\n : undefined\n let revoked = operation?.cancelled === true\n || (key !== undefined\n && credentialRevocations.get(options.secrets)?.has(key) === true)\n let stored: IntegrationConnection | undefined\n if (options.connections) {\n stored = await options.connections.get(input.id)\n revoked ||= stored?.status === 'revoked'\n }\n if (!revoked && input.secretRef) {\n revoked = await options.secrets.get(input.secretRef) === undefined\n }\n if (!revoked) return\n\n if (operation) operation.cancelled = true\n if (input.secretRef) await options.secrets.delete?.(input.secretRef)\n if (options.connections && stored?.status !== 'revoked') {\n await options.connections.put({\n ...(stored ?? input),\n status: 'revoked',\n updatedAt: now().toISOString(),\n })\n }\n throw new CredentialRefreshRevokedError()\n}\n\nexport type CredentialBackedAdapterProviderOptions =\n Omit<ConnectorAdapterProviderOptions, 'resolveDataSource' | 'onCredentialsRotated'>\n & ConnectionCredentialResolverOptions\n & {\n /** Fired after the provider re-persists rotated credentials to the\n * secret + connection stores. Receives the hub-shaped event including\n * the resolved secretRef so the host can drive external re-encryption\n * or telemetry. */\n onCredentialsRotated?: (event: IntegrationCredentialsRotatedEvent) => Promise<void> | void\n }\n\nexport function createCredentialBackedAdapterProvider(options: CredentialBackedAdapterProviderOptions): IntegrationProvider {\n const now = options.now ?? (() => new Date())\n return createConnectorAdapterProvider({\n ...options,\n resolveDataSource: createConnectionCredentialResolver(options),\n onCredentialsRotated: async ({ connection, credentials }) => {\n const persistence = connection.secretRef\n ? acquireCredentialPersistence(\n options.secrets,\n connection.connectorId,\n connection.secretRef,\n )\n : undefined\n try {\n await assertCredentialRefreshActive(connection, options, now, persistence)\n if (connection.secretRef) {\n await options.secrets.put(connection.secretRef, credentials)\n }\n await assertCredentialRefreshActive(connection, options, now, persistence)\n if (options.connections) {\n await options.connections.put({\n ...connection,\n status: 'active',\n updatedAt: now().toISOString(),\n expiresAt: credentials.kind === 'oauth2' && credentials.expiresAt\n ? new Date(credentials.expiresAt).toISOString()\n : connection.expiresAt,\n })\n await assertCredentialRefreshActive(connection, options, now, persistence)\n }\n await options.onCredentialsRotated?.({ connection, secretRef: connection.secretRef, credentials })\n await assertCredentialRefreshActive(connection, options, now, persistence)\n } finally {\n if (persistence && connection.secretRef) {\n releaseCredentialPersistence(\n options.secrets,\n connection.connectorId,\n connection.secretRef,\n persistence,\n )\n }\n }\n },\n })\n}\n\nfunction acquireCredentialPersistence(\n secrets: IntegrationSecretStore,\n connectorId: string,\n secretRef: SecretRef,\n): CredentialPersistenceLease {\n let persistences = credentialPersistences.get(secrets)\n if (!persistences) {\n persistences = new Map()\n credentialPersistences.set(secrets, persistences)\n }\n const key = credentialRefreshKey(connectorId, secretRef)\n let leases = persistences.get(key)\n if (!leases) {\n leases = new Set()\n persistences.set(key, leases)\n }\n const lease = {\n cancelled: credentialRevocations.get(secrets)?.has(key) === true,\n }\n leases.add(lease)\n return lease\n}\n\nfunction releaseCredentialPersistence(\n secrets: IntegrationSecretStore,\n connectorId: string,\n secretRef: SecretRef,\n lease: CredentialPersistenceLease,\n): void {\n const persistences = credentialPersistences.get(secrets)\n if (!persistences) return\n const key = credentialRefreshKey(connectorId, secretRef)\n const leases = persistences.get(key)\n leases?.delete(lease)\n if (leases?.size === 0) persistences.delete(key)\n if (persistences.size === 0) credentialPersistences.delete(secrets)\n}\n\nexport async function revokeConnection(input: {\n connection: IntegrationConnection\n connections?: IntegrationConnectionStore\n secrets?: IntegrationSecretStore\n now?: () => Date\n}): Promise<IntegrationConnection> {\n const finishRevocation = input.connection.secretRef && input.secrets\n ? beginCredentialRevocation(\n input.secrets,\n input.connection.connectorId,\n input.connection.secretRef,\n )\n : undefined\n try {\n if (input.connection.secretRef) await input.secrets?.delete?.(input.connection.secretRef)\n const revoked: IntegrationConnection = {\n ...input.connection,\n status: 'revoked',\n updatedAt: (input.now?.() ?? new Date()).toISOString(),\n }\n await input.connections?.put(revoked)\n return revoked\n } finally {\n finishRevocation?.()\n }\n}\n\nfunction beginCredentialRevocation(\n secrets: IntegrationSecretStore,\n connectorId: string,\n secretRef: SecretRef,\n): () => void {\n const key = credentialRefreshKey(connectorId, secretRef)\n let revocations = credentialRevocations.get(secrets)\n if (!revocations) {\n revocations = new Map()\n credentialRevocations.set(secrets, revocations)\n }\n revocations.set(key, (revocations.get(key) ?? 0) + 1)\n const flight = credentialRefreshes.get(secrets)?.get(key)\n if (flight) flight.cancelled = true\n for (const persistence of credentialPersistences.get(secrets)?.get(key) ?? []) {\n persistence.cancelled = true\n }\n\n return () => {\n const remaining = (revocations?.get(key) ?? 1) - 1\n if (remaining > 0) revocations?.set(key, remaining)\n else revocations?.delete(key)\n if (revocations?.size === 0) credentialRevocations.delete(secrets)\n }\n}\n\nfunction isExpiredOauth(credentials: ConnectorCredentials, now: () => Date): boolean {\n return credentials.kind === 'oauth2'\n && typeof credentials.expiresAt === 'number'\n && credentials.expiresAt <= now().getTime()\n && Boolean(credentials.refreshToken)\n}\n\nfunction secretKey(ref: SecretRef): string {\n return `${ref.provider}:${ref.id}`\n}\n\nfunction credentialRefreshKey(connectorId: string, ref: SecretRef): string {\n return JSON.stringify([connectorId, ref.provider, ref.id])\n}\n","import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from 'node:crypto'\nimport {\n composeIntegrationRegistry,\n type ComposeIntegrationRegistryOptions,\n type IntegrationRegistry,\n} from './registry-core.js'\nimport {\n InMemoryIntegrationOAuthStateStore,\n InMemoryIntegrationSecretStore,\n type IntegrationOAuthState,\n} from './credentials.js'\nimport { IntegrationError } from './core-error.js'\nimport type {\n CompleteAuthRequest,\n IntegrationActionGuard,\n IntegrationActionRequest,\n IntegrationActionResult,\n IntegrationActor,\n IntegrationCapability,\n IntegrationConnection,\n IntegrationConnectionStore,\n IntegrationConnector,\n IntegrationHubOptions,\n IntegrationPolicyEngine,\n IntegrationProvider,\n IntegrationTriggerEvent,\n IntegrationTriggerSubscription,\n InvokeWithCapabilityRequest,\n IssueCapabilityRequest,\n IssuedIntegrationCapability,\n StartAuthRequest,\n StartAuthResult,\n} from './core-types.js'\n\nexport class IntegrationHub {\n private readonly providers = new Map<string, IntegrationProvider>()\n private readonly store: IntegrationConnectionStore\n private readonly capabilitySecret: string\n private readonly guard: IntegrationActionGuard | undefined\n private readonly policy: IntegrationPolicyEngine | undefined\n /** Host-injected (or in-memory default) secret store. The hub re-persists\n * rotated credentials here when a connection carries a secretRef. */\n readonly secretStore: IntegrationHubOptions['secretStore']\n private readonly oauthStateStore: NonNullable<IntegrationHubOptions['oauthStateStore']>\n private readonly oauthStateTtlMs: number\n private readonly credentialsRotated: IntegrationHubOptions['credentialsRotated']\n private readonly now: () => Date\n\n constructor(options: IntegrationHubOptions) {\n if (!options.capabilitySecret) {\n throw new IntegrationError('capabilitySecret is required.', 'capability_invalid')\n }\n for (const provider of options.providers) this.providers.set(provider.id, provider)\n this.store = options.store\n this.capabilitySecret = options.capabilitySecret\n this.guard = options.guard\n this.policy = options.policy\n this.secretStore = options.secretStore ?? new InMemoryIntegrationSecretStore()\n this.oauthStateStore = options.oauthStateStore ?? new InMemoryIntegrationOAuthStateStore()\n this.oauthStateTtlMs = options.oauthStateTtlMs ?? 10 * 60 * 1000\n this.credentialsRotated = options.credentialsRotated\n this.now = options.now ?? (() => new Date())\n }\n\n async listConnectors(): Promise<IntegrationConnector[]> {\n const catalogs = await Promise.all([...this.providers.values()].map((provider) => provider.listConnectors()))\n return catalogs.flat()\n }\n\n async listRegistry(options: ComposeIntegrationRegistryOptions = {}): Promise<IntegrationRegistry> {\n const sources = await Promise.all([...this.providers.values()].map(async (provider) => ({\n id: provider.id,\n connectors: await provider.listConnectors(),\n })))\n return composeIntegrationRegistry(sources, options)\n }\n\n async startAuth(providerId: string, request: StartAuthRequest): Promise<StartAuthResult> {\n const provider = this.requireProvider(providerId)\n if (!provider.startAuth) throw new IntegrationError(`Provider ${providerId} does not support auth start.`, 'auth_not_supported')\n const connector = await this.requireConnector(provider, request.connectorId)\n const pkce = connectorOAuthPkceMode(connector)\n const pkcePair = pkce === 'unsupported' ? undefined : createPkcePair()\n const result = await provider.startAuth({\n ...request,\n codeChallenge: pkcePair?.challenge,\n })\n const record: IntegrationOAuthState = {\n state: result.state,\n providerId,\n connectorId: request.connectorId,\n owner: request.owner,\n requestedScopes: request.requestedScopes,\n redirectUri: request.redirectUri,\n codeVerifier: pkcePair?.verifier,\n expiresAt: this.now().getTime() + this.oauthStateTtlMs,\n metadata: request.metadata,\n }\n await this.oauthStateStore.put(record)\n return result\n }\n\n async completeAuth(providerId: string, request: CompleteAuthRequest): Promise<IntegrationConnection> {\n const provider = this.requireProvider(providerId)\n if (!provider.completeAuth) throw new IntegrationError(`Provider ${providerId} does not support auth completion.`, 'auth_not_supported')\n const outcome = await this.oauthStateStore.consume(request.state)\n if (!outcome.ok) {\n throw new IntegrationError(`Integration OAuth state ${outcome.reason}: possible CSRF, replay, or stale flow.`, 'capability_invalid')\n }\n if (outcome.state.providerId !== providerId || outcome.state.connectorId !== request.connectorId) {\n throw new IntegrationError('Integration OAuth state does not match completion request.', 'capability_invalid')\n }\n if (outcome.state.redirectUri !== request.redirectUri) {\n throw new IntegrationError('Integration OAuth redirect URI does not match the start request.', 'capability_invalid')\n }\n const pinnedMetadata = request.metadata || outcome.state.metadata\n ? { ...request.metadata, ...outcome.state.metadata }\n : undefined\n const connection = await provider.completeAuth({\n ...request,\n connectorId: outcome.state.connectorId,\n owner: outcome.state.owner,\n state: outcome.state.state,\n redirectUri: outcome.state.redirectUri,\n codeVerifier: outcome.state.codeVerifier,\n metadata: pinnedMetadata,\n })\n await this.store.put(connection)\n return connection\n }\n\n async upsertConnection(connection: IntegrationConnection): Promise<IntegrationConnection> {\n await this.store.put(connection)\n return connection\n }\n\n async listConnections(owner: IntegrationActor): Promise<IntegrationConnection[]> {\n return this.store.listByOwner(owner)\n }\n\n async getConnection(connectionId: string): Promise<IntegrationConnection | undefined> {\n return this.store.get(connectionId)\n }\n\n async issueCapability(request: IssueCapabilityRequest): Promise<IssuedIntegrationCapability> {\n const connection = await this.requireConnection(request.connectionId)\n this.assertConnectionActive(connection)\n assertScopes(connection, request.scopes)\n const now = this.now()\n const capability: IntegrationCapability = {\n id: `cap_${randomUUID()}`,\n subject: request.subject,\n connectionId: request.connectionId,\n scopes: unique(request.scopes),\n allowedActions: unique(request.allowedActions),\n issuedAt: now.toISOString(),\n expiresAt: new Date(now.getTime() + request.ttlMs).toISOString(),\n metadata: request.metadata,\n }\n return { capability, token: signCapability(capability, this.capabilitySecret) }\n }\n\n verifyCapability(token: string): IntegrationCapability {\n const capability = verifyCapabilityToken(token, this.capabilitySecret)\n if (Date.parse(capability.expiresAt) <= this.now().getTime()) {\n throw new IntegrationError('Integration capability expired.', 'capability_expired')\n }\n return capability\n }\n\n async invokeWithCapability(token: string, request: InvokeWithCapabilityRequest): Promise<IntegrationActionResult> {\n const capability = this.verifyCapability(token)\n if (!capability.allowedActions.includes(request.action)) {\n throw new IntegrationError(`Capability does not allow action ${request.action}.`, 'action_denied')\n }\n const connection = await this.requireConnection(capability.connectionId)\n this.assertConnectionActive(connection)\n const provider = this.requireProvider(connection.providerId)\n const connector = await this.requireConnector(provider, connection.connectorId)\n const action = connector.actions.find((candidate) => candidate.id === request.action)\n if (!action) throw new IntegrationError(`Action ${request.action} is not defined by connector ${connector.id}.`, 'action_not_found')\n assertScopes(connection, action.requiredScopes)\n assertScopes({ ...connection, grantedScopes: capability.scopes }, action.requiredScopes)\n const fullRequest: IntegrationActionRequest = { ...request, connectionId: connection.id }\n const proceed = async () => {\n if (!this.policy) return provider.invokeAction(connection, fullRequest)\n const decision = await this.policy.decide({\n connection,\n request: fullRequest,\n action,\n subject: capability.subject,\n })\n if (decision.decision === 'deny') {\n throw new IntegrationError(decision.reason, 'policy_denied')\n }\n if (decision.decision === 'require_approval') {\n return {\n ok: false,\n action: request.action,\n output: { approvalRequired: true, approval: decision.approval },\n metadata: { policyDecision: decision.decision, reason: decision.reason, ...decision.metadata },\n }\n }\n return provider.invokeAction(connection, fullRequest)\n }\n if (this.guard) {\n return this.guard.invokeAction({ connection, request: fullRequest, action }, proceed)\n }\n return proceed()\n }\n\n async subscribeTrigger(connectionId: string, trigger: string, targetUrl?: string): Promise<IntegrationTriggerSubscription> {\n const connection = await this.requireConnection(connectionId)\n this.assertConnectionActive(connection)\n const provider = this.requireProvider(connection.providerId)\n const connector = await this.requireConnector(provider, connection.connectorId)\n const spec = connector.triggers?.find((candidate) => candidate.id === trigger)\n if (!spec) throw new IntegrationError(`Trigger ${trigger} is not defined by connector ${connector.id}.`, 'trigger_not_found')\n assertScopes(connection, spec.requiredScopes)\n if (!provider.subscribeTrigger) {\n throw new IntegrationError(`Provider ${provider.id} does not support triggers.`, 'auth_not_supported')\n }\n return provider.subscribeTrigger(connection, trigger, targetUrl)\n }\n\n private requireProvider(providerId: string): IntegrationProvider {\n const provider = this.providers.get(providerId)\n if (!provider) throw new IntegrationError(`Provider ${providerId} not found.`, 'provider_not_found')\n return provider\n }\n\n private async requireConnector(provider: IntegrationProvider, connectorId: string): Promise<IntegrationConnector> {\n const connector = (await provider.listConnectors()).find((candidate) => candidate.id === connectorId)\n if (!connector) throw new IntegrationError(`Connector ${connectorId} not found.`, 'connector_not_found')\n return connector\n }\n\n private async requireConnection(connectionId: string): Promise<IntegrationConnection> {\n const connection = await this.store.get(connectionId)\n if (!connection) throw new IntegrationError(`Connection ${connectionId} not found.`, 'connection_not_found')\n return connection\n }\n\n private assertConnectionActive(connection: IntegrationConnection): void {\n if (connection.status !== 'active') {\n throw new IntegrationError(`Connection ${connection.id} is ${connection.status}.`, 'connection_not_active')\n }\n if (connection.expiresAt && Date.parse(connection.expiresAt) <= this.now().getTime()) {\n throw new IntegrationError(`Connection ${connection.id} is expired.`, 'connection_not_active')\n }\n }\n}\n\n\nexport function signCapability(capability: IntegrationCapability, secret: string): string {\n const payload = base64UrlEncode(JSON.stringify(capability))\n const signature = hmac(payload, secret)\n return `${payload}.${signature}`\n}\n\nexport function verifyCapabilityToken(token: string, secret: string): IntegrationCapability {\n const [payload, signature] = token.split('.')\n if (!payload || !signature) throw new IntegrationError('Malformed integration capability.', 'capability_invalid')\n const expected = hmac(payload, secret)\n if (!constantTimeEqual(signature, expected)) throw new IntegrationError('Invalid integration capability signature.', 'capability_invalid')\n let parsed: IntegrationCapability\n try {\n parsed = JSON.parse(base64UrlDecode(payload)) as IntegrationCapability\n } catch {\n throw new IntegrationError('Invalid integration capability payload.', 'capability_invalid')\n }\n if (!parsed.id || !parsed.connectionId || !Array.isArray(parsed.scopes) || !Array.isArray(parsed.allowedActions)) {\n throw new IntegrationError('Invalid integration capability payload.', 'capability_invalid')\n }\n return parsed\n}\n\n\nfunction assertScopes(connection: Pick<IntegrationConnection, 'grantedScopes'>, requiredScopes: string[]): void {\n const missing = requiredScopes.filter((scope) => !connection.grantedScopes.includes(scope))\n if (missing.length > 0) throw new IntegrationError(`Missing integration scopes: ${missing.join(', ')}`, 'scope_denied')\n}\n\n\ntype IntegrationOAuthPkceMode = 'required' | 'supported' | 'unsupported'\n\nfunction connectorOAuthPkceMode(connector: IntegrationConnector): IntegrationOAuthPkceMode {\n const value = connector.metadata?.oauthPkce\n if (value === undefined) return 'required'\n if (value === 'required' || value === 'supported' || value === 'unsupported') return value\n throw new IntegrationError(\n `Connector ${connector.id} declares an invalid OAuth PKCE posture.`,\n 'config_missing',\n )\n}\n\nfunction createPkcePair(): { verifier: string; challenge: string } {\n const verifier = randomBytes(48).toString('base64url')\n const challenge = createHash('sha256').update(verifier).digest('base64url')\n return { verifier, challenge }\n}\n\nfunction hmac(payload: string, secret: string): string {\n return createHmac('sha256', secret).update(payload).digest('base64url')\n}\n\nfunction constantTimeEqual(a: string, b: string): boolean {\n const left = Buffer.from(a)\n const right = Buffer.from(b)\n return left.length === right.length && timingSafeEqual(left, right)\n}\n\nfunction base64UrlEncode(value: string): string {\n return Buffer.from(value, 'utf8').toString('base64url')\n}\n\nfunction base64UrlDecode(value: string): string {\n return Buffer.from(value, 'base64url').toString('utf8')\n}\n\nfunction unique<T>(values: T[]): T[] {\n return [...new Set(values)]\n}\n\n"],"mappings":";;;;AA6BA,IAAa,mBAAb,cAAsC,MAAM;CAG/B;CAFX,YACE,SACA,MACA;EACA,MAAM,OAAO;EAFJ,KAAA,OAAA;EAGT,KAAK,OAAO;CACd;AACF;;;AC+BA,SAAgB,+BAA+B,SAA+D;CAC5G,MAAM,aAAa,QAAQ,MAAM;CACjC,MAAM,MAAM,QAAQ,8BAAc,IAAI,KAAK;CAC3C,MAAM,YAAY,QAAQ,aAAc,WAAW,OAAO,KAAK,UAAU;CACzE,MAAM,2BAAW,IAAI,IAA8B;CACnD,KAAK,MAAM,WAAW,QAAQ,UAC5B,SAAS,IAAI,QAAQ,SAAS,MAAM,OAAO;CAE7C,OAAO;EACL,IAAI;EACJ,MAAM,QAAQ,QAAQ;EACtB,sBAAsB,CAAC,GAAG,SAAS,OAAO,CAAC,CAAC,CAAC,KAAK,YAAY,oBAAoB,YAAY,OAAO,CAAC;EACtG,MAAM,UAAU,SAAqD;GACnE,MAAM,UAAU,SAAS,IAAI,QAAQ,WAAW;GAChD,IAAI,CAAC,SACH,MAAM,IAAI,iBACR,qBAAqB,QAAQ,YAAY,cACzC,qBACF;GAEF,MAAM,OAAO,kBAAkB,QAAQ,SAAS,IAAI;GACpD,IAAI,CAAC,MACH,MAAM,IAAI,iBACR,aAAa,QAAQ,YAAY,qDAAqD,QAAQ,SAAS,KAAK,KAAK,KACjH,oBACF;GAEF,KAAK,KAAK,aAAa,0BAA0B,sBAC/C,MAAM,IAAI,iBACR,aAAa,QAAQ,YAAY,mEACjC,oBACF;GAEF,MAAM,OAAO,qBAAqB,KAAK,MAAM,QAAQ,WAAW;GAChE,MAAM,wBAAwB,6BAC5B,KAAK,uBACL,QAAQ,WACV;GACA,IAAI,CAAC,QAAQ,oBACX,MAAM,IAAI,iBACR,4EAA4E,QAAQ,YAAY,IAChG,gBACF;GAEF,MAAM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