webflow-api 3.0.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mock/definition/__package__.yml +526 -221
- package/.mock/definition/accessGroups.yml +3 -3
- package/.mock/definition/assets.yml +10 -9
- package/.mock/definition/collections/fields.yml +16 -14
- package/.mock/definition/collections/items.yml +168 -35
- package/.mock/definition/collections.yml +6 -5
- package/.mock/definition/components.yml +486 -0
- package/.mock/definition/ecommerce.yml +2 -2
- package/.mock/definition/forms.yml +7 -6
- package/.mock/definition/inventory.yml +6 -4
- package/.mock/definition/orders.yml +11 -9
- package/.mock/definition/pages/scripts.yml +18 -17
- package/.mock/definition/pages.yml +91 -64
- package/.mock/definition/products.yml +9 -9
- package/.mock/definition/scripts.yml +12 -16
- package/.mock/definition/sites/activityLogs.yml +2 -2
- package/.mock/definition/sites/plans.yml +40 -0
- package/.mock/definition/sites/redirects.yml +190 -0
- package/.mock/definition/sites/scripts.yml +16 -21
- package/.mock/definition/sites.yml +202 -6
- package/.mock/definition/token.yml +5 -4
- package/.mock/definition/users.yml +8 -8
- package/.mock/definition/webhooks.yml +9 -9
- package/.mock/fern.config.json +1 -1
- package/Client.d.ts +3 -0
- package/Client.js +25 -20
- package/api/errors/index.d.ts +1 -1
- package/api/errors/index.js +1 -1
- package/api/resources/accessGroups/client/Client.js +1 -1
- package/api/resources/assets/client/Client.d.ts +5 -0
- package/api/resources/assets/client/Client.js +13 -8
- package/api/resources/collections/client/Client.d.ts +3 -0
- package/api/resources/collections/client/Client.js +7 -4
- package/api/resources/collections/resources/fields/client/Client.js +3 -3
- package/api/resources/collections/resources/fields/types/FieldCreateType.d.ts +11 -10
- package/api/resources/collections/resources/fields/types/FieldCreateType.js +10 -9
- package/api/resources/collections/resources/items/client/Client.d.ts +8 -5
- package/api/resources/collections/resources/items/client/Client.js +26 -21
- package/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +1 -1
- package/api/resources/collections/resources/items/types/MultipleItems.d.ts +2 -2
- package/api/resources/collections/resources/items/types/MultipleLiveItems.d.ts +8 -0
- package/api/resources/collections/resources/items/types/index.d.ts +1 -0
- package/api/resources/collections/resources/items/types/index.js +1 -0
- package/api/resources/components/client/Client.d.ts +176 -0
- package/api/resources/components/client/Client.js +670 -0
- package/api/resources/components/client/index.d.ts +1 -0
- package/api/resources/components/client/index.js +17 -0
- package/api/resources/components/client/requests/ComponentDomWrite.d.ts +34 -0
- package/api/resources/components/client/requests/ComponentPropertiesWrite.d.ts +25 -0
- package/api/resources/components/client/requests/ComponentsGetContentRequest.d.ts +28 -0
- package/api/resources/components/client/requests/ComponentsGetPropertiesRequest.d.ts +23 -0
- package/api/resources/components/client/requests/ComponentsListRequest.d.ts +17 -0
- package/api/resources/components/client/requests/index.d.ts +5 -0
- package/api/resources/components/client/requests/index.js +2 -0
- package/api/resources/components/index.d.ts +2 -0
- package/api/resources/components/index.js +18 -0
- package/api/resources/components/types/ComponentDomWriteNodesItem.d.ts +5 -0
- package/api/resources/components/types/ComponentDomWriteNodesItem.js +5 -0
- package/api/resources/components/types/ComponentPropertiesWritePropertiesItem.d.ts +16 -0
- package/api/resources/components/types/ComponentPropertiesWritePropertiesItem.js +5 -0
- package/api/resources/components/types/ComponentsUpdateContentResponse.d.ts +7 -0
- package/api/resources/components/types/ComponentsUpdateContentResponse.js +5 -0
- package/api/resources/components/types/ComponentsUpdatePropertiesResponse.d.ts +7 -0
- package/api/resources/components/types/ComponentsUpdatePropertiesResponse.js +5 -0
- package/api/resources/components/types/index.d.ts +4 -0
- package/api/resources/components/types/index.js +20 -0
- package/api/resources/ecommerce/client/Client.js +1 -1
- package/api/resources/forms/client/Client.d.ts +3 -0
- package/api/resources/forms/client/Client.js +8 -5
- package/api/resources/index.d.ts +3 -0
- package/api/resources/index.js +4 -1
- package/api/resources/inventory/client/Client.d.ts +3 -1
- package/api/resources/inventory/client/Client.js +5 -3
- package/api/resources/orders/client/Client.d.ts +3 -0
- package/api/resources/orders/client/Client.js +9 -6
- package/api/resources/pages/client/Client.d.ts +26 -10
- package/api/resources/pages/client/Client.js +32 -18
- package/api/resources/pages/client/requests/PageDomWrite.d.ts +34 -0
- package/api/resources/pages/client/requests/PageDomWrite.js +5 -0
- package/api/resources/pages/client/requests/index.d.ts +1 -1
- package/api/resources/pages/resources/scripts/client/Client.d.ts +6 -3
- package/api/resources/pages/resources/scripts/client/Client.js +11 -6
- package/api/resources/pages/types/PageDomWriteNodesItem.d.ts +5 -0
- package/api/resources/pages/types/PageDomWriteNodesItem.js +5 -0
- package/api/resources/pages/types/index.d.ts +1 -1
- package/api/resources/pages/types/index.js +1 -1
- package/api/resources/products/client/Client.d.ts +5 -6
- package/api/resources/products/client/Client.js +11 -12
- package/api/resources/scripts/client/Client.d.ts +3 -3
- package/api/resources/scripts/client/Client.js +6 -6
- package/api/resources/sites/client/Client.d.ts +70 -0
- package/api/resources/sites/client/Client.js +330 -9
- package/api/resources/sites/client/requests/SitesCreateRequest.d.ts +17 -0
- package/api/resources/sites/client/requests/SitesCreateRequest.js +5 -0
- package/api/resources/sites/client/requests/SitesUpdateRequest.d.ts +13 -0
- package/api/resources/sites/client/requests/SitesUpdateRequest.js +5 -0
- package/api/resources/sites/client/requests/index.d.ts +2 -0
- package/api/resources/sites/resources/activityLogs/client/Client.d.ts +1 -1
- package/api/resources/sites/resources/activityLogs/client/Client.js +2 -2
- package/api/resources/sites/resources/index.d.ts +2 -0
- package/api/resources/sites/resources/index.js +3 -1
- package/api/resources/sites/resources/plans/client/Client.d.ts +45 -0
- package/api/resources/sites/resources/plans/client/Client.js +155 -0
- package/api/resources/sites/resources/plans/client/index.d.ts +1 -0
- package/api/resources/sites/resources/plans/client/index.js +2 -0
- package/api/resources/sites/resources/plans/index.d.ts +1 -0
- package/api/resources/sites/resources/plans/index.js +17 -0
- package/api/resources/sites/resources/redirects/client/Client.d.ts +115 -0
- package/api/resources/sites/resources/redirects/client/Client.js +472 -0
- package/api/resources/sites/resources/redirects/client/index.d.ts +1 -0
- package/api/resources/sites/resources/redirects/client/index.js +2 -0
- package/api/resources/sites/resources/redirects/index.d.ts +1 -0
- package/api/resources/sites/resources/redirects/index.js +17 -0
- package/api/resources/sites/resources/scripts/client/Client.d.ts +4 -4
- package/api/resources/sites/resources/scripts/client/Client.js +8 -8
- package/api/resources/token/client/Client.d.ts +2 -1
- package/api/resources/token/client/Client.js +4 -3
- package/api/resources/users/client/Client.d.ts +1 -1
- package/api/resources/users/client/Client.js +6 -6
- package/api/resources/webhooks/client/Client.d.ts +4 -1
- package/api/resources/webhooks/client/Client.js +8 -5
- package/api/types/CollectionItem.d.ts +5 -1
- package/api/types/CollectionItemPostSingle.d.ts +7 -3
- package/api/types/Component.d.ts +18 -0
- package/api/types/Component.js +5 -0
- package/api/types/ComponentDom.d.ts +13 -0
- package/api/types/ComponentDom.js +5 -0
- package/api/types/ComponentInstanceNodePropertyOverridesWrite.d.ts +13 -0
- package/api/types/ComponentInstanceNodePropertyOverridesWrite.js +5 -0
- package/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.d.ts +14 -0
- package/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.js +5 -0
- package/api/types/ComponentList.d.ts +11 -0
- package/api/types/ComponentList.js +5 -0
- package/api/types/ComponentNode.d.ts +15 -0
- package/api/types/ComponentNode.js +5 -0
- package/api/types/ComponentProperties.d.ts +13 -0
- package/api/types/ComponentProperties.js +5 -0
- package/api/types/ComponentProperty.d.ts +17 -0
- package/api/types/ComponentProperty.js +5 -0
- package/api/types/ComponentPropertyType.d.ts +12 -0
- package/api/types/ComponentPropertyType.js +11 -0
- package/api/types/Dom.d.ts +1 -1
- package/api/types/Domain.d.ts +2 -0
- package/api/types/Error_.d.ts +1 -1
- package/api/types/FieldType.d.ts +10 -10
- package/api/types/FieldType.js +9 -9
- package/api/types/ImageNode.d.ts +6 -2
- package/api/types/ImageNodeImage.d.ts +7 -0
- package/api/types/ImageNodeImage.js +5 -0
- package/api/types/Node.d.ts +11 -8
- package/api/types/{ErrorDetailsItem.d.ts → NotEnterprisePlanWorkspace.d.ts} +1 -1
- package/api/types/NotEnterprisePlanWorkspace.js +5 -0
- package/api/types/ProductFieldData.d.ts +1 -1
- package/api/types/Redirect.d.ts +14 -0
- package/api/types/Redirect.js +5 -0
- package/api/types/Redirects.d.ts +12 -0
- package/api/types/Redirects.js +5 -0
- package/api/types/ScriptApply.d.ts +1 -1
- package/api/types/SitePlan.d.ts +12 -0
- package/api/types/SitePlan.js +5 -0
- package/api/types/SitePlanId.d.ts +21 -0
- package/api/types/SitePlanId.js +20 -0
- package/api/types/SitePlanName.d.ts +15 -0
- package/api/types/SitePlanName.js +14 -0
- package/api/types/Text.d.ts +9 -0
- package/api/types/Text.js +5 -0
- package/api/types/TextNode.d.ts +7 -3
- package/api/types/TextNodeText.d.ts +9 -0
- package/api/types/TextNodeText.js +5 -0
- package/api/{resources/pages/types/DomWriteNodesItem.d.ts → types/TextNodeWrite.d.ts} +4 -1
- package/api/types/TextNodeWrite.js +5 -0
- package/api/types/TriggerType.d.ts +15 -15
- package/api/types/UserAccessGroupsItem.d.ts +2 -3
- package/api/types/UserAccessGroupsItemType.d.ts +2 -3
- package/api/types/index.d.ts +23 -6
- package/api/types/index.js +23 -6
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +25 -20
- package/dist/api/errors/index.d.ts +1 -1
- package/dist/api/errors/index.js +1 -1
- package/dist/api/resources/accessGroups/client/Client.js +1 -1
- package/dist/api/resources/assets/client/Client.d.ts +5 -0
- package/dist/api/resources/assets/client/Client.js +13 -8
- package/dist/api/resources/collections/client/Client.d.ts +3 -0
- package/dist/api/resources/collections/client/Client.js +7 -4
- package/dist/api/resources/collections/resources/fields/client/Client.js +3 -3
- package/dist/api/resources/collections/resources/fields/types/FieldCreateType.d.ts +11 -10
- package/dist/api/resources/collections/resources/fields/types/FieldCreateType.js +10 -9
- package/dist/api/resources/collections/resources/items/client/Client.d.ts +8 -5
- package/dist/api/resources/collections/resources/items/client/Client.js +26 -21
- package/dist/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +1 -1
- package/dist/api/resources/collections/resources/items/types/MultipleItems.d.ts +2 -2
- package/dist/api/resources/collections/resources/items/types/MultipleLiveItems.d.ts +8 -0
- package/dist/api/resources/collections/resources/items/types/MultipleLiveItems.js +5 -0
- package/dist/api/resources/collections/resources/items/types/index.d.ts +1 -0
- package/dist/api/resources/collections/resources/items/types/index.js +1 -0
- package/dist/api/resources/components/client/Client.d.ts +176 -0
- package/dist/api/resources/components/client/Client.js +670 -0
- package/dist/api/resources/components/client/index.d.ts +1 -0
- package/dist/api/resources/components/client/index.js +17 -0
- package/dist/api/resources/components/client/requests/ComponentDomWrite.d.ts +34 -0
- package/dist/api/resources/components/client/requests/ComponentDomWrite.js +5 -0
- package/dist/api/resources/components/client/requests/ComponentPropertiesWrite.d.ts +25 -0
- package/dist/api/resources/components/client/requests/ComponentPropertiesWrite.js +5 -0
- package/dist/api/resources/components/client/requests/ComponentsGetContentRequest.d.ts +28 -0
- package/dist/api/resources/components/client/requests/ComponentsGetContentRequest.js +5 -0
- package/dist/api/resources/components/client/requests/ComponentsGetPropertiesRequest.d.ts +23 -0
- package/dist/api/resources/components/client/requests/ComponentsGetPropertiesRequest.js +5 -0
- package/dist/api/resources/components/client/requests/ComponentsListRequest.d.ts +17 -0
- package/dist/api/resources/components/client/requests/ComponentsListRequest.js +5 -0
- package/dist/api/resources/components/client/requests/index.d.ts +5 -0
- package/dist/api/resources/components/client/requests/index.js +2 -0
- package/dist/api/resources/components/index.d.ts +2 -0
- package/dist/api/resources/components/index.js +18 -0
- package/dist/api/resources/components/types/ComponentDomWriteNodesItem.d.ts +5 -0
- package/dist/api/resources/components/types/ComponentDomWriteNodesItem.js +5 -0
- package/dist/api/resources/components/types/ComponentPropertiesWritePropertiesItem.d.ts +16 -0
- package/dist/api/resources/components/types/ComponentPropertiesWritePropertiesItem.js +5 -0
- package/dist/api/resources/components/types/ComponentsUpdateContentResponse.d.ts +7 -0
- package/dist/api/resources/components/types/ComponentsUpdateContentResponse.js +5 -0
- package/dist/api/resources/components/types/ComponentsUpdatePropertiesResponse.d.ts +7 -0
- package/dist/api/resources/components/types/ComponentsUpdatePropertiesResponse.js +5 -0
- package/dist/api/resources/components/types/index.d.ts +4 -0
- package/dist/api/resources/components/types/index.js +20 -0
- package/dist/api/resources/ecommerce/client/Client.js +1 -1
- package/dist/api/resources/forms/client/Client.d.ts +3 -0
- package/dist/api/resources/forms/client/Client.js +8 -5
- package/dist/api/resources/index.d.ts +3 -0
- package/dist/api/resources/index.js +4 -1
- package/dist/api/resources/inventory/client/Client.d.ts +3 -1
- package/dist/api/resources/inventory/client/Client.js +5 -3
- package/dist/api/resources/orders/client/Client.d.ts +3 -0
- package/dist/api/resources/orders/client/Client.js +9 -6
- package/dist/api/resources/pages/client/Client.d.ts +26 -10
- package/dist/api/resources/pages/client/Client.js +32 -18
- package/dist/api/resources/pages/client/requests/PageDomWrite.d.ts +34 -0
- package/dist/api/resources/pages/client/requests/PageDomWrite.js +5 -0
- package/dist/api/resources/pages/client/requests/index.d.ts +1 -1
- package/dist/api/resources/pages/resources/scripts/client/Client.d.ts +6 -3
- package/dist/api/resources/pages/resources/scripts/client/Client.js +11 -6
- package/dist/api/resources/pages/types/PageDomWriteNodesItem.d.ts +5 -0
- package/dist/api/resources/pages/types/PageDomWriteNodesItem.js +5 -0
- package/dist/api/resources/pages/types/index.d.ts +1 -1
- package/dist/api/resources/pages/types/index.js +1 -1
- package/dist/api/resources/products/client/Client.d.ts +5 -6
- package/dist/api/resources/products/client/Client.js +11 -12
- package/dist/api/resources/scripts/client/Client.d.ts +3 -3
- package/dist/api/resources/scripts/client/Client.js +6 -6
- package/dist/api/resources/sites/client/Client.d.ts +70 -0
- package/dist/api/resources/sites/client/Client.js +330 -9
- package/dist/api/resources/sites/client/requests/SitesCreateRequest.d.ts +17 -0
- package/dist/api/resources/sites/client/requests/SitesCreateRequest.js +5 -0
- package/dist/api/resources/sites/client/requests/SitesUpdateRequest.d.ts +13 -0
- package/dist/api/resources/sites/client/requests/SitesUpdateRequest.js +5 -0
- package/dist/api/resources/sites/client/requests/index.d.ts +2 -0
- package/dist/api/resources/sites/resources/activityLogs/client/Client.d.ts +1 -1
- package/dist/api/resources/sites/resources/activityLogs/client/Client.js +2 -2
- package/dist/api/resources/sites/resources/index.d.ts +2 -0
- package/dist/api/resources/sites/resources/index.js +3 -1
- package/dist/api/resources/sites/resources/plans/client/Client.d.ts +45 -0
- package/dist/api/resources/sites/resources/plans/client/Client.js +155 -0
- package/dist/api/resources/sites/resources/plans/client/index.d.ts +1 -0
- package/dist/api/resources/sites/resources/plans/client/index.js +2 -0
- package/dist/api/resources/sites/resources/plans/index.d.ts +1 -0
- package/dist/api/resources/sites/resources/plans/index.js +17 -0
- package/dist/api/resources/sites/resources/redirects/client/Client.d.ts +115 -0
- package/dist/api/resources/sites/resources/redirects/client/Client.js +472 -0
- package/dist/api/resources/sites/resources/redirects/client/index.d.ts +1 -0
- package/dist/api/resources/sites/resources/redirects/client/index.js +2 -0
- package/dist/api/resources/sites/resources/redirects/index.d.ts +1 -0
- package/dist/api/resources/sites/resources/redirects/index.js +17 -0
- package/dist/api/resources/sites/resources/scripts/client/Client.d.ts +4 -4
- package/dist/api/resources/sites/resources/scripts/client/Client.js +8 -8
- package/dist/api/resources/token/client/Client.d.ts +2 -1
- package/dist/api/resources/token/client/Client.js +4 -3
- package/dist/api/resources/users/client/Client.d.ts +1 -1
- package/dist/api/resources/users/client/Client.js +6 -6
- package/dist/api/resources/webhooks/client/Client.d.ts +4 -1
- package/dist/api/resources/webhooks/client/Client.js +8 -5
- package/dist/api/types/CollectionItem.d.ts +5 -1
- package/dist/api/types/CollectionItemPostSingle.d.ts +7 -3
- package/dist/api/types/Component.d.ts +18 -0
- package/dist/api/types/Component.js +5 -0
- package/dist/api/types/ComponentDom.d.ts +13 -0
- package/dist/api/types/ComponentDom.js +5 -0
- package/dist/api/types/ComponentInstanceNodePropertyOverridesWrite.d.ts +13 -0
- package/dist/api/types/ComponentInstanceNodePropertyOverridesWrite.js +5 -0
- package/dist/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.d.ts +14 -0
- package/dist/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.js +5 -0
- package/dist/api/types/ComponentList.d.ts +11 -0
- package/dist/api/types/ComponentList.js +5 -0
- package/dist/api/types/ComponentNode.d.ts +15 -0
- package/dist/api/types/ComponentNode.js +5 -0
- package/dist/api/types/ComponentProperties.d.ts +13 -0
- package/dist/api/types/ComponentProperties.js +5 -0
- package/dist/api/types/ComponentProperty.d.ts +17 -0
- package/dist/api/types/ComponentProperty.js +5 -0
- package/dist/api/types/ComponentPropertyType.d.ts +12 -0
- package/dist/api/types/ComponentPropertyType.js +11 -0
- package/dist/api/types/Dom.d.ts +1 -1
- package/dist/api/types/Domain.d.ts +2 -0
- package/dist/api/types/Error_.d.ts +1 -1
- package/dist/api/types/FieldType.d.ts +10 -10
- package/dist/api/types/FieldType.js +9 -9
- package/dist/api/types/ImageNode.d.ts +6 -2
- package/dist/api/types/ImageNodeImage.d.ts +7 -0
- package/dist/api/types/ImageNodeImage.js +5 -0
- package/dist/api/types/Node.d.ts +11 -8
- package/dist/api/types/{ErrorDetailsItem.d.ts → NotEnterprisePlanWorkspace.d.ts} +1 -1
- package/dist/api/types/NotEnterprisePlanWorkspace.js +5 -0
- package/dist/api/types/ProductFieldData.d.ts +1 -1
- package/dist/api/types/Redirect.d.ts +14 -0
- package/dist/api/types/Redirect.js +5 -0
- package/dist/api/types/Redirects.d.ts +12 -0
- package/dist/api/types/Redirects.js +5 -0
- package/dist/api/types/ScriptApply.d.ts +1 -1
- package/dist/api/types/SitePlan.d.ts +12 -0
- package/dist/api/types/SitePlan.js +5 -0
- package/dist/api/types/SitePlanId.d.ts +21 -0
- package/dist/api/types/SitePlanId.js +20 -0
- package/dist/api/types/SitePlanName.d.ts +15 -0
- package/dist/api/types/SitePlanName.js +14 -0
- package/dist/api/types/Text.d.ts +9 -0
- package/dist/api/types/Text.js +5 -0
- package/dist/api/types/TextNode.d.ts +7 -3
- package/dist/api/types/TextNodeText.d.ts +9 -0
- package/dist/api/types/TextNodeText.js +5 -0
- package/dist/api/{resources/pages/types/DomWriteNodesItem.d.ts → types/TextNodeWrite.d.ts} +4 -1
- package/dist/api/types/TextNodeWrite.js +5 -0
- package/dist/api/types/TriggerType.d.ts +15 -15
- package/dist/api/types/UserAccessGroupsItem.d.ts +2 -3
- package/dist/api/types/UserAccessGroupsItemType.d.ts +2 -3
- package/dist/api/types/index.d.ts +23 -6
- package/dist/api/types/index.js +23 -6
- package/dist/serialization/resources/collections/resources/fields/types/FieldCreateType.d.ts +1 -1
- package/dist/serialization/resources/collections/resources/fields/types/FieldCreateType.js +10 -9
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +2 -2
- package/dist/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +2 -2
- package/dist/serialization/resources/collections/resources/items/types/MultipleItems.d.ts +2 -2
- package/dist/serialization/resources/collections/resources/items/types/MultipleItems.js +2 -2
- package/dist/serialization/resources/collections/resources/items/types/MultipleLiveItems.d.ts +13 -0
- package/dist/serialization/resources/collections/resources/items/types/MultipleLiveItems.js +34 -0
- package/dist/serialization/resources/collections/resources/items/types/index.d.ts +1 -0
- package/dist/serialization/resources/collections/resources/items/types/index.js +1 -0
- package/dist/serialization/resources/components/client/index.d.ts +1 -0
- package/dist/serialization/resources/components/client/index.js +17 -0
- package/dist/serialization/resources/components/client/requests/ComponentDomWrite.d.ts +13 -0
- package/dist/serialization/resources/components/client/requests/ComponentDomWrite.js +34 -0
- package/dist/serialization/resources/components/client/requests/ComponentPropertiesWrite.d.ts +13 -0
- package/dist/serialization/resources/components/client/requests/ComponentPropertiesWrite.js +34 -0
- package/dist/serialization/resources/components/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/components/client/requests/index.js +7 -0
- package/dist/serialization/resources/components/index.d.ts +2 -0
- package/dist/serialization/resources/components/index.js +18 -0
- package/dist/serialization/resources/components/types/ComponentDomWriteNodesItem.d.ts +12 -0
- package/dist/serialization/resources/components/types/ComponentDomWriteNodesItem.js +33 -0
- package/dist/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.d.ts +13 -0
- package/dist/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.js +34 -0
- package/dist/serialization/resources/components/types/ComponentsUpdateContentResponse.d.ts +12 -0
- package/dist/serialization/resources/components/types/ComponentsUpdateContentResponse.js +33 -0
- package/dist/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.d.ts +12 -0
- package/dist/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.js +33 -0
- package/dist/serialization/resources/components/types/index.d.ts +4 -0
- package/dist/serialization/resources/components/types/index.js +20 -0
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +4 -1
- package/dist/serialization/resources/pages/client/requests/PageDomWrite.d.ts +13 -0
- package/dist/serialization/resources/pages/client/requests/PageDomWrite.js +34 -0
- package/dist/serialization/resources/pages/client/requests/index.d.ts +1 -1
- package/dist/serialization/resources/pages/client/requests/index.js +3 -3
- package/dist/serialization/resources/pages/types/PageDomWriteNodesItem.d.ts +12 -0
- package/dist/serialization/resources/pages/types/PageDomWriteNodesItem.js +33 -0
- package/dist/serialization/resources/pages/types/index.d.ts +1 -1
- package/dist/serialization/resources/pages/types/index.js +1 -1
- package/dist/serialization/resources/sites/client/requests/SitesCreateRequest.d.ts +14 -0
- package/dist/serialization/resources/sites/client/requests/SitesCreateRequest.js +35 -0
- package/dist/serialization/resources/sites/client/requests/SitesUpdateRequest.d.ts +13 -0
- package/{serialization/resources/pages/client/requests/DomWrite.js → dist/serialization/resources/sites/client/requests/SitesUpdateRequest.js} +4 -4
- package/dist/serialization/resources/sites/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/sites/client/requests/index.js +5 -1
- package/dist/serialization/types/Component.d.ts +16 -0
- package/dist/serialization/types/Component.js +37 -0
- package/dist/serialization/types/ComponentDom.d.ts +16 -0
- package/dist/serialization/types/ComponentDom.js +37 -0
- package/dist/serialization/types/ComponentInstanceNodePropertyOverridesWrite.d.ts +14 -0
- package/dist/serialization/types/ComponentInstanceNodePropertyOverridesWrite.js +35 -0
- package/dist/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.d.ts +13 -0
- package/dist/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.js +34 -0
- package/dist/serialization/types/ComponentList.d.ts +15 -0
- package/dist/serialization/types/ComponentList.js +36 -0
- package/dist/serialization/types/ComponentNode.d.ts +15 -0
- package/dist/serialization/types/ComponentNode.js +36 -0
- package/dist/serialization/types/ComponentProperties.d.ts +16 -0
- package/dist/serialization/types/ComponentProperties.js +37 -0
- package/dist/serialization/types/ComponentProperty.d.ts +17 -0
- package/dist/serialization/types/ComponentProperty.js +38 -0
- package/dist/serialization/types/ComponentPropertyType.d.ts +10 -0
- package/dist/serialization/types/{ErrorDetailsItem.js → ComponentPropertyType.js} +2 -5
- package/dist/serialization/types/Domain.d.ts +1 -0
- package/dist/serialization/types/Domain.js +1 -0
- package/dist/serialization/types/Error_.d.ts +1 -2
- package/dist/serialization/types/Error_.js +1 -2
- package/dist/serialization/types/FieldType.d.ts +1 -1
- package/dist/serialization/types/FieldType.js +9 -9
- package/dist/serialization/types/ImageNode.d.ts +4 -2
- package/dist/serialization/types/ImageNode.js +4 -2
- package/dist/serialization/types/ImageNodeImage.d.ts +13 -0
- package/{serialization/types/ErrorDetailsItem.js → dist/serialization/types/ImageNodeImage.js} +5 -5
- package/dist/serialization/types/Node.d.ts +11 -8
- package/dist/serialization/types/Node.js +10 -7
- package/dist/serialization/types/NotEnterprisePlanWorkspace.d.ts +10 -0
- package/dist/serialization/types/{NodeType.js → NotEnterprisePlanWorkspace.js} +2 -2
- package/dist/serialization/types/Redirect.d.ts +14 -0
- package/dist/serialization/types/Redirect.js +35 -0
- package/dist/serialization/types/Redirects.d.ts +15 -0
- package/dist/serialization/types/Redirects.js +36 -0
- package/dist/serialization/types/SitePlan.d.ts +16 -0
- package/dist/serialization/types/SitePlan.js +37 -0
- package/dist/serialization/types/SitePlanId.d.ts +10 -0
- package/dist/serialization/types/SitePlanId.js +44 -0
- package/dist/serialization/types/SitePlanName.d.ts +10 -0
- package/dist/serialization/types/SitePlanName.js +38 -0
- package/dist/serialization/types/Text.d.ts +13 -0
- package/dist/serialization/types/Text.js +34 -0
- package/dist/serialization/types/TextNode.d.ts +4 -2
- package/dist/serialization/types/TextNode.js +4 -2
- package/dist/serialization/types/TextNodeText.d.ts +13 -0
- package/dist/serialization/types/TextNodeText.js +34 -0
- package/dist/serialization/types/TextNodeWrite.d.ts +13 -0
- package/{serialization/resources/pages/types/DomWriteNodesItem.js → dist/serialization/types/TextNodeWrite.js} +3 -3
- package/dist/serialization/types/index.d.ts +23 -6
- package/dist/serialization/types/index.js +23 -6
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +1844 -778
- package/serialization/resources/collections/resources/fields/types/FieldCreateType.d.ts +1 -1
- package/serialization/resources/collections/resources/fields/types/FieldCreateType.js +10 -9
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.d.ts +2 -2
- package/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequest.js +2 -2
- package/serialization/resources/collections/resources/items/types/MultipleItems.d.ts +2 -2
- package/serialization/resources/collections/resources/items/types/MultipleItems.js +2 -2
- package/serialization/resources/collections/resources/items/types/MultipleLiveItems.d.ts +13 -0
- package/serialization/resources/collections/resources/items/types/MultipleLiveItems.js +34 -0
- package/serialization/resources/collections/resources/items/types/index.d.ts +1 -0
- package/serialization/resources/collections/resources/items/types/index.js +1 -0
- package/serialization/resources/components/client/index.d.ts +1 -0
- package/serialization/resources/components/client/index.js +17 -0
- package/serialization/resources/components/client/requests/ComponentDomWrite.d.ts +13 -0
- package/serialization/resources/components/client/requests/ComponentDomWrite.js +34 -0
- package/serialization/resources/components/client/requests/ComponentPropertiesWrite.d.ts +13 -0
- package/serialization/resources/components/client/requests/ComponentPropertiesWrite.js +34 -0
- package/serialization/resources/components/client/requests/index.d.ts +2 -0
- package/serialization/resources/components/client/requests/index.js +7 -0
- package/serialization/resources/components/index.d.ts +2 -0
- package/serialization/resources/components/index.js +18 -0
- package/serialization/resources/components/types/ComponentDomWriteNodesItem.d.ts +12 -0
- package/serialization/resources/components/types/ComponentDomWriteNodesItem.js +33 -0
- package/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.d.ts +13 -0
- package/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.js +34 -0
- package/serialization/resources/components/types/ComponentsUpdateContentResponse.d.ts +12 -0
- package/serialization/resources/components/types/ComponentsUpdateContentResponse.js +33 -0
- package/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.d.ts +12 -0
- package/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.js +33 -0
- package/serialization/resources/components/types/index.d.ts +4 -0
- package/serialization/resources/components/types/index.js +20 -0
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +4 -1
- package/serialization/resources/pages/client/requests/PageDomWrite.d.ts +13 -0
- package/serialization/resources/pages/client/requests/PageDomWrite.js +34 -0
- package/serialization/resources/pages/client/requests/index.d.ts +1 -1
- package/serialization/resources/pages/client/requests/index.js +3 -3
- package/serialization/resources/pages/types/PageDomWriteNodesItem.d.ts +12 -0
- package/serialization/resources/pages/types/PageDomWriteNodesItem.js +33 -0
- package/serialization/resources/pages/types/index.d.ts +1 -1
- package/serialization/resources/pages/types/index.js +1 -1
- package/serialization/resources/sites/client/requests/SitesCreateRequest.d.ts +14 -0
- package/serialization/resources/sites/client/requests/SitesCreateRequest.js +35 -0
- package/serialization/resources/sites/client/requests/SitesUpdateRequest.d.ts +13 -0
- package/{dist/serialization/resources/pages/client/requests/DomWrite.js → serialization/resources/sites/client/requests/SitesUpdateRequest.js} +4 -4
- package/serialization/resources/sites/client/requests/index.d.ts +2 -0
- package/serialization/resources/sites/client/requests/index.js +5 -1
- package/serialization/types/Component.d.ts +16 -0
- package/serialization/types/Component.js +37 -0
- package/serialization/types/ComponentDom.d.ts +16 -0
- package/serialization/types/ComponentDom.js +37 -0
- package/serialization/types/ComponentInstanceNodePropertyOverridesWrite.d.ts +14 -0
- package/serialization/types/ComponentInstanceNodePropertyOverridesWrite.js +35 -0
- package/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.d.ts +13 -0
- package/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.js +34 -0
- package/serialization/types/ComponentList.d.ts +15 -0
- package/serialization/types/ComponentList.js +36 -0
- package/serialization/types/ComponentNode.d.ts +15 -0
- package/serialization/types/ComponentNode.js +36 -0
- package/serialization/types/ComponentProperties.d.ts +16 -0
- package/serialization/types/ComponentProperties.js +37 -0
- package/serialization/types/ComponentProperty.d.ts +17 -0
- package/serialization/types/ComponentProperty.js +38 -0
- package/serialization/types/ComponentPropertyType.d.ts +10 -0
- package/serialization/types/ComponentPropertyType.js +31 -0
- package/serialization/types/Domain.d.ts +1 -0
- package/serialization/types/Domain.js +1 -0
- package/serialization/types/Error_.d.ts +1 -2
- package/serialization/types/Error_.js +1 -2
- package/serialization/types/FieldType.d.ts +1 -1
- package/serialization/types/FieldType.js +9 -9
- package/serialization/types/ImageNode.d.ts +4 -2
- package/serialization/types/ImageNode.js +4 -2
- package/serialization/types/ImageNodeImage.d.ts +13 -0
- package/serialization/types/ImageNodeImage.js +34 -0
- package/serialization/types/Node.d.ts +11 -8
- package/serialization/types/Node.js +10 -7
- package/serialization/types/NotEnterprisePlanWorkspace.d.ts +10 -0
- package/serialization/types/{NodeType.js → NotEnterprisePlanWorkspace.js} +2 -2
- package/serialization/types/Redirect.d.ts +14 -0
- package/serialization/types/Redirect.js +35 -0
- package/serialization/types/Redirects.d.ts +15 -0
- package/serialization/types/Redirects.js +36 -0
- package/serialization/types/SitePlan.d.ts +16 -0
- package/serialization/types/SitePlan.js +37 -0
- package/serialization/types/SitePlanId.d.ts +10 -0
- package/serialization/types/SitePlanId.js +44 -0
- package/serialization/types/SitePlanName.d.ts +10 -0
- package/serialization/types/SitePlanName.js +38 -0
- package/serialization/types/Text.d.ts +13 -0
- package/serialization/types/Text.js +34 -0
- package/serialization/types/TextNode.d.ts +4 -2
- package/serialization/types/TextNode.js +4 -2
- package/serialization/types/TextNodeText.d.ts +13 -0
- package/serialization/types/TextNodeText.js +34 -0
- package/serialization/types/TextNodeWrite.d.ts +13 -0
- package/{dist/serialization/resources/pages/types/DomWriteNodesItem.js → serialization/types/TextNodeWrite.js} +3 -3
- package/serialization/types/index.d.ts +23 -6
- package/serialization/types/index.js +23 -6
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/pages/client/requests/DomWrite.d.ts +0 -27
- package/api/types/NodeType.d.ts +0 -8
- package/api/types/NodeType.js +0 -10
- package/dist/api/resources/pages/client/requests/DomWrite.d.ts +0 -27
- package/dist/api/types/NodeType.d.ts +0 -8
- package/dist/api/types/NodeType.js +0 -10
- package/dist/serialization/resources/pages/client/requests/DomWrite.d.ts +0 -13
- package/dist/serialization/resources/pages/types/DomWriteNodesItem.d.ts +0 -13
- package/dist/serialization/types/ErrorDetailsItem.d.ts +0 -10
- package/dist/serialization/types/NodeType.d.ts +0 -10
- package/serialization/resources/pages/client/requests/DomWrite.d.ts +0 -13
- package/serialization/resources/pages/types/DomWriteNodesItem.d.ts +0 -13
- package/serialization/types/ErrorDetailsItem.d.ts +0 -10
- package/serialization/types/NodeType.d.ts +0 -10
- /package/api/resources/{pages/client/requests/DomWrite.js → collections/resources/items/types/MultipleLiveItems.js} +0 -0
- /package/api/resources/{pages/types/DomWriteNodesItem.js → components/client/requests/ComponentDomWrite.js} +0 -0
- /package/api/{types/ErrorDetailsItem.js → resources/components/client/requests/ComponentPropertiesWrite.js} +0 -0
- /package/{dist/api/resources/pages/client/requests/DomWrite.js → api/resources/components/client/requests/ComponentsGetContentRequest.js} +0 -0
- /package/{dist/api/resources/pages/types/DomWriteNodesItem.js → api/resources/components/client/requests/ComponentsGetPropertiesRequest.js} +0 -0
- /package/{dist/api/types/ErrorDetailsItem.js → api/resources/components/client/requests/ComponentsListRequest.js} +0 -0
|
@@ -0,0 +1,670 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
38
|
+
var t = {};
|
|
39
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
40
|
+
t[p] = s[p];
|
|
41
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
42
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
43
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
44
|
+
t[p[i]] = s[p[i]];
|
|
45
|
+
}
|
|
46
|
+
return t;
|
|
47
|
+
};
|
|
48
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
49
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
50
|
+
};
|
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
+
exports.Components = void 0;
|
|
53
|
+
const environments = __importStar(require("../../../../environments"));
|
|
54
|
+
const core = __importStar(require("../../../../core"));
|
|
55
|
+
const Webflow = __importStar(require("../../../index"));
|
|
56
|
+
const url_join_1 = __importDefault(require("url-join"));
|
|
57
|
+
const serializers = __importStar(require("../../../../serialization/index"));
|
|
58
|
+
const errors = __importStar(require("../../../../errors/index"));
|
|
59
|
+
class Components {
|
|
60
|
+
constructor(_options) {
|
|
61
|
+
this._options = _options;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* List of all components for a site.
|
|
65
|
+
*
|
|
66
|
+
* Required scope | `components:read`
|
|
67
|
+
*
|
|
68
|
+
* @param {string} siteId - Unique identifier for a Site
|
|
69
|
+
* @param {Webflow.ComponentsListRequest} request
|
|
70
|
+
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
|
|
71
|
+
*
|
|
72
|
+
* @throws {@link Webflow.BadRequestError}
|
|
73
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
74
|
+
* @throws {@link Webflow.NotFoundError}
|
|
75
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
76
|
+
* @throws {@link Webflow.InternalServerError}
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* await client.components.list("580e63e98c9a982ac9b8b741")
|
|
80
|
+
*/
|
|
81
|
+
list(siteId, request = {}, requestOptions) {
|
|
82
|
+
var _a;
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
const { limit, offset } = request;
|
|
85
|
+
const _queryParams = {};
|
|
86
|
+
if (limit != null) {
|
|
87
|
+
_queryParams["limit"] = limit.toString();
|
|
88
|
+
}
|
|
89
|
+
if (offset != null) {
|
|
90
|
+
_queryParams["offset"] = offset.toString();
|
|
91
|
+
}
|
|
92
|
+
const _response = yield core.fetcher({
|
|
93
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/components`),
|
|
94
|
+
method: "GET",
|
|
95
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.1.0", "User-Agent": "webflow-api/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
96
|
+
contentType: "application/json",
|
|
97
|
+
queryParameters: _queryParams,
|
|
98
|
+
requestType: "json",
|
|
99
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
100
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
101
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
102
|
+
});
|
|
103
|
+
if (_response.ok) {
|
|
104
|
+
return serializers.ComponentList.parseOrThrow(_response.body, {
|
|
105
|
+
unrecognizedObjectKeys: "passthrough",
|
|
106
|
+
allowUnrecognizedUnionMembers: true,
|
|
107
|
+
allowUnrecognizedEnumValues: true,
|
|
108
|
+
skipValidation: true,
|
|
109
|
+
breadcrumbsPrefix: ["response"],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (_response.error.reason === "status-code") {
|
|
113
|
+
switch (_response.error.statusCode) {
|
|
114
|
+
case 400:
|
|
115
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
116
|
+
case 401:
|
|
117
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
118
|
+
unrecognizedObjectKeys: "passthrough",
|
|
119
|
+
allowUnrecognizedUnionMembers: true,
|
|
120
|
+
allowUnrecognizedEnumValues: true,
|
|
121
|
+
skipValidation: true,
|
|
122
|
+
breadcrumbsPrefix: ["response"],
|
|
123
|
+
}));
|
|
124
|
+
case 404:
|
|
125
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
126
|
+
unrecognizedObjectKeys: "passthrough",
|
|
127
|
+
allowUnrecognizedUnionMembers: true,
|
|
128
|
+
allowUnrecognizedEnumValues: true,
|
|
129
|
+
skipValidation: true,
|
|
130
|
+
breadcrumbsPrefix: ["response"],
|
|
131
|
+
}));
|
|
132
|
+
case 429:
|
|
133
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
134
|
+
unrecognizedObjectKeys: "passthrough",
|
|
135
|
+
allowUnrecognizedUnionMembers: true,
|
|
136
|
+
allowUnrecognizedEnumValues: true,
|
|
137
|
+
skipValidation: true,
|
|
138
|
+
breadcrumbsPrefix: ["response"],
|
|
139
|
+
}));
|
|
140
|
+
case 500:
|
|
141
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
142
|
+
unrecognizedObjectKeys: "passthrough",
|
|
143
|
+
allowUnrecognizedUnionMembers: true,
|
|
144
|
+
allowUnrecognizedEnumValues: true,
|
|
145
|
+
skipValidation: true,
|
|
146
|
+
breadcrumbsPrefix: ["response"],
|
|
147
|
+
}));
|
|
148
|
+
default:
|
|
149
|
+
throw new errors.WebflowError({
|
|
150
|
+
statusCode: _response.error.statusCode,
|
|
151
|
+
body: _response.error.body,
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
switch (_response.error.reason) {
|
|
156
|
+
case "non-json":
|
|
157
|
+
throw new errors.WebflowError({
|
|
158
|
+
statusCode: _response.error.statusCode,
|
|
159
|
+
body: _response.error.rawBody,
|
|
160
|
+
});
|
|
161
|
+
case "timeout":
|
|
162
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/components.");
|
|
163
|
+
case "unknown":
|
|
164
|
+
throw new errors.WebflowError({
|
|
165
|
+
message: _response.error.errorMessage,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Get static content from a component definition. This includes text nodes, image nodes and nested component instances.
|
|
172
|
+
* To retrieve dynamic content set by component properties, use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint.
|
|
173
|
+
*
|
|
174
|
+
* <Note>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.</Note>
|
|
175
|
+
*
|
|
176
|
+
* Required scope | `components:read`
|
|
177
|
+
*
|
|
178
|
+
* @param {string} siteId - Unique identifier for a Site
|
|
179
|
+
* @param {string} componentId - Unique identifier for a Component
|
|
180
|
+
* @param {Webflow.ComponentsGetContentRequest} request
|
|
181
|
+
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
|
|
182
|
+
*
|
|
183
|
+
* @throws {@link Webflow.BadRequestError}
|
|
184
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
185
|
+
* @throws {@link Webflow.NotFoundError}
|
|
186
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
187
|
+
* @throws {@link Webflow.InternalServerError}
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", {
|
|
191
|
+
* localeId: "65427cf400e02b306eaa04a0"
|
|
192
|
+
* })
|
|
193
|
+
*/
|
|
194
|
+
getContent(siteId, componentId, request = {}, requestOptions) {
|
|
195
|
+
var _a;
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
const { localeId, limit, offset } = request;
|
|
198
|
+
const _queryParams = {};
|
|
199
|
+
if (localeId != null) {
|
|
200
|
+
_queryParams["localeId"] = localeId;
|
|
201
|
+
}
|
|
202
|
+
if (limit != null) {
|
|
203
|
+
_queryParams["limit"] = limit.toString();
|
|
204
|
+
}
|
|
205
|
+
if (offset != null) {
|
|
206
|
+
_queryParams["offset"] = offset.toString();
|
|
207
|
+
}
|
|
208
|
+
const _response = yield core.fetcher({
|
|
209
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`),
|
|
210
|
+
method: "GET",
|
|
211
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.1.0", "User-Agent": "webflow-api/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
212
|
+
contentType: "application/json",
|
|
213
|
+
queryParameters: _queryParams,
|
|
214
|
+
requestType: "json",
|
|
215
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
216
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
217
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
218
|
+
});
|
|
219
|
+
if (_response.ok) {
|
|
220
|
+
return serializers.ComponentDom.parseOrThrow(_response.body, {
|
|
221
|
+
unrecognizedObjectKeys: "passthrough",
|
|
222
|
+
allowUnrecognizedUnionMembers: true,
|
|
223
|
+
allowUnrecognizedEnumValues: true,
|
|
224
|
+
skipValidation: true,
|
|
225
|
+
breadcrumbsPrefix: ["response"],
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
if (_response.error.reason === "status-code") {
|
|
229
|
+
switch (_response.error.statusCode) {
|
|
230
|
+
case 400:
|
|
231
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
232
|
+
case 401:
|
|
233
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
234
|
+
unrecognizedObjectKeys: "passthrough",
|
|
235
|
+
allowUnrecognizedUnionMembers: true,
|
|
236
|
+
allowUnrecognizedEnumValues: true,
|
|
237
|
+
skipValidation: true,
|
|
238
|
+
breadcrumbsPrefix: ["response"],
|
|
239
|
+
}));
|
|
240
|
+
case 404:
|
|
241
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
242
|
+
unrecognizedObjectKeys: "passthrough",
|
|
243
|
+
allowUnrecognizedUnionMembers: true,
|
|
244
|
+
allowUnrecognizedEnumValues: true,
|
|
245
|
+
skipValidation: true,
|
|
246
|
+
breadcrumbsPrefix: ["response"],
|
|
247
|
+
}));
|
|
248
|
+
case 429:
|
|
249
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
250
|
+
unrecognizedObjectKeys: "passthrough",
|
|
251
|
+
allowUnrecognizedUnionMembers: true,
|
|
252
|
+
allowUnrecognizedEnumValues: true,
|
|
253
|
+
skipValidation: true,
|
|
254
|
+
breadcrumbsPrefix: ["response"],
|
|
255
|
+
}));
|
|
256
|
+
case 500:
|
|
257
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
258
|
+
unrecognizedObjectKeys: "passthrough",
|
|
259
|
+
allowUnrecognizedUnionMembers: true,
|
|
260
|
+
allowUnrecognizedEnumValues: true,
|
|
261
|
+
skipValidation: true,
|
|
262
|
+
breadcrumbsPrefix: ["response"],
|
|
263
|
+
}));
|
|
264
|
+
default:
|
|
265
|
+
throw new errors.WebflowError({
|
|
266
|
+
statusCode: _response.error.statusCode,
|
|
267
|
+
body: _response.error.body,
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
switch (_response.error.reason) {
|
|
272
|
+
case "non-json":
|
|
273
|
+
throw new errors.WebflowError({
|
|
274
|
+
statusCode: _response.error.statusCode,
|
|
275
|
+
body: _response.error.rawBody,
|
|
276
|
+
});
|
|
277
|
+
case "timeout":
|
|
278
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/components/{component_id}/dom.");
|
|
279
|
+
case "unknown":
|
|
280
|
+
throw new errors.WebflowError({
|
|
281
|
+
message: _response.error.errorMessage,
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* This endpoint updates content within a component defintion for **secondary locales**. It supports updating up to 1000 nodes in a single request.
|
|
288
|
+
*
|
|
289
|
+
* Before making updates:
|
|
290
|
+
* 1. Use the [get component content](/data/reference/pages-and-components/components/get-content) endpoint to identify available content nodes and their types
|
|
291
|
+
* 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
|
|
292
|
+
*
|
|
293
|
+
* <Note>
|
|
294
|
+
* 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.
|
|
295
|
+
* </Note>
|
|
296
|
+
*
|
|
297
|
+
* Required scope | `components:write`
|
|
298
|
+
*
|
|
299
|
+
* @param {string} siteId - Unique identifier for a Site
|
|
300
|
+
* @param {string} componentId - Unique identifier for a Component
|
|
301
|
+
* @param {Webflow.ComponentDomWrite} request
|
|
302
|
+
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
|
|
303
|
+
*
|
|
304
|
+
* @throws {@link Webflow.BadRequestError}
|
|
305
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
306
|
+
* @throws {@link Webflow.ForbiddenError}
|
|
307
|
+
* @throws {@link Webflow.NotFoundError}
|
|
308
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
309
|
+
* @throws {@link Webflow.InternalServerError}
|
|
310
|
+
*
|
|
311
|
+
* @example
|
|
312
|
+
* await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", {
|
|
313
|
+
* localeId: "65427cf400e02b306eaa04a0",
|
|
314
|
+
* nodes: [{
|
|
315
|
+
* nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623",
|
|
316
|
+
* text: "<h1>The Hitchhiker's Guide to the Galaxy</h1>"
|
|
317
|
+
* }, {
|
|
318
|
+
* nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad627",
|
|
319
|
+
* text: "<div><h3>Don't Panic!</h3><p>Always know where your towel is.</p></div>"
|
|
320
|
+
* }, {
|
|
321
|
+
* nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad629",
|
|
322
|
+
* propertyOverrides: [{
|
|
323
|
+
* propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0",
|
|
324
|
+
* text: "<div><h1>Time is an <em>illusion</em></h1></div>"
|
|
325
|
+
* }, {
|
|
326
|
+
* propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1",
|
|
327
|
+
* text: "Life, the Universe and Everything"
|
|
328
|
+
* }]
|
|
329
|
+
* }]
|
|
330
|
+
* })
|
|
331
|
+
*/
|
|
332
|
+
updateContent(siteId, componentId, request, requestOptions) {
|
|
333
|
+
var _a;
|
|
334
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
335
|
+
const { localeId } = request, _body = __rest(request, ["localeId"]);
|
|
336
|
+
const _queryParams = {};
|
|
337
|
+
if (localeId != null) {
|
|
338
|
+
_queryParams["localeId"] = localeId;
|
|
339
|
+
}
|
|
340
|
+
const _response = yield core.fetcher({
|
|
341
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`),
|
|
342
|
+
method: "POST",
|
|
343
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.1.0", "User-Agent": "webflow-api/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
344
|
+
contentType: "application/json",
|
|
345
|
+
queryParameters: _queryParams,
|
|
346
|
+
requestType: "json",
|
|
347
|
+
body: serializers.ComponentDomWrite.jsonOrThrow(_body, {
|
|
348
|
+
unrecognizedObjectKeys: "passthrough",
|
|
349
|
+
allowUnrecognizedUnionMembers: true,
|
|
350
|
+
allowUnrecognizedEnumValues: true,
|
|
351
|
+
}),
|
|
352
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
353
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
354
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
355
|
+
});
|
|
356
|
+
if (_response.ok) {
|
|
357
|
+
return serializers.ComponentsUpdateContentResponse.parseOrThrow(_response.body, {
|
|
358
|
+
unrecognizedObjectKeys: "passthrough",
|
|
359
|
+
allowUnrecognizedUnionMembers: true,
|
|
360
|
+
allowUnrecognizedEnumValues: true,
|
|
361
|
+
skipValidation: true,
|
|
362
|
+
breadcrumbsPrefix: ["response"],
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
if (_response.error.reason === "status-code") {
|
|
366
|
+
switch (_response.error.statusCode) {
|
|
367
|
+
case 400:
|
|
368
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
369
|
+
case 401:
|
|
370
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
371
|
+
unrecognizedObjectKeys: "passthrough",
|
|
372
|
+
allowUnrecognizedUnionMembers: true,
|
|
373
|
+
allowUnrecognizedEnumValues: true,
|
|
374
|
+
skipValidation: true,
|
|
375
|
+
breadcrumbsPrefix: ["response"],
|
|
376
|
+
}));
|
|
377
|
+
case 403:
|
|
378
|
+
throw new Webflow.ForbiddenError(_response.error.body);
|
|
379
|
+
case 404:
|
|
380
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
381
|
+
unrecognizedObjectKeys: "passthrough",
|
|
382
|
+
allowUnrecognizedUnionMembers: true,
|
|
383
|
+
allowUnrecognizedEnumValues: true,
|
|
384
|
+
skipValidation: true,
|
|
385
|
+
breadcrumbsPrefix: ["response"],
|
|
386
|
+
}));
|
|
387
|
+
case 429:
|
|
388
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
389
|
+
unrecognizedObjectKeys: "passthrough",
|
|
390
|
+
allowUnrecognizedUnionMembers: true,
|
|
391
|
+
allowUnrecognizedEnumValues: true,
|
|
392
|
+
skipValidation: true,
|
|
393
|
+
breadcrumbsPrefix: ["response"],
|
|
394
|
+
}));
|
|
395
|
+
case 500:
|
|
396
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
397
|
+
unrecognizedObjectKeys: "passthrough",
|
|
398
|
+
allowUnrecognizedUnionMembers: true,
|
|
399
|
+
allowUnrecognizedEnumValues: true,
|
|
400
|
+
skipValidation: true,
|
|
401
|
+
breadcrumbsPrefix: ["response"],
|
|
402
|
+
}));
|
|
403
|
+
default:
|
|
404
|
+
throw new errors.WebflowError({
|
|
405
|
+
statusCode: _response.error.statusCode,
|
|
406
|
+
body: _response.error.body,
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
switch (_response.error.reason) {
|
|
411
|
+
case "non-json":
|
|
412
|
+
throw new errors.WebflowError({
|
|
413
|
+
statusCode: _response.error.statusCode,
|
|
414
|
+
body: _response.error.rawBody,
|
|
415
|
+
});
|
|
416
|
+
case "timeout":
|
|
417
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/components/{component_id}/dom.");
|
|
418
|
+
case "unknown":
|
|
419
|
+
throw new errors.WebflowError({
|
|
420
|
+
message: _response.error.errorMessage,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Get the property default values of a component definition.
|
|
427
|
+
*
|
|
428
|
+
* <Note>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.</Note>
|
|
429
|
+
*
|
|
430
|
+
* Required scope | `components:read`
|
|
431
|
+
*
|
|
432
|
+
* @param {string} siteId - Unique identifier for a Site
|
|
433
|
+
* @param {string} componentId - Unique identifier for a Component
|
|
434
|
+
* @param {Webflow.ComponentsGetPropertiesRequest} request
|
|
435
|
+
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
|
|
436
|
+
*
|
|
437
|
+
* @throws {@link Webflow.BadRequestError}
|
|
438
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
439
|
+
* @throws {@link Webflow.NotFoundError}
|
|
440
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
441
|
+
* @throws {@link Webflow.InternalServerError}
|
|
442
|
+
*
|
|
443
|
+
* @example
|
|
444
|
+
* await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", {
|
|
445
|
+
* localeId: "65427cf400e02b306eaa04a0"
|
|
446
|
+
* })
|
|
447
|
+
*/
|
|
448
|
+
getProperties(siteId, componentId, request = {}, requestOptions) {
|
|
449
|
+
var _a;
|
|
450
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
451
|
+
const { localeId, limit, offset } = request;
|
|
452
|
+
const _queryParams = {};
|
|
453
|
+
if (localeId != null) {
|
|
454
|
+
_queryParams["localeId"] = localeId;
|
|
455
|
+
}
|
|
456
|
+
if (limit != null) {
|
|
457
|
+
_queryParams["limit"] = limit.toString();
|
|
458
|
+
}
|
|
459
|
+
if (offset != null) {
|
|
460
|
+
_queryParams["offset"] = offset.toString();
|
|
461
|
+
}
|
|
462
|
+
const _response = yield core.fetcher({
|
|
463
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`),
|
|
464
|
+
method: "GET",
|
|
465
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.1.0", "User-Agent": "webflow-api/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
466
|
+
contentType: "application/json",
|
|
467
|
+
queryParameters: _queryParams,
|
|
468
|
+
requestType: "json",
|
|
469
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
470
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
471
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
472
|
+
});
|
|
473
|
+
if (_response.ok) {
|
|
474
|
+
return serializers.ComponentProperties.parseOrThrow(_response.body, {
|
|
475
|
+
unrecognizedObjectKeys: "passthrough",
|
|
476
|
+
allowUnrecognizedUnionMembers: true,
|
|
477
|
+
allowUnrecognizedEnumValues: true,
|
|
478
|
+
skipValidation: true,
|
|
479
|
+
breadcrumbsPrefix: ["response"],
|
|
480
|
+
});
|
|
481
|
+
}
|
|
482
|
+
if (_response.error.reason === "status-code") {
|
|
483
|
+
switch (_response.error.statusCode) {
|
|
484
|
+
case 400:
|
|
485
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
486
|
+
case 401:
|
|
487
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
488
|
+
unrecognizedObjectKeys: "passthrough",
|
|
489
|
+
allowUnrecognizedUnionMembers: true,
|
|
490
|
+
allowUnrecognizedEnumValues: true,
|
|
491
|
+
skipValidation: true,
|
|
492
|
+
breadcrumbsPrefix: ["response"],
|
|
493
|
+
}));
|
|
494
|
+
case 404:
|
|
495
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
496
|
+
unrecognizedObjectKeys: "passthrough",
|
|
497
|
+
allowUnrecognizedUnionMembers: true,
|
|
498
|
+
allowUnrecognizedEnumValues: true,
|
|
499
|
+
skipValidation: true,
|
|
500
|
+
breadcrumbsPrefix: ["response"],
|
|
501
|
+
}));
|
|
502
|
+
case 429:
|
|
503
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
504
|
+
unrecognizedObjectKeys: "passthrough",
|
|
505
|
+
allowUnrecognizedUnionMembers: true,
|
|
506
|
+
allowUnrecognizedEnumValues: true,
|
|
507
|
+
skipValidation: true,
|
|
508
|
+
breadcrumbsPrefix: ["response"],
|
|
509
|
+
}));
|
|
510
|
+
case 500:
|
|
511
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
512
|
+
unrecognizedObjectKeys: "passthrough",
|
|
513
|
+
allowUnrecognizedUnionMembers: true,
|
|
514
|
+
allowUnrecognizedEnumValues: true,
|
|
515
|
+
skipValidation: true,
|
|
516
|
+
breadcrumbsPrefix: ["response"],
|
|
517
|
+
}));
|
|
518
|
+
default:
|
|
519
|
+
throw new errors.WebflowError({
|
|
520
|
+
statusCode: _response.error.statusCode,
|
|
521
|
+
body: _response.error.body,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
switch (_response.error.reason) {
|
|
526
|
+
case "non-json":
|
|
527
|
+
throw new errors.WebflowError({
|
|
528
|
+
statusCode: _response.error.statusCode,
|
|
529
|
+
body: _response.error.rawBody,
|
|
530
|
+
});
|
|
531
|
+
case "timeout":
|
|
532
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/components/{component_id}/properties.");
|
|
533
|
+
case "unknown":
|
|
534
|
+
throw new errors.WebflowError({
|
|
535
|
+
message: _response.error.errorMessage,
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
});
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Update the property default values of a component definition in a specificed locale.
|
|
542
|
+
*
|
|
543
|
+
* Before making updates:
|
|
544
|
+
* 1. Use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify available properties
|
|
545
|
+
*
|
|
546
|
+
* <Note>The request requires a secondary locale ID. If a locale is missing, the request will not be processed and will result in an error.</Note>
|
|
547
|
+
*
|
|
548
|
+
* Required scope | `components:write`
|
|
549
|
+
*
|
|
550
|
+
* @param {string} siteId - Unique identifier for a Site
|
|
551
|
+
* @param {string} componentId - Unique identifier for a Component
|
|
552
|
+
* @param {Webflow.ComponentPropertiesWrite} request
|
|
553
|
+
* @param {Components.RequestOptions} requestOptions - Request-specific configuration.
|
|
554
|
+
*
|
|
555
|
+
* @throws {@link Webflow.BadRequestError}
|
|
556
|
+
* @throws {@link Webflow.UnauthorizedError}
|
|
557
|
+
* @throws {@link Webflow.NotFoundError}
|
|
558
|
+
* @throws {@link Webflow.TooManyRequestsError}
|
|
559
|
+
* @throws {@link Webflow.InternalServerError}
|
|
560
|
+
*
|
|
561
|
+
* @example
|
|
562
|
+
* await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", {
|
|
563
|
+
* localeId: "65427cf400e02b306eaa04a0",
|
|
564
|
+
* properties: [{
|
|
565
|
+
* propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad623",
|
|
566
|
+
* text: "The Hitchhiker\u2019s Guide to the Galaxy"
|
|
567
|
+
* }, {
|
|
568
|
+
* propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad627",
|
|
569
|
+
* text: "<div><h3>Dont Panic!</h3><p>Always know where your towel is.</p></div>"
|
|
570
|
+
* }]
|
|
571
|
+
* })
|
|
572
|
+
*/
|
|
573
|
+
updateProperties(siteId, componentId, request, requestOptions) {
|
|
574
|
+
var _a;
|
|
575
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
576
|
+
const { localeId } = request, _body = __rest(request, ["localeId"]);
|
|
577
|
+
const _queryParams = {};
|
|
578
|
+
if (localeId != null) {
|
|
579
|
+
_queryParams["localeId"] = localeId;
|
|
580
|
+
}
|
|
581
|
+
const _response = yield core.fetcher({
|
|
582
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`),
|
|
583
|
+
method: "POST",
|
|
584
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.1.0", "User-Agent": "webflow-api/3.1.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
585
|
+
contentType: "application/json",
|
|
586
|
+
queryParameters: _queryParams,
|
|
587
|
+
requestType: "json",
|
|
588
|
+
body: serializers.ComponentPropertiesWrite.jsonOrThrow(_body, {
|
|
589
|
+
unrecognizedObjectKeys: "passthrough",
|
|
590
|
+
allowUnrecognizedUnionMembers: true,
|
|
591
|
+
allowUnrecognizedEnumValues: true,
|
|
592
|
+
}),
|
|
593
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
594
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
595
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
596
|
+
});
|
|
597
|
+
if (_response.ok) {
|
|
598
|
+
return serializers.ComponentsUpdatePropertiesResponse.parseOrThrow(_response.body, {
|
|
599
|
+
unrecognizedObjectKeys: "passthrough",
|
|
600
|
+
allowUnrecognizedUnionMembers: true,
|
|
601
|
+
allowUnrecognizedEnumValues: true,
|
|
602
|
+
skipValidation: true,
|
|
603
|
+
breadcrumbsPrefix: ["response"],
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
if (_response.error.reason === "status-code") {
|
|
607
|
+
switch (_response.error.statusCode) {
|
|
608
|
+
case 400:
|
|
609
|
+
throw new Webflow.BadRequestError(_response.error.body);
|
|
610
|
+
case 401:
|
|
611
|
+
throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
612
|
+
unrecognizedObjectKeys: "passthrough",
|
|
613
|
+
allowUnrecognizedUnionMembers: true,
|
|
614
|
+
allowUnrecognizedEnumValues: true,
|
|
615
|
+
skipValidation: true,
|
|
616
|
+
breadcrumbsPrefix: ["response"],
|
|
617
|
+
}));
|
|
618
|
+
case 404:
|
|
619
|
+
throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
620
|
+
unrecognizedObjectKeys: "passthrough",
|
|
621
|
+
allowUnrecognizedUnionMembers: true,
|
|
622
|
+
allowUnrecognizedEnumValues: true,
|
|
623
|
+
skipValidation: true,
|
|
624
|
+
breadcrumbsPrefix: ["response"],
|
|
625
|
+
}));
|
|
626
|
+
case 429:
|
|
627
|
+
throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
628
|
+
unrecognizedObjectKeys: "passthrough",
|
|
629
|
+
allowUnrecognizedUnionMembers: true,
|
|
630
|
+
allowUnrecognizedEnumValues: true,
|
|
631
|
+
skipValidation: true,
|
|
632
|
+
breadcrumbsPrefix: ["response"],
|
|
633
|
+
}));
|
|
634
|
+
case 500:
|
|
635
|
+
throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
|
|
636
|
+
unrecognizedObjectKeys: "passthrough",
|
|
637
|
+
allowUnrecognizedUnionMembers: true,
|
|
638
|
+
allowUnrecognizedEnumValues: true,
|
|
639
|
+
skipValidation: true,
|
|
640
|
+
breadcrumbsPrefix: ["response"],
|
|
641
|
+
}));
|
|
642
|
+
default:
|
|
643
|
+
throw new errors.WebflowError({
|
|
644
|
+
statusCode: _response.error.statusCode,
|
|
645
|
+
body: _response.error.body,
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
switch (_response.error.reason) {
|
|
650
|
+
case "non-json":
|
|
651
|
+
throw new errors.WebflowError({
|
|
652
|
+
statusCode: _response.error.statusCode,
|
|
653
|
+
body: _response.error.rawBody,
|
|
654
|
+
});
|
|
655
|
+
case "timeout":
|
|
656
|
+
throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/components/{component_id}/properties.");
|
|
657
|
+
case "unknown":
|
|
658
|
+
throw new errors.WebflowError({
|
|
659
|
+
message: _response.error.errorMessage,
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
}
|
|
664
|
+
_getAuthorizationHeader() {
|
|
665
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
666
|
+
return `Bearer ${yield core.Supplier.get(this._options.accessToken)}`;
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
exports.Components = Components;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|