import { Scalars } from '../index.js'; import '../genql/runtime/_type-selection.js'; import '../_create-client-B5RrFpfM.js'; import '../genql/runtime/_types.js'; import '../genql/runtime/_generate-graphql-operation.js'; import '../genql/runtime/_aliasing.js'; import '../type-helpers.js'; import '../bin/util/get-stuff-from-env.js'; import '../common-types.js'; type KeysStartingWith = { [K in keyof Obj]: K extends `${Prefix}${string}` ? K : never; }[keyof Obj]; type ExtractWorkflowKey = T extends `${infer Base}:${string}` ? Base : T; type WorkflowKeys = KeysStartingWith extends never ? `bshb_workflow_${string}` : KeysStartingWith; type WorkflowSchemaMap = { [K in WorkflowKeys]: Scalars[`schema_${K}`]; }; declare const authenticateWebhook: ({ secret: _secret, body, signature, }: { /** * The body of the incoming webhook request * Can be: * - Parsed JSON from request.json() * - Raw string from request.text() * - ReadableStream from request.body */ body: unknown; /** * The signature of the incoming webhook request—you get this via request.headers["x-basehub-webhook-signature"] * This should be a hex-encoded HMAC SHA-256 hash of the request body */ signature: string | null | Headers; /** * The secret used for verifying the incoming webhook request—you get this via the BaseHub API * This secret should never be exposed in requests or responses */ secret: Key; }) => Promise<{ success: true; payload: WorkflowSchemaMap[ExtractWorkflowKey]; } | { success: false; error: string; }>; export { type WorkflowKeys, authenticateWebhook };