import { Scalars } from '../index.cjs'; import '../genql/runtime/_type-selection.cjs'; import '../_create-client-DeRWkSzy.cjs'; import '../genql/runtime/_types.cjs'; import '../genql/runtime/_generate-graphql-operation.cjs'; import '../genql/runtime/_aliasing.cjs'; import '../type-helpers.cjs'; import '../bin/util/get-stuff-from-env.cjs'; import '../common-types.cjs'; 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 };