/** * 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"; import { Scripts } from "../resources/scripts/client/Client"; export declare namespace Pages { 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; } } /** * Pages are the pages in your Webflow site. */ export declare class Pages { protected readonly _options: Pages.Options; constructor(_options: Pages.Options); /** * List of all pages for a site. * * Required scope | `pages:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.PagesListRequest} request * @param {Pages.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.pages.list("580e63e98c9a982ac9b8b741", { * localeId: "65427cf400e02b306eaa04a0" * }) */ list(siteId: string, request?: Webflow.PagesListRequest, requestOptions?: Pages.RequestOptions): Promise; /** * Get metadata information for a single page. * * Required scope | `pages:read` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.PagesGetMetadataRequest} request * @param {Pages.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.pages.getMetadata("63c720f9347c2139b248e552", { * localeId: "65427cf400e02b306eaa04a0" * }) */ getMetadata(pageId: string, request?: Webflow.PagesGetMetadataRequest, requestOptions?: Pages.RequestOptions): Promise; /** * Update Page-level metadata, including SEO and Open Graph fields. * * * Note: When updating Page Metadata in secondary locales, you may only add `slug` to the request if your Site has the [Advanced or Enterprise Localization](https://webflow.com/localization) add-on. * * * Required scope | `pages:write` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.UpdatePageSettingsRequest} request * @param {Pages.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.pages.updatePageSettings("63c720f9347c2139b248e552", { * localeId: "65427cf400e02b306eaa04a0", * body: { * id: "6596da6045e56dee495bcbba", * siteId: "6258612d1ee792848f805dcf", * title: "Guide to the Galaxy", * slug: "guide-to-the-galaxy", * createdOn: "2024-03-11T10:42:00Z", * lastUpdated: "2024-03-11T10:42:42Z", * archived: false, * draft: false, * canBranch: true, * isBranch: false, * seo: { * title: "The Ultimate Hitchhiker's Guide to the Galaxy", * description: "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels." * }, * openGraph: { * title: "Explore the Cosmos with The Ultimate Guide", * titleCopied: false, * description: "Dive deep into the mysteries of the universe with your guide to everything galactic.", * descriptionCopied: false * }, * localeId: "653fd9af6a07fc9cfd7a5e57", * publishedPath: "/en-us/guide-to-the-galaxy" * } * }) */ updatePageSettings(pageId: string, request: Webflow.UpdatePageSettingsRequest, requestOptions?: Pages.RequestOptions): Promise; /** * Get content from a static page. This includes text nodes, image nodes, select nodes, text input nodes, submit button nodes, and component instances with [property overrides](https://help.webflow.com/hc/en-us/articles/33961219350547-Component-properties#how-to-modify-property-values-on-component-instances). * * To retrieve the static content of a component instance, use the [Get Component Content](/data/reference/pages-and-components/components/get-content) endpoint. * * If you do not include a `localeId` in your request, the response will return any content that can be localized from the Primary locale. * * Required scope | `pages:read` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.PagesGetContentRequest} request * @param {Pages.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.pages.getContent("63c720f9347c2139b248e552", { * localeId: "65427cf400e02b306eaa04a0" * }) */ getContent(pageId: string, request?: Webflow.PagesGetContentRequest, requestOptions?: Pages.RequestOptions): Promise; /** * This endpoint updates content on a static page in **secondary locales**. It supports updating up to 1000 nodes in a single request. * * Before making updates: * 1. Use the [get page content](/data/reference/pages-and-components/pages/get-content) endpoint to identify available content nodes and their types * 2. If the page has component instances, retrieve the component'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 localized pages. Ensure that the specified `localeId` is a valid **secondary locale** for the site otherwise the request will fail. * * * Required scope | `pages:write` * * @param {string} pageId - Unique identifier for a Page * @param {Webflow.PageDomWrite} request * @param {Pages.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.pages.updateStaticContent("63c720f9347c2139b248e552", { * localeId: "localeId", * 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" * }] * }] * }) */ updateStaticContent(pageId: string, request: Webflow.PageDomWrite, requestOptions?: Pages.RequestOptions): Promise; protected _scripts: Scripts | undefined; get scripts(): Scripts; protected _getAuthorizationHeader(): Promise; }