From add83f594702dd65656f9d2e23a3efb358e2f6f8 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Tue, 24 Dec 2024 15:21:00 +0000 Subject: [PATCH] SDK regeneration --- .mock/definition/__package__.yml | 392 ++++- .mock/definition/collections/fields.yml | 1 + .mock/definition/collections/items.yml | 4 +- .mock/definition/components.yml | 476 ++++++ .mock/definition/inventory.yml | 1 + .mock/definition/orders.yml | 1 + .mock/definition/pages.yml | 132 +- .mock/definition/redirects.yml | 190 +++ .mock/definition/sitePlan.yml | 40 + .mock/definition/sites.yml | 184 +++ .mock/fern.config.json | 2 +- reference.md | 1348 +++++++++++++++-- src/Client.ts | 21 + src/api/errors/index.ts | 2 +- src/api/resources/assets/client/Client.ts | 2 + .../resources/items/client/Client.ts | 12 +- src/api/resources/components/client/Client.ts | 779 ++++++++++ src/api/resources/components/client/index.ts | 1 + .../client/requests/ComponentDomWrite.ts | 36 + .../requests/ComponentPropertiesWrite.ts | 27 + .../requests/ComponentsGetContentRequest.ts | 29 + .../ComponentsGetPropertiesRequest.ts | 24 + .../client/requests/ComponentsListRequest.ts | 18 + .../components/client/requests/index.ts | 5 + src/api/resources/components/index.ts | 2 + .../types/ComponentDomWriteNodesItem.ts | 7 + .../ComponentPropertiesWritePropertiesItem.ts | 17 + .../types/ComponentsUpdateContentResponse.ts | 8 + .../ComponentsUpdatePropertiesResponse.ts | 8 + src/api/resources/components/types/index.ts | 4 + src/api/resources/index.ts | 5 + src/api/resources/inventory/client/Client.ts | 1 - src/api/resources/pages/client/Client.ts | 40 +- .../pages/client/requests/DomWrite.ts | 29 - .../pages/client/requests/PageDomWrite.ts | 36 + .../resources/pages/client/requests/index.ts | 2 +- .../pages/resources/scripts/client/Client.ts | 3 - .../pages/types/PageDomWriteNodesItem.ts | 7 + src/api/resources/pages/types/index.ts | 2 +- src/api/resources/products/client/Client.ts | 11 +- src/api/resources/redirects/client/Client.ts | 547 +++++++ src/api/resources/redirects/client/index.ts | 1 + src/api/resources/redirects/index.ts | 1 + src/api/resources/scripts/client/Client.ts | 2 - src/api/resources/sitePlan/client/Client.ts | 153 ++ src/api/resources/sitePlan/client/index.ts | 1 + src/api/resources/sitePlan/index.ts | 1 + src/api/resources/sites/client/Client.ts | 380 ++++- .../client/requests/SitesCreateRequest.ts | 18 + .../client/requests/SitesUpdateRequest.ts | 14 + .../resources/sites/client/requests/index.ts | 2 + .../resources/activityLogs/client/Client.ts | 2 +- .../sites/resources/scripts/client/Client.ts | 3 - src/api/resources/users/client/Client.ts | 2 +- src/api/resources/webhooks/client/Client.ts | 1 - src/api/types/Component.ts | 19 + src/api/types/ComponentDom.ts | 15 + ...onentInstanceNodePropertyOverridesWrite.ts | 15 + ...ertyOverridesWritePropertyOverridesItem.ts | 15 + src/api/types/ComponentList.ts | 13 + src/api/types/ComponentNode.ts | 17 + src/api/types/ComponentProperties.ts | 15 + src/api/types/ComponentProperty.ts | 16 + src/api/types/ComponentPropertyType.ts | 11 + src/api/types/Dom.ts | 2 +- src/api/types/ImageNode.ts | 9 +- src/api/types/ImageNodeImage.ts | 8 + src/api/types/Node.ts | 22 +- src/api/types/NodeType.ts | 10 - src/api/types/NotEnterprisePlanWorkspace.ts | 5 + src/api/types/ProductFieldData.ts | 2 +- src/api/types/Redirect.ts | 15 + src/api/types/Redirects.ts | 14 + src/api/types/ScriptApply.ts | 2 +- src/api/types/SitePlan.ts | 14 + src/api/types/SitePlanId.ts | 35 + src/api/types/SitePlanName.ts | 23 + src/api/types/TextNode.ts | 11 +- src/api/types/TextNodeText.ts | 8 + .../TextNodeWrite.ts} | 5 +- src/api/types/TriggerType.ts | 30 +- src/api/types/UserAccessGroupsItem.ts | 5 +- src/api/types/UserAccessGroupsItemType.ts | 5 +- src/api/types/index.ts | 27 +- .../resources/components/client/index.ts | 1 + .../client/requests/ComponentDomWrite.ts | 21 + .../requests/ComponentPropertiesWrite.ts | 21 + .../components/client/requests/index.ts | 2 + .../resources/components/index.ts | 2 + .../types/ComponentDomWriteNodesItem.ts | 18 + ...ComponentPropertiesWritePropertiesItem.ts} | 12 +- .../types/ComponentsUpdateContentResponse.ts | 20 + .../ComponentsUpdatePropertiesResponse.ts | 20 + .../resources/components/types/index.ts | 4 + src/serialization/resources/index.ts | 3 + .../pages/client/requests/DomWrite.ts | 21 - .../pages/client/requests/PageDomWrite.ts | 21 + .../resources/pages/client/requests/index.ts | 2 +- .../pages/types/PageDomWriteNodesItem.ts | 18 + .../resources/pages/types/index.ts | 2 +- .../client/requests/SitesCreateRequest.ts | 24 + .../client/requests/SitesUpdateRequest.ts | 22 + .../resources/sites/client/requests/index.ts | 2 + src/serialization/types/Component.ts | 26 + src/serialization/types/ComponentDom.ts | 24 + ...onentInstanceNodePropertyOverridesWrite.ts | 23 + ...ertyOverridesWritePropertyOverridesItem.ts | 22 + src/serialization/types/ComponentList.ts | 22 + src/serialization/types/ComponentNode.ts | 23 + .../types/ComponentProperties.ts | 26 + src/serialization/types/ComponentProperty.ts | 28 + .../types/ComponentPropertyType.ts | 16 + src/serialization/types/ImageNode.ts | 11 +- src/serialization/types/ImageNodeImage.ts | 20 + src/serialization/types/Node.ts | 37 +- src/serialization/types/NodeType.ts | 15 - .../types/NotEnterprisePlanWorkspace.ts | 16 + src/serialization/types/Redirect.ts | 22 + src/serialization/types/Redirects.ts | 22 + src/serialization/types/SitePlan.ts | 24 + src/serialization/types/SitePlanId.ts | 39 + src/serialization/types/SitePlanName.ts | 27 + src/serialization/types/TextNode.ts | 11 +- src/serialization/types/TextNodeText.ts | 20 + src/serialization/types/TextNodeWrite.ts | 20 + src/serialization/types/index.ts | 27 +- yarn.lock | 203 +-- 127 files changed, 5831 insertions(+), 554 deletions(-) create mode 100644 .mock/definition/components.yml create mode 100644 .mock/definition/redirects.yml create mode 100644 .mock/definition/sitePlan.yml create mode 100644 src/api/resources/components/client/Client.ts create mode 100644 src/api/resources/components/client/index.ts create mode 100644 src/api/resources/components/client/requests/ComponentDomWrite.ts create mode 100644 src/api/resources/components/client/requests/ComponentPropertiesWrite.ts create mode 100644 src/api/resources/components/client/requests/ComponentsGetContentRequest.ts create mode 100644 src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts create mode 100644 src/api/resources/components/client/requests/ComponentsListRequest.ts create mode 100644 src/api/resources/components/client/requests/index.ts create mode 100644 src/api/resources/components/index.ts create mode 100644 src/api/resources/components/types/ComponentDomWriteNodesItem.ts create mode 100644 src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts create mode 100644 src/api/resources/components/types/ComponentsUpdateContentResponse.ts create mode 100644 src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts create mode 100644 src/api/resources/components/types/index.ts delete mode 100644 src/api/resources/pages/client/requests/DomWrite.ts create mode 100644 src/api/resources/pages/client/requests/PageDomWrite.ts create mode 100644 src/api/resources/pages/types/PageDomWriteNodesItem.ts create mode 100644 src/api/resources/redirects/client/Client.ts create mode 100644 src/api/resources/redirects/client/index.ts create mode 100644 src/api/resources/redirects/index.ts create mode 100644 src/api/resources/sitePlan/client/Client.ts create mode 100644 src/api/resources/sitePlan/client/index.ts create mode 100644 src/api/resources/sitePlan/index.ts create mode 100644 src/api/resources/sites/client/requests/SitesCreateRequest.ts create mode 100644 src/api/resources/sites/client/requests/SitesUpdateRequest.ts create mode 100644 src/api/types/Component.ts create mode 100644 src/api/types/ComponentDom.ts create mode 100644 src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts create mode 100644 src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts create mode 100644 src/api/types/ComponentList.ts create mode 100644 src/api/types/ComponentNode.ts create mode 100644 src/api/types/ComponentProperties.ts create mode 100644 src/api/types/ComponentProperty.ts create mode 100644 src/api/types/ComponentPropertyType.ts create mode 100644 src/api/types/ImageNodeImage.ts delete mode 100644 src/api/types/NodeType.ts create mode 100644 src/api/types/NotEnterprisePlanWorkspace.ts create mode 100644 src/api/types/Redirect.ts create mode 100644 src/api/types/Redirects.ts create mode 100644 src/api/types/SitePlan.ts create mode 100644 src/api/types/SitePlanId.ts create mode 100644 src/api/types/SitePlanName.ts create mode 100644 src/api/types/TextNodeText.ts rename src/api/{resources/pages/types/DomWriteNodesItem.ts => types/TextNodeWrite.ts} (81%) create mode 100644 src/serialization/resources/components/client/index.ts create mode 100644 src/serialization/resources/components/client/requests/ComponentDomWrite.ts create mode 100644 src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts create mode 100644 src/serialization/resources/components/client/requests/index.ts create mode 100644 src/serialization/resources/components/index.ts create mode 100644 src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts rename src/serialization/resources/{pages/types/DomWriteNodesItem.ts => components/types/ComponentPropertiesWritePropertiesItem.ts} (50%) create mode 100644 src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts create mode 100644 src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts create mode 100644 src/serialization/resources/components/types/index.ts delete mode 100644 src/serialization/resources/pages/client/requests/DomWrite.ts create mode 100644 src/serialization/resources/pages/client/requests/PageDomWrite.ts create mode 100644 src/serialization/resources/pages/types/PageDomWriteNodesItem.ts create mode 100644 src/serialization/resources/sites/client/requests/SitesCreateRequest.ts create mode 100644 src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts create mode 100644 src/serialization/types/Component.ts create mode 100644 src/serialization/types/ComponentDom.ts create mode 100644 src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts create mode 100644 src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts create mode 100644 src/serialization/types/ComponentList.ts create mode 100644 src/serialization/types/ComponentNode.ts create mode 100644 src/serialization/types/ComponentProperties.ts create mode 100644 src/serialization/types/ComponentProperty.ts create mode 100644 src/serialization/types/ComponentPropertyType.ts create mode 100644 src/serialization/types/ImageNodeImage.ts delete mode 100644 src/serialization/types/NodeType.ts create mode 100644 src/serialization/types/NotEnterprisePlanWorkspace.ts create mode 100644 src/serialization/types/Redirect.ts create mode 100644 src/serialization/types/Redirects.ts create mode 100644 src/serialization/types/SitePlan.ts create mode 100644 src/serialization/types/SitePlanId.ts create mode 100644 src/serialization/types/SitePlanName.ts create mode 100644 src/serialization/types/TextNodeText.ts create mode 100644 src/serialization/types/TextNodeWrite.ts diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 667df1ba..e73d472b 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -19,11 +19,24 @@ errors: message: >- OAuthForbidden: You are missing the following scopes - components:write + - value: + key: value - value: code: forbidden message: User is not authorized to perform this action + BadRequestError: + status-code: 400 + type: unknown + docs: Request body was incorrectly formatted. + examples: + - value: + code: bad_request + message: 'Bad Request: Request is malformed' - value: key: value + - value: + code: validation_error + message: 'Validation Error: Provided ID is invalid' NotFoundError: status-code: 404 type: Error @@ -43,19 +56,6 @@ errors: - value: code: too_many_requests message: Too many requests - BadRequestError: - status-code: 400 - type: unknown - docs: Request body was incorrectly formatted. - examples: - - value: - code: bad_request - message: 'Bad Request: Request is malformed' - - value: - key: value - - value: - code: validation_error - message: 'Validation Error: Provided ID is invalid' InternalServerError: status-code: 500 type: Error @@ -80,18 +80,18 @@ errors: code: ecommerce_not_enabled message: Ecommerce is not yet initialized types: - BadRequestErrorBody: + ForbiddenErrorBody: discriminated: false union: - - InvalidDomain - - NoDomains + - InvalidScopes + - UsersNotEnabled source: openapi: ../../../referenced-specs/v2.yml - ForbiddenErrorBody: + BadRequestErrorBody: discriminated: false union: - - InvalidScopes - - UsersNotEnabled + - InvalidDomain + - NoDomains source: openapi: ../../../referenced-specs/v2.yml ConflictErrorBody: @@ -151,6 +151,7 @@ types: - users_not_enabled - validation_error docs: Error code + inline: true source: openapi: ../../../referenced-specs/v2.yml ErrorDetailsItem: @@ -281,6 +282,7 @@ types: - optOut - disabled docs: The type of data collection enabled for the site. + inline: true source: openapi: ../../../referenced-specs/v2.yml Site: @@ -327,11 +329,14 @@ types: docs: The type of data collection enabled for the site. source: openapi: ../../../referenced-specs/v2.yml + InvalidScopes: unknown + NotEnterprisePlanWorkspace: unknown Sites: properties: sites: optional> source: openapi: ../../../referenced-specs/v2.yml + NotEnterprisePlanSite: unknown Domains: properties: customDomains: optional> @@ -339,6 +344,104 @@ types: openapi: ../../../referenced-specs/v2.yml InvalidDomain: unknown NoDomains: unknown + Redirect: + docs: A single redirection rule, specifying a source URL and a destination URL. + properties: + id: + type: optional + docs: The ID of the specific redirect rule + fromUrl: + type: optional + docs: The source URL path that will be redirected. + toUrl: + type: optional + docs: The target URL path where the user or client will be redirected. + source: + openapi: ../../../referenced-specs/v2.yml + Pagination: + docs: Pagination object + properties: + limit: + type: optional + docs: The limit used for pagination + offset: + type: optional + docs: The offset used for pagination + total: + type: optional + docs: The total number of records + source: + openapi: ../../../referenced-specs/v2.yml + Redirects: + docs: Site redirects response + properties: + redirects: + type: optional> + docs: List of redirects for a given site + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + SitePlanId: + enum: + - value: hosting-basic-v3 + name: HostingBasicV3 + - value: hosting-cms-v3 + name: HostingCmsV3 + - value: hosting-business-v3 + name: HostingBusinessV3 + - value: hosting-ecommerce-standard-v2 + name: HostingEcommerceStandardV2 + - value: hosting-ecommerce-plus-v2 + name: HostingEcommercePlusV2 + - value: hosting-ecommerce-advanced-v2 + name: HostingEcommerceAdvancedV2 + - value: hosting-basic-v4 + name: HostingBasicV4 + - value: hosting-cms-v4 + name: HostingCmsV4 + - value: hosting-business-v4 + name: HostingBusinessV4 + - value: hosting-ecommerce-standard-v3 + name: HostingEcommerceStandardV3 + - value: hosting-ecommerce-plus-v3 + name: HostingEcommercePlusV3 + - value: hosting-ecommerce-advanced-v3 + name: HostingEcommerceAdvancedV3 + docs: ID of the hosting plan. + inline: true + source: + openapi: ../../../referenced-specs/v2.yml + SitePlanName: + enum: + - value: Basic Hosting + name: BasicHosting + - value: CMS Hosting + name: CmsHosting + - value: Business Hosting + name: BusinessHosting + - value: ECommerce Standard Hosting + name: ECommerceStandardHosting + - value: ECommerce Plus Hosting + name: ECommercePlusHosting + - value: ECommerce Advanced Hosting + name: ECommerceAdvancedHosting + docs: Name of the hosting plan. + inline: true + source: + openapi: ../../../referenced-specs/v2.yml + SitePlan: + properties: + id: + type: optional + docs: ID of the hosting plan. + name: + type: optional + docs: Name of the hosting plan. + pricingInfo: + type: optional + docs: URL for more information about Webflow hosting plan pricing. + source: + openapi: ../../../referenced-specs/v2.yml SiteActivityLogItemEvent: enum: - styles_modified @@ -383,6 +486,7 @@ types: - branch_review_created - branch_review_approved - branch_review_canceled + inline: true source: openapi: ../../../referenced-specs/v2.yml SiteActivityLogItemResourceOperation: @@ -396,6 +500,7 @@ types: - GROUP_CREATED - GROUP_DELETED - REORDERED + inline: true source: openapi: ../../../referenced-specs/v2.yml SiteActivityLogItemUser: @@ -420,28 +525,12 @@ types: payload: optional> source: openapi: ../../../referenced-specs/v2.yml - Pagination: - docs: Pagination object - properties: - limit: - type: optional - docs: The limit used for pagination - offset: - type: optional - docs: The offset used for pagination - total: - type: optional - docs: The total number of records - source: - openapi: ../../../referenced-specs/v2.yml SiteActivityLogResponse: properties: items: optional> pagination: optional source: openapi: ../../../referenced-specs/v2.yml - InvalidScopes: unknown - NotEnterprisePlanSite: unknown CollectionListArrayItem: docs: A collection object properties: @@ -490,6 +579,7 @@ types: - Color - ExtFileRef docs: Choose these appropriate field type for your collection data + inline: true source: openapi: ../../../referenced-specs/v2.yml Field: @@ -940,17 +1030,35 @@ types: pagination: optional source: openapi: ../../../referenced-specs/v2.yml - TextNode: - docs: > - Represents textual content within the DOM. It contains both the raw text - and its HTML representation, allowing for flexibility in rendering and - processing. Additional attributes can be associated with the text for - styling or other purposes. + TextNodeText: properties: html: optional text: optional source: openapi: ../../../referenced-specs/v2.yml + inline: true + TextNode: + docs: > + Represents text content within the DOM. It contains both the raw text and + its HTML representation. Additional attributes can be associated with the + text for styling or other purposes. + properties: + id: + type: optional + docs: Node UUID + text: optional + attributes: + type: optional> + docs: The custom attributes of the node + source: + openapi: ../../../referenced-specs/v2.yml + ImageNodeImage: + properties: + alt: optional + assetId: optional + source: + openapi: ../../../referenced-specs/v2.yml + inline: true ImageNode: docs: > Represents an image within the DOM. It contains details about the image, @@ -958,41 +1066,78 @@ types: identifier for fetching the actual image resource. Additional attributes can be associated with the image for styling or other purposes. properties: - alt: optional - assetId: optional + id: + type: optional + docs: Node UUID + image: optional + attributes: + type: optional> + docs: The custom attributes of the node source: openapi: ../../../referenced-specs/v2.yml - NodeType: + ComponentPropertyType: enum: - - text - - image + - value: Plain Text + name: PlainText + - value: Rich Text + name: RichText + - value: Alt Text + name: AltText + inline: true source: openapi: ../../../referenced-specs/v2.yml - Node: + ComponentProperty: docs: > - A generic representation of a content element within the Document Object - Model (DOM). Each node has a unique identifier and a specific type that - determines its content structure and attributes. + Represents a property of a component instance in the DOM. A property + contains a list of both the raw text and the HTML representation, allowing + for flexibility in rendering and processing. Additional attributes can be + associated with the text for styling or other purposes. + properties: + propertyId: + type: optional + docs: The ID of the property. + type: optional + label: optional + text: optional + source: + openapi: ../../../referenced-specs/v2.yml + ComponentNode: + docs: > + Represents a component instance within the DOM. It contains details about + the component instance, such as its type and properties. properties: id: type: optional docs: Node UUID - type: optional - text: optional - image: optional - attributes: - type: optional> - docs: The custom attributes of the node + componentId: + type: optional + docs: Component ID + propertyOverrides: + type: optional> + docs: List of component properties with overrides for a component instance. + source: + openapi: ../../../referenced-specs/v2.yml + Node: + discriminant: type + base-properties: {} + docs: > + A generic representation of a content element within the Document Object + Model (DOM). Each node has a unique identifier and a specific type that + determines its content structure and attributes. + union: + text: TextNode + image: ImageNode + component-instance: ComponentNode source: openapi: ../../../referenced-specs/v2.yml Dom: docs: > The DOM (Document Object Model) schema represents the content structure of - a web page. It captures various content nodes, such as text and images, - along with their associated attributes. Each node has a unique identifier - and can be of different types like text or image. The schema also provides - pagination details for scenarios where the content nodes are too many to - be fetched in a single request. + a web page or component. It captures various content nodes along with + their associated attributes. Each node has a unique identifier and can be + of different types like text, image or component-instance. The schema also + provides pagination details for scenarios where the content nodes are too + many to be fetched in a single request. properties: pageId: type: optional @@ -1001,6 +1146,113 @@ types: pagination: optional source: openapi: ../../../referenced-specs/v2.yml + TextNodeWrite: + docs: Update a text node + properties: + nodeId: + type: string + docs: Node UUID + text: + type: string + docs: >- + HTML content of the node, including the HTML tag. The HTML tags must + be the same as what's returned from the Get Content endpoint. + source: + openapi: ../../../referenced-specs/v2.yml + ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem: + properties: + propertyId: + type: string + docs: The ID of the property. + text: + type: string + docs: > + The new string or HTML value used to override the component instance + property value. + + The provided value must be compatible with the type of the component + instance property. + + For example, attempting to override a single-line plain-text property + with a multi-line + + value will result in an error. + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ComponentInstanceNodePropertyOverridesWrite: + docs: Update text property overrides of a component instance + properties: + nodeId: + type: string + docs: Node UUID + propertyOverrides: + docs: >- + A list of component instance properties to override within the + specified secondary locale. + type: list + source: + openapi: ../../../referenced-specs/v2.yml + Component: + docs: The Component object + properties: + id: + type: string + docs: Unique identifier for the Component + name: + type: optional + docs: Component Name + group: + type: optional + docs: The group that the component belongs to + description: + type: optional + docs: Component Description + readonly: + type: optional + docs: >- + Indicates whether the component is read-only. Components that cannot + be updated within this Site are set to readonly. Workspace Libraries + are a good example. + source: + openapi: ../../../referenced-specs/v2.yml + ComponentList: + docs: List of Components on a site. + properties: + components: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + ComponentDom: + docs: > + The Component DOM schema represents the content structure of a component. + Similar to Page DOM, it captures various content nodes and their + associated attributes, but specifically for a component's structure. Each + node has a unique identifier and can contain text, images, or nested + component instances. + properties: + componentId: + type: optional + docs: Component ID + nodes: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml + ComponentProperties: + docs: > + The Component Properties schema represents a list of properties that store + text content. Each property has a unique identifier and can be of + different types like plain text or rich text. The schema also provides + pagination details for scenarios where there more properties than the + limit. + properties: + componentId: + type: optional + docs: Component ID + properties: optional> + pagination: optional + source: + openapi: ../../../referenced-specs/v2.yml ScriptApplyLocation: enum: - header @@ -1009,6 +1261,7 @@ types: Location of the script, either in the header or footer of the published site default: header + inline: true source: openapi: ../../../referenced-specs/v2.yml ScriptApply: @@ -1131,6 +1384,7 @@ types: - page - site docs: Whether the Custom Code script is applied at the Site-level or Page-level + inline: true source: openapi: ../../../referenced-specs/v2.yml CustomCodeBlock: @@ -1438,6 +1692,7 @@ types: - Phone - Number docs: The field type + inline: true source: openapi: ../../../referenced-specs/v2.yml FormFieldValue: @@ -1457,6 +1712,7 @@ types: docs: Whether the field is visible to the user source: openapi: ../../../referenced-specs/v2.yml + inline: true FormField: type: map docs: A collection of form fields with additional properties. @@ -1589,6 +1845,7 @@ types: - verified - unverified docs: The status of the user + inline: true source: openapi: ../../../referenced-specs/v2.yml UserAccessGroupsItemType: @@ -1599,6 +1856,7 @@ types: The type of access group based on how it was assigned to the user. * `admin` - Assigned to the user via API or in the designer * `ecommerce` - Assigned to the user via an ecommerce purchase + inline: true source: openapi: ../../../referenced-specs/v2.yml UserAccessGroupsItem: @@ -1811,6 +2069,7 @@ types: - value: service-training name: ServiceTraining docs: Product tax class + inline: true source: openapi: ../../../referenced-specs/v2.yml ProductFieldDataEcProductType: @@ -1824,6 +2083,7 @@ types: href="https://university.webflow.com/lesson/add-and-manage-products-and-categories?topics=ecommerce#how-to-understand-product-types">Product types. Enums reflect the following values in order: Physical, Digital, Service, Advanced" + inline: true source: openapi: ../../../referenced-specs/v2.yml ProductFieldData: @@ -1928,6 +2188,7 @@ types: - value: one-time name: OneTime - subscription + inline: true source: openapi: ../../../referenced-specs/v2.yml SkuFieldDataEcSkuSubscriptionPlanInterval: @@ -1937,6 +2198,7 @@ types: - month - year docs: Interval of subscription renewal + inline: true source: openapi: ../../../referenced-specs/v2.yml SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus: @@ -1945,6 +2207,7 @@ types: - inactive - canceled docs: The status of the plan + inline: true source: openapi: ../../../referenced-specs/v2.yml SkuFieldDataEcSkuSubscriptionPlanPlansItem: @@ -2072,6 +2335,7 @@ types: - shipping - billing docs: The type of the order address (billing or shipping) + inline: true source: openapi: ../../../referenced-specs/v2.yml OrderAddressJapanType: @@ -2081,6 +2345,7 @@ types: docs: >- Represents a Japan-only address format. This field will only appear on orders placed from Japan. + inline: true source: openapi: ../../../referenced-specs/v2.yml OrderAddress: @@ -2265,6 +2530,7 @@ types: name: DinersClub - Unknown docs: The card's brand (ie. credit card network) + inline: true source: openapi: ../../../referenced-specs/v2.yml StripeCardExpires: @@ -2331,6 +2597,7 @@ types: - refunded docs: | The status of the Order + inline: true source: openapi: ../../../referenced-specs/v2.yml OrderDisputeLastStatus: @@ -2346,6 +2613,7 @@ types: docs: > If an order was disputed by the customer, then this key will be set with the [dispute's status](https://stripe.com/docs/api#dispute_object-status). + inline: true source: openapi: ../../../referenced-specs/v2.yml OrderCustomerInfo: @@ -2376,6 +2644,7 @@ types: - shipping - tax docs: The type of extra item this is. + inline: true source: openapi: ../../../referenced-specs/v2.yml OrderTotalsExtrasItem: @@ -2569,6 +2838,7 @@ types: - infinite - finite docs: infinite or finite + inline: true source: openapi: ../../../referenced-specs/v2.yml InventoryItem: diff --git a/.mock/definition/collections/fields.yml b/.mock/definition/collections/fields.yml index 210ebcc6..6fc14dda 100644 --- a/.mock/definition/collections/fields.yml +++ b/.mock/definition/collections/fields.yml @@ -15,6 +15,7 @@ types: - Color - File docs: Choose these appropriate field type for your collection data + inline: true source: openapi: ../../../referenced-specs/v2.yml imports: diff --git a/.mock/definition/collections/items.yml b/.mock/definition/collections/items.yml index f4bf2439..53c64e33 100644 --- a/.mock/definition/collections/items.yml +++ b/.mock/definition/collections/items.yml @@ -225,7 +225,7 @@ service: To create items across multiple locales, please use [this - endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) + endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) Required scope | `CMS:write` @@ -605,7 +605,7 @@ service: To create items across multiple locales, [please use this - endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) + endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) diff --git a/.mock/definition/components.yml b/.mock/definition/components.yml new file mode 100644 index 00000000..d3e3fe42 --- /dev/null +++ b/.mock/definition/components.yml @@ -0,0 +1,476 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + list: + path: /sites/{site_id}/components + method: GET + auth: true + docs: | + List of all components for a site. + + Required scope | `components:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: List Components + request: + name: ComponentsListRequest + query-parameters: + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.ComponentList + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + components: + - id: 6596da6045e56dee495bcbba + name: Primary Button + group: Buttons + description: A default button component that can be used across the site + readonly: true + - id: 658205daa3e8206a523b5ad4 + name: Secondary Button + group: Buttons + description: >- + A secondary button component that can be used across the + site + readonly: true + - id: 6258612d1ee792848f805dcf + name: Card + group: Buttons + description: A button component that can be used across the site + readonly: true + - id: 68a2b1d1ee792848f805dcf + name: Nav + group: Buttons + description: A button component that can be used across the site + readonly: true + pagination: + limit: 20 + offset: 0 + total: 4 + get-content: + path: /sites/{site_id}/components/{component_id}/dom + method: GET + auth: true + docs: > + Get static content from a component definition. This includes text + nodes, image 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` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + component_id: + type: string + docs: Unique identifier for a Component + display-name: Get Component Content + request: + name: ComponentsGetContentRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.ComponentDom + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: ComponentDOM + path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + component_id: 8505ba55-ef72-629e-f85c-33e4b703d48b + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + componentId: 69118560-d0bc-15fc-bbf8-b8fe5f6535b5 + nodes: + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad623 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad627 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad629 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad631 + componentId: 6258612d1ee792848f805dcf + propertyOverrides: + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad633 + type: Plain Text + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad635 + type: Rich Text + pagination: + limit: 4 + offset: 0 + total: 4 + - name: LocalizedComponentDOM + path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + component_id: 8505ba55-ef72-629e-f85c-33e4b703d48b + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + componentId: 69118560-d0bc-15fc-bbf8-b8fe5f6535b5 + nodes: + - type: component-instance + id: 69118560-d0bc-15fc-bbf8-b8fe5f6535b8 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: 8ebfb409-7493-3bca-5d48-0e547befb960 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: 69118560-d0bc-15fc-bbf8-b8fe5f6535c2 + componentId: 69118560-d0bc-15fc-bbf8-b8fe5f6535b5 + propertyOverrides: + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad623 + pagination: + limit: 100 + offset: 0 + total: 3 + update-content: + path: /sites/{site_id}/components/{component_id}/dom + method: POST + auth: true + docs: > + 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` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + component_id: + type: string + docs: Unique identifier for a Component + display-name: Update Component Content + request: + name: ComponentDomWrite + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + body: + properties: + nodes: + docs: >- + List of DOM Nodes with the new content that will be updated in + each node. + type: list + content-type: application/json + response: + docs: Request was successful + type: ComponentsUpdateContentResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + component_id: 8505ba55-ef72-629e-f85c-33e4b703d48b + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + request: + 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-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 + response: + body: + errors: + - errors + get-properties: + path: /sites/{site_id}/components/{component_id}/properties + method: GET + auth: true + docs: > + Get the property default values of a component definition. + + + If you do not provide a Locale ID in your request, the response + will return any properties that can be localized from the Primary + locale. + + + Required scope | `components:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + component_id: + type: string + docs: Unique identifier for a Component + display-name: Get Component Properties + request: + name: ComponentsGetPropertiesRequest + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + limit: + type: optional + docs: 'Maximum number of records to be returned (max limit: 100)' + offset: + type: optional + docs: >- + Offset used for pagination if the results have more than limit + records + response: + docs: Request was successful + type: root.ComponentProperties + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + component_id: 8505ba55-ef72-629e-f85c-33e4b703d48b + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + response: + body: + componentId: 658205daa3e8206a523b5ad4 + properties: + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad623 + type: Plain Text + label: Title + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad627 + type: Rich Text + label: Content + pagination: + limit: 2 + offset: 0 + total: 2 + update-properties: + path: /sites/{site_id}/components/{component_id}/properties + method: POST + auth: true + docs: > + Update the property default values of a component definition in a + specificed locale. + + + Before making updates: + + 1. Use the [get component + properties](/data/reference/pages-and-components/components/get-properties) + endpoint to identify available properties + + + The request requires a secondary locale ID. If a locale is + missing, the request will not be processed and will result in an + error. + + + Required scope | `components:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + component_id: + type: string + docs: Unique identifier for a Component + display-name: Update Component Properties + request: + name: ComponentPropertiesWrite + query-parameters: + localeId: + type: optional + docs: >- + Unique identifier for a specific locale. Applicable, when using + localization. + body: + properties: + properties: + docs: >- + A list of component properties to update within the specified + secondary locale. + type: list + content-type: application/json + response: + docs: Request was successful + type: ComponentsUpdatePropertiesResponse + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + component_id: 8505ba55-ef72-629e-f85c-33e4b703d48b + query-parameters: + localeId: 65427cf400e02b306eaa04a0 + request: + properties: + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad623 + text: The Hitchhiker’s Guide to the Galaxy + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad627 + text: >- +

Dont Panic!

Always know where your towel + is.

+ response: + body: + errors: + - errors + source: + openapi: ../../../referenced-specs/v2.yml +types: + ComponentDomWriteNodesItem: + discriminated: false + union: + - root.TextNodeWrite + - root.ComponentInstanceNodePropertyOverridesWrite + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ComponentsUpdateContentResponse: + properties: + errors: + docs: A list of error messages, if any. + type: list + source: + openapi: ../../../referenced-specs/v2.yml + ComponentPropertiesWritePropertiesItem: + properties: + propertyId: + type: string + docs: The ID of the property. + text: + type: string + docs: > + The new string or HTML value used to update the component property in + the secondary locale. + + + The provided value must be compatible with the type of the component + property. + + + For example, attempting to update a single-line plain-text property + with a multi-line + + value will result in an error. + source: + openapi: ../../../referenced-specs/v2.yml + inline: true + ComponentsUpdatePropertiesResponse: + properties: + errors: + docs: A list of error messages, if any. + type: list + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/inventory.yml b/.mock/definition/inventory.yml index 14bd5c07..7dbf22a7 100644 --- a/.mock/definition/inventory.yml +++ b/.mock/definition/inventory.yml @@ -116,5 +116,6 @@ types: - infinite - finite docs: infinite or finite + inline: true source: openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml index 75be2224..3b33c18e 100644 --- a/.mock/definition/orders.yml +++ b/.mock/definition/orders.yml @@ -16,6 +16,7 @@ types: - fraudulent - requested docs: The reason for the refund + inline: true source: openapi: ../../../referenced-specs/v2.yml imports: diff --git a/.mock/definition/pages.yml b/.mock/definition/pages.yml index b3fdcd1b..67b2f6a7 100644 --- a/.mock/definition/pages.yml +++ b/.mock/definition/pages.yml @@ -276,11 +276,18 @@ service: method: GET auth: true docs: > - Get static content from a static page. + Get static content from a static page. This includes text nodes, image + nodes and component instances. + To retrieve the contents of components in the page use the [get + component + content](/data/reference/pages-and-components/components/get-content) + 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. + + 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 | `pages:read` @@ -318,7 +325,8 @@ service: - root.TooManyRequestsError - root.InternalServerError examples: - - path-parameters: + - name: PageDOM + path-parameters: page_id: 63c720f9347c2139b248e552 query-parameters: localeId: 65427cf400e02b306eaa04a0 @@ -326,44 +334,57 @@ service: body: pageId: 658205daa3e8206a523b5ad4 nodes: - - id: a245c12d-995b-55ee-5ec7-aa36a6cad623 - type: text - text: - html:

The Hitchhiker's Guide to the Galaxy

- text: The Hitchhiker's Guide to the Galaxy - attributes: - key: value - - id: a245c12d-995b-55ee-5ec7-aa36a6cad627 - type: text - text: - html: >- -

Don't Panic!

Always know where your towel - is.

- attributes: - key: value - - id: a245c12d-995b-55ee-5ec7-aa36a6cad629 - type: image - image: - alt: Marvin, the Paranoid Android - assetId: 659595234426a9fcbad57043 - attributes: - key: value + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad623 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad627 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad629 + componentId: nodes + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + - type: component-instance + id: a245c12d-995b-55ee-5ec7-aa36a6cad631 + componentId: 6258612d1ee792848f805dcf + propertyOverrides: + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad633 + type: Plain Text + - propertyId: a245c12d-995b-55ee-5ec7-aa36a6cad635 + type: Rich Text pagination: - limit: 3 + limit: 4 offset: 0 - total: 3 + total: 4 update-static-content: path: /pages/{page_id}/dom method: POST auth: true docs: > - This endpoint allows for updating static content on a static page within - a secondary locale. It is designed specifically for localized pages and - can handle up to 1000 nodes per request. + 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: -

Note:This - endpoint is specifically for localized pages. Ensure that the locale - specified is a valid secondary locale for the site.

+ 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` @@ -375,16 +396,18 @@ service: docs: Unique identifier for a Page display-name: Update Page Content request: - name: DomWrite + name: PageDomWrite query-parameters: localeId: - type: optional - docs: >- - Unique identifier for a specific locale. Applicable, when using - localization. + type: string + docs: The locale identifier. body: properties: - nodes: list + nodes: + docs: >- + List of DOM Nodes with the new content that will be updated in + each node. + type: list content-type: application/json response: docs: Request was successful @@ -400,19 +423,21 @@ service: - path-parameters: page_id: 63c720f9347c2139b248e552 query-parameters: - localeId: 65427cf400e02b306eaa04a0 + localeId: localeId request: nodes: - nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad623 - text:

The Hitchhiker’s Guide to the Galaxy

+ text:

The Hitchhiker's Guide to the Galaxy

- nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad627 text: >- -

Don’t Panic!

Always know where your towel +

Don't Panic!

Always know where your towel is.

- nodeId: a245c12d-995b-55ee-5ec7-aa36a6cad629 - text: >- - Marvin, the Paranoid Android + propertyOverrides: + - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f0 + text:

Time is an illusion

+ - propertyId: 7dd14c08-2e96-8d3d-2b19-b5c03642a0f1 + text: Life, the Universe and Everything response: body: errors: @@ -421,16 +446,11 @@ service: openapi: ../../../referenced-specs/v2.yml display-name: Pages types: - DomWriteNodesItem: - properties: - nodeId: - type: string - docs: Node UUID - text: - type: string - docs: >- - HTML content of the node, including the HTML tag. The HTML tags must - be the same as what's returned from the Get Content endpoint. + PageDomWriteNodesItem: + discriminated: false + union: + - root.TextNodeWrite + - root.ComponentInstanceNodePropertyOverridesWrite source: openapi: ../../../referenced-specs/v2.yml inline: true diff --git a/.mock/definition/redirects.yml b/.mock/definition/redirects.yml new file mode 100644 index 00000000..db553d83 --- /dev/null +++ b/.mock/definition/redirects.yml @@ -0,0 +1,190 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /sites/{site_id}/redirects + method: GET + auth: true + docs: > + Fetch a list of all URL redirect rules configured for a specific site. + + + Use this endpoint to review, audit, or manage the redirection rules that + control how traffic is rerouted on your site. + + + + Required scope: `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get URL redirects + response: + docs: Request was successful + type: root.Redirects + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + redirects: + - id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + - id: 6x9e7f8d9a4b1c2d3e4f5678 + fromUrl: /babel-fish + toUrl: /translate + pagination: + limit: 100 + offset: 0 + total: 2 + create: + path: /sites/{site_id}/redirects + method: POST + auth: true + docs: > + Add a new URL redirection rule to a site. + + + This endpoint allows you to define a source path (`fromUrl`) and its + corresponding destination path (`toUrl`), which will dictate how traffic + is rerouted on your site. This is useful for managing site changes, + restructuring URLs, or handling outdated links. + + + Required scope: `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Create a URL redirect + request: + body: root.Redirect + content-type: application/json + response: + docs: Request was successful + type: root.Redirect + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: + id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + response: + body: + id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + delete: + path: /sites/{site_id}/redirects/{redirect_id} + method: DELETE + auth: true + docs: > + Remove a URL redirection rule from a site. + + This is useful for cleaning up outdated or unnecessary redirects, + ensuring that your site's routing behavior remains efficient and + up-to-date. + + Required scope: `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + redirect_id: + type: string + docs: Unique identifier site rediect + display-name: Delete URL redirects + response: + docs: Request was successful + type: root.Redirects + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + redirect_id: 66c4cb9a20cac35ed19500e6 + response: + body: + redirects: + - id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + - id: 6x9e7f8d9a4b1c2d3e4f5678 + fromUrl: /babel-fish + toUrl: /translate + pagination: + limit: 100 + offset: 0 + total: 2 + patch: + path: /sites/{site_id}/redirects/{redirect_id} + method: PATCH + auth: true + docs: | + Update a URL redirection rule from a site. + Required scope: `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + redirect_id: + type: string + docs: Unique identifier site rediect + display-name: Update URL redirect + request: + body: root.Redirect + content-type: application/json + response: + docs: Request was successful + type: root.Redirect + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + redirect_id: 66c4cb9a20cac35ed19500e6 + request: + id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + response: + body: + id: 42e1a2b7aa1a13f768a0042a + fromUrl: /mostly-harmless + toUrl: /earth + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/sitePlan.yml b/.mock/definition/sitePlan.yml new file mode 100644 index 00000000..a8489daa --- /dev/null +++ b/.mock/definition/sitePlan.yml @@ -0,0 +1,40 @@ +imports: + root: __package__.yml +service: + auth: false + base-path: '' + endpoints: + get: + path: /sites/{site_id}/plan + method: GET + auth: true + docs: | + Get site plan details for the specified Site. + + Required scope | `sites:read` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Get Site Plan + response: + docs: Request was successful + type: root.SitePlan + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + response: + body: + id: hosting-business-v4 + name: Business Hosting + pricingInfo: https://webflow.com/pricing + source: + openapi: ../../../referenced-specs/v2.yml diff --git a/.mock/definition/sites.yml b/.mock/definition/sites.yml index 31a7f313..fa00d338 100644 --- a/.mock/definition/sites.yml +++ b/.mock/definition/sites.yml @@ -4,6 +4,87 @@ service: auth: false base-path: '' endpoints: + create: + path: /workspaces/{workspace_id}/sites + method: POST + auth: true + docs: | + Create a site. This endpoint requires an Enterprise workspace. + + Required scope | `workspace:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + workspace_id: + type: string + docs: Unique identifier for a Workspace + display-name: Create Site + request: + name: SitesCreateRequest + body: + properties: + name: + type: string + docs: The name of the site + templateName: + type: optional + docs: The workspace or marketplace template to use + parentFolderId: + type: optional + docs: MegaDodo Publications - Potential Book Ideas + content-type: application/json + response: + docs: Request was successful + type: root.Site + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - name: NewlyCreatedSite + path-parameters: + workspace_id: 580e63e98c9a982ac9b8b741 + request: + name: The Hitchhiker's Guide to the Galaxy + response: + body: + id: 670ecf86817e3cc7a510eb6a + workspaceId: 625860a7a6c16d624927122f + createdOn: '2024-10-15T20:24:38Z' + displayName: The Hitchiker‘s Guide + shortName: hitchikers-guide + lastPublished: '2016-10-24T19:43:17Z' + lastUpdated: '2024-10-15T20:24:38Z' + previewUrl: >- + https://d1otoma47x30pg.cloudfront.net/580e63e98c9a982ac9b8b741/201610241243.png + timeZone: America/Los_Angeles + parentFolderId: 670ece123598db72d9648be1 + customDomains: + - id: 589a331aa51e760df7ccb89d + url: test-api-domain.com + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + displayImageId: displayImageId + redirect: true + subdirectory: '' + tag: en-US + secondary: + - id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + redirect: true + subdirectory: '' + tag: en-US + dataCollectionEnabled: false + dataCollectionType: always list: path: /sites method: GET @@ -197,6 +278,109 @@ service: tag: en-US dataCollectionEnabled: true dataCollectionType: always + delete: + path: /sites/{site_id} + method: DELETE + auth: true + docs: | + Delete a site. This endpoint requires an Enterprise workspace. + + Required scope | `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Delete Site + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + update: + path: /sites/{site_id} + method: PATCH + auth: true + docs: | + Update a site. This endpoint requires an Enterprise workspace. + + Required scope | `sites:write` + source: + openapi: ../../../referenced-specs/v2.yml + path-parameters: + site_id: + type: string + docs: Unique identifier for a Site + display-name: Update Site + request: + name: SitesUpdateRequest + body: + properties: + name: + type: optional + docs: The name of the site + parentFolderId: + type: optional + docs: The parent folder ID of the site + content-type: application/json + response: + docs: Request was successful + type: root.Site + errors: + - root.BadRequestError + - root.UnauthorizedError + - root.ForbiddenError + - root.NotFoundError + - root.TooManyRequestsError + - root.InternalServerError + examples: + - path-parameters: + site_id: 580e63e98c9a982ac9b8b741 + request: {} + response: + body: + id: 42e98c9a982ac9b8b742 + workspaceId: 42e63e98c9a982ac9b8b742 + createdOn: '1979-10-12T12:00:00Z' + displayName: The Hitchhiker's Guide to the Galaxy + shortName: hitchhikers-guide + lastPublished: '2023-04-02T12:42:00Z' + lastUpdated: '2023-04-02T12:42:00Z' + previewUrl: >- + https://screenshots.webflow.com/sites/6258612d1ee792848f805dcf/20231219211811_d5990556c743f33b7071300a03bf67e6.png + timeZone: Magrathea/FactoryFloor + parentFolderId: 1as2d3f4g5h6j7k8l9z0x1c2v3b4n5m6 + customDomains: + - id: 589a331aa51e760df7ccb89d + url: hitchhikersguide.galaxy + - id: 589a331aa51e760df7ccb89e + url: heartofgold.spaceship + locales: + primary: + id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + displayImageId: displayImageId + redirect: true + subdirectory: '' + tag: en-US + secondary: + - id: 653fd9af6a07fc9cfd7a5e57 + cmsLocaleId: 653ad57de882f528b32e810e + enabled: false + displayName: English (United States) + redirect: true + subdirectory: '' + tag: en-US + dataCollectionEnabled: true + dataCollectionType: always get-custom-domain: path: /sites/{site_id}/custom_domains method: GET diff --git a/.mock/fern.config.json b/.mock/fern.config.json index 757dd2f7..2c648f8d 100644 --- a/.mock/fern.config.json +++ b/.mock/fern.config.json @@ -1,4 +1,4 @@ { "organization" : "webflow", - "version" : "0.45.3" + "version" : "0.46.4" } \ No newline at end of file diff --git a/reference.md b/reference.md index bf9f6049..3678d0a0 100644 --- a/reference.md +++ b/reference.md @@ -117,6 +117,81 @@ await client.token.introspect(); ## Sites +
client.sites.create(workspaceId, { ...params }) -> Webflow.Site +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Create a site. This endpoint requires an Enterprise workspace. + +Required scope | `workspace:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.sites.create("580e63e98c9a982ac9b8b741", { + name: "The Hitchhiker's Guide to the Galaxy", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**workspaceId:** `string` — Unique identifier for a Workspace + +
+
+ +
+
+ +**request:** `Webflow.SitesCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Sites.RequestOptions` + +
+
+
+
+ +
+
+
+
client.sites.list() -> Webflow.Sites
@@ -239,7 +314,7 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-
client.sites.getCustomDomain(siteId) -> Webflow.Domains +
client.sites.delete(siteId) -> void
@@ -251,9 +326,9 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-Get a list of all custom domains related to site. +Delete a site. This endpoint requires an Enterprise workspace. -Required scope | `sites:read` +Required scope | `sites:write`
@@ -269,7 +344,7 @@ Required scope | `sites:read`
```typescript -await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741"); +await client.sites.delete("580e63e98c9a982ac9b8b741"); ```
@@ -304,7 +379,7 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-
client.sites.publish(siteId, { ...params }) -> Webflow.SitesPublishResponse +
client.sites.update(siteId, { ...params }) -> Webflow.Site
@@ -316,9 +391,7 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-Publishes a site to one or more more domains. - -This endpoint has a limit of one successful publish queue per minute. +Update a site. This endpoint requires an Enterprise workspace. Required scope | `sites:write` @@ -336,7 +409,7 @@ Required scope | `sites:write`
```typescript -await client.sites.publish("580e63e98c9a982ac9b8b741"); +await client.sites.update("580e63e98c9a982ac9b8b741"); ```
@@ -360,7 +433,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741");
-**request:** `Webflow.SitesPublishRequest` +**request:** `Webflow.SitesUpdateRequest`
@@ -379,9 +452,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741");
-## Collections - -
client.collections.list(siteId) -> Webflow.CollectionList +
client.sites.getCustomDomain(siteId) -> Webflow.Domains
@@ -393,9 +464,9 @@ await client.sites.publish("580e63e98c9a982ac9b8b741");
-List of all Collections within a Site. +Get a list of all custom domains related to site. -Required scope | `cms:read` +Required scope | `sites:read`
@@ -411,7 +482,7 @@ Required scope | `cms:read`
```typescript -await client.collections.list("580e63e98c9a982ac9b8b741"); +await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741"); ```
@@ -435,7 +506,7 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-**requestOptions:** `Collections.RequestOptions` +**requestOptions:** `Sites.RequestOptions`
@@ -446,7 +517,7 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-
client.collections.create(siteId, { ...params }) -> Webflow.Collection +
client.sites.publish(siteId, { ...params }) -> Webflow.SitesPublishResponse
@@ -458,9 +529,11 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-Create a Collection for a site. +Publishes a site to one or more more domains. -Required scope | `cms:write` +This endpoint has a limit of one successful publish queue per minute. + +Required scope | `sites:write`
@@ -476,11 +549,7 @@ Required scope | `cms:write`
```typescript -await client.collections.create("580e63e98c9a982ac9b8b741", { - displayName: "Blog Posts", - singularName: "Blog Post", - slug: "posts", -}); +await client.sites.publish("580e63e98c9a982ac9b8b741"); ```
@@ -504,7 +573,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-**request:** `Webflow.CollectionsCreateRequest` +**request:** `Webflow.SitesPublishRequest`
@@ -512,7 +581,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-**requestOptions:** `Collections.RequestOptions` +**requestOptions:** `Sites.RequestOptions`
@@ -523,7 +592,9 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-
client.collections.get(collectionId) -> Webflow.Collection +## Redirects + +
client.redirects.get(siteId) -> Webflow.Redirects
@@ -535,9 +606,11 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-Get the full details of a collection from its ID. +Fetch a list of all URL redirect rules configured for a specific site. -Required scope | `cms:read` +Use this endpoint to review, audit, or manage the redirection rules that control how traffic is rerouted on your site. + +Required scope: `sites:read`
@@ -553,7 +626,7 @@ Required scope | `cms:read`
```typescript -await client.collections.get("580e63fc8c9a982ac9b8b745"); +await client.redirects.get("580e63e98c9a982ac9b8b741"); ```
@@ -569,7 +642,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-**collectionId:** `string` — Unique identifier for a Collection +**siteId:** `string` — Unique identifier for a Site
@@ -577,7 +650,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-**requestOptions:** `Collections.RequestOptions` +**requestOptions:** `Redirects.RequestOptions`
@@ -588,7 +661,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-
client.collections.delete(collectionId) -> void +
client.redirects.create(siteId, { ...params }) -> Webflow.Redirect
@@ -600,9 +673,11 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-Delete a collection using its ID. +Add a new URL redirection rule to a site. -Required scope | `cms:write` +This endpoint allows you to define a source path (`fromUrl`) and its corresponding destination path (`toUrl`), which will dictate how traffic is rerouted on your site. This is useful for managing site changes, restructuring URLs, or handling outdated links. + +Required scope: `sites:write`
@@ -618,7 +693,11 @@ Required scope | `cms:write`
```typescript -await client.collections.delete("580e63fc8c9a982ac9b8b745"); +await client.redirects.create("580e63e98c9a982ac9b8b741", { + id: "42e1a2b7aa1a13f768a0042a", + fromUrl: "/mostly-harmless", + toUrl: "/earth", +}); ```
@@ -634,7 +713,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-**collectionId:** `string` — Unique identifier for a Collection +**siteId:** `string` — Unique identifier for a Site
@@ -642,7 +721,15 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-**requestOptions:** `Collections.RequestOptions` +**request:** `Webflow.Redirect` + +
+
+ +
+
+ +**requestOptions:** `Redirects.RequestOptions`
@@ -653,9 +740,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-## Pages - -
client.pages.list(siteId, { ...params }) -> Webflow.PageList +
client.redirects.delete(siteId, redirectId) -> Webflow.Redirects
@@ -667,9 +752,9 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-List of all pages for a site. - -Required scope | `pages:read` +Remove a URL redirection rule from a site. +This is useful for cleaning up outdated or unnecessary redirects, ensuring that your site's routing behavior remains efficient and up-to-date. +Required scope: `sites:write`
@@ -685,9 +770,7 @@ Required scope | `pages:read`
```typescript -await client.pages.list("580e63e98c9a982ac9b8b741", { - localeId: "65427cf400e02b306eaa04a0", -}); +await client.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6"); ```
@@ -711,7 +794,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-**request:** `Webflow.PagesListRequest` +**redirectId:** `string` — Unique identifier site rediect
@@ -719,7 +802,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-**requestOptions:** `Pages.RequestOptions` +**requestOptions:** `Redirects.RequestOptions`
@@ -730,7 +813,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-
client.pages.getMetadata(pageId, { ...params }) -> Webflow.Page +
client.redirects.patch(siteId, redirectId, { ...params }) -> Webflow.Redirect
@@ -742,9 +825,8 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-Get metadata information for a single page. - -Required scope | `pages:read` +Update a URL redirection rule from a site. +Required scope: `sites:write`
@@ -760,8 +842,10 @@ Required scope | `pages:read`
```typescript -await client.pages.getMetadata("63c720f9347c2139b248e552", { - localeId: "65427cf400e02b306eaa04a0", +await client.redirects.patch("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6", { + id: "42e1a2b7aa1a13f768a0042a", + fromUrl: "/mostly-harmless", + toUrl: "/earth", }); ``` @@ -778,7 +862,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-**pageId:** `string` — Unique identifier for a Page +**siteId:** `string` — Unique identifier for a Site
@@ -786,7 +870,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-**request:** `Webflow.PagesGetMetadataRequest` +**redirectId:** `string` — Unique identifier site rediect
@@ -794,7 +878,15 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-**requestOptions:** `Pages.RequestOptions` +**request:** `Webflow.Redirect` + +
+
+ +
+
+ +**requestOptions:** `Redirects.RequestOptions`
@@ -805,7 +897,9 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-
client.pages.updatePageSettings(pageId, { ...params }) -> Webflow.Page +## SitePlan + +
client.sitePlan.get(siteId) -> Webflow.SitePlan
@@ -817,9 +911,9 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-Update Page-level metadata, including SEO and Open Graph fields. +Get site plan details for the specified Site. -Required scope | `pages:write` +Required scope | `sites:read`
@@ -835,34 +929,7 @@ Required scope | `pages:write`
```typescript -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", - }, -}); +await client.sitePlan.get("580e63e98c9a982ac9b8b741"); ```
@@ -878,15 +945,7 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-**pageId:** `string` — Unique identifier for a Page - -
-
- -
-
- -**request:** `Webflow.UpdatePageSettingsRequest` +**siteId:** `string` — Unique identifier for a Site
@@ -894,7 +953,7 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-**requestOptions:** `Pages.RequestOptions` +**requestOptions:** `SitePlan.RequestOptions`
@@ -905,7 +964,9 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-
client.pages.getContent(pageId, { ...params }) -> Webflow.Dom +## Collections + +
client.collections.list(siteId) -> Webflow.CollectionList
@@ -917,11 +978,9 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-Get static content from a static page. - -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. +List of all Collections within a Site. -Required scope | `pages:read` +Required scope | `cms:read`
@@ -937,9 +996,7 @@ Required scope | `pages:read`
```typescript -await client.pages.getContent("63c720f9347c2139b248e552", { - localeId: "65427cf400e02b306eaa04a0", -}); +await client.collections.list("580e63e98c9a982ac9b8b741"); ```
@@ -955,15 +1012,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-**pageId:** `string` — Unique identifier for a Page - -
-
- -
-
- -**request:** `Webflow.PagesGetContentRequest` +**siteId:** `string` — Unique identifier for a Site
@@ -971,7 +1020,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-**requestOptions:** `Pages.RequestOptions` +**requestOptions:** `Collections.RequestOptions`
@@ -982,7 +1031,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-
client.pages.updateStaticContent(pageId, { ...params }) -> Webflow.UpdateStaticContentResponse +
client.collections.create(siteId, { ...params }) -> Webflow.Collection
@@ -994,11 +1043,9 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-This endpoint allows for updating static content on a static page within a secondary locale. It is designed specifically for localized pages and can handle up to 1000 nodes per request. - -

Note:This endpoint is specifically for localized pages. Ensure that the locale specified is a valid secondary locale for the site.

+Create a Collection for a site. -Required scope | `pages:write` +Required scope | `cms:write`
@@ -1014,22 +1061,10 @@ Required scope | `pages:write`
```typescript -await client.pages.updateStaticContent("63c720f9347c2139b248e552", { - localeId: "65427cf400e02b306eaa04a0", - nodes: [ - { - nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker\u2019s Guide to the Galaxy

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

Don\u2019t Panic!

Always know where your towel is.

", - }, - { - nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - text: 'Marvin, the Paranoid Android', - }, - ], +await client.collections.create("580e63e98c9a982ac9b8b741", { + displayName: "Blog Posts", + singularName: "Blog Post", + slug: "posts", }); ``` @@ -1046,7 +1081,7 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
-**pageId:** `string` — Unique identifier for a Page +**siteId:** `string` — Unique identifier for a Site
@@ -1054,7 +1089,214 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
-**request:** `Webflow.DomWrite` +**request:** `Webflow.CollectionsCreateRequest` + +
+
+ +
+
+ +**requestOptions:** `Collections.RequestOptions` + +
+
+
+
+ + + +
+ +
client.collections.get(collectionId) -> Webflow.Collection +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the full details of a collection from its ID. + +Required scope | `cms:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.get("580e63fc8c9a982ac9b8b745"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**requestOptions:** `Collections.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.collections.delete(collectionId) -> void +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Delete a collection using its ID. + +Required scope | `cms:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.collections.delete("580e63fc8c9a982ac9b8b745"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**collectionId:** `string` — Unique identifier for a Collection + +
+
+ +
+
+ +**requestOptions:** `Collections.RequestOptions` + +
+
+
+
+ +
+
+
+ +## Pages + +
client.pages.list(siteId, { ...params }) -> Webflow.PageList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List of all pages for a site. + +Required scope | `pages:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.pages.list("580e63e98c9a982ac9b8b741", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `Webflow.PagesListRequest`
@@ -1073,6 +1315,826 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
+
client.pages.getMetadata(pageId, { ...params }) -> Webflow.Page +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get metadata information for a single page. + +Required scope | `pages:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.pages.getMetadata("63c720f9347c2139b248e552", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**pageId:** `string` — Unique identifier for a Page + +
+
+ +
+
+ +**request:** `Webflow.PagesGetMetadataRequest` + +
+
+ +
+
+ +**requestOptions:** `Pages.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.pages.updatePageSettings(pageId, { ...params }) -> Webflow.Page +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update Page-level metadata, including SEO and Open Graph fields. + +Required scope | `pages:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +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", + }, +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**pageId:** `string` — Unique identifier for a Page + +
+
+ +
+
+ +**request:** `Webflow.UpdatePageSettingsRequest` + +
+
+ +
+
+ +**requestOptions:** `Pages.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.pages.getContent(pageId, { ...params }) -> Webflow.Dom +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get static content from a static page. This includes text nodes, image nodes and component instances. +To retrieve the contents of components in the page use the [get component content](/data/reference/pages-and-components/components/get-content) 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 | `pages:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.pages.getContent("63c720f9347c2139b248e552", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**pageId:** `string` — Unique identifier for a Page + +
+
+ +
+
+ +**request:** `Webflow.PagesGetContentRequest` + +
+
+ +
+
+ +**requestOptions:** `Pages.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.pages.updateStaticContent(pageId, { ...params }) -> Webflow.UpdateStaticContentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +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-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", + }, + ], + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**pageId:** `string` — Unique identifier for a Page + +
+
+ +
+
+ +**request:** `Webflow.PageDomWrite` + +
+
+ +
+
+ +**requestOptions:** `Pages.RequestOptions` + +
+
+
+
+ +
+
+
+ +## Components + +
client.components.list(siteId, { ...params }) -> Webflow.ComponentList +
+
+ +#### 📝 Description + +
+
+ +
+
+ +List of all components for a site. + +Required scope | `components:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.components.list("580e63e98c9a982ac9b8b741"); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**request:** `Webflow.ComponentsListRequest` + +
+
+ +
+
+ +**requestOptions:** `Components.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.components.getContent(siteId, componentId, { ...params }) -> Webflow.ComponentDom +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get static content from a component definition. This includes text nodes, image 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` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**componentId:** `string` — Unique identifier for a Component + +
+
+ +
+
+ +**request:** `Webflow.ComponentsGetContentRequest` + +
+
+ +
+
+ +**requestOptions:** `Components.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.components.updateContent(siteId, componentId, { ...params }) -> Webflow.ComponentsUpdateContentResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +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` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +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-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", + }, + ], + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**componentId:** `string` — Unique identifier for a Component + +
+
+ +
+
+ +**request:** `Webflow.ComponentDomWrite` + +
+
+ +
+
+ +**requestOptions:** `Components.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.components.getProperties(siteId, componentId, { ...params }) -> Webflow.ComponentProperties +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Get the property default values of a component definition. + +If you do not provide a Locale ID in your request, the response will return any properties that can be localized from the Primary locale. + +Required scope | `components:read` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { + localeId: "65427cf400e02b306eaa04a0", +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**componentId:** `string` — Unique identifier for a Component + +
+
+ +
+
+ +**request:** `Webflow.ComponentsGetPropertiesRequest` + +
+
+ +
+
+ +**requestOptions:** `Components.RequestOptions` + +
+
+
+
+ +
+
+
+ +
client.components.updateProperties(siteId, componentId, { ...params }) -> Webflow.ComponentsUpdatePropertiesResponse +
+
+ +#### 📝 Description + +
+
+ +
+
+ +Update the property default values of a component definition in a specificed locale. + +Before making updates: + +1. Use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify available properties + +The request requires a secondary locale ID. If a locale is missing, the request will not be processed and will result in an error. + +Required scope | `components:write` + +
+
+
+
+ +#### 🔌 Usage + +
+
+ +
+
+ +```typescript +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.

", + }, + ], +}); +``` + +
+
+
+
+ +#### ⚙️ Parameters + +
+
+ +
+
+ +**siteId:** `string` — Unique identifier for a Site + +
+
+ +
+
+ +**componentId:** `string` — Unique identifier for a Component + +
+
+ +
+
+ +**request:** `Webflow.ComponentPropertiesWrite` + +
+
+ +
+
+ +**requestOptions:** `Components.RequestOptions` + +
+
+
+
+ +
+
+
+ ## Scripts
client.scripts.list(siteId) -> Webflow.RegisteredScriptList @@ -4496,7 +5558,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745"); Create Item(s) in a Collection. -To create items across multiple locales, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) +To create items across multiple locales, please use [this endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) Required scope | `CMS:write` @@ -4836,7 +5898,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745"); Create live Item(s) in a Collection. The Item(s) will be published to the live site. -To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) +To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) Required scope | `CMS:write` diff --git a/src/Client.ts b/src/Client.ts index e4cb5550..8f6e8f90 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -6,8 +6,11 @@ import * as environments from "./environments"; import * as core from "./core"; import { Token } from "./api/resources/token/client/Client"; import { Sites } from "./api/resources/sites/client/Client"; +import { Redirects } from "./api/resources/redirects/client/Client"; +import { SitePlan } from "./api/resources/sitePlan/client/Client"; import { Collections } from "./api/resources/collections/client/Client"; import { Pages } from "./api/resources/pages/client/Client"; +import { Components } from "./api/resources/components/client/Client"; import { Scripts } from "./api/resources/scripts/client/Client"; import { Assets } from "./api/resources/assets/client/Client"; import { Webhooks } from "./api/resources/webhooks/client/Client"; @@ -52,6 +55,18 @@ export class WebflowClient { return (this._sites ??= new Sites(this._options)); } + protected _redirects: Redirects | undefined; + + public get redirects(): Redirects { + return (this._redirects ??= new Redirects(this._options)); + } + + protected _sitePlan: SitePlan | undefined; + + public get sitePlan(): SitePlan { + return (this._sitePlan ??= new SitePlan(this._options)); + } + protected _collections: Collections | undefined; public get collections(): Collections { @@ -64,6 +79,12 @@ export class WebflowClient { return (this._pages ??= new Pages(this._options)); } + protected _components: Components | undefined; + + public get components(): Components { + return (this._components ??= new Components(this._options)); + } + protected _scripts: Scripts | undefined; public get scripts(): Scripts { diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index 12de3c09..764085c5 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,7 +1,7 @@ export * from "./UnauthorizedError"; export * from "./ForbiddenError"; +export * from "./BadRequestError"; export * from "./NotFoundError"; export * from "./TooManyRequestsError"; -export * from "./BadRequestError"; export * from "./InternalServerError"; export * from "./ConflictError"; diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts index 54cc69d7..40d7ae0b 100644 --- a/src/api/resources/assets/client/Client.ts +++ b/src/api/resources/assets/client/Client.ts @@ -150,10 +150,12 @@ export class Assets { /** * Create a new asset entry. * + * * This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. * You can use these two properties to [upload the file to Amazon s3 by making a POST](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) * request to the `uploadUrl` with the `uploadDetails` object as your header information in the request. * + * * Required scope | `assets:write` * * @param {string} siteId - Unique identifier for a Site diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index dcbe7333..cfdd07f8 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -188,7 +188,8 @@ export class Items { /** * Create Item(s) in a Collection. * - * To create items across multiple locales, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/bulk-items/create-items) + * + * To create items across multiple locales, please use [this endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) * * Required scope | `CMS:write` * @@ -810,7 +811,9 @@ export class Items { /** * Create live Item(s) in a Collection. The Item(s) will be published to the live site. * - * To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/bulk-items/create-items) + * + * To create items across multiple locales, [please use this endpoint.](/v2.0.0/data/reference/cms/collection-items/staged-items/create-items) + * * * Required scope | `CMS:write` * @@ -1275,9 +1278,8 @@ export class Items { * Create an item or multiple items in a CMS Collection across multiple corresponding locales. * * **Notes:** - * - * - This endpoint can create up to 100 items in a request. - * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale. + * - This endpoint can create up to 100 items in a request. + * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale. * * Required scope | `CMS:write` * diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts new file mode 100644 index 00000000..97e0916f --- /dev/null +++ b/src/api/resources/components/client/Client.ts @@ -0,0 +1,779 @@ +/** + * 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 urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/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 class Components { + constructor(protected readonly _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") + */ + public async list( + siteId: string, + request: Webflow.ComponentsListRequest = {}, + requestOptions?: Components.RequestOptions + ): Promise { + const { limit, offset } = request; + const _queryParams: Record = {}; + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/components` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ComponentList.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/components."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Get static content from a component definition. This includes text nodes, image 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" + * }) + */ + public async getContent( + siteId: string, + componentId: string, + request: Webflow.ComponentsGetContentRequest = {}, + requestOptions?: Components.RequestOptions + ): Promise { + const { localeId, limit, offset } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ComponentDom.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/components/{component_id}/dom." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * 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-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" + * }] + * }] + * }) + */ + public async updateContent( + siteId: string, + componentId: string, + request: Webflow.ComponentDomWrite, + requestOptions?: Components.RequestOptions + ): Promise { + const { localeId, ..._body } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom` + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + body: serializers.ComponentDomWrite.jsonOrThrow(_body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ComponentsUpdateContentResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/components/{component_id}/dom." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Get the property default values of a component definition. + * + * If you do not provide a Locale ID 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" + * }) + */ + public async getProperties( + siteId: string, + componentId: string, + request: Webflow.ComponentsGetPropertiesRequest = {}, + requestOptions?: Components.RequestOptions + ): Promise { + const { localeId, limit, offset } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + if (limit != null) { + _queryParams["limit"] = limit.toString(); + } + + if (offset != null) { + _queryParams["offset"] = offset.toString(); + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ComponentProperties.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling GET /sites/{site_id}/components/{component_id}/properties." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Update the property default values of a component definition in a specificed locale. + * + * Before making updates: + * 1. Use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify available properties + * + * The request requires a secondary locale ID. If a locale 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.

" + * }] + * }) + */ + public async updateProperties( + siteId: string, + componentId: string, + request: Webflow.ComponentPropertiesWrite, + requestOptions?: Components.RequestOptions + ): Promise { + const { localeId, ..._body } = request; + const _queryParams: Record = {}; + if (localeId != null) { + _queryParams["localeId"] = localeId; + } + + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties` + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + queryParameters: _queryParams, + requestType: "json", + body: serializers.ComponentPropertiesWrite.jsonOrThrow(_body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.ComponentsUpdatePropertiesResponse.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /sites/{site_id}/components/{component_id}/properties." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.accessToken)}`; + } +} diff --git a/src/api/resources/components/client/index.ts b/src/api/resources/components/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/api/resources/components/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/api/resources/components/client/requests/ComponentDomWrite.ts b/src/api/resources/components/client/requests/ComponentDomWrite.ts new file mode 100644 index 00000000..0a7b7b99 --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentDomWrite.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../index"; + +/** + * @example + * { + * 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-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" + * }] + * }] + * } + */ +export interface ComponentDomWrite { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** List of DOM Nodes with the new content that will be updated in each node. */ + nodes: Webflow.ComponentDomWriteNodesItem[]; +} diff --git a/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts new file mode 100644 index 00000000..9c64e279 --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../index"; + +/** + * @example + * { + * 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.

" + * }] + * } + */ +export interface ComponentPropertiesWrite { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** A list of component properties to update within the specified secondary locale. */ + properties: Webflow.ComponentPropertiesWritePropertiesItem[]; +} diff --git a/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts new file mode 100644 index 00000000..043c8f2b --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts @@ -0,0 +1,29 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + * + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + */ +export interface ComponentsGetContentRequest { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; +} diff --git a/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts new file mode 100644 index 00000000..d8d9ce7d --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * localeId: "65427cf400e02b306eaa04a0" + * } + */ +export interface ComponentsGetPropertiesRequest { + /** + * Unique identifier for a specific locale. Applicable, when using localization. + */ + localeId?: string; + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; +} diff --git a/src/api/resources/components/client/requests/ComponentsListRequest.ts b/src/api/resources/components/client/requests/ComponentsListRequest.ts new file mode 100644 index 00000000..c1090ce9 --- /dev/null +++ b/src/api/resources/components/client/requests/ComponentsListRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface ComponentsListRequest { + /** + * Maximum number of records to be returned (max limit: 100) + */ + limit?: number; + /** + * Offset used for pagination if the results have more than limit records + */ + offset?: number; +} diff --git a/src/api/resources/components/client/requests/index.ts b/src/api/resources/components/client/requests/index.ts new file mode 100644 index 00000000..c8f88ea5 --- /dev/null +++ b/src/api/resources/components/client/requests/index.ts @@ -0,0 +1,5 @@ +export { type ComponentsListRequest } from "./ComponentsListRequest"; +export { type ComponentsGetContentRequest } from "./ComponentsGetContentRequest"; +export { type ComponentDomWrite } from "./ComponentDomWrite"; +export { type ComponentsGetPropertiesRequest } from "./ComponentsGetPropertiesRequest"; +export { type ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; diff --git a/src/api/resources/components/index.ts b/src/api/resources/components/index.ts new file mode 100644 index 00000000..c9240f83 --- /dev/null +++ b/src/api/resources/components/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/components/types/ComponentDomWriteNodesItem.ts b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts new file mode 100644 index 00000000..f9884a29 --- /dev/null +++ b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../index"; + +export type ComponentDomWriteNodesItem = Webflow.TextNodeWrite | Webflow.ComponentInstanceNodePropertyOverridesWrite; diff --git a/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts new file mode 100644 index 00000000..dac54dc0 --- /dev/null +++ b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ComponentPropertiesWritePropertiesItem { + /** The ID of the property. */ + propertyId: string; + /** + * The new string or HTML value used to update the component property in the secondary locale. + * + * The provided value must be compatible with the type of the component property. + * + * For example, attempting to update a single-line plain-text property with a multi-line + * value will result in an error. + */ + text: string; +} diff --git a/src/api/resources/components/types/ComponentsUpdateContentResponse.ts b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts new file mode 100644 index 00000000..3bb712bd --- /dev/null +++ b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ComponentsUpdateContentResponse { + /** A list of error messages, if any. */ + errors: string[]; +} diff --git a/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts new file mode 100644 index 00000000..8c1f4142 --- /dev/null +++ b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ComponentsUpdatePropertiesResponse { + /** A list of error messages, if any. */ + errors: string[]; +} diff --git a/src/api/resources/components/types/index.ts b/src/api/resources/components/types/index.ts new file mode 100644 index 00000000..1bdf297c --- /dev/null +++ b/src/api/resources/components/types/index.ts @@ -0,0 +1,4 @@ +export * from "./ComponentDomWriteNodesItem"; +export * from "./ComponentsUpdateContentResponse"; +export * from "./ComponentPropertiesWritePropertiesItem"; +export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index 45832f7c..bde95436 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -2,6 +2,8 @@ export * as sites from "./sites"; export * from "./sites/types"; export * as pages from "./pages"; export * from "./pages/types"; +export * as components from "./components"; +export * from "./components/types"; export * as users from "./users"; export * from "./users/types"; export * as accessGroups from "./accessGroups"; @@ -14,6 +16,8 @@ export * as inventory from "./inventory"; export * from "./inventory/types"; export * as collections from "./collections"; export * as token from "./token"; +export * as redirects from "./redirects"; +export * as sitePlan from "./sitePlan"; export * as scripts from "./scripts"; export * as assets from "./assets"; export * as webhooks from "./webhooks"; @@ -22,6 +26,7 @@ export * as ecommerce from "./ecommerce"; export * from "./sites/client/requests"; export * from "./collections/client/requests"; export * from "./pages/client/requests"; +export * from "./components/client/requests"; export * from "./scripts/client/requests"; export * from "./assets/client/requests"; export * from "./forms/client/requests"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index fa344820..b927a9ef 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -164,7 +164,6 @@ export class Inventory { * Updates the current inventory levels for a particular SKU item. * * Updates may be given in one or two methods, absolutely or incrementally. - * * - Absolute updates are done by setting `quantity` directly. * - Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. * diff --git a/src/api/resources/pages/client/Client.ts b/src/api/resources/pages/client/Client.ts index 8181172e..75becbc1 100644 --- a/src/api/resources/pages/client/Client.ts +++ b/src/api/resources/pages/client/Client.ts @@ -462,9 +462,10 @@ export class Pages { } /** - * Get static content from a static page. + * Get static content from a static page. This includes text nodes, image nodes and component instances. + * To retrieve the contents of components in the page use the [get component content](/data/reference/pages-and-components/components/get-content) 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. + * 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 | `pages:read` * @@ -606,14 +607,20 @@ export class Pages { } /** - * This endpoint allows for updating static content on a static page within a secondary locale. It is designed specifically for localized pages and can handle up to 1000 nodes per request. + * This endpoint updates content on a static page in **secondary locales**. It supports updating up to 1000 nodes in a single request. * - *

Note:This endpoint is specifically for localized pages. Ensure that the locale specified is a valid secondary locale for the site.

+ * 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.DomWrite} request + * @param {Webflow.PageDomWrite} request * @param {Pages.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Webflow.BadRequestError} @@ -625,30 +632,33 @@ export class Pages { * * @example * await client.pages.updateStaticContent("63c720f9347c2139b248e552", { - * localeId: "65427cf400e02b306eaa04a0", + * localeId: "localeId", * nodes: [{ * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - * text: "

The Hitchhiker\u2019s Guide to the Galaxy

" + * text: "

The Hitchhiker's Guide to the Galaxy

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

Don\u2019t Panic!

Always know where your towel is.

" + * text: "

Don't Panic!

Always know where your towel is.

" * }, { * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - * text: "\"Marvin," + * propertyOverrides: [{ + * propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0", + * text: "

Time is an illusion

" + * }, { + * propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", + * text: "Life, the Universe and Everything" + * }] * }] * }) */ public async updateStaticContent( pageId: string, - request: Webflow.DomWrite, + request: Webflow.PageDomWrite, requestOptions?: Pages.RequestOptions ): Promise { const { localeId, ..._body } = request; const _queryParams: Record = {}; - if (localeId != null) { - _queryParams["localeId"] = localeId; - } - + _queryParams["localeId"] = localeId; const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, @@ -668,7 +678,7 @@ export class Pages { contentType: "application/json", queryParameters: _queryParams, requestType: "json", - body: serializers.DomWrite.jsonOrThrow(_body, { + body: serializers.PageDomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, diff --git a/src/api/resources/pages/client/requests/DomWrite.ts b/src/api/resources/pages/client/requests/DomWrite.ts deleted file mode 100644 index 0f0d95ff..00000000 --- a/src/api/resources/pages/client/requests/DomWrite.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as Webflow from "../../../../index"; - -/** - * @example - * { - * localeId: "65427cf400e02b306eaa04a0", - * nodes: [{ - * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - * text: "

The Hitchhiker\u2019s Guide to the Galaxy

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

Don\u2019t Panic!

Always know where your towel is.

" - * }, { - * nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629", - * text: "\"Marvin," - * }] - * } - */ -export interface DomWrite { - /** - * Unique identifier for a specific locale. Applicable, when using localization. - */ - localeId?: string; - nodes: Webflow.DomWriteNodesItem[]; -} diff --git a/src/api/resources/pages/client/requests/PageDomWrite.ts b/src/api/resources/pages/client/requests/PageDomWrite.ts new file mode 100644 index 00000000..9a4c0adc --- /dev/null +++ b/src/api/resources/pages/client/requests/PageDomWrite.ts @@ -0,0 +1,36 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../../index"; + +/** + * @example + * { + * 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-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" + * }] + * }] + * } + */ +export interface PageDomWrite { + /** + * The locale identifier. + */ + localeId: string; + /** List of DOM Nodes with the new content that will be updated in each node. */ + nodes: Webflow.PageDomWriteNodesItem[]; +} diff --git a/src/api/resources/pages/client/requests/index.ts b/src/api/resources/pages/client/requests/index.ts index f979def7..93bd2381 100644 --- a/src/api/resources/pages/client/requests/index.ts +++ b/src/api/resources/pages/client/requests/index.ts @@ -2,4 +2,4 @@ export { type PagesListRequest } from "./PagesListRequest"; export { type PagesGetMetadataRequest } from "./PagesGetMetadataRequest"; export { type UpdatePageSettingsRequest } from "./UpdatePageSettingsRequest"; export { type PagesGetContentRequest } from "./PagesGetContentRequest"; -export { type DomWrite } from "./DomWrite"; +export { type PageDomWrite } from "./PageDomWrite"; diff --git a/src/api/resources/pages/resources/scripts/client/Client.ts b/src/api/resources/pages/resources/scripts/client/Client.ts index e1ff1f19..6a57e2a2 100644 --- a/src/api/resources/pages/resources/scripts/client/Client.ts +++ b/src/api/resources/pages/resources/scripts/client/Client.ts @@ -36,7 +36,6 @@ export class Scripts { * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:read` @@ -162,7 +161,6 @@ export class Scripts { * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:write` @@ -308,7 +306,6 @@ export class Scripts { * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:write` diff --git a/src/api/resources/pages/types/PageDomWriteNodesItem.ts b/src/api/resources/pages/types/PageDomWriteNodesItem.ts new file mode 100644 index 00000000..037cfcbf --- /dev/null +++ b/src/api/resources/pages/types/PageDomWriteNodesItem.ts @@ -0,0 +1,7 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../../../index"; + +export type PageDomWriteNodesItem = Webflow.TextNodeWrite | Webflow.ComponentInstanceNodePropertyOverridesWrite; diff --git a/src/api/resources/pages/types/index.ts b/src/api/resources/pages/types/index.ts index 943c3715..b9ce1b58 100644 --- a/src/api/resources/pages/types/index.ts +++ b/src/api/resources/pages/types/index.ts @@ -1,2 +1,2 @@ -export * from "./DomWriteNodesItem"; +export * from "./PageDomWriteNodesItem"; export * from "./UpdateStaticContentResponse"; diff --git a/src/api/resources/products/client/Client.ts b/src/api/resources/products/client/Client.ts index e75102c0..2a73fc73 100644 --- a/src/api/resources/products/client/Client.ts +++ b/src/api/resources/products/client/Client.ts @@ -178,12 +178,11 @@ export class Products { * When you create a product, you will always create a SKU, since a Product Item must have, at minimum, a single SKU. * * To create a Product with multiple SKUs - for example a T-shirt in sizes small, medium and large: - * - * - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). - * - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. - * - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. - * - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. - * - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku) + * - Create parameters in `sku-properties`, also known as [product options and variants.](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). + * - A single `sku-property` would be `color`. Within the `color` property, list the various colors of T-shirts as an array of `enum` values: `royal-blue`, `crimson-red`, and `forrest-green`. + * - Once, you've created a Product and its `sku-properties` with `enum` values, Webflow will create a **default SKU**, which will automatically be a combination of the first `sku-properties` you've created. + * - In our example, the default SKU will be a Royal Blue T-Shirt, because our first `enum` of our Color `sku-property` is Royal Blue. + * - After you've created your product, you can create additional SKUs using the [Create SKU endpoint.](/data/reference/ecommerce/products-sk-us/create-sku) * * Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. * diff --git a/src/api/resources/redirects/client/Client.ts b/src/api/resources/redirects/client/Client.ts new file mode 100644 index 00000000..c4813d0b --- /dev/null +++ b/src/api/resources/redirects/client/Client.ts @@ -0,0 +1,547 @@ +/** + * 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 urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace Redirects { + 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 class Redirects { + constructor(protected readonly _options: Redirects.Options) {} + + /** + * Fetch a list of all URL redirect rules configured for a specific site. + * + * Use this endpoint to review, audit, or manage the redirection rules that control how traffic is rerouted on your site. + * + * + * Required scope: `sites:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Redirects.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.redirects.get("580e63e98c9a982ac9b8b741") + */ + public async get(siteId: string, requestOptions?: Redirects.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/redirects` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Redirects.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/redirects."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Add a new URL redirection rule to a site. + * + * This endpoint allows you to define a source path (`fromUrl`) and its corresponding destination path (`toUrl`), which will dictate how traffic is rerouted on your site. This is useful for managing site changes, restructuring URLs, or handling outdated links. + * + * Required scope: `sites:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Webflow.Redirect} request + * @param {Redirects.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.redirects.create("580e63e98c9a982ac9b8b741", { + * id: "42e1a2b7aa1a13f768a0042a", + * fromUrl: "/mostly-harmless", + * toUrl: "/earth" + * }) + */ + public async create( + siteId: string, + request: Webflow.Redirect, + requestOptions?: Redirects.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/redirects` + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.Redirect.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Redirect.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/redirects."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Remove a URL redirection rule from a site. + * This is useful for cleaning up outdated or unnecessary redirects, ensuring that your site's routing behavior remains efficient and up-to-date. + * Required scope: `sites:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} redirectId - Unique identifier site rediect + * @param {Redirects.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.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6") + */ + public async delete( + siteId: string, + redirectId: string, + requestOptions?: Redirects.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Redirects.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling DELETE /sites/{site_id}/redirects/{redirect_id}." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Update a URL redirection rule from a site. + * Required scope: `sites:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {string} redirectId - Unique identifier site rediect + * @param {Webflow.Redirect} request + * @param {Redirects.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.redirects.patch("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6", { + * id: "42e1a2b7aa1a13f768a0042a", + * fromUrl: "/mostly-harmless", + * toUrl: "/earth" + * }) + */ + public async patch( + siteId: string, + redirectId: string, + request: Webflow.Redirect, + requestOptions?: Redirects.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}` + ), + method: "PATCH", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.Redirect.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Redirect.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling PATCH /sites/{site_id}/redirects/{redirect_id}." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.accessToken)}`; + } +} diff --git a/src/api/resources/redirects/client/index.ts b/src/api/resources/redirects/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/redirects/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/redirects/index.ts b/src/api/resources/redirects/index.ts new file mode 100644 index 00000000..5ec76921 --- /dev/null +++ b/src/api/resources/redirects/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/scripts/client/Client.ts b/src/api/resources/scripts/client/Client.ts index 5c476ab4..52773712 100644 --- a/src/api/resources/scripts/client/Client.ts +++ b/src/api/resources/scripts/client/Client.ts @@ -37,7 +37,6 @@ export class Scripts { * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. * Additionally, Scripts can be remotely hosted, or registered as inline snippets. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:read` @@ -163,7 +162,6 @@ export class Scripts { * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. * Additionally, Scripts can be remotely hosted, or registered as inline snippets. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:write` diff --git a/src/api/resources/sitePlan/client/Client.ts b/src/api/resources/sitePlan/client/Client.ts new file mode 100644 index 00000000..7322080f --- /dev/null +++ b/src/api/resources/sitePlan/client/Client.ts @@ -0,0 +1,153 @@ +/** + * 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 urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; + +export declare namespace SitePlan { + 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 class SitePlan { + constructor(protected readonly _options: SitePlan.Options) {} + + /** + * Get site plan details for the specified Site. + * + * Required scope | `sites:read` + * + * @param {string} siteId - Unique identifier for a Site + * @param {SitePlan.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.sitePlan.get("580e63e98c9a982ac9b8b741") + */ + public async get(siteId: string, requestOptions?: SitePlan.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}/plan` + ), + method: "GET", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.SitePlan.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/plan."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + protected async _getAuthorizationHeader(): Promise { + return `Bearer ${await core.Supplier.get(this._options.accessToken)}`; + } +} diff --git a/src/api/resources/sitePlan/client/index.ts b/src/api/resources/sitePlan/client/index.ts new file mode 100644 index 00000000..cb0ff5c3 --- /dev/null +++ b/src/api/resources/sitePlan/client/index.ts @@ -0,0 +1 @@ +export {}; diff --git a/src/api/resources/sitePlan/index.ts b/src/api/resources/sitePlan/index.ts new file mode 100644 index 00000000..5ec76921 --- /dev/null +++ b/src/api/resources/sitePlan/index.ts @@ -0,0 +1 @@ +export * from "./client"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 9e04812e..15c53320 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -5,8 +5,8 @@ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Webflow from "../../../index"; -import urlJoin from "url-join"; import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; import * as errors from "../../../../errors/index"; import { ActivityLogs } from "../resources/activityLogs/client/Client"; import { Scripts } from "../resources/scripts/client/Client"; @@ -32,6 +32,140 @@ export declare namespace Sites { export class Sites { constructor(protected readonly _options: Sites.Options) {} + /** + * Create a site. This endpoint requires an Enterprise workspace. + * + * Required scope | `workspace:write` + * + * @param {string} workspaceId - Unique identifier for a Workspace + * @param {Webflow.SitesCreateRequest} request + * @param {Sites.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.sites.create("580e63e98c9a982ac9b8b741", { + * name: "The Hitchhiker's Guide to the Galaxy" + * }) + */ + public async create( + workspaceId: string, + request: Webflow.SitesCreateRequest, + requestOptions?: Sites.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `workspaces/${encodeURIComponent(workspaceId)}/sites` + ), + method: "POST", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SitesCreateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Site.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError( + "Timeout exceeded when calling POST /workspaces/{workspace_id}/sites." + ); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + /** * List of all sites the provided access token is able to access. * @@ -251,6 +385,250 @@ export class Sites { } } + /** + * Delete a site. This endpoint requires an Enterprise workspace. + * + * Required scope | `sites:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Sites.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.sites.delete("580e63e98c9a982ac9b8b741") + */ + public async delete(siteId: string, requestOptions?: Sites.RequestOptions): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}` + ), + method: "DELETE", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /sites/{site_id}."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + + /** + * Update a site. This endpoint requires an Enterprise workspace. + * + * Required scope | `sites:write` + * + * @param {string} siteId - Unique identifier for a Site + * @param {Webflow.SitesUpdateRequest} request + * @param {Sites.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.sites.update("580e63e98c9a982ac9b8b741") + */ + public async update( + siteId: string, + request: Webflow.SitesUpdateRequest = {}, + requestOptions?: Sites.RequestOptions + ): Promise { + const _response = await core.fetcher({ + url: urlJoin( + (await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.Default, + `sites/${encodeURIComponent(siteId)}` + ), + method: "PATCH", + headers: { + Authorization: await this._getAuthorizationHeader(), + "X-Fern-Language": "JavaScript", + "X-Fern-SDK-Name": "webflow-api", + "X-Fern-SDK-Version": "3.0.2", + "User-Agent": "webflow-api/3.0.2", + "X-Fern-Runtime": core.RUNTIME.type, + "X-Fern-Runtime-Version": core.RUNTIME.version, + ...requestOptions?.headers, + }, + contentType: "application/json", + requestType: "json", + body: serializers.SitesUpdateRequest.jsonOrThrow(request, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, + }); + if (_response.ok) { + return serializers.Site.parseOrThrow(_response.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }); + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Webflow.BadRequestError(_response.error.body); + case 401: + throw new Webflow.UnauthorizedError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 403: + throw new Webflow.ForbiddenError(_response.error.body); + case 404: + throw new Webflow.NotFoundError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 429: + throw new Webflow.TooManyRequestsError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + case 500: + throw new Webflow.InternalServerError( + serializers.Error_.parseOrThrow(_response.error.body, { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + skipValidation: true, + breadcrumbsPrefix: ["response"], + }) + ); + default: + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + }); + } + } + + switch (_response.error.reason) { + case "non-json": + throw new errors.WebflowError({ + statusCode: _response.error.statusCode, + body: _response.error.rawBody, + }); + case "timeout": + throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /sites/{site_id}."); + case "unknown": + throw new errors.WebflowError({ + message: _response.error.errorMessage, + }); + } + } + /** * Get a list of all custom domains related to site. * diff --git a/src/api/resources/sites/client/requests/SitesCreateRequest.ts b/src/api/resources/sites/client/requests/SitesCreateRequest.ts new file mode 100644 index 00000000..c7911a56 --- /dev/null +++ b/src/api/resources/sites/client/requests/SitesCreateRequest.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * { + * name: "The Hitchhiker's Guide to the Galaxy" + * } + */ +export interface SitesCreateRequest { + /** The name of the site */ + name: string; + /** The workspace or marketplace template to use */ + templateName?: string; + /** MegaDodo Publications - Potential Book Ideas */ + parentFolderId?: string; +} diff --git a/src/api/resources/sites/client/requests/SitesUpdateRequest.ts b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts new file mode 100644 index 00000000..99058677 --- /dev/null +++ b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * @example + * {} + */ +export interface SitesUpdateRequest { + /** The name of the site */ + name?: string; + /** The parent folder ID of the site */ + parentFolderId?: string; +} diff --git a/src/api/resources/sites/client/requests/index.ts b/src/api/resources/sites/client/requests/index.ts index 9dc259ab..b802fad3 100644 --- a/src/api/resources/sites/client/requests/index.ts +++ b/src/api/resources/sites/client/requests/index.ts @@ -1 +1,3 @@ +export { type SitesCreateRequest } from "./SitesCreateRequest"; +export { type SitesUpdateRequest } from "./SitesUpdateRequest"; export { type SitesPublishRequest } from "./SitesPublishRequest"; diff --git a/src/api/resources/sites/resources/activityLogs/client/Client.ts b/src/api/resources/sites/resources/activityLogs/client/Client.ts index d8ca510e..7147f43e 100644 --- a/src/api/resources/sites/resources/activityLogs/client/Client.ts +++ b/src/api/resources/sites/resources/activityLogs/client/Client.ts @@ -31,7 +31,7 @@ export class ActivityLogs { constructor(protected readonly _options: ActivityLogs.Options) {} /** - * Retrieve Activity Logs for a specific Site. Requires Site to be on an Enterprise plan.

Required scope | `site_activity:read` + * Retrieve Activity Logs for a specific Site. Requires Site to be on an Enterprise plan.

Required scope | `site_activity:read` * * @param {string} siteId - Unique identifier for a Site * @param {Webflow.sites.ActivityLogsListRequest} request diff --git a/src/api/resources/sites/resources/scripts/client/Client.ts b/src/api/resources/sites/resources/scripts/client/Client.ts index 04d7f9e7..abf444d3 100644 --- a/src/api/resources/sites/resources/scripts/client/Client.ts +++ b/src/api/resources/sites/resources/scripts/client/Client.ts @@ -32,7 +32,6 @@ export class Scripts { /** * Get all registered scripts that have been applied to a specific Site. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:read` @@ -158,7 +157,6 @@ export class Scripts { * In order to use the Custom Code APIs for Sites and Pages, Custom Code Scripts must first be registered * to a Site via the `registered_scripts` endpoints, and then applied to a Site or Page using the appropriate * `custom_code` endpoints. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:write` @@ -415,7 +413,6 @@ export class Scripts { /** * Get all instances of Custom Code applied to a Site or Pages. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* * Required scope | `custom_code:read` diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index 451c894e..5356ff39 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -413,7 +413,7 @@ export class Users { /** * Update a User by ID * - * Required scope | `users:write` + * Required scope | `users:write` * * The email and password * fields cannot be updated using this endpoint diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index ea8c6c05..7807c60a 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -151,7 +151,6 @@ export class Webhooks { * Create a new Webhook. * * Limit of 75 registrations per `triggerType`, per site. - * *
Access to this endpoint requires a bearer token from a Data Client App.
* Required scope | `sites:write` * diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts new file mode 100644 index 00000000..f90eff53 --- /dev/null +++ b/src/api/types/Component.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * The Component object + */ +export interface Component { + /** Unique identifier for the Component */ + id: string; + /** Component Name */ + name?: string; + /** The group that the component belongs to */ + group?: string; + /** Component Description */ + description?: string; + /** Indicates whether the component is read-only. Components that cannot be updated within this Site are set to readonly. Workspace Libraries are a good example. */ + readonly?: boolean; +} diff --git a/src/api/types/ComponentDom.ts b/src/api/types/ComponentDom.ts new file mode 100644 index 00000000..aaf5e2a8 --- /dev/null +++ b/src/api/types/ComponentDom.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * The Component DOM schema represents the content structure of a component. Similar to Page DOM, it captures various content nodes and their associated attributes, but specifically for a component's structure. Each node has a unique identifier and can contain text, images, or nested component instances. + */ +export interface ComponentDom { + /** Component ID */ + componentId?: string; + nodes?: Webflow.Node[]; + pagination?: Webflow.Pagination; +} diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts new file mode 100644 index 00000000..2fe7cd3b --- /dev/null +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * Update text property overrides of a component instance + */ +export interface ComponentInstanceNodePropertyOverridesWrite { + /** Node UUID */ + nodeId: string; + /** A list of component instance properties to override within the specified secondary locale. */ + propertyOverrides: Webflow.ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem[]; +} diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts new file mode 100644 index 00000000..a69d7028 --- /dev/null +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem { + /** The ID of the property. */ + propertyId: string; + /** + * The new string or HTML value used to override the component instance property value. + * The provided value must be compatible with the type of the component instance property. + * For example, attempting to override a single-line plain-text property with a multi-line + * value will result in an error. + */ + text: string; +} diff --git a/src/api/types/ComponentList.ts b/src/api/types/ComponentList.ts new file mode 100644 index 00000000..8af4f455 --- /dev/null +++ b/src/api/types/ComponentList.ts @@ -0,0 +1,13 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * List of Components on a site. + */ +export interface ComponentList { + components?: Webflow.Component[]; + pagination?: Webflow.Pagination; +} diff --git a/src/api/types/ComponentNode.ts b/src/api/types/ComponentNode.ts new file mode 100644 index 00000000..052cbab9 --- /dev/null +++ b/src/api/types/ComponentNode.ts @@ -0,0 +1,17 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * Represents a component instance within the DOM. It contains details about the component instance, such as its type and properties. + */ +export interface ComponentNode { + /** Node UUID */ + id?: string; + /** Component ID */ + componentId?: string; + /** List of component properties with overrides for a component instance. */ + propertyOverrides?: Webflow.ComponentProperty[]; +} diff --git a/src/api/types/ComponentProperties.ts b/src/api/types/ComponentProperties.ts new file mode 100644 index 00000000..e2e33ecb --- /dev/null +++ b/src/api/types/ComponentProperties.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * The Component Properties schema represents a list of properties that store text content. Each property has a unique identifier and can be of different types like plain text or rich text. The schema also provides pagination details for scenarios where there more properties than the limit. + */ +export interface ComponentProperties { + /** Component ID */ + componentId?: string; + properties?: Webflow.ComponentProperty[]; + pagination?: Webflow.Pagination; +} diff --git a/src/api/types/ComponentProperty.ts b/src/api/types/ComponentProperty.ts new file mode 100644 index 00000000..95471eff --- /dev/null +++ b/src/api/types/ComponentProperty.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * Represents a property of a component instance in the DOM. A property contains a list of both the raw text and the HTML representation, allowing for flexibility in rendering and processing. Additional attributes can be associated with the text for styling or other purposes. + */ +export interface ComponentProperty { + /** The ID of the property. */ + propertyId?: string; + type?: Webflow.ComponentPropertyType; + label?: string; + text?: Webflow.TextNode; +} diff --git a/src/api/types/ComponentPropertyType.ts b/src/api/types/ComponentPropertyType.ts new file mode 100644 index 00000000..79aa439f --- /dev/null +++ b/src/api/types/ComponentPropertyType.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type ComponentPropertyType = "Plain Text" | "Rich Text" | "Alt Text"; + +export const ComponentPropertyType = { + PlainText: "Plain Text", + RichText: "Rich Text", + AltText: "Alt Text", +} as const; diff --git a/src/api/types/Dom.ts b/src/api/types/Dom.ts index ff5f7c0b..b02c0628 100644 --- a/src/api/types/Dom.ts +++ b/src/api/types/Dom.ts @@ -5,7 +5,7 @@ import * as Webflow from "../index"; /** - * The DOM (Document Object Model) schema represents the content structure of a web page. It captures various content nodes, such as text and images, along with their associated attributes. Each node has a unique identifier and can be of different types like text or image. The schema also provides pagination details for scenarios where the content nodes are too many to be fetched in a single request. + * The DOM (Document Object Model) schema represents the content structure of a web page or component. It captures various content nodes along with their associated attributes. Each node has a unique identifier and can be of different types like text, image or component-instance. The schema also provides pagination details for scenarios where the content nodes are too many to be fetched in a single request. */ export interface Dom { /** Page ID */ diff --git a/src/api/types/ImageNode.ts b/src/api/types/ImageNode.ts index 11ff84db..d1b45fc7 100644 --- a/src/api/types/ImageNode.ts +++ b/src/api/types/ImageNode.ts @@ -2,10 +2,15 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Webflow from "../index"; + /** * Represents an image within the DOM. It contains details about the image, such as its alternative text (alt) for accessibility and an asset identifier for fetching the actual image resource. Additional attributes can be associated with the image for styling or other purposes. */ export interface ImageNode { - alt?: string; - assetId?: string; + /** Node UUID */ + id?: string; + image?: Webflow.ImageNodeImage; + /** The custom attributes of the node */ + attributes?: Record; } diff --git a/src/api/types/ImageNodeImage.ts b/src/api/types/ImageNodeImage.ts new file mode 100644 index 00000000..74f51a90 --- /dev/null +++ b/src/api/types/ImageNodeImage.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface ImageNodeImage { + alt?: string; + assetId?: string; +} diff --git a/src/api/types/Node.ts b/src/api/types/Node.ts index 4f8f21c3..74e961bd 100644 --- a/src/api/types/Node.ts +++ b/src/api/types/Node.ts @@ -7,12 +7,18 @@ import * as Webflow from "../index"; /** * A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes. */ -export interface Node { - /** Node UUID */ - id?: string; - type?: Webflow.NodeType; - text?: Webflow.TextNode; - image?: Webflow.ImageNode; - /** The custom attributes of the node */ - attributes?: Record; +export type Node = Webflow.Node.Text | Webflow.Node.Image | Webflow.Node.ComponentInstance; + +export declare namespace Node { + interface Text extends Webflow.TextNode { + type: "text"; + } + + interface Image extends Webflow.ImageNode { + type: "image"; + } + + interface ComponentInstance extends Webflow.ComponentNode { + type: "component-instance"; + } } diff --git a/src/api/types/NodeType.ts b/src/api/types/NodeType.ts deleted file mode 100644 index 30b5f886..00000000 --- a/src/api/types/NodeType.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -export type NodeType = "text" | "image"; - -export const NodeType = { - Text: "text", - Image: "image", -} as const; diff --git a/src/api/types/NotEnterprisePlanWorkspace.ts b/src/api/types/NotEnterprisePlanWorkspace.ts new file mode 100644 index 00000000..fbd758af --- /dev/null +++ b/src/api/types/NotEnterprisePlanWorkspace.ts @@ -0,0 +1,5 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export type NotEnterprisePlanWorkspace = unknown; diff --git a/src/api/types/ProductFieldData.ts b/src/api/types/ProductFieldData.ts index a8c49373..977fe806 100644 --- a/src/api/types/ProductFieldData.ts +++ b/src/api/types/ProductFieldData.ts @@ -5,7 +5,7 @@ import * as Webflow from "../index"; /** - * Contains content-specific details for a product, covering both standard (e.g., title, description) and custom fields tailored to the product setup. + * Contains content-specific details for a product, covering both standard (e.g., title, description) and custom fields tailored to the product setup. */ export interface ProductFieldData { /** Name of the Product */ diff --git a/src/api/types/Redirect.ts b/src/api/types/Redirect.ts new file mode 100644 index 00000000..d0a7a9fc --- /dev/null +++ b/src/api/types/Redirect.ts @@ -0,0 +1,15 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * A single redirection rule, specifying a source URL and a destination URL. + */ +export interface Redirect { + /** The ID of the specific redirect rule */ + id?: string; + /** The source URL path that will be redirected. */ + fromUrl?: string; + /** The target URL path where the user or client will be redirected. */ + toUrl?: string; +} diff --git a/src/api/types/Redirects.ts b/src/api/types/Redirects.ts new file mode 100644 index 00000000..f6da48d3 --- /dev/null +++ b/src/api/types/Redirects.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +/** + * Site redirects response + */ +export interface Redirects { + /** List of redirects for a given site */ + redirects?: Webflow.Redirect[]; + pagination?: Webflow.Pagination; +} diff --git a/src/api/types/ScriptApply.ts b/src/api/types/ScriptApply.ts index bc8c0d7f..309a6bc0 100644 --- a/src/api/types/ScriptApply.ts +++ b/src/api/types/ScriptApply.ts @@ -9,7 +9,7 @@ export interface ScriptApply { id: string; /** Location of the script, either in the header or footer of the published site */ location: Webflow.ScriptApplyLocation; - /** Semantic Version String for the registered script _e.g. 0.0.1_ */ + /** Semantic Version String for the registered script *e.g. 0.0.1* */ version: string; /** Developer-specified key/value pairs to be applied as attributes to the script */ attributes?: Record; diff --git a/src/api/types/SitePlan.ts b/src/api/types/SitePlan.ts new file mode 100644 index 00000000..3a1c50cf --- /dev/null +++ b/src/api/types/SitePlan.ts @@ -0,0 +1,14 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Webflow from "../index"; + +export interface SitePlan { + /** ID of the hosting plan. */ + id?: Webflow.SitePlanId; + /** Name of the hosting plan. */ + name?: Webflow.SitePlanName; + /** URL for more information about Webflow hosting plan pricing. */ + pricingInfo?: string; +} diff --git a/src/api/types/SitePlanId.ts b/src/api/types/SitePlanId.ts new file mode 100644 index 00000000..9d65463a --- /dev/null +++ b/src/api/types/SitePlanId.ts @@ -0,0 +1,35 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * ID of the hosting plan. + */ +export type SitePlanId = + | "hosting-basic-v3" + | "hosting-cms-v3" + | "hosting-business-v3" + | "hosting-ecommerce-standard-v2" + | "hosting-ecommerce-plus-v2" + | "hosting-ecommerce-advanced-v2" + | "hosting-basic-v4" + | "hosting-cms-v4" + | "hosting-business-v4" + | "hosting-ecommerce-standard-v3" + | "hosting-ecommerce-plus-v3" + | "hosting-ecommerce-advanced-v3"; + +export const SitePlanId = { + HostingBasicV3: "hosting-basic-v3", + HostingCmsV3: "hosting-cms-v3", + HostingBusinessV3: "hosting-business-v3", + HostingEcommerceStandardV2: "hosting-ecommerce-standard-v2", + HostingEcommercePlusV2: "hosting-ecommerce-plus-v2", + HostingEcommerceAdvancedV2: "hosting-ecommerce-advanced-v2", + HostingBasicV4: "hosting-basic-v4", + HostingCmsV4: "hosting-cms-v4", + HostingBusinessV4: "hosting-business-v4", + HostingEcommerceStandardV3: "hosting-ecommerce-standard-v3", + HostingEcommercePlusV3: "hosting-ecommerce-plus-v3", + HostingEcommerceAdvancedV3: "hosting-ecommerce-advanced-v3", +} as const; diff --git a/src/api/types/SitePlanName.ts b/src/api/types/SitePlanName.ts new file mode 100644 index 00000000..925eaa9b --- /dev/null +++ b/src/api/types/SitePlanName.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Name of the hosting plan. + */ +export type SitePlanName = + | "Basic Hosting" + | "CMS Hosting" + | "Business Hosting" + | "ECommerce Standard Hosting" + | "ECommerce Plus Hosting" + | "ECommerce Advanced Hosting"; + +export const SitePlanName = { + BasicHosting: "Basic Hosting", + CmsHosting: "CMS Hosting", + BusinessHosting: "Business Hosting", + ECommerceStandardHosting: "ECommerce Standard Hosting", + ECommercePlusHosting: "ECommerce Plus Hosting", + ECommerceAdvancedHosting: "ECommerce Advanced Hosting", +} as const; diff --git a/src/api/types/TextNode.ts b/src/api/types/TextNode.ts index d40e72c5..d3bb2e5f 100644 --- a/src/api/types/TextNode.ts +++ b/src/api/types/TextNode.ts @@ -2,10 +2,15 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Webflow from "../index"; + /** - * Represents textual content within the DOM. It contains both the raw text and its HTML representation, allowing for flexibility in rendering and processing. Additional attributes can be associated with the text for styling or other purposes. + * Represents text content within the DOM. It contains both the raw text and its HTML representation. Additional attributes can be associated with the text for styling or other purposes. */ export interface TextNode { - html?: string; - text?: string; + /** Node UUID */ + id?: string; + text?: Webflow.TextNodeText; + /** The custom attributes of the node */ + attributes?: Record; } diff --git a/src/api/types/TextNodeText.ts b/src/api/types/TextNodeText.ts new file mode 100644 index 00000000..63f9ec09 --- /dev/null +++ b/src/api/types/TextNodeText.ts @@ -0,0 +1,8 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +export interface TextNodeText { + html?: string; + text?: string; +} diff --git a/src/api/resources/pages/types/DomWriteNodesItem.ts b/src/api/types/TextNodeWrite.ts similarity index 81% rename from src/api/resources/pages/types/DomWriteNodesItem.ts rename to src/api/types/TextNodeWrite.ts index 907de6eb..0c52cf2c 100644 --- a/src/api/resources/pages/types/DomWriteNodesItem.ts +++ b/src/api/types/TextNodeWrite.ts @@ -2,7 +2,10 @@ * This file was auto-generated by Fern from our API Definition. */ -export interface DomWriteNodesItem { +/** + * Update a text node + */ +export interface TextNodeWrite { /** Node UUID */ nodeId: string; /** HTML content of the node, including the HTML tag. The HTML tags must be the same as what's returned from the Get Content endpoint. */ diff --git a/src/api/types/TriggerType.ts b/src/api/types/TriggerType.ts index 771c4e92..345bf260 100644 --- a/src/api/types/TriggerType.ts +++ b/src/api/types/TriggerType.ts @@ -3,21 +3,21 @@ */ /** - * - `form_submission` - Sends the [form_submission](#form_submission) event - * - `site_publish` - Sends a [site_publish](#site_publish) event - * - `page_created` - Send the [page_created](#page_created) event - * - `page_metadata_updated` - Sends the [page_metadata_updated](#page_metadata_updated) event - * - `page_deleted` - Sends the [page_deleted](#page_deleted) event - * - `ecomm_new_order` - Sends the new [ecomm_new_order](#ecomm_new_order) event - * - `ecomm_order_changed` - Sends the [ecomm_order_changed](#ecomm_order_changed) event - * - `ecomm_inventory_changed` - Sends the [ecomm_inventory_changed](#ecomm_inventory_changed) event - * - `user_account_added` - Sends the [user_account_added](#user_account_added) event - * - `user_account_updated` - Sends the [user_account_updated](#user_account_updated) event - * - `user_account_deleted` - Sends the [user_account_deleted](#user_account_deleted) event - * - `collection_item_created` - Sends the [collection_item_created](#collection_item_created) event - * - `collection_item_changed` - Sends the [collection_item_changed](#collection_item_changed) event - * - `collection_item_deleted` - Sends the [collection_item_deleted](#collection_item_deleted) event - * - `collection_item_unpublished` - Sends the [collection_item_unpublished](#collection_item_unpublished) event + * * `form_submission` - Sends the [form_submission](#form_submission) event + * * `site_publish` - Sends a [site_publish](#site_publish) event + * * `page_created` - Send the [page_created](#page_created) event + * * `page_metadata_updated` - Sends the [page_metadata_updated](#page_metadata_updated) event + * * `page_deleted` - Sends the [page_deleted](#page_deleted) event + * * `ecomm_new_order` - Sends the new [ecomm_new_order](#ecomm_new_order) event + * * `ecomm_order_changed` - Sends the [ecomm_order_changed](#ecomm_order_changed) event + * * `ecomm_inventory_changed` - Sends the [ecomm_inventory_changed](#ecomm_inventory_changed) event + * * `user_account_added` - Sends the [user_account_added](#user_account_added) event + * * `user_account_updated` - Sends the [user_account_updated](#user_account_updated) event + * * `user_account_deleted` - Sends the [user_account_deleted](#user_account_deleted) event + * * `collection_item_created` - Sends the [collection_item_created](#collection_item_created) event + * * `collection_item_changed` - Sends the [collection_item_changed](#collection_item_changed) event + * * `collection_item_deleted` - Sends the [collection_item_deleted](#collection_item_deleted) event + * * `collection_item_unpublished` - Sends the [collection_item_unpublished](#collection_item_unpublished) event */ export type TriggerType = | "form_submission" diff --git a/src/api/types/UserAccessGroupsItem.ts b/src/api/types/UserAccessGroupsItem.ts index 80ae6d9f..637d39f3 100644 --- a/src/api/types/UserAccessGroupsItem.ts +++ b/src/api/types/UserAccessGroupsItem.ts @@ -12,9 +12,8 @@ export interface UserAccessGroupsItem { slug?: string; /** * The type of access group based on how it was assigned to the user. - * - * - `admin` - Assigned to the user via API or in the designer - * - `ecommerce` - Assigned to the user via an ecommerce purchase + * * `admin` - Assigned to the user via API or in the designer + * * `ecommerce` - Assigned to the user via an ecommerce purchase */ type?: Webflow.UserAccessGroupsItemType; } diff --git a/src/api/types/UserAccessGroupsItemType.ts b/src/api/types/UserAccessGroupsItemType.ts index 0057bea9..aa4eda82 100644 --- a/src/api/types/UserAccessGroupsItemType.ts +++ b/src/api/types/UserAccessGroupsItemType.ts @@ -4,9 +4,8 @@ /** * The type of access group based on how it was assigned to the user. - * - * - `admin` - Assigned to the user via API or in the designer - * - `ecommerce` - Assigned to the user via an ecommerce purchase + * * `admin` - Assigned to the user via API or in the designer + * * `ecommerce` - Assigned to the user via an ecommerce purchase */ export type UserAccessGroupsItemType = "admin" | "ecommerce"; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index cd6788c7..a0f32c34 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,5 +1,5 @@ -export * from "./BadRequestErrorBody"; export * from "./ForbiddenErrorBody"; +export * from "./BadRequestErrorBody"; export * from "./ConflictErrorBody"; export * from "./AuthorizedUser"; export * from "./ErrorCode"; @@ -14,18 +14,24 @@ export * from "./Locale"; export * from "./Locales"; export * from "./SiteDataCollectionType"; export * from "./Site"; +export * from "./InvalidScopes"; +export * from "./NotEnterprisePlanWorkspace"; export * from "./Sites"; +export * from "./NotEnterprisePlanSite"; export * from "./Domains"; export * from "./InvalidDomain"; export * from "./NoDomains"; +export * from "./Redirect"; +export * from "./Pagination"; +export * from "./Redirects"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePlan"; export * from "./SiteActivityLogItemEvent"; export * from "./SiteActivityLogItemResourceOperation"; export * from "./SiteActivityLogItemUser"; export * from "./SiteActivityLogItem"; -export * from "./Pagination"; export * from "./SiteActivityLogResponse"; -export * from "./InvalidScopes"; -export * from "./NotEnterprisePlanSite"; export * from "./CollectionListArrayItem"; export * from "./CollectionList"; export * from "./FieldType"; @@ -48,11 +54,22 @@ export * from "./PageSeo"; export * from "./PageOpenGraph"; export * from "./Page"; export * from "./PageList"; +export * from "./TextNodeText"; export * from "./TextNode"; +export * from "./ImageNodeImage"; export * from "./ImageNode"; -export * from "./NodeType"; +export * from "./ComponentPropertyType"; +export * from "./ComponentProperty"; +export * from "./ComponentNode"; export * from "./Node"; export * from "./Dom"; +export * from "./TextNodeWrite"; +export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./Component"; +export * from "./ComponentList"; +export * from "./ComponentDom"; +export * from "./ComponentProperties"; export * from "./ScriptApplyLocation"; export * from "./ScriptApply"; export * from "./ScriptApplyList"; diff --git a/src/serialization/resources/components/client/index.ts b/src/serialization/resources/components/client/index.ts new file mode 100644 index 00000000..415726b7 --- /dev/null +++ b/src/serialization/resources/components/client/index.ts @@ -0,0 +1 @@ +export * from "./requests"; diff --git a/src/serialization/resources/components/client/requests/ComponentDomWrite.ts b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts new file mode 100644 index 00000000..efcca33f --- /dev/null +++ b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ComponentDomWriteNodesItem } from "../../types/ComponentDomWriteNodesItem"; + +export const ComponentDomWrite: core.serialization.Schema< + serializers.ComponentDomWrite.Raw, + Omit +> = core.serialization.object({ + nodes: core.serialization.list(ComponentDomWriteNodesItem), +}); + +export declare namespace ComponentDomWrite { + interface Raw { + nodes: ComponentDomWriteNodesItem.Raw[]; + } +} diff --git a/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts new file mode 100644 index 00000000..0b5ace7a --- /dev/null +++ b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { ComponentPropertiesWritePropertiesItem } from "../../types/ComponentPropertiesWritePropertiesItem"; + +export const ComponentPropertiesWrite: core.serialization.Schema< + serializers.ComponentPropertiesWrite.Raw, + Omit +> = core.serialization.object({ + properties: core.serialization.list(ComponentPropertiesWritePropertiesItem), +}); + +export declare namespace ComponentPropertiesWrite { + interface Raw { + properties: ComponentPropertiesWritePropertiesItem.Raw[]; + } +} diff --git a/src/serialization/resources/components/client/requests/index.ts b/src/serialization/resources/components/client/requests/index.ts new file mode 100644 index 00000000..ce5a0aaf --- /dev/null +++ b/src/serialization/resources/components/client/requests/index.ts @@ -0,0 +1,2 @@ +export { ComponentDomWrite } from "./ComponentDomWrite"; +export { ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; diff --git a/src/serialization/resources/components/index.ts b/src/serialization/resources/components/index.ts new file mode 100644 index 00000000..c9240f83 --- /dev/null +++ b/src/serialization/resources/components/index.ts @@ -0,0 +1,2 @@ +export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts new file mode 100644 index 00000000..5aaf2383 --- /dev/null +++ b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; + +export const ComponentDomWriteNodesItem: core.serialization.Schema< + serializers.ComponentDomWriteNodesItem.Raw, + Webflow.ComponentDomWriteNodesItem +> = core.serialization.undiscriminatedUnion([TextNodeWrite, ComponentInstanceNodePropertyOverridesWrite]); + +export declare namespace ComponentDomWriteNodesItem { + type Raw = TextNodeWrite.Raw | ComponentInstanceNodePropertyOverridesWrite.Raw; +} diff --git a/src/serialization/resources/pages/types/DomWriteNodesItem.ts b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts similarity index 50% rename from src/serialization/resources/pages/types/DomWriteNodesItem.ts rename to src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts index 507c8108..cc1b20e8 100644 --- a/src/serialization/resources/pages/types/DomWriteNodesItem.ts +++ b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -6,17 +6,17 @@ import * as serializers from "../../../index"; import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -export const DomWriteNodesItem: core.serialization.ObjectSchema< - serializers.DomWriteNodesItem.Raw, - Webflow.DomWriteNodesItem +export const ComponentPropertiesWritePropertiesItem: core.serialization.ObjectSchema< + serializers.ComponentPropertiesWritePropertiesItem.Raw, + Webflow.ComponentPropertiesWritePropertiesItem > = core.serialization.object({ - nodeId: core.serialization.string(), + propertyId: core.serialization.string(), text: core.serialization.string(), }); -export declare namespace DomWriteNodesItem { +export declare namespace ComponentPropertiesWritePropertiesItem { interface Raw { - nodeId: string; + propertyId: string; text: string; } } diff --git a/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts new file mode 100644 index 00000000..418f1082 --- /dev/null +++ b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; + +export const ComponentsUpdateContentResponse: core.serialization.ObjectSchema< + serializers.ComponentsUpdateContentResponse.Raw, + Webflow.ComponentsUpdateContentResponse +> = core.serialization.object({ + errors: core.serialization.list(core.serialization.string()), +}); + +export declare namespace ComponentsUpdateContentResponse { + interface Raw { + errors: string[]; + } +} diff --git a/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts new file mode 100644 index 00000000..2d25e7d7 --- /dev/null +++ b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; + +export const ComponentsUpdatePropertiesResponse: core.serialization.ObjectSchema< + serializers.ComponentsUpdatePropertiesResponse.Raw, + Webflow.ComponentsUpdatePropertiesResponse +> = core.serialization.object({ + errors: core.serialization.list(core.serialization.string()), +}); + +export declare namespace ComponentsUpdatePropertiesResponse { + interface Raw { + errors: string[]; + } +} diff --git a/src/serialization/resources/components/types/index.ts b/src/serialization/resources/components/types/index.ts new file mode 100644 index 00000000..1bdf297c --- /dev/null +++ b/src/serialization/resources/components/types/index.ts @@ -0,0 +1,4 @@ +export * from "./ComponentDomWriteNodesItem"; +export * from "./ComponentsUpdateContentResponse"; +export * from "./ComponentPropertiesWritePropertiesItem"; +export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 54a413ab..daa4176c 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -2,6 +2,8 @@ export * as sites from "./sites"; export * from "./sites/types"; export * as pages from "./pages"; export * from "./pages/types"; +export * as components from "./components"; +export * from "./components/types"; export * as users from "./users"; export * from "./users/types"; export * as accessGroups from "./accessGroups"; @@ -16,6 +18,7 @@ export * as collections from "./collections"; export * from "./sites/client/requests"; export * from "./collections/client/requests"; export * from "./pages/client/requests"; +export * from "./components/client/requests"; export * as scripts from "./scripts"; export * from "./scripts/client/requests"; export * as assets from "./assets"; diff --git a/src/serialization/resources/pages/client/requests/DomWrite.ts b/src/serialization/resources/pages/client/requests/DomWrite.ts deleted file mode 100644 index 7ec432f7..00000000 --- a/src/serialization/resources/pages/client/requests/DomWrite.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../../../../index"; -import * as Webflow from "../../../../../api/index"; -import * as core from "../../../../../core"; -import { DomWriteNodesItem } from "../../types/DomWriteNodesItem"; - -export const DomWrite: core.serialization.Schema< - serializers.DomWrite.Raw, - Omit -> = core.serialization.object({ - nodes: core.serialization.list(DomWriteNodesItem), -}); - -export declare namespace DomWrite { - interface Raw { - nodes: DomWriteNodesItem.Raw[]; - } -} diff --git a/src/serialization/resources/pages/client/requests/PageDomWrite.ts b/src/serialization/resources/pages/client/requests/PageDomWrite.ts new file mode 100644 index 00000000..6d1e1b76 --- /dev/null +++ b/src/serialization/resources/pages/client/requests/PageDomWrite.ts @@ -0,0 +1,21 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; +import * as core from "../../../../../core"; +import { PageDomWriteNodesItem } from "../../types/PageDomWriteNodesItem"; + +export const PageDomWrite: core.serialization.Schema< + serializers.PageDomWrite.Raw, + Omit +> = core.serialization.object({ + nodes: core.serialization.list(PageDomWriteNodesItem), +}); + +export declare namespace PageDomWrite { + interface Raw { + nodes: PageDomWriteNodesItem.Raw[]; + } +} diff --git a/src/serialization/resources/pages/client/requests/index.ts b/src/serialization/resources/pages/client/requests/index.ts index a4b8aef6..ce50f647 100644 --- a/src/serialization/resources/pages/client/requests/index.ts +++ b/src/serialization/resources/pages/client/requests/index.ts @@ -1 +1 @@ -export { DomWrite } from "./DomWrite"; +export { PageDomWrite } from "./PageDomWrite"; diff --git a/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts new file mode 100644 index 00000000..4d32f518 --- /dev/null +++ b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts @@ -0,0 +1,18 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; +import * as core from "../../../../core"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; + +export const PageDomWriteNodesItem: core.serialization.Schema< + serializers.PageDomWriteNodesItem.Raw, + Webflow.PageDomWriteNodesItem +> = core.serialization.undiscriminatedUnion([TextNodeWrite, ComponentInstanceNodePropertyOverridesWrite]); + +export declare namespace PageDomWriteNodesItem { + type Raw = TextNodeWrite.Raw | ComponentInstanceNodePropertyOverridesWrite.Raw; +} diff --git a/src/serialization/resources/pages/types/index.ts b/src/serialization/resources/pages/types/index.ts index 943c3715..b9ce1b58 100644 --- a/src/serialization/resources/pages/types/index.ts +++ b/src/serialization/resources/pages/types/index.ts @@ -1,2 +1,2 @@ -export * from "./DomWriteNodesItem"; +export * from "./PageDomWriteNodesItem"; export * from "./UpdateStaticContentResponse"; diff --git a/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts new file mode 100644 index 00000000..83339694 --- /dev/null +++ b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SitesCreateRequest: core.serialization.Schema< + serializers.SitesCreateRequest.Raw, + Webflow.SitesCreateRequest +> = core.serialization.object({ + name: core.serialization.string(), + templateName: core.serialization.string().optional(), + parentFolderId: core.serialization.string().optional(), +}); + +export declare namespace SitesCreateRequest { + interface Raw { + name: string; + templateName?: string | null; + parentFolderId?: string | null; + } +} diff --git a/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts new file mode 100644 index 00000000..5b3291a3 --- /dev/null +++ b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; +import * as core from "../../../../../core"; + +export const SitesUpdateRequest: core.serialization.Schema< + serializers.SitesUpdateRequest.Raw, + Webflow.SitesUpdateRequest +> = core.serialization.object({ + name: core.serialization.string().optional(), + parentFolderId: core.serialization.string().optional(), +}); + +export declare namespace SitesUpdateRequest { + interface Raw { + name?: string | null; + parentFolderId?: string | null; + } +} diff --git a/src/serialization/resources/sites/client/requests/index.ts b/src/serialization/resources/sites/client/requests/index.ts index dddc2657..1a807906 100644 --- a/src/serialization/resources/sites/client/requests/index.ts +++ b/src/serialization/resources/sites/client/requests/index.ts @@ -1 +1,3 @@ +export { SitesCreateRequest } from "./SitesCreateRequest"; +export { SitesUpdateRequest } from "./SitesUpdateRequest"; export { SitesPublishRequest } from "./SitesPublishRequest"; diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts new file mode 100644 index 00000000..2f2366aa --- /dev/null +++ b/src/serialization/types/Component.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const Component: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string(), + name: core.serialization.string().optional(), + group: core.serialization.string().optional(), + description: core.serialization.string().optional(), + readonly: core.serialization.boolean().optional(), + }); + +export declare namespace Component { + interface Raw { + id: string; + name?: string | null; + group?: string | null; + description?: string | null; + readonly?: boolean | null; + } +} diff --git a/src/serialization/types/ComponentDom.ts b/src/serialization/types/ComponentDom.ts new file mode 100644 index 00000000..80a30810 --- /dev/null +++ b/src/serialization/types/ComponentDom.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { Node } from "./Node"; +import { Pagination } from "./Pagination"; + +export const ComponentDom: core.serialization.ObjectSchema = + core.serialization.object({ + componentId: core.serialization.string().optional(), + nodes: core.serialization.list(Node).optional(), + pagination: Pagination.optional(), + }); + +export declare namespace ComponentDom { + interface Raw { + componentId?: string | null; + nodes?: Node.Raw[] | null; + pagination?: Pagination.Raw | null; + } +} diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts new file mode 100644 index 00000000..d87995d2 --- /dev/null +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem } from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; + +export const ComponentInstanceNodePropertyOverridesWrite: core.serialization.ObjectSchema< + serializers.ComponentInstanceNodePropertyOverridesWrite.Raw, + Webflow.ComponentInstanceNodePropertyOverridesWrite +> = core.serialization.object({ + nodeId: core.serialization.string(), + propertyOverrides: core.serialization.list(ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem), +}); + +export declare namespace ComponentInstanceNodePropertyOverridesWrite { + interface Raw { + nodeId: string; + propertyOverrides: ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.Raw[]; + } +} diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts new file mode 100644 index 00000000..0648f7db --- /dev/null +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem: core.serialization.ObjectSchema< + serializers.ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.Raw, + Webflow.ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem +> = core.serialization.object({ + propertyId: core.serialization.string(), + text: core.serialization.string(), +}); + +export declare namespace ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem { + interface Raw { + propertyId: string; + text: string; + } +} diff --git a/src/serialization/types/ComponentList.ts b/src/serialization/types/ComponentList.ts new file mode 100644 index 00000000..54f963af --- /dev/null +++ b/src/serialization/types/ComponentList.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { Component } from "./Component"; +import { Pagination } from "./Pagination"; + +export const ComponentList: core.serialization.ObjectSchema = + core.serialization.object({ + components: core.serialization.list(Component).optional(), + pagination: Pagination.optional(), + }); + +export declare namespace ComponentList { + interface Raw { + components?: Component.Raw[] | null; + pagination?: Pagination.Raw | null; + } +} diff --git a/src/serialization/types/ComponentNode.ts b/src/serialization/types/ComponentNode.ts new file mode 100644 index 00000000..4118e39d --- /dev/null +++ b/src/serialization/types/ComponentNode.ts @@ -0,0 +1,23 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { ComponentProperty } from "./ComponentProperty"; + +export const ComponentNode: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + componentId: core.serialization.string().optional(), + propertyOverrides: core.serialization.list(ComponentProperty).optional(), + }); + +export declare namespace ComponentNode { + interface Raw { + id?: string | null; + componentId?: string | null; + propertyOverrides?: ComponentProperty.Raw[] | null; + } +} diff --git a/src/serialization/types/ComponentProperties.ts b/src/serialization/types/ComponentProperties.ts new file mode 100644 index 00000000..f347c485 --- /dev/null +++ b/src/serialization/types/ComponentProperties.ts @@ -0,0 +1,26 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { ComponentProperty } from "./ComponentProperty"; +import { Pagination } from "./Pagination"; + +export const ComponentProperties: core.serialization.ObjectSchema< + serializers.ComponentProperties.Raw, + Webflow.ComponentProperties +> = core.serialization.object({ + componentId: core.serialization.string().optional(), + properties: core.serialization.list(ComponentProperty).optional(), + pagination: Pagination.optional(), +}); + +export declare namespace ComponentProperties { + interface Raw { + componentId?: string | null; + properties?: ComponentProperty.Raw[] | null; + pagination?: Pagination.Raw | null; + } +} diff --git a/src/serialization/types/ComponentProperty.ts b/src/serialization/types/ComponentProperty.ts new file mode 100644 index 00000000..ffbc21db --- /dev/null +++ b/src/serialization/types/ComponentProperty.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { ComponentPropertyType } from "./ComponentPropertyType"; +import { TextNode } from "./TextNode"; + +export const ComponentProperty: core.serialization.ObjectSchema< + serializers.ComponentProperty.Raw, + Webflow.ComponentProperty +> = core.serialization.object({ + propertyId: core.serialization.string().optional(), + type: ComponentPropertyType.optional(), + label: core.serialization.string().optional(), + text: TextNode.optional(), +}); + +export declare namespace ComponentProperty { + interface Raw { + propertyId?: string | null; + type?: ComponentPropertyType.Raw | null; + label?: string | null; + text?: TextNode.Raw | null; + } +} diff --git a/src/serialization/types/ComponentPropertyType.ts b/src/serialization/types/ComponentPropertyType.ts new file mode 100644 index 00000000..5ace7091 --- /dev/null +++ b/src/serialization/types/ComponentPropertyType.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const ComponentPropertyType: core.serialization.Schema< + serializers.ComponentPropertyType.Raw, + Webflow.ComponentPropertyType +> = core.serialization.enum_(["Plain Text", "Rich Text", "Alt Text"]); + +export declare namespace ComponentPropertyType { + type Raw = "Plain Text" | "Rich Text" | "Alt Text"; +} diff --git a/src/serialization/types/ImageNode.ts b/src/serialization/types/ImageNode.ts index 0f059779..b83e26f9 100644 --- a/src/serialization/types/ImageNode.ts +++ b/src/serialization/types/ImageNode.ts @@ -5,16 +5,19 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; +import { ImageNodeImage } from "./ImageNodeImage"; export const ImageNode: core.serialization.ObjectSchema = core.serialization.object({ - alt: core.serialization.string().optional(), - assetId: core.serialization.string().optional(), + id: core.serialization.string().optional(), + image: ImageNodeImage.optional(), + attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace ImageNode { interface Raw { - alt?: string | null; - assetId?: string | null; + id?: string | null; + image?: ImageNodeImage.Raw | null; + attributes?: Record | null; } } diff --git a/src/serialization/types/ImageNodeImage.ts b/src/serialization/types/ImageNodeImage.ts new file mode 100644 index 00000000..05cd07c2 --- /dev/null +++ b/src/serialization/types/ImageNodeImage.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const ImageNodeImage: core.serialization.ObjectSchema = + core.serialization.object({ + alt: core.serialization.string().optional(), + assetId: core.serialization.string().optional(), + }); + +export declare namespace ImageNodeImage { + interface Raw { + alt?: string | null; + assetId?: string | null; + } +} diff --git a/src/serialization/types/Node.ts b/src/serialization/types/Node.ts index 49a8f26b..311ff02b 100644 --- a/src/serialization/types/Node.ts +++ b/src/serialization/types/Node.ts @@ -5,24 +5,33 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; -import { NodeType } from "./NodeType"; import { TextNode } from "./TextNode"; import { ImageNode } from "./ImageNode"; +import { ComponentNode } from "./ComponentNode"; -export const Node: core.serialization.ObjectSchema = core.serialization.object({ - id: core.serialization.string().optional(), - type: NodeType.optional(), - text: TextNode.optional(), - image: ImageNode.optional(), - attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), -}); +export const Node: core.serialization.Schema = core.serialization + .union("type", { + text: TextNode, + image: ImageNode, + "component-instance": ComponentNode, + }) + .transform({ + transform: (value) => value, + untransform: (value) => value, + }); export declare namespace Node { - interface Raw { - id?: string | null; - type?: NodeType.Raw | null; - text?: TextNode.Raw | null; - image?: ImageNode.Raw | null; - attributes?: Record | null; + type Raw = Node.Text | Node.Image | Node.ComponentInstance; + + interface Text extends TextNode.Raw { + type: "text"; + } + + interface Image extends ImageNode.Raw { + type: "image"; + } + + interface ComponentInstance extends ComponentNode.Raw { + type: "component-instance"; } } diff --git a/src/serialization/types/NodeType.ts b/src/serialization/types/NodeType.ts deleted file mode 100644 index e3e70f16..00000000 --- a/src/serialization/types/NodeType.ts +++ /dev/null @@ -1,15 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as serializers from "../index"; -import * as Webflow from "../../api/index"; -import * as core from "../../core"; - -export const NodeType: core.serialization.Schema = core.serialization.enum_( - ["text", "image"] -); - -export declare namespace NodeType { - type Raw = "text" | "image"; -} diff --git a/src/serialization/types/NotEnterprisePlanWorkspace.ts b/src/serialization/types/NotEnterprisePlanWorkspace.ts new file mode 100644 index 00000000..23ba9a43 --- /dev/null +++ b/src/serialization/types/NotEnterprisePlanWorkspace.ts @@ -0,0 +1,16 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const NotEnterprisePlanWorkspace: core.serialization.Schema< + serializers.NotEnterprisePlanWorkspace.Raw, + Webflow.NotEnterprisePlanWorkspace +> = core.serialization.unknown(); + +export declare namespace NotEnterprisePlanWorkspace { + type Raw = unknown; +} diff --git a/src/serialization/types/Redirect.ts b/src/serialization/types/Redirect.ts new file mode 100644 index 00000000..1f7e72cf --- /dev/null +++ b/src/serialization/types/Redirect.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const Redirect: core.serialization.ObjectSchema = + core.serialization.object({ + id: core.serialization.string().optional(), + fromUrl: core.serialization.string().optional(), + toUrl: core.serialization.string().optional(), + }); + +export declare namespace Redirect { + interface Raw { + id?: string | null; + fromUrl?: string | null; + toUrl?: string | null; + } +} diff --git a/src/serialization/types/Redirects.ts b/src/serialization/types/Redirects.ts new file mode 100644 index 00000000..b8481248 --- /dev/null +++ b/src/serialization/types/Redirects.ts @@ -0,0 +1,22 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { Redirect } from "./Redirect"; +import { Pagination } from "./Pagination"; + +export const Redirects: core.serialization.ObjectSchema = + core.serialization.object({ + redirects: core.serialization.list(Redirect).optional(), + pagination: Pagination.optional(), + }); + +export declare namespace Redirects { + interface Raw { + redirects?: Redirect.Raw[] | null; + pagination?: Pagination.Raw | null; + } +} diff --git a/src/serialization/types/SitePlan.ts b/src/serialization/types/SitePlan.ts new file mode 100644 index 00000000..37dca864 --- /dev/null +++ b/src/serialization/types/SitePlan.ts @@ -0,0 +1,24 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; +import { SitePlanId } from "./SitePlanId"; +import { SitePlanName } from "./SitePlanName"; + +export const SitePlan: core.serialization.ObjectSchema = + core.serialization.object({ + id: SitePlanId.optional(), + name: SitePlanName.optional(), + pricingInfo: core.serialization.string().optional(), + }); + +export declare namespace SitePlan { + interface Raw { + id?: SitePlanId.Raw | null; + name?: SitePlanName.Raw | null; + pricingInfo?: string | null; + } +} diff --git a/src/serialization/types/SitePlanId.ts b/src/serialization/types/SitePlanId.ts new file mode 100644 index 00000000..f6c32dd5 --- /dev/null +++ b/src/serialization/types/SitePlanId.ts @@ -0,0 +1,39 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const SitePlanId: core.serialization.Schema = + core.serialization.enum_([ + "hosting-basic-v3", + "hosting-cms-v3", + "hosting-business-v3", + "hosting-ecommerce-standard-v2", + "hosting-ecommerce-plus-v2", + "hosting-ecommerce-advanced-v2", + "hosting-basic-v4", + "hosting-cms-v4", + "hosting-business-v4", + "hosting-ecommerce-standard-v3", + "hosting-ecommerce-plus-v3", + "hosting-ecommerce-advanced-v3", + ]); + +export declare namespace SitePlanId { + type Raw = + | "hosting-basic-v3" + | "hosting-cms-v3" + | "hosting-business-v3" + | "hosting-ecommerce-standard-v2" + | "hosting-ecommerce-plus-v2" + | "hosting-ecommerce-advanced-v2" + | "hosting-basic-v4" + | "hosting-cms-v4" + | "hosting-business-v4" + | "hosting-ecommerce-standard-v3" + | "hosting-ecommerce-plus-v3" + | "hosting-ecommerce-advanced-v3"; +} diff --git a/src/serialization/types/SitePlanName.ts b/src/serialization/types/SitePlanName.ts new file mode 100644 index 00000000..870550ad --- /dev/null +++ b/src/serialization/types/SitePlanName.ts @@ -0,0 +1,27 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const SitePlanName: core.serialization.Schema = + core.serialization.enum_([ + "Basic Hosting", + "CMS Hosting", + "Business Hosting", + "ECommerce Standard Hosting", + "ECommerce Plus Hosting", + "ECommerce Advanced Hosting", + ]); + +export declare namespace SitePlanName { + type Raw = + | "Basic Hosting" + | "CMS Hosting" + | "Business Hosting" + | "ECommerce Standard Hosting" + | "ECommerce Plus Hosting" + | "ECommerce Advanced Hosting"; +} diff --git a/src/serialization/types/TextNode.ts b/src/serialization/types/TextNode.ts index abf03e06..b97e6956 100644 --- a/src/serialization/types/TextNode.ts +++ b/src/serialization/types/TextNode.ts @@ -5,16 +5,19 @@ import * as serializers from "../index"; import * as Webflow from "../../api/index"; import * as core from "../../core"; +import { TextNodeText } from "./TextNodeText"; export const TextNode: core.serialization.ObjectSchema = core.serialization.object({ - html: core.serialization.string().optional(), - text: core.serialization.string().optional(), + id: core.serialization.string().optional(), + text: TextNodeText.optional(), + attributes: core.serialization.record(core.serialization.string(), core.serialization.string()).optional(), }); export declare namespace TextNode { interface Raw { - html?: string | null; - text?: string | null; + id?: string | null; + text?: TextNodeText.Raw | null; + attributes?: Record | null; } } diff --git a/src/serialization/types/TextNodeText.ts b/src/serialization/types/TextNodeText.ts new file mode 100644 index 00000000..d83f5aae --- /dev/null +++ b/src/serialization/types/TextNodeText.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const TextNodeText: core.serialization.ObjectSchema = + core.serialization.object({ + html: core.serialization.string().optional(), + text: core.serialization.string().optional(), + }); + +export declare namespace TextNodeText { + interface Raw { + html?: string | null; + text?: string | null; + } +} diff --git a/src/serialization/types/TextNodeWrite.ts b/src/serialization/types/TextNodeWrite.ts new file mode 100644 index 00000000..2c961026 --- /dev/null +++ b/src/serialization/types/TextNodeWrite.ts @@ -0,0 +1,20 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import * as core from "../../core"; + +export const TextNodeWrite: core.serialization.ObjectSchema = + core.serialization.object({ + nodeId: core.serialization.string(), + text: core.serialization.string(), + }); + +export declare namespace TextNodeWrite { + interface Raw { + nodeId: string; + text: string; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index cd6788c7..a0f32c34 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,5 +1,5 @@ -export * from "./BadRequestErrorBody"; export * from "./ForbiddenErrorBody"; +export * from "./BadRequestErrorBody"; export * from "./ConflictErrorBody"; export * from "./AuthorizedUser"; export * from "./ErrorCode"; @@ -14,18 +14,24 @@ export * from "./Locale"; export * from "./Locales"; export * from "./SiteDataCollectionType"; export * from "./Site"; +export * from "./InvalidScopes"; +export * from "./NotEnterprisePlanWorkspace"; export * from "./Sites"; +export * from "./NotEnterprisePlanSite"; export * from "./Domains"; export * from "./InvalidDomain"; export * from "./NoDomains"; +export * from "./Redirect"; +export * from "./Pagination"; +export * from "./Redirects"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePlan"; export * from "./SiteActivityLogItemEvent"; export * from "./SiteActivityLogItemResourceOperation"; export * from "./SiteActivityLogItemUser"; export * from "./SiteActivityLogItem"; -export * from "./Pagination"; export * from "./SiteActivityLogResponse"; -export * from "./InvalidScopes"; -export * from "./NotEnterprisePlanSite"; export * from "./CollectionListArrayItem"; export * from "./CollectionList"; export * from "./FieldType"; @@ -48,11 +54,22 @@ export * from "./PageSeo"; export * from "./PageOpenGraph"; export * from "./Page"; export * from "./PageList"; +export * from "./TextNodeText"; export * from "./TextNode"; +export * from "./ImageNodeImage"; export * from "./ImageNode"; -export * from "./NodeType"; +export * from "./ComponentPropertyType"; +export * from "./ComponentProperty"; +export * from "./ComponentNode"; export * from "./Node"; export * from "./Dom"; +export * from "./TextNodeWrite"; +export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./Component"; +export * from "./ComponentList"; +export * from "./ComponentDom"; +export * from "./ComponentProperties"; export * from "./ScriptApplyLocation"; export * from "./ScriptApply"; export * from "./ScriptApplyList"; diff --git a/yarn.lock b/yarn.lock index 525154e7..87772aee 100644 --- a/yarn.lock +++ b/yarn.lock @@ -513,7 +513,7 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": +"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": version "0.3.25" resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== @@ -642,7 +642,7 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.8": +"@types/json-schema@*", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -877,11 +877,25 @@ agent-base@6: dependencies: debug "4" +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" + ajv@^6.12.5: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" @@ -892,6 +906,16 @@ ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.0.0, ajv@^8.9.0: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-escapes@^4.2.1: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" @@ -1025,13 +1049,13 @@ braces@^3.0.3: fill-range "^7.1.1" browserslist@^4.24.0: - version "4.24.2" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.2.tgz#f5845bc91069dbd55ee89faf9822e1d885d16580" - integrity sha512-ZIc+Q62revdMcqC6aChtW4jz3My3klmCO1fEmINZY/8J3EpBg5/A/D0AKmBveUh6pgoeycoMkVMko84tuYS+Gg== + version "4.24.3" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.3.tgz#5fc2725ca8fb3c1432e13dac278c7cc103e026d2" + integrity sha512-1CPmv8iobE2fyRMV97dAcMVegvvWKxmq94hkLiAkUGwKVTyDLw33K+ZxiFrREKmmps4rIw6grcCFCnTMSZ/YiA== dependencies: - caniuse-lite "^1.0.30001669" - electron-to-chromium "^1.5.41" - node-releases "^2.0.18" + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" update-browserslist-db "^1.1.1" bs-logger@0.x: @@ -1061,7 +1085,7 @@ buffer@^6.0.3: base64-js "^1.3.1" ieee754 "^1.2.1" -call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1: +call-bind-apply-helpers@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.1.tgz#32e5892e6361b29b0b545ba6f7763378daca2840" integrity sha512-BhYE+WDaywFg2TBWYNXAE+8B1ATnThNBqXHP5nQu0jWJdVvY2hvkpyB3qOmtmDePiS5/BDQ8wASEWGMWRG148g== @@ -1069,23 +1093,13 @@ call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1: es-errors "^1.3.0" function-bind "^1.1.2" -call-bind@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" - integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== - dependencies: - call-bind-apply-helpers "^1.0.0" - es-define-property "^1.0.0" - get-intrinsic "^1.2.4" - set-function-length "^1.2.2" - call-bound@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.2.tgz#9dbd4daf9f5f753bec3e4c8fbb8a2ecc4de6c39b" - integrity sha512-0lk0PHFe/uz0vl527fG9CgdE9WdafjDbCXvBbs+LUv000TVt2Jjhqbs4Jwm8gz070w8xXyEAxrPOMullsxXeGg== + version "1.0.3" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.3.tgz#41cfd032b593e39176a71533ab4f384aa04fd681" + integrity sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA== dependencies: - call-bind "^1.0.8" - get-intrinsic "^1.2.5" + call-bind-apply-helpers "^1.0.1" + get-intrinsic "^1.2.6" callsites@^3.0.0: version "3.1.0" @@ -1102,10 +1116,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001669: - version "1.0.30001688" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001688.tgz#f9d3ede749f083ce0db4c13db9d828adaf2e8d0a" - integrity sha512-Nmqpru91cuABu/DTCXbM2NSRHzM2uVHfPnhJ/1zEAJx/ILBRVmz3pzH4N7DZqbdG0gWClsCC05Oj0mJ/1AWMbA== +caniuse-lite@^1.0.30001688: + version "1.0.30001690" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001690.tgz#f2d15e3aaf8e18f76b2b8c1481abde063b8104c8" + integrity sha512-5ExiE3qQN6oF8Clf8ifIDcMRCRE/dMGcETG/XGMD8/XiXm6HXQgQTh1yZYLXXpSOsEUlJm1Xr7kGULZTuGtP/w== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1258,15 +1272,6 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.1.tgz#44b5f2147cd3b00d4b56137685966f26fd25dd4a" integrity sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A== -define-data-property@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" - integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== - dependencies: - es-define-property "^1.0.0" - es-errors "^1.3.0" - gopd "^1.0.1" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" @@ -1290,18 +1295,18 @@ domexception@^4.0.0: webidl-conversions "^7.0.0" dunder-proto@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.0.tgz#c2fce098b3c8f8899554905f4377b6d85dabaa80" - integrity sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A== + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== dependencies: - call-bind-apply-helpers "^1.0.0" + call-bind-apply-helpers "^1.0.1" es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.5.41: - version "1.5.73" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.73.tgz#f32956ce40947fa3c8606726a96cd8fb5bb5f720" - integrity sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg== +electron-to-chromium@^1.5.73: + version "1.5.76" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.76.tgz#db20295c5061b68f07c8ea4dfcbd701485d94a3d" + integrity sha512-CjVQyG7n7Sr+eBXE86HIulnL5N8xZY1sgmOPGuq/F0Rr0FJq63lg0kEtOIDfZBk44FnDLf6FUJ+dsJcuiUDdDQ== emittery@^0.13.1: version "0.13.1" @@ -1314,9 +1319,9 @@ emoji-regex@^8.0.0: integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.1: - version "5.17.1" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz#67bfbbcc2f81d511be77d686a90267ef7f898a15" - integrity sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg== + version "5.18.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.0.tgz#91eb1db193896b9801251eeff1c6980278b1e404" + integrity sha512-0/r0MySGYG8YqlayBZ6MuCfECmHFdJ5qyPh8s8wa5Hnm6SaFLSK1VYCbj+NKp090Nm1caZhD+QTnmxO7esYGyQ== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1333,7 +1338,7 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" -es-define-property@^1.0.0, es-define-property@^1.0.1: +es-define-property@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== @@ -1452,7 +1457,7 @@ expect@^29.0.0, expect@^29.7.0: jest-message-util "^29.7.0" jest-util "^29.7.0" -fast-deep-equal@^3.1.1: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -1462,6 +1467,11 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.0.0, fast-json-sta resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + fb-watchman@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" @@ -1523,7 +1533,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.4, get-intrinsic@^1.2.5: +get-intrinsic@^1.2.5, get-intrinsic@^1.2.6: version "1.2.6" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.6.tgz#43dd3dd0e7b49b82b2dfcad10dc824bf7fc265d5" integrity sha512-qxsEs+9A+u85HhllWJJFicJfPDhRmjzoYdl64aMWW9yRIJmSyxdn8IEkuIM530/7T+lv0TIHd8L6Q/ra0tEoeA== @@ -1571,7 +1581,7 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== -gopd@^1.0.1, gopd@^1.2.0: +gopd@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== @@ -1586,13 +1596,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" - integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== - dependencies: - es-define-property "^1.0.0" - has-symbols@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" @@ -1682,10 +1685,10 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== -is-core-module@^2.13.0: - version "2.15.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.15.1.tgz#a7363a25bee942fefab0de13bf6aa372c82dcc37" - integrity sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ== +is-core-module@^2.16.0: + version "2.16.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" + integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== dependencies: hasown "^2.0.2" @@ -2218,6 +2221,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json5@^2.2.3: version "2.2.3" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" @@ -2282,9 +2290,9 @@ makeerror@1.0.12: tmpl "1.0.5" math-intrinsics@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.0.0.tgz#4e04bf87c85aa51e90d078dac2252b4eb5260817" - integrity sha512-4MqMiKP90ybymYvsut0CH2g4XWbfLtmlCkXmtmdcDCxNB+mQcu1w/1+L/VD7vi/PSv7X2JYV7SCcR+jiPXnQtA== + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== merge-stream@^2.0.0: version "2.0.0" @@ -2350,7 +2358,7 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.18: +node-releases@^2.0.19: version "2.0.19" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== @@ -2545,9 +2553,9 @@ react-is@^18.0.0: integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== readable-stream@^4.5.2: - version "4.5.2" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.5.2.tgz#9e7fc4c45099baeed934bff6eb97ba6cf2729e09" - integrity sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g== + version "4.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.6.0.tgz#ce412dfb19c04efde1c5936d99c27f37a1ff94c9" + integrity sha512-cbAdYt0VcnpN2Bekq7PU+k363ZRsPwJoEEJOEtSJQlJXzwaxt3FIo/uL+KeDSGIjJqtkwyge4KQgD2S2kd+CQw== dependencies: abort-controller "^3.0.0" buffer "^6.0.3" @@ -2560,6 +2568,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + requires-port@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" @@ -2583,11 +2596,11 @@ resolve.exports@^2.0.0: integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.20.0: - version "1.22.8" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" - integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + version "1.22.10" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39" + integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w== dependencies: - is-core-module "^2.13.0" + is-core-module "^2.16.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2613,7 +2626,7 @@ saxes@^6.0.0: dependencies: xmlchars "^2.2.0" -schema-utils@^3.1.1, schema-utils@^3.2.0: +schema-utils@^3.2.0: version "3.3.0" resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== @@ -2622,6 +2635,16 @@ schema-utils@^3.1.1, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" +schema-utils@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== + dependencies: + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" + semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" @@ -2632,25 +2655,13 @@ semver@^7.3.4, semver@^7.5.3, semver@^7.5.4: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143" integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A== -serialize-javascript@^6.0.1: +serialize-javascript@^6.0.2: version "6.0.2" resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" -set-function-length@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" - integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== - dependencies: - define-data-property "^1.1.4" - es-errors "^1.3.0" - function-bind "^1.1.2" - get-intrinsic "^1.2.4" - gopd "^1.0.1" - has-property-descriptors "^1.0.2" - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -2832,17 +2843,17 @@ tapable@^2.1.1, tapable@^2.2.0: integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== terser-webpack-plugin@^5.3.10: - version "5.3.10" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" - integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== + version "5.3.11" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz#93c21f44ca86634257cac176f884f942b7ba3832" + integrity sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ== dependencies: - "@jridgewell/trace-mapping" "^0.3.20" + "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.1" - terser "^5.26.0" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" -terser@^5.26.0: +terser@^5.31.1: version "5.37.0" resolved "https://registry.yarnpkg.com/terser/-/terser-5.37.0.tgz#38aa66d1cfc43d0638fab54e43ff8a4f72a21ba3" integrity sha512-B8wRRkmre4ERucLM/uXx4MOV5cbnOlVAqUst+1+iLKPI0dOgFO28f84ptoQt9HEI537PMzfYa/d+GEPKTRXmYA==