import { type Encodable } from "@automate.ax/codec"; import { WebflowClient } from "webflow-api"; import * as z from "zod"; import type { DefinedAction } from "../../automation/actions.js"; import type { ResolvedIntegrationAccount } from "../../automation/integrations.js"; type InputObject = Record; interface WebflowRequestSerializer { json(value: unknown, options?: { unrecognizedObjectKeys?: "fail" | "passthrough" | "strip"; }): { ok: boolean; }; } /** Codec-safe form of an official Webflow SDK type. */ export type WebflowValue = unknown extends T ? Encodable : T extends void ? void : T extends Date ? string : T extends readonly (infer TItem)[] ? WebflowValue[] : T extends object ? { [TKey in keyof T]: WebflowValue; } & Encodable : T extends Encodable ? T : never; /** Official Webflow request type accepted by an action. */ export type WebflowInputValue = T extends unknown ? T extends Date ? string : T extends readonly (infer TItem)[] ? WebflowInputValue[] : T extends object ? { [TKey in keyof T]: WebflowInputValue; } : T : never; /** Portable public type for one Webflow-backed action definition. */ export type WebflowDefinedAction = DefinedAction, z.ZodType>, "webflow">; /** * Keeps declaration emit on public Webflow SDK names. * * @param action - Webflow-backed action definition. */ export declare function webflowAction(action: WebflowDefinedAction): WebflowDefinedAction; /** * Creates the official authenticated Webflow Data API client. * * @param account - Resolved Webflow integration account. */ export declare function getWebflowApi(account: ResolvedIntegrationAccount<"webflow">): WebflowClient; /** * Returns the bearer token for direct Webflow Data API v2 requests. * * @param account - Resolved Webflow integration account. */ export declare function getWebflowAccessToken(account: ResolvedIntegrationAccount<"webflow">): string; /** * Sends an authenticated request to a current Webflow Data API v2 endpoint. * * @param account - Resolved Webflow integration account. * @param path - Data API v2 path relative to the Webflow API origin. * @param options - Optional method, query, and JSON body. * @param options.body - JSON request body. * @param options.method - HTTP request method. * @param options.query - Query parameters, including nested filter objects. */ export declare function requestWebflowApi(account: ResolvedIntegrationAccount<"webflow">, path: string, options?: { body?: InputObject; method?: "DELETE" | "GET" | "PATCH" | "POST" | "PUT"; query?: InputObject; }): Promise; /** * Removes path identifiers before passing request fields to the Webflow SDK. * * @param input - Action input containing path and request fields. * @param keys - Path identifier keys to remove. */ export declare function webflowRequest(input: InputObject, ...keys: string[]): TRequest; /** Runtime schema for an official Webflow response type. */ export declare function webflowObjectSchema(): z.ZodType>; /** Runtime schema for Webflow mutations that return no response body. */ export declare function webflowVoidSchema(): z.ZodType>; /** * Runtime schema for an official Webflow request plus concrete constraints. * * @param schema - Concrete validation applied before the codec check. * @param requestSerializer - Official serializer for non-parameter fields. */ export declare function webflowInputSchema(schema: z.ZodObject, requestSerializer?: WebflowRequestSerializer): z.ZodType>; /** * Runtime schema backed by an official Webflow request serializer. * * @param requestSerializer - Official serializer for the request body. */ export declare function webflowSerializedSchema(requestSerializer: WebflowRequestSerializer): z.ZodCustom; /** Shared concrete schemas for Webflow action inputs. */ export declare const webflowActionSchemas: { comments: (...keys: string[]) => z.ZodObject<{ limit: z.ZodOptional; localeId: z.ZodOptional; offset: z.ZodOptional; sortBy: z.ZodOptional>; sortOrder: z.ZodOptional>; }, z.core.$loose>; empty: z.ZodObject<{}, z.core.$strip>; id: (key: string) => z.ZodObject<{ [x: string]: z.ZodString; }, z.core.$loose>; ids: (...keys: string[]) => z.ZodObject<{ [x: string]: z.ZodString; }, z.core.$loose>; paginated: (...keys: string[]) => z.ZodObject<{ limit: z.ZodOptional; offset: z.ZodOptional; }, z.core.$loose>; parameters: (keys: string[], shape?: Record) => z.ZodObject<{ [x: string]: z.ZodString | z.ZodType>; }, z.core.$loose>; pagination: z.ZodObject<{ limit: z.ZodOptional; offset: z.ZodOptional; }, z.core.$loose>; }; /** * Converts official Webflow response dates into portable ISO strings. * * @param value - Value returned by the official Webflow SDK. * @throws When Webflow returns a value the automation codec cannot encode. */ export declare function normalizeWebflowValue(value: unknown): Encodable; export {}; //# sourceMappingURL=lib.d.ts.map