/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Webflow from "../../../index"; export declare namespace Components { interface Options { environment?: core.Supplier; accessToken: core.Supplier; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; /** Additional headers to include in the request. */ headers?: Record; } } export declare class Components { protected readonly _options: Components.Options; constructor(_options: Components.Options); /** * List of all components for a site. * * Required scope | `components:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.ComponentsListRequest} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.components.list("580e63e98c9a982ac9b8b741") */ list(siteId: string, request?: Webflow.ComponentsListRequest, requestOptions?: Components.RequestOptions): Promise; /** * Get static content from a component definition. This includes text nodes, image nodes, select nodes, text input nodes, submit button nodes, and nested component instances. * To retrieve dynamic content set by component properties, use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint. * * If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale. * * Required scope | `components:read` * * @param {string} siteId - Unique identifier for a Site * @param {string} componentId - Unique identifier for a Component * @param {Webflow.ComponentsGetContentRequest} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0" * }) */ getContent(siteId: string, componentId: string, request?: Webflow.ComponentsGetContentRequest, requestOptions?: Components.RequestOptions): Promise; /** * This endpoint updates content within a component defintion for **secondary locales**. It supports updating up to 1000 nodes in a single request. * * Before making updates: * 1. Use the [get component content](/data/reference/pages-and-components/components/get-content) endpoint to identify available content nodes and their types * 2. If your component definition has a component instance nested within it, retrieve the nested component instance's properties that you'll override using the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint * * * This endpoint is specifically for localizing component definitions. Ensure that the specified `localeId` is a valid **secondary locale** for the site otherwise the request will fail. * * * Required scope | `components:write` * * @param {string} siteId - Unique identifier for a Site * @param {string} componentId - Unique identifier for a Component * @param {Webflow.ComponentDomWrite} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.ForbiddenError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0", * nodes: [{ * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", * text: "

The Hitchhiker's Guide to the Galaxy

" * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", * text: "

Don't Panic!

Always know where your towel is.

" * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad635", * choices: [{ * value: "choice-1", * text: "First choice" * }, { * value: "choice-2", * text: "Second choice" * }] * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad642", * placeholder: "Enter something here..." * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad671", * value: "Submit", * waitingText: "Submitting..." * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", * propertyOverrides: [{ * propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0", * text: "

Time is an illusion

" * }, { * propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", * text: "Life, the Universe and Everything" * }] * }] * }) */ updateContent(siteId: string, componentId: string, request: Webflow.ComponentDomWrite, requestOptions?: Components.RequestOptions): Promise; /** * Get the default property values of a component definition. * * If you do not include a `localeId` in your request, the response will return any properties that can be localized from the Primary locale. * * Required scope | `components:read` * * @param {string} siteId - Unique identifier for a Site * @param {string} componentId - Unique identifier for a Component * @param {Webflow.ComponentsGetPropertiesRequest} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0" * }) */ getProperties(siteId: string, componentId: string, request?: Webflow.ComponentsGetPropertiesRequest, requestOptions?: Components.RequestOptions): Promise; /** * Update the default property values of a component definition in a specificed locale. * * Before making updates, use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify properties that can be updated in a secondary locale. * * The request requires a secondary locale ID. If a `localeId` is missing, the request will not be processed and will result in an error. * * Required scope | `components:write` * * @param {string} siteId - Unique identifier for a Site * @param {string} componentId - Unique identifier for a Component * @param {Webflow.ComponentPropertiesWrite} request * @param {Components.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} * @throws {@link Webflow.UnauthorizedError} * @throws {@link Webflow.NotFoundError} * @throws {@link Webflow.TooManyRequestsError} * @throws {@link Webflow.InternalServerError} * * @example * await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0", * properties: [{ * propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", * text: "The Hitchhiker\u2019s Guide to the Galaxy" * }, { * propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", * text: "

Dont Panic!

Always know where your towel is.

" * }] * }) */ updateProperties(siteId: string, componentId: string, request: Webflow.ComponentPropertiesWrite, requestOptions?: Components.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }