diff --git a/.fern/metadata.json b/.fern/metadata.json
new file mode 100644
index 00000000..131aa9df
--- /dev/null
+++ b/.fern/metadata.json
@@ -0,0 +1,39 @@
+{
+ "cliVersion": "4.22.0",
+ "generatorName": "fernapi/fern-typescript-node-sdk",
+ "generatorVersion": "3.53.13",
+ "generatorConfig": {
+ "namespaceExport": "Webflow",
+ "skipResponseValidation": true,
+ "allowExtraFields": true,
+ "inlineFileProperties": true,
+ "inlinePathParameters": false,
+ "enableInlineTypes": false,
+ "noSerdeLayer": false,
+ "omitUndefined": true,
+ "useLegacyExports": true,
+ "streamType": "wrapper",
+ "fileResponseType": "stream",
+ "formDataSupport": "Node16",
+ "fetchSupport": "node-fetch",
+ "packageManager": "yarn",
+ "testFramework": "jest",
+ "packageJson": {
+ "dependencies": {
+ "crypto-browserify": "^3.12.1"
+ },
+ "devDependencies": {
+ "jest-fetch-mock": "^3.0.3"
+ },
+ "browser": {
+ "crypto": false
+ },
+ "resolutions": {
+ "pbkdf2": "^3.1.3",
+ "@types/babel__traverse": "7.20.6"
+ }
+ }
+ },
+ "originGitCommit": "f0174d404a2635415e858ef151cf9202df3e3d02",
+ "sdkVersion": "3.3.2"
+}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index c39c7866..f27c4d1c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,19 +2,23 @@ name: ci
on: [push]
+concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: false
+
jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Set up node
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v6
- name: Install dependencies
- run: yarn install
+ run: yarn install --frozen-lockfile
- name: Compile
run: yarn build
@@ -24,13 +28,13 @@ jobs:
steps:
- name: Checkout repo
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Set up node
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v6
- name: Install dependencies
- run: yarn install
+ run: yarn install --frozen-lockfile
- name: Test
run: yarn test
@@ -40,16 +44,17 @@ jobs:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
+ contents: read # Required for checkout
id-token: write # Required for OIDC
steps:
- name: Checkout repo
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Set up node
- uses: actions/setup-node@v4
+ uses: actions/setup-node@v6
- name: Install dependencies
- run: yarn install
+ run: yarn install --frozen-lockfile
- name: Build
run: yarn build
@@ -64,5 +69,13 @@ jobs:
elif [[ ${GITHUB_REF} == *beta* ]]; then
publish --access public --tag beta
else
- publish --access public
+ PKG_NAME=$(node -p "require('./package.json').name")
+ PKG_VERSION=$(node -p "require('./package.json').version")
+ CURRENT_LATEST=$(npm view "${PKG_NAME}" dist-tags.latest 2>/dev/null || echo "0.0.0")
+ if npx -y semver "${PKG_VERSION}" -r "<${CURRENT_LATEST}" > /dev/null 2>&1; then
+ echo "Publishing ${PKG_VERSION} with --tag backport (current latest is ${CURRENT_LATEST})"
+ publish --access public --tag backport
+ else
+ publish --access public
+ fi
fi
\ No newline at end of file
diff --git a/.npmignore b/.npmignore
index c0c40ac1..d730bd7d 100644
--- a/.npmignore
+++ b/.npmignore
@@ -4,8 +4,14 @@ tests
.gitignore
.github
.fernignore
+.fern
.prettierrc.yml
biome.json
tsconfig.json
yarn.lock
-pnpm-lock.yaml
\ No newline at end of file
+pnpm-lock.yaml
+.mock
+dist
+scripts
+jest.config.*
+vitest.config.*
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 00000000..4b59dbc9
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,133 @@
+# Contributing
+
+Thanks for your interest in contributing to this SDK! This document provides guidelines for contributing to the project.
+
+## Getting Started
+
+### Prerequisites
+
+- Node.js 20 or higher
+- yarn package manager
+
+### Installation
+
+Install the project dependencies:
+
+```bash
+yarn install
+```
+
+### Building
+
+Build the project:
+
+```bash
+yarn build
+```
+
+### Testing
+
+Run the test suite:
+
+```bash
+yarn test
+```
+
+Run specific test types:
+- `yarn test:unit` - Run unit tests
+- `yarn test:wire` - Run wire/integration tests
+
+### Linting and Formatting
+
+Check code style:
+
+```bash
+yarn run lint
+yarn run format:check
+```
+
+Fix code style issues:
+
+```bash
+yarn run lint:fix
+yarn run format:fix
+```
+
+Or use the combined check command:
+
+```bash
+yarn run check:fix
+```
+
+## About Generated Code
+
+**Important**: Most files in this SDK are automatically generated by [Fern](https://buildwithfern.com) from the API definition. Direct modifications to generated files will be overwritten the next time the SDK is generated.
+
+### Generated Files
+
+The following directories contain generated code:
+- `src/api/` - API client classes and types
+- `src/serialization/` - Serialization/deserialization logic
+- Most TypeScript files in `src/`
+
+### How to Customize
+
+If you need to customize the SDK, you have two options:
+
+#### Option 1: Use `.fernignore`
+
+For custom code that should persist across SDK regenerations:
+
+1. Create a `.fernignore` file in the project root
+2. Add file patterns for files you want to preserve (similar to `.gitignore` syntax)
+3. Add your custom code to those files
+
+Files listed in `.fernignore` will not be overwritten when the SDK is regenerated.
+
+For more information, see the [Fern documentation on custom code](https://buildwithfern.com/learn/sdks/overview/custom-code).
+
+#### Option 2: Contribute to the Generator
+
+If you want to change how code is generated for all users of this SDK:
+
+1. The TypeScript SDK generator lives in the [Fern repository](https://github.com/fern-api/fern)
+2. Generator code is located at `generators/typescript/sdk/`
+3. Follow the [Fern contributing guidelines](https://github.com/fern-api/fern/blob/main/CONTRIBUTING.md)
+4. Submit a pull request with your changes to the generator
+
+This approach is best for:
+- Bug fixes in generated code
+- New features that would benefit all users
+- Improvements to code generation patterns
+
+## Making Changes
+
+### Workflow
+
+1. Create a new branch for your changes
+2. Make your modifications
+3. Run tests to ensure nothing breaks: `yarn test`
+4. Run linting and formatting: `yarn run check:fix`
+5. Build the project: `yarn build`
+6. Commit your changes with a clear commit message
+7. Push your branch and create a pull request
+
+### Commit Messages
+
+Write clear, descriptive commit messages that explain what changed and why.
+
+### Code Style
+
+This project uses automated code formatting and linting. Run `yarn run check:fix` before committing to ensure your code meets the project's style guidelines.
+
+## Questions or Issues?
+
+If you have questions or run into issues:
+
+1. Check the [Fern documentation](https://buildwithfern.com)
+2. Search existing [GitHub issues](https://github.com/fern-api/fern/issues)
+3. Open a new issue if your question hasn't been addressed
+
+## License
+
+By contributing to this project, you agree that your contributions will be licensed under the same license as the project.
diff --git a/biome.json b/biome.json
index a777468e..5084b70a 100644
--- a/biome.json
+++ b/biome.json
@@ -1,5 +1,5 @@
{
- "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
+ "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json",
"root": true,
"vcs": {
"enabled": false
diff --git a/package.json b/package.json
index cb4c8827..a88be021 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,11 @@
{
"name": "webflow-api",
- "version": "3.3.1",
+ "version": "3.3.2",
"private": false,
- "repository": "github:webflow/js-webflow-api",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/webflow/js-webflow-api.git"
+ },
"license": "MIT",
"main": "./index.js",
"types": "./index.d.ts",
@@ -39,7 +42,7 @@
"msw": "2.11.2",
"@types/node": "^18.19.70",
"typescript": "~5.7.2",
- "@biomejs/biome": "2.3.1",
+ "@biomejs/biome": "2.4.3",
"jest-fetch-mock": "^3.0.3"
},
"browser": {
diff --git a/reference.md b/reference.md
index 4a593acb..1b8d26b2 100644
--- a/reference.md
+++ b/reference.md
@@ -45,7 +45,7 @@ await client.token.authorizedBy();
-
-**requestOptions:** `Token.RequestOptions`
+**requestOptions:** `TokenClient.RequestOptions`
@@ -102,7 +102,7 @@ await client.token.introspect();
-
-**requestOptions:** `Token.RequestOptions`
+**requestOptions:** `TokenClient.RequestOptions`
@@ -115,7 +115,7 @@ await client.token.introspect();
## Sites
-client.sites.create(workspaceId, { ...params }) -> Webflow.Site
+client.sites.create(workspace_id, { ...params }) -> Webflow.Site
-
@@ -164,7 +164,7 @@ await client.sites.create("580e63e98c9a982ac9b8b741", {
-
-**workspaceId:** `string` — Unique identifier for a Workspace
+**workspace_id:** `string` — Unique identifier for a Workspace
@@ -180,7 +180,7 @@ await client.sites.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -237,7 +237,7 @@ await client.sites.list();
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -249,7 +249,7 @@ await client.sites.list();
-client.sites.get(siteId) -> Webflow.Site
+client.sites.get(site_id) -> Webflow.Site
-
@@ -294,7 +294,7 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -302,7 +302,7 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -314,7 +314,7 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-client.sites.delete(siteId) -> void
+client.sites.delete(site_id) -> void
-
@@ -361,7 +361,7 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -369,7 +369,7 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -381,7 +381,7 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
-client.sites.update(siteId, { ...params }) -> Webflow.Site
+client.sites.update(site_id, { ...params }) -> Webflow.Site
-
@@ -428,7 +428,7 @@ await client.sites.update("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -444,7 +444,7 @@ await client.sites.update("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -456,7 +456,7 @@ await client.sites.update("580e63e98c9a982ac9b8b741");
-client.sites.getCustomDomain(siteId) -> Webflow.Domains
+client.sites.getCustomDomain(site_id) -> Webflow.Domains
-
@@ -501,7 +501,7 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -509,7 +509,7 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -521,7 +521,7 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-client.sites.publish(siteId, { ...params }) -> Webflow.SitesPublishResponse
+client.sites.publish(site_id, { ...params }) -> Webflow.SitesPublishResponse
-
@@ -573,7 +573,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -589,7 +589,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Sites.RequestOptions`
+**requestOptions:** `SitesClient.RequestOptions`
@@ -602,7 +602,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", {
## Collections
-client.collections.list(siteId) -> Webflow.CollectionList
+client.collections.list(site_id) -> Webflow.CollectionList
-
@@ -647,7 +647,7 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -655,7 +655,7 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Collections.RequestOptions`
+**requestOptions:** `CollectionsClient.RequestOptions`
@@ -667,7 +667,7 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
-client.collections.create(siteId, { ...params }) -> Webflow.Collection
+client.collections.create(site_id, { ...params }) -> Webflow.Collection
-
@@ -737,7 +737,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -753,7 +753,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Collections.RequestOptions`
+**requestOptions:** `CollectionsClient.RequestOptions`
@@ -765,7 +765,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
-client.collections.get(collectionId) -> Webflow.Collection
+client.collections.get(collection_id) -> Webflow.Collection
-
@@ -810,7 +810,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -818,7 +818,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-
-**requestOptions:** `Collections.RequestOptions`
+**requestOptions:** `CollectionsClient.RequestOptions`
@@ -830,7 +830,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
-client.collections.delete(collectionId) -> void
+client.collections.delete(collection_id) -> void
-
@@ -875,7 +875,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -883,7 +883,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
-
-**requestOptions:** `Collections.RequestOptions`
+**requestOptions:** `CollectionsClient.RequestOptions`
@@ -896,7 +896,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
## Pages
-client.pages.list(siteId, { ...params }) -> Webflow.PageList
+client.pages.list(site_id, { ...params }) -> Webflow.PageList
-
@@ -945,7 +945,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -961,7 +961,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Pages.RequestOptions`
+**requestOptions:** `PagesClient.RequestOptions`
@@ -973,7 +973,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
-client.pages.getMetadata(pageId, { ...params }) -> Webflow.Page
+client.pages.getMetadata(page_id, { ...params }) -> Webflow.Page
-
@@ -1020,7 +1020,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -1036,7 +1036,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-
-**requestOptions:** `Pages.RequestOptions`
+**requestOptions:** `PagesClient.RequestOptions`
@@ -1048,7 +1048,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
-client.pages.updatePageSettings(pageId, { ...params }) -> Webflow.Page
+client.pages.updatePageSettings(page_id, { ...params }) -> Webflow.Page
-
@@ -1107,7 +1107,7 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -1123,7 +1123,7 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-
-**requestOptions:** `Pages.RequestOptions`
+**requestOptions:** `PagesClient.RequestOptions`
@@ -1135,7 +1135,7 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
-client.pages.getContent(pageId, { ...params }) -> Webflow.Dom
+client.pages.getContent(page_id, { ...params }) -> Webflow.Dom
-
@@ -1186,7 +1186,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -1202,7 +1202,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-
-**requestOptions:** `Pages.RequestOptions`
+**requestOptions:** `PagesClient.RequestOptions`
@@ -1214,7 +1214,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
-client.pages.updateStaticContent(pageId, { ...params }) -> Webflow.UpdateStaticContentResponse
+client.pages.updateStaticContent(page_id, { ...params }) -> Webflow.UpdateStaticContentResponse
-
@@ -1302,7 +1302,7 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -1318,7 +1318,7 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
-
-**requestOptions:** `Pages.RequestOptions`
+**requestOptions:** `PagesClient.RequestOptions`
@@ -1331,7 +1331,7 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
## Components
-client.components.list(siteId, { ...params }) -> Webflow.ComponentList
+client.components.list(site_id, { ...params }) -> Webflow.ComponentList
-
@@ -1380,7 +1380,7 @@ await client.components.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1396,7 +1396,7 @@ await client.components.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Components.RequestOptions`
+**requestOptions:** `ComponentsClient.RequestOptions`
@@ -1408,7 +1408,7 @@ await client.components.list("580e63e98c9a982ac9b8b741", {
-client.components.getContent(siteId, componentId, { ...params }) -> Webflow.ComponentDom
+client.components.getContent(site_id, component_id, { ...params }) -> Webflow.ComponentDom
-
@@ -1461,7 +1461,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1469,7 +1469,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
-
-**componentId:** `string` — Unique identifier for a Component
+**component_id:** `string` — Unique identifier for a Component
@@ -1485,7 +1485,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
-
-**requestOptions:** `Components.RequestOptions`
+**requestOptions:** `ComponentsClient.RequestOptions`
@@ -1497,7 +1497,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
-client.components.updateContent(siteId, componentId, { ...params }) -> Webflow.ComponentsUpdateContentResponse
+client.components.updateContent(site_id, component_id, { ...params }) -> Webflow.ComponentsUpdateContentResponse
-
@@ -1586,7 +1586,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1594,7 +1594,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**componentId:** `string` — Unique identifier for a Component
+**component_id:** `string` — Unique identifier for a Component
@@ -1610,7 +1610,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**requestOptions:** `Components.RequestOptions`
+**requestOptions:** `ComponentsClient.RequestOptions`
@@ -1622,7 +1622,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-client.components.getProperties(siteId, componentId, { ...params }) -> Webflow.ComponentProperties
+client.components.getProperties(site_id, component_id, { ...params }) -> Webflow.ComponentProperties
-
@@ -1674,7 +1674,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1682,7 +1682,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**componentId:** `string` — Unique identifier for a Component
+**component_id:** `string` — Unique identifier for a Component
@@ -1698,7 +1698,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-
-**requestOptions:** `Components.RequestOptions`
+**requestOptions:** `ComponentsClient.RequestOptions`
@@ -1710,7 +1710,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
-client.components.updateProperties(siteId, componentId, { ...params }) -> Webflow.ComponentsUpdatePropertiesResponse
+client.components.updateProperties(site_id, component_id, { ...params }) -> Webflow.ComponentsUpdatePropertiesResponse
-
@@ -1771,7 +1771,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1779,7 +1779,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
-
-**componentId:** `string` — Unique identifier for a Component
+**component_id:** `string` — Unique identifier for a Component
@@ -1795,7 +1795,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
-
-**requestOptions:** `Components.RequestOptions`
+**requestOptions:** `ComponentsClient.RequestOptions`
@@ -1808,7 +1808,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
## Scripts
-client.scripts.list(siteId) -> Webflow.RegisteredScriptList
+client.scripts.list(site_id) -> Webflow.RegisteredScriptList
-
@@ -1857,7 +1857,7 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1865,7 +1865,7 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -1877,7 +1877,7 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
-client.scripts.registerHosted(siteId, { ...params }) -> Webflow.CustomCodeHostedResponse
+client.scripts.registerHosted(site_id, { ...params }) -> Webflow.CustomCodeHostedResponse
-
@@ -1931,7 +1931,7 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -1947,7 +1947,7 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -1959,7 +1959,7 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
-client.scripts.registerInline(siteId, { ...params }) -> Webflow.CustomCodeInlineResponse
+client.scripts.registerInline(site_id, { ...params }) -> Webflow.CustomCodeInlineResponse
-
@@ -2012,7 +2012,7 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2028,7 +2028,7 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -2041,7 +2041,7 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
## Assets
-client.assets.list(siteId, { ...params }) -> Webflow.Assets
+client.assets.list(site_id, { ...params }) -> Webflow.Assets
-
@@ -2089,7 +2089,7 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2105,7 +2105,7 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2117,7 +2117,7 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
-client.assets.create(siteId, { ...params }) -> Webflow.AssetUpload
+client.assets.create(site_id, { ...params }) -> Webflow.AssetUpload
-
@@ -2174,7 +2174,7 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2190,7 +2190,7 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2202,7 +2202,7 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
-client.assets.get(assetId) -> Webflow.Asset
+client.assets.get(asset_id) -> Webflow.Asset
-
@@ -2247,7 +2247,7 @@ await client.assets.get("580e63fc8c9a982ac9b8b745");
-
-**assetId:** `string` — Unique identifier for an Asset on a site
+**asset_id:** `string` — Unique identifier for an Asset on a site
@@ -2255,7 +2255,7 @@ await client.assets.get("580e63fc8c9a982ac9b8b745");
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2267,7 +2267,7 @@ await client.assets.get("580e63fc8c9a982ac9b8b745");
-client.assets.delete(assetId) -> void
+client.assets.delete(asset_id) -> void
-
@@ -2312,7 +2312,7 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
-
-**assetId:** `string` — Unique identifier for an Asset on a site
+**asset_id:** `string` — Unique identifier for an Asset on a site
@@ -2320,7 +2320,7 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2332,7 +2332,7 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
-client.assets.update(assetId, { ...params }) -> Webflow.Asset
+client.assets.update(asset_id, { ...params }) -> Webflow.Asset
-
@@ -2377,7 +2377,7 @@ await client.assets.update("580e63fc8c9a982ac9b8b745");
-
-**assetId:** `string` — Unique identifier for an Asset on a site
+**asset_id:** `string` — Unique identifier for an Asset on a site
@@ -2393,7 +2393,7 @@ await client.assets.update("580e63fc8c9a982ac9b8b745");
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2405,7 +2405,7 @@ await client.assets.update("580e63fc8c9a982ac9b8b745");
-client.assets.listFolders(siteId) -> Webflow.AssetFolderList
+client.assets.listFolders(site_id) -> Webflow.AssetFolderList
-
@@ -2450,7 +2450,7 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2458,7 +2458,7 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2470,7 +2470,7 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
-client.assets.createFolder(siteId, { ...params }) -> Webflow.AssetFolder
+client.assets.createFolder(site_id, { ...params }) -> Webflow.AssetFolder
-
@@ -2517,7 +2517,7 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2533,7 +2533,7 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2545,7 +2545,7 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
-client.assets.getFolder(assetFolderId) -> Webflow.AssetFolder
+client.assets.getFolder(asset_folder_id) -> Webflow.AssetFolder
-
@@ -2590,7 +2590,7 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
-
-**assetFolderId:** `string` — Unique identifier for an Asset Folder
+**asset_folder_id:** `string` — Unique identifier for an Asset Folder
@@ -2598,7 +2598,7 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
-
-**requestOptions:** `Assets.RequestOptions`
+**requestOptions:** `AssetsClient.RequestOptions`
@@ -2611,7 +2611,7 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
## Webhooks
-client.webhooks.list(siteId) -> Webflow.WebhookList
+client.webhooks.list(site_id) -> Webflow.WebhookList
-
@@ -2656,7 +2656,7 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2664,7 +2664,7 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Webhooks.RequestOptions`
+**requestOptions:** `WebhooksClient.RequestOptions`
@@ -2676,7 +2676,7 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
-client.webhooks.create(siteId, { ...params }) -> Webflow.Webhook
+client.webhooks.create(site_id, { ...params }) -> Webflow.Webhook
-
@@ -2732,7 +2732,7 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2748,7 +2748,7 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Webhooks.RequestOptions`
+**requestOptions:** `WebhooksClient.RequestOptions`
@@ -2760,7 +2760,7 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", {
-client.webhooks.get(webhookId) -> Webflow.Webhook
+client.webhooks.get(webhook_id) -> Webflow.Webhook
-
@@ -2805,7 +2805,7 @@ await client.webhooks.get("580e64008c9a982ac9b8b754");
-
-**webhookId:** `string` — Unique identifier for a Webhook
+**webhook_id:** `string` — Unique identifier for a Webhook
@@ -2813,7 +2813,7 @@ await client.webhooks.get("580e64008c9a982ac9b8b754");
-
-**requestOptions:** `Webhooks.RequestOptions`
+**requestOptions:** `WebhooksClient.RequestOptions`
@@ -2825,7 +2825,7 @@ await client.webhooks.get("580e64008c9a982ac9b8b754");
-client.webhooks.delete(webhookId) -> void
+client.webhooks.delete(webhook_id) -> void
-
@@ -2870,7 +2870,7 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
-
-**webhookId:** `string` — Unique identifier for a Webhook
+**webhook_id:** `string` — Unique identifier for a Webhook
@@ -2878,7 +2878,7 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
-
-**requestOptions:** `Webhooks.RequestOptions`
+**requestOptions:** `WebhooksClient.RequestOptions`
@@ -2891,7 +2891,7 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
## Forms
-client.forms.list(siteId, { ...params }) -> Webflow.FormList
+client.forms.list(site_id, { ...params }) -> Webflow.FormList
-
@@ -2939,7 +2939,7 @@ await client.forms.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -2955,7 +2955,7 @@ await client.forms.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -2967,7 +2967,7 @@ await client.forms.list("580e63e98c9a982ac9b8b741", {
-client.forms.get(formId) -> Webflow.Form
+client.forms.get(form_id) -> Webflow.Form
-
@@ -3012,7 +3012,7 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
-
-**formId:** `string` — Unique identifier for a Form
+**form_id:** `string` — Unique identifier for a Form
@@ -3020,7 +3020,7 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -3032,7 +3032,7 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
-client.forms.listSubmissions(formId, { ...params }) -> Webflow.FormSubmissionList
+client.forms.listSubmissions(form_id, { ...params }) -> Webflow.FormSubmissionList
-
@@ -3086,7 +3086,7 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", {
-
-**formId:** `string` — Unique identifier for a Form
+**form_id:** `string` — Unique identifier for a Form
@@ -3102,7 +3102,7 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -3114,7 +3114,7 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", {
-client.forms.getSubmission(formSubmissionId) -> Webflow.FormSubmission
+client.forms.getSubmission(form_submission_id) -> Webflow.FormSubmission
-
@@ -3159,7 +3159,7 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -3167,7 +3167,7 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -3179,7 +3179,7 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
-client.forms.deleteSubmission(formSubmissionId) -> void
+client.forms.deleteSubmission(form_submission_id) -> void
-
@@ -3225,7 +3225,7 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741");
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -3233,7 +3233,7 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -3245,7 +3245,7 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741");
-client.forms.updateSubmission(formSubmissionId, { ...params }) -> Webflow.FormSubmission
+client.forms.updateSubmission(form_submission_id, { ...params }) -> Webflow.FormSubmission
-
@@ -3290,7 +3290,7 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -3306,7 +3306,7 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -3319,7 +3319,7 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
## Products
-client.products.list(siteId, { ...params }) -> Webflow.ProductAndSkUsList
+client.products.list(site_id, { ...params }) -> Webflow.ProductAndSkUsList
-
@@ -3370,7 +3370,7 @@ await client.products.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3386,7 +3386,7 @@ await client.products.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3398,7 +3398,7 @@ await client.products.list("580e63e98c9a982ac9b8b741", {
-client.products.create(siteId, { ...params }) -> Webflow.ProductAndSkUs
+client.products.create(site_id, { ...params }) -> Webflow.ProductAndSkUs
-
@@ -3504,7 +3504,7 @@ await client.products.create("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3520,7 +3520,7 @@ await client.products.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3532,7 +3532,7 @@ await client.products.create("580e63e98c9a982ac9b8b741", {
-client.products.get(siteId, productId) -> Webflow.ProductAndSkUs
+client.products.get(site_id, product_id) -> Webflow.ProductAndSkUs
-
@@ -3578,7 +3578,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3586,7 +3586,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
-
-**productId:** `string` — Unique identifier for a Product
+**product_id:** `string` — Unique identifier for a Product
@@ -3594,7 +3594,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3606,7 +3606,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
-client.products.update(siteId, productId, { ...params }) -> Webflow.Product
+client.products.update(site_id, product_id, { ...params }) -> Webflow.Product
-
@@ -3653,7 +3653,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3661,7 +3661,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
-
-**productId:** `string` — Unique identifier for a Product
+**product_id:** `string` — Unique identifier for a Product
@@ -3677,7 +3677,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3689,7 +3689,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
-client.products.createSku(siteId, productId, { ...params }) -> Webflow.ProductsCreateSkuResponse
+client.products.createSku(site_id, product_id, { ...params }) -> Webflow.ProductsCreateSkuResponse
-
@@ -3753,7 +3753,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3761,7 +3761,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**productId:** `string` — Unique identifier for a Product
+**product_id:** `string` — Unique identifier for a Product
@@ -3777,7 +3777,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3789,7 +3789,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-client.products.updateSku(siteId, productId, skuId, { ...params }) -> Webflow.Sku
+client.products.updateSku(site_id, product_id, sku_id, { ...params }) -> Webflow.Sku
-
@@ -3853,7 +3853,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3861,7 +3861,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**productId:** `string` — Unique identifier for a Product
+**product_id:** `string` — Unique identifier for a Product
@@ -3869,7 +3869,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**skuId:** `string` — Unique identifier for a SKU
+**sku_id:** `string` — Unique identifier for a SKU
@@ -3885,7 +3885,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
-
-**requestOptions:** `Products.RequestOptions`
+**requestOptions:** `ProductsClient.RequestOptions`
@@ -3898,7 +3898,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
## Orders
-client.orders.list(siteId, { ...params }) -> Webflow.OrderList
+client.orders.list(site_id, { ...params }) -> Webflow.OrderList
-
@@ -3947,7 +3947,7 @@ await client.orders.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -3963,7 +3963,7 @@ await client.orders.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -3975,7 +3975,7 @@ await client.orders.list("580e63e98c9a982ac9b8b741", {
-client.orders.get(siteId, orderId) -> Webflow.Order
+client.orders.get(site_id, order_id) -> Webflow.Order
-
@@ -4021,7 +4021,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4029,7 +4029,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
-
-**orderId:** `string` — Unique identifier for an Order
+**order_id:** `string` — Unique identifier for an Order
@@ -4037,7 +4037,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -4049,7 +4049,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
-client.orders.update(siteId, orderId, { ...params }) -> Webflow.Order
+client.orders.update(site_id, order_id, { ...params }) -> Webflow.Order
-
@@ -4096,7 +4096,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4104,7 +4104,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**orderId:** `string` — Unique identifier for an Order
+**order_id:** `string` — Unique identifier for an Order
@@ -4120,7 +4120,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -4132,7 +4132,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-client.orders.updateFulfill(siteId, orderId, { ...params }) -> Webflow.Order
+client.orders.updateFulfill(site_id, order_id, { ...params }) -> Webflow.Order
-
@@ -4177,7 +4177,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4185,7 +4185,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
-
-**orderId:** `string` — Unique identifier for an Order
+**order_id:** `string` — Unique identifier for an Order
@@ -4201,7 +4201,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -4213,7 +4213,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
-client.orders.updateUnfulfill(siteId, orderId) -> Webflow.Order
+client.orders.updateUnfulfill(site_id, order_id) -> Webflow.Order
-
@@ -4258,7 +4258,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4266,7 +4266,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
-
-**orderId:** `string` — Unique identifier for an Order
+**order_id:** `string` — Unique identifier for an Order
@@ -4274,7 +4274,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -4286,7 +4286,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
-client.orders.refund(siteId, orderId, { ...params }) -> Webflow.Order
+client.orders.refund(site_id, order_id, { ...params }) -> Webflow.Order
-
@@ -4332,7 +4332,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4340,7 +4340,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**orderId:** `string` — Unique identifier for an Order
+**order_id:** `string` — Unique identifier for an Order
@@ -4356,7 +4356,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
-
-**requestOptions:** `Orders.RequestOptions`
+**requestOptions:** `OrdersClient.RequestOptions`
@@ -4369,7 +4369,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
## Inventory
-client.inventory.list(skuCollectionId, skuId) -> Webflow.InventoryItem
+client.inventory.list(sku_collection_id, sku_id) -> Webflow.InventoryItem
-
@@ -4414,7 +4414,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-
-**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID.
+**sku_collection_id:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID.
@@ -4422,7 +4422,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-
-**skuId:** `string` — Unique identifier for a SKU
+**sku_id:** `string` — Unique identifier for a SKU
@@ -4430,7 +4430,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-
-**requestOptions:** `Inventory.RequestOptions`
+**requestOptions:** `InventoryClient.RequestOptions`
@@ -4442,7 +4442,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-client.inventory.update(skuCollectionId, skuId, { ...params }) -> Webflow.InventoryItem
+client.inventory.update(sku_collection_id, sku_id, { ...params }) -> Webflow.InventoryItem
-
@@ -4493,7 +4493,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
-
-**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID.
+**sku_collection_id:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID.
@@ -4501,7 +4501,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
-
-**skuId:** `string` — Unique identifier for a SKU
+**sku_id:** `string` — Unique identifier for a SKU
@@ -4517,7 +4517,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
-
-**requestOptions:** `Inventory.RequestOptions`
+**requestOptions:** `InventoryClient.RequestOptions`
@@ -4530,7 +4530,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
## Ecommerce
-client.ecommerce.getSettings(siteId) -> Webflow.EcommerceSettings
+client.ecommerce.getSettings(site_id) -> Webflow.EcommerceSettings
-
@@ -4575,7 +4575,7 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -4583,7 +4583,7 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Ecommerce.RequestOptions`
+**requestOptions:** `EcommerceClient.RequestOptions`
@@ -4596,7 +4596,7 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
## Collections Fields
-client.collections.fields.create(collectionId, { ...params }) -> Webflow.FieldCreate
+client.collections.fields.create(collection_id, { ...params }) -> Webflow.FieldCreate
-
@@ -4652,7 +4652,7 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -4668,7 +4668,7 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Fields.RequestOptions`
+**requestOptions:** `FieldsClient.RequestOptions`
@@ -4680,7 +4680,7 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
-client.collections.fields.delete(collectionId, fieldId) -> void
+client.collections.fields.delete(collection_id, field_id) -> void
-
@@ -4725,7 +4725,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -4733,7 +4733,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**fieldId:** `string` — Unique identifier for a Field in a collection
+**field_id:** `string` — Unique identifier for a Field in a collection
@@ -4741,7 +4741,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**requestOptions:** `Fields.RequestOptions`
+**requestOptions:** `FieldsClient.RequestOptions`
@@ -4753,7 +4753,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-client.collections.fields.update(collectionId, fieldId, { ...params }) -> Webflow.Field
+client.collections.fields.update(collection_id, field_id, { ...params }) -> Webflow.Field
-
@@ -4802,7 +4802,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -4810,7 +4810,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**fieldId:** `string` — Unique identifier for a Field in a collection
+**field_id:** `string` — Unique identifier for a Field in a collection
@@ -4826,7 +4826,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
-
-**requestOptions:** `Fields.RequestOptions`
+**requestOptions:** `FieldsClient.RequestOptions`
@@ -4839,7 +4839,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
## Collections Items
-client.collections.items.listItems(collectionId, { ...params }) -> Webflow.CollectionItemList
+client.collections.items.listItems(collection_id, { ...params }) -> Webflow.CollectionItemList
-
@@ -4892,7 +4892,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -4908,7 +4908,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -4920,7 +4920,7 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", {
-client.collections.items.createItem(collectionId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.createItem(collection_id, { ...params }) -> Webflow.CollectionItem
-
@@ -5012,7 +5012,7 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5028,7 +5028,7 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5040,7 +5040,7 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
-client.collections.items.deleteItems(collectionId, { ...params }) -> void
+client.collections.items.deleteItems(collection_id, { ...params }) -> void
-
@@ -5091,7 +5091,7 @@ await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5107,7 +5107,7 @@ await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5119,7 +5119,7 @@ await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", {
-client.collections.items.updateItems(collectionId, { ...params }) -> Webflow.ItemsUpdateItemsResponse
+client.collections.items.updateItems(collection_id, { ...params }) -> Webflow.ItemsUpdateItemsResponse
-
@@ -5203,7 +5203,7 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5219,7 +5219,7 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5231,7 +5231,7 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
-client.collections.items.listItemsLive(collectionId, { ...params }) -> Webflow.CollectionItemList
+client.collections.items.listItemsLive(collection_id, { ...params }) -> Webflow.CollectionItemList
-
@@ -5288,7 +5288,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5304,7 +5304,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5316,7 +5316,7 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", {
-client.collections.items.createItemLive(collectionId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.createItemLive(collection_id, { ...params }) -> Webflow.CollectionItem
-
@@ -5409,7 +5409,7 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5425,7 +5425,7 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5437,7 +5437,7 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-client.collections.items.deleteItemsLive(collectionId, { ...params }) -> void
+client.collections.items.deleteItemsLive(collection_id, { ...params }) -> void
-
@@ -5488,7 +5488,7 @@ await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5504,7 +5504,7 @@ await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5516,7 +5516,7 @@ await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", {
-client.collections.items.updateItemsLive(collectionId, { ...params }) -> Webflow.CollectionItemListNoPagination
+client.collections.items.updateItemsLive(collection_id, { ...params }) -> Webflow.CollectionItemListNoPagination
-
@@ -5598,7 +5598,7 @@ await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5614,7 +5614,7 @@ await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5626,7 +5626,7 @@ await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
-client.collections.items.createItems(collectionId, { ...params }) -> Webflow.BulkCollectionItem
+client.collections.items.createItems(collection_id, { ...params }) -> Webflow.BulkCollectionItem
-
@@ -5685,7 +5685,7 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5701,7 +5701,7 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5713,7 +5713,7 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
-client.collections.items.getItem(collectionId, itemId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.getItem(collection_id, item_id, { ...params }) -> Webflow.CollectionItem
-
@@ -5760,7 +5760,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5768,7 +5768,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -5784,7 +5784,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5796,7 +5796,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-client.collections.items.deleteItem(collectionId, itemId, { ...params }) -> void
+client.collections.items.deleteItem(collection_id, item_id, { ...params }) -> void
-
@@ -5843,7 +5843,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5851,7 +5851,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -5867,7 +5867,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -5879,7 +5879,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
-client.collections.items.updateItem(collectionId, itemId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.updateItem(collection_id, item_id, { ...params }) -> Webflow.CollectionItem
-
@@ -5968,7 +5968,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -5976,7 +5976,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -5992,7 +5992,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -6004,7 +6004,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
-client.collections.items.getItemLive(collectionId, itemId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.getItemLive(collection_id, item_id, { ...params }) -> Webflow.CollectionItem
-
@@ -6055,7 +6055,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -6063,7 +6063,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -6079,7 +6079,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -6091,7 +6091,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-client.collections.items.deleteItemLive(collectionId, itemId, { ...params }) -> void
+client.collections.items.deleteItemLive(collection_id, item_id, { ...params }) -> void
-
@@ -6140,7 +6140,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -6148,7 +6148,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -6164,7 +6164,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -6176,7 +6176,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
-client.collections.items.updateItemLive(collectionId, itemId, { ...params }) -> Webflow.CollectionItem
+client.collections.items.updateItemLive(collection_id, item_id, { ...params }) -> Webflow.CollectionItem
-
@@ -6265,7 +6265,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -6273,7 +6273,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**itemId:** `string` — Unique identifier for an Item
+**item_id:** `string` — Unique identifier for an Item
@@ -6289,7 +6289,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -6301,7 +6301,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
-client.collections.items.publishItem(collectionId, { ...params }) -> Webflow.ItemsPublishItemResponse
+client.collections.items.publishItem(collection_id, { ...params }) -> Webflow.ItemsPublishItemResponse
-
@@ -6348,7 +6348,7 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
-
-**collectionId:** `string` — Unique identifier for a Collection
+**collection_id:** `string` — Unique identifier for a Collection
@@ -6364,7 +6364,7 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
-
-**requestOptions:** `Items.RequestOptions`
+**requestOptions:** `ItemsClient.RequestOptions`
@@ -6377,7 +6377,7 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
## Pages Scripts
-client.pages.scripts.getCustomCode(pageId) -> Webflow.ScriptApplyList
+client.pages.scripts.getCustomCode(page_id) -> Webflow.ScriptApplyList
-
@@ -6422,7 +6422,7 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -6430,7 +6430,7 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -6442,7 +6442,7 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
-client.pages.scripts.upsertCustomCode(pageId, { ...params }) -> Webflow.ScriptApplyList
+client.pages.scripts.upsertCustomCode(page_id, { ...params }) -> Webflow.ScriptApplyList
-
@@ -6504,7 +6504,7 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -6520,7 +6520,7 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -6532,7 +6532,7 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
-client.pages.scripts.deleteCustomCode(pageId) -> void
+client.pages.scripts.deleteCustomCode(page_id) -> void
-
@@ -6581,7 +6581,7 @@ await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552");
-
-**pageId:** `string` — Unique identifier for a Page
+**page_id:** `string` — Unique identifier for a Page
@@ -6589,7 +6589,7 @@ await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552");
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -6602,7 +6602,7 @@ await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552");
## Sites Redirects
-client.sites.redirects.list(siteId) -> Webflow.Redirects
+client.sites.redirects.list(site_id) -> Webflow.Redirects
-
@@ -6651,7 +6651,7 @@ await client.sites.redirects.list("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -6659,7 +6659,7 @@ await client.sites.redirects.list("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Redirects.RequestOptions`
+**requestOptions:** `RedirectsClient.RequestOptions`
@@ -6671,7 +6671,7 @@ await client.sites.redirects.list("580e63e98c9a982ac9b8b741");
-client.sites.redirects.create(siteId, { ...params }) -> Webflow.Redirect
+client.sites.redirects.create(site_id, { ...params }) -> Webflow.Redirect
-
@@ -6724,7 +6724,7 @@ await client.sites.redirects.create("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -6740,7 +6740,7 @@ await client.sites.redirects.create("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Redirects.RequestOptions`
+**requestOptions:** `RedirectsClient.RequestOptions`
@@ -6752,7 +6752,7 @@ await client.sites.redirects.create("580e63e98c9a982ac9b8b741", {
-client.sites.redirects.delete(siteId, redirectId) -> Webflow.Redirects
+client.sites.redirects.delete(site_id, redirect_id) -> Webflow.Redirects
-
@@ -6801,7 +6801,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -6809,7 +6809,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**redirectId:** `string` — Unique identifier site redirect
+**redirect_id:** `string` — Unique identifier site redirect
@@ -6817,7 +6817,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**requestOptions:** `Redirects.RequestOptions`
+**requestOptions:** `RedirectsClient.RequestOptions`
@@ -6829,7 +6829,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-client.sites.redirects.update(siteId, redirectId, { ...params }) -> Webflow.Redirect
+client.sites.redirects.update(site_id, redirect_id, { ...params }) -> Webflow.Redirect
-
@@ -6880,7 +6880,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -6888,7 +6888,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**redirectId:** `string` — Unique identifier site redirect
+**redirect_id:** `string` — Unique identifier site redirect
@@ -6904,7 +6904,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
-
-**requestOptions:** `Redirects.RequestOptions`
+**requestOptions:** `RedirectsClient.RequestOptions`
@@ -6917,7 +6917,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
## Sites Plans
-client.sites.plans.getSitePlan(siteId) -> Webflow.SitePlan
+client.sites.plans.getSitePlan(site_id) -> Webflow.SitePlan
-
@@ -6964,7 +6964,7 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -6972,7 +6972,7 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Plans.RequestOptions`
+**requestOptions:** `PlansClient.RequestOptions`
@@ -6985,7 +6985,7 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741");
## Sites RobotsTxt
-client.sites.robotsTxt.get(siteId) -> Webflow.Robots
+client.sites.robotsTxt.get(site_id) -> Webflow.Robots
-
@@ -7032,7 +7032,7 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7040,7 +7040,7 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `RobotsTxt.RequestOptions`
+**requestOptions:** `RobotsTxtClient.RequestOptions`
@@ -7052,7 +7052,7 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741");
-client.sites.robotsTxt.put(siteId, { ...params }) -> Webflow.Robots
+client.sites.robotsTxt.put(site_id, { ...params }) -> Webflow.Robots
-
@@ -7106,7 +7106,7 @@ await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7122,7 +7122,7 @@ await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `RobotsTxt.RequestOptions`
+**requestOptions:** `RobotsTxtClient.RequestOptions`
@@ -7134,7 +7134,7 @@ await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", {
-client.sites.robotsTxt.delete(siteId, { ...params }) -> Webflow.Robots
+client.sites.robotsTxt.delete(site_id, { ...params }) -> Webflow.Robots
-
@@ -7189,7 +7189,7 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7205,7 +7205,7 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `RobotsTxt.RequestOptions`
+**requestOptions:** `RobotsTxtClient.RequestOptions`
@@ -7217,7 +7217,7 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", {
-client.sites.robotsTxt.patch(siteId, { ...params }) -> Webflow.Robots
+client.sites.robotsTxt.patch(site_id, { ...params }) -> Webflow.Robots
-
@@ -7271,7 +7271,7 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7287,7 +7287,7 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `RobotsTxt.RequestOptions`
+**requestOptions:** `RobotsTxtClient.RequestOptions`
@@ -7300,7 +7300,7 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
## Sites WellKnown
-client.sites.wellKnown.put(siteId, { ...params }) -> void
+client.sites.wellKnown.put(site_id, { ...params }) -> void
-
@@ -7360,7 +7360,7 @@ await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7376,7 +7376,7 @@ await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `WellKnown.RequestOptions`
+**requestOptions:** `WellKnownClient.RequestOptions`
@@ -7388,7 +7388,7 @@ await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", {
-client.sites.wellKnown.delete(siteId, { ...params }) -> void
+client.sites.wellKnown.delete(site_id, { ...params }) -> void
-
@@ -7435,7 +7435,7 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7451,7 +7451,7 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `WellKnown.RequestOptions`
+**requestOptions:** `WellKnownClient.RequestOptions`
@@ -7464,7 +7464,7 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
## Sites ActivityLogs
-client.sites.activityLogs.list(siteId, { ...params }) -> Webflow.SiteActivityLogResponse
+client.sites.activityLogs.list(site_id, { ...params }) -> Webflow.SiteActivityLogResponse
-
@@ -7514,7 +7514,7 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7530,7 +7530,7 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `ActivityLogs.RequestOptions`
+**requestOptions:** `ActivityLogsClient.RequestOptions`
@@ -7543,7 +7543,7 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", {
## Sites Comments
-client.sites.comments.listCommentThreads(siteId, { ...params }) -> Webflow.CommentThreadList
+client.sites.comments.listCommentThreads(site_id, { ...params }) -> Webflow.CommentThreadList
-
@@ -7598,7 +7598,7 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7614,7 +7614,7 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Comments.RequestOptions`
+**requestOptions:** `CommentsClient.RequestOptions`
@@ -7626,7 +7626,7 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", {
-client.sites.comments.getCommentThread(siteId, commentThreadId, { ...params }) -> Webflow.CommentThread
+client.sites.comments.getCommentThread(site_id, comment_thread_id, { ...params }) -> Webflow.CommentThread
-
@@ -7681,7 +7681,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7689,7 +7689,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
-
-**commentThreadId:** `string` — Unique identifier for a Comment Thread
+**comment_thread_id:** `string` — Unique identifier for a Comment Thread
@@ -7705,7 +7705,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
-
-**requestOptions:** `Comments.RequestOptions`
+**requestOptions:** `CommentsClient.RequestOptions`
@@ -7717,7 +7717,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
-client.sites.comments.listCommentReplies(siteId, commentThreadId, { ...params }) -> Webflow.CommentReplyList
+client.sites.comments.listCommentReplies(site_id, comment_thread_id, { ...params }) -> Webflow.CommentReplyList
-
@@ -7772,7 +7772,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7780,7 +7780,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
-
-**commentThreadId:** `string` — Unique identifier for a Comment Thread
+**comment_thread_id:** `string` — Unique identifier for a Comment Thread
@@ -7796,7 +7796,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
-
-**requestOptions:** `Comments.RequestOptions`
+**requestOptions:** `CommentsClient.RequestOptions`
@@ -7809,7 +7809,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
## Sites Scripts
-client.sites.scripts.getCustomCode(siteId) -> Webflow.ScriptApplyList
+client.sites.scripts.getCustomCode(site_id) -> Webflow.ScriptApplyList
-
@@ -7858,7 +7858,7 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7866,7 +7866,7 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -7878,7 +7878,7 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
-client.sites.scripts.upsertCustomCode(siteId, { ...params }) -> Webflow.ScriptApplyList
+client.sites.scripts.upsertCustomCode(site_id, { ...params }) -> Webflow.ScriptApplyList
-
@@ -7940,7 +7940,7 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -7956,7 +7956,7 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -7968,7 +7968,7 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
-client.sites.scripts.deleteCustomCode(siteId) -> void
+client.sites.scripts.deleteCustomCode(site_id) -> void
-
@@ -8017,7 +8017,7 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8025,7 +8025,7 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -8037,7 +8037,7 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-client.sites.scripts.listCustomCodeBlocks(siteId, { ...params }) -> Webflow.ListCustomCodeBlocks
+client.sites.scripts.listCustomCodeBlocks(site_id, { ...params }) -> Webflow.ListCustomCodeBlocks
-
@@ -8091,7 +8091,7 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8107,7 +8107,7 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Scripts.RequestOptions`
+**requestOptions:** `ScriptsClient.RequestOptions`
@@ -8120,7 +8120,7 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", {
## Sites Forms
-client.sites.forms.listSubmissionsBySite(siteId, { ...params }) -> Webflow.FormSubmissionList
+client.sites.forms.listSubmissionsBySite(site_id, { ...params }) -> Webflow.FormSubmissionList
-
@@ -8177,7 +8177,7 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8193,7 +8193,7 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -8205,7 +8205,7 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
-client.sites.forms.listSubmissions(siteId, formId, { ...params }) -> Webflow.FormSubmissionList
+client.sites.forms.listSubmissions(site_id, form_id, { ...params }) -> Webflow.FormSubmissionList
-
@@ -8255,7 +8255,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8263,7 +8263,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
-
-**formId:** `string` — Unique identifier for a Form
+**form_id:** `string` — Unique identifier for a Form
@@ -8279,7 +8279,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -8291,7 +8291,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
-client.sites.forms.getSubmission(siteId, formSubmissionId) -> Webflow.FormSubmission
+client.sites.forms.getSubmission(site_id, form_submission_id) -> Webflow.FormSubmission
-
@@ -8336,7 +8336,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8344,7 +8344,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -8352,7 +8352,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -8364,7 +8364,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
-client.sites.forms.deleteSubmission(siteId, formSubmissionId) -> void
+client.sites.forms.deleteSubmission(site_id, form_submission_id) -> void
-
@@ -8409,7 +8409,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8417,7 +8417,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -8425,7 +8425,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -8437,7 +8437,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-client.sites.forms.updateSubmission(siteId, formSubmissionId, { ...params }) -> Webflow.FormSubmission
+client.sites.forms.updateSubmission(site_id, form_submission_id, { ...params }) -> Webflow.FormSubmission
-
@@ -8482,7 +8482,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**siteId:** `string` — Unique identifier for a Site
+**site_id:** `string` — Unique identifier for a Site
@@ -8490,7 +8490,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**formSubmissionId:** `string` — Unique identifier for a Form Submission
+**form_submission_id:** `string` — Unique identifier for a Form Submission
@@ -8506,7 +8506,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
-
-**requestOptions:** `Forms.RequestOptions`
+**requestOptions:** `FormsClient.RequestOptions`
@@ -8519,7 +8519,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
## Workspaces AuditLogs
-client.workspaces.auditLogs.getWorkspaceAuditLogs(workspaceIdOrSlug, { ...params }) -> Webflow.WorkspaceAuditLogResponse
+client.workspaces.auditLogs.getWorkspaceAuditLogs(workspace_id_or_slug, { ...params }) -> Webflow.WorkspaceAuditLogResponse
-
@@ -8573,7 +8573,7 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace",
-
-**workspaceIdOrSlug:** `string` — Unique identifier or slug for a Workspace
+**workspace_id_or_slug:** `string` — Unique identifier or slug for a Workspace
@@ -8589,7 +8589,7 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace",
-
-**requestOptions:** `AuditLogs.RequestOptions`
+**requestOptions:** `AuditLogsClient.RequestOptions`
@@ -8600,3 +8600,4 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace",
+
diff --git a/src/BaseClient.ts b/src/BaseClient.ts
index ea3b4652..c73d5fc3 100644
--- a/src/BaseClient.ts
+++ b/src/BaseClient.ts
@@ -1,20 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
-import type * as core from "./core";
+import { BearerAuthProvider } from "./auth/BearerAuthProvider";
+import * as core from "./core";
+import { mergeHeaders } from "./core/headers";
import type * as environments from "./environments";
-export interface BaseClientOptions {
+export type BaseClientOptions = {
environment?: core.Supplier;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier;
- accessToken: core.Supplier;
/** Additional headers to include in requests. */
headers?: Record | null | undefined>;
/** The default maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The default number of times to retry the request. Defaults to 2. */
maxRetries?: number;
-}
+ /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
+ fetch?: typeof fetch;
+ /** Configure logging for the client. */
+ logging?: core.logging.LogConfig | core.logging.Logger;
+} & BearerAuthProvider.AuthOptions;
export interface BaseRequestOptions {
/** The maximum time to wait for a response in seconds. */
@@ -28,3 +33,53 @@ export interface BaseRequestOptions {
/** Additional headers to include in the request. */
headers?: Record | null | undefined>;
}
+
+export type NormalizedClientOptions = T & {
+ logging: core.logging.Logger;
+ authProvider?: core.AuthProvider;
+};
+
+export type NormalizedClientOptionsWithAuth =
+ NormalizedClientOptions & {
+ authProvider: core.AuthProvider;
+ };
+
+export function normalizeClientOptions(
+ options: T,
+): NormalizedClientOptions {
+ const headers = mergeHeaders(
+ {
+ "X-Fern-Language": "JavaScript",
+ "X-Fern-SDK-Name": "webflow-api",
+ "X-Fern-SDK-Version": "3.3.2",
+ "User-Agent": "webflow-api/3.3.2",
+ "X-Fern-Runtime": core.RUNTIME.type,
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
+ },
+ options?.headers,
+ );
+
+ return {
+ ...options,
+ logging: core.logging.createLogger(options?.logging),
+ headers,
+ } as NormalizedClientOptions;
+}
+
+export function normalizeClientOptionsWithAuth(
+ options: T,
+): NormalizedClientOptionsWithAuth {
+ const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth;
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
+ normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider);
+ return normalized;
+}
+
+function withNoOpAuthProvider(
+ options: NormalizedClientOptions,
+): NormalizedClientOptionsWithAuth {
+ return {
+ ...options,
+ authProvider: new core.NoOpAuthProvider(),
+ };
+}
diff --git a/src/Client.ts b/src/Client.ts
index 85bf5ef5..1f973607 100644
--- a/src/Client.ts
+++ b/src/Client.ts
@@ -1,116 +1,102 @@
// This file was auto-generated by Fern from our API Definition.
-import { Assets } from "./api/resources/assets/client/Client";
-import { Collections } from "./api/resources/collections/client/Client";
-import { Components } from "./api/resources/components/client/Client";
-import { Ecommerce } from "./api/resources/ecommerce/client/Client";
-import { Forms } from "./api/resources/forms/client/Client";
-import { Inventory } from "./api/resources/inventory/client/Client";
-import { Orders } from "./api/resources/orders/client/Client";
-import { Pages } from "./api/resources/pages/client/Client";
-import { Products } from "./api/resources/products/client/Client";
-import { Scripts } from "./api/resources/scripts/client/Client";
-import { Sites } from "./api/resources/sites/client/Client";
-import { Token } from "./api/resources/token/client/Client";
-import { Webhooks } from "./api/resources/webhooks/client/Client";
-import { Workspaces } from "./api/resources/workspaces/client/Client";
+import { AssetsClient } from "./api/resources/assets/client/Client";
+import { CollectionsClient } from "./api/resources/collections/client/Client";
+import { ComponentsClient } from "./api/resources/components/client/Client";
+import { EcommerceClient } from "./api/resources/ecommerce/client/Client";
+import { FormsClient } from "./api/resources/forms/client/Client";
+import { InventoryClient } from "./api/resources/inventory/client/Client";
+import { OrdersClient } from "./api/resources/orders/client/Client";
+import { PagesClient } from "./api/resources/pages/client/Client";
+import { ProductsClient } from "./api/resources/products/client/Client";
+import { ScriptsClient } from "./api/resources/scripts/client/Client";
+import { SitesClient } from "./api/resources/sites/client/Client";
+import { TokenClient } from "./api/resources/token/client/Client";
+import { WebhooksClient } from "./api/resources/webhooks/client/Client";
+import { WorkspacesClient } from "./api/resources/workspaces/client/Client";
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient";
-import * as core from "./core";
-import { mergeHeaders } from "./core/headers";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient";
export declare namespace WebflowClient {
- export interface Options extends BaseClientOptions {}
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
export class WebflowClient {
- protected readonly _options: WebflowClient.Options;
- protected _token: Token | undefined;
- protected _sites: Sites | undefined;
- protected _collections: Collections | undefined;
- protected _pages: Pages | undefined;
- protected _components: Components | undefined;
- protected _scripts: Scripts | undefined;
- protected _assets: Assets | undefined;
- protected _webhooks: Webhooks | undefined;
- protected _forms: Forms | undefined;
- protected _products: Products | undefined;
- protected _orders: Orders | undefined;
- protected _inventory: Inventory | undefined;
- protected _ecommerce: Ecommerce | undefined;
- protected _workspaces: Workspaces | undefined;
-
- constructor(_options: WebflowClient.Options) {
- this._options = {
- ..._options,
- headers: mergeHeaders(
- {
- "X-Fern-Language": "JavaScript",
- "X-Fern-SDK-Name": "webflow-api",
- "X-Fern-SDK-Version": "3.3.1",
- "User-Agent": "webflow-api/3.3.1",
- "X-Fern-Runtime": core.RUNTIME.type,
- "X-Fern-Runtime-Version": core.RUNTIME.version,
- },
- _options?.headers,
- ),
- };
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _token: TokenClient | undefined;
+ protected _sites: SitesClient | undefined;
+ protected _collections: CollectionsClient | undefined;
+ protected _pages: PagesClient | undefined;
+ protected _components: ComponentsClient | undefined;
+ protected _scripts: ScriptsClient | undefined;
+ protected _assets: AssetsClient | undefined;
+ protected _webhooks: WebhooksClient | undefined;
+ protected _forms: FormsClient | undefined;
+ protected _products: ProductsClient | undefined;
+ protected _orders: OrdersClient | undefined;
+ protected _inventory: InventoryClient | undefined;
+ protected _ecommerce: EcommerceClient | undefined;
+ protected _workspaces: WorkspacesClient | undefined;
+
+ constructor(options: WebflowClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get token(): Token {
- return (this._token ??= new Token(this._options));
+ public get token(): TokenClient {
+ return (this._token ??= new TokenClient(this._options));
}
- public get sites(): Sites {
- return (this._sites ??= new Sites(this._options));
+ public get sites(): SitesClient {
+ return (this._sites ??= new SitesClient(this._options));
}
- public get collections(): Collections {
- return (this._collections ??= new Collections(this._options));
+ public get collections(): CollectionsClient {
+ return (this._collections ??= new CollectionsClient(this._options));
}
- public get pages(): Pages {
- return (this._pages ??= new Pages(this._options));
+ public get pages(): PagesClient {
+ return (this._pages ??= new PagesClient(this._options));
}
- public get components(): Components {
- return (this._components ??= new Components(this._options));
+ public get components(): ComponentsClient {
+ return (this._components ??= new ComponentsClient(this._options));
}
- public get scripts(): Scripts {
- return (this._scripts ??= new Scripts(this._options));
+ public get scripts(): ScriptsClient {
+ return (this._scripts ??= new ScriptsClient(this._options));
}
- public get assets(): Assets {
- return (this._assets ??= new Assets(this._options));
+ public get assets(): AssetsClient {
+ return (this._assets ??= new AssetsClient(this._options));
}
- public get webhooks(): Webhooks {
- return (this._webhooks ??= new Webhooks(this._options));
+ public get webhooks(): WebhooksClient {
+ return (this._webhooks ??= new WebhooksClient(this._options));
}
- public get forms(): Forms {
- return (this._forms ??= new Forms(this._options));
+ public get forms(): FormsClient {
+ return (this._forms ??= new FormsClient(this._options));
}
- public get products(): Products {
- return (this._products ??= new Products(this._options));
+ public get products(): ProductsClient {
+ return (this._products ??= new ProductsClient(this._options));
}
- public get orders(): Orders {
- return (this._orders ??= new Orders(this._options));
+ public get orders(): OrdersClient {
+ return (this._orders ??= new OrdersClient(this._options));
}
- public get inventory(): Inventory {
- return (this._inventory ??= new Inventory(this._options));
+ public get inventory(): InventoryClient {
+ return (this._inventory ??= new InventoryClient(this._options));
}
- public get ecommerce(): Ecommerce {
- return (this._ecommerce ??= new Ecommerce(this._options));
+ public get ecommerce(): EcommerceClient {
+ return (this._ecommerce ??= new EcommerceClient(this._options));
}
- public get workspaces(): Workspaces {
- return (this._workspaces ??= new Workspaces(this._options));
+ public get workspaces(): WorkspacesClient {
+ return (this._workspaces ??= new WorkspacesClient(this._options));
}
}
diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts
index 82b8c800..5c71b8cb 100644
--- a/src/api/errors/BadRequestError.ts
+++ b/src/api/errors/BadRequestError.ts
@@ -11,6 +11,11 @@ export class BadRequestError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, BadRequestError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts
index c26d504e..23b0e5b2 100644
--- a/src/api/errors/ConflictError.ts
+++ b/src/api/errors/ConflictError.ts
@@ -11,6 +11,11 @@ export class ConflictError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ConflictError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts
index 42c8a436..84f228b0 100644
--- a/src/api/errors/ForbiddenError.ts
+++ b/src/api/errors/ForbiddenError.ts
@@ -11,6 +11,11 @@ export class ForbiddenError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, ForbiddenError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts
index 6891f521..6c3e5006 100644
--- a/src/api/errors/InternalServerError.ts
+++ b/src/api/errors/InternalServerError.ts
@@ -12,6 +12,11 @@ export class InternalServerError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, InternalServerError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts
index 3a23bbcd..5f98e08d 100644
--- a/src/api/errors/NotFoundError.ts
+++ b/src/api/errors/NotFoundError.ts
@@ -12,6 +12,11 @@ export class NotFoundError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, NotFoundError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts
index b446eae7..42c2304f 100644
--- a/src/api/errors/TooManyRequestsError.ts
+++ b/src/api/errors/TooManyRequestsError.ts
@@ -12,6 +12,11 @@ export class TooManyRequestsError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, TooManyRequestsError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts
index 00be898b..f59dce84 100644
--- a/src/api/errors/UnauthorizedError.ts
+++ b/src/api/errors/UnauthorizedError.ts
@@ -12,6 +12,11 @@ export class UnauthorizedError extends errors.WebflowError {
body: body,
rawResponse: rawResponse,
});
- Object.setPrototypeOf(this, UnauthorizedError.prototype);
+ Object.setPrototypeOf(this, new.target.prototype);
+ if (Error.captureStackTrace) {
+ Error.captureStackTrace(this, this.constructor);
+ }
+
+ this.name = this.constructor.name;
}
}
diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts
index 8a4a5827..f129db10 100644
--- a/src/api/resources/assets/client/Client.ts
+++ b/src/api/resources/assets/client/Client.ts
@@ -1,15 +1,17 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient";
import * as core from "../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers";
+import { mergeHeaders } from "../../../../core/headers";
import * as environments from "../../../../environments";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../errors/index";
import * as serializers from "../../../../serialization/index";
import * as Webflow from "../../../index";
-export declare namespace Assets {
- export interface Options extends BaseClientOptions {}
+export declare namespace AssetsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
@@ -17,11 +19,11 @@ export declare namespace Assets {
/**
* Assets are files that are uploaded to your Webflow account.
*/
-export class Assets {
- protected readonly _options: Assets.Options;
+export class AssetsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Assets.Options) {
- this._options = _options;
+ constructor(options: AssetsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -29,9 +31,9 @@ export class Assets {
*
* Required scope | `assets:read`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.AssetsListRequest} request
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -46,31 +48,27 @@ export class Assets {
* })
*/
public list(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsListRequest = {},
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__list(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__list(site_id, request, requestOptions));
}
private async __list(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsListRequest = {},
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
const { offset, limit } = request;
- const _queryParams: Record = {};
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
+ const _queryParams: Record = {
+ offset,
+ limit,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -78,7 +76,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/assets`,
+ `sites/${core.url.encodePathParam(site_id)}/assets`,
),
method: "GET",
headers: _headers,
@@ -86,6 +84,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -157,21 +157,7 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/assets.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/sites/{site_id}/assets");
}
/**
@@ -188,9 +174,9 @@ export class Assets {
*
* Required scope | `assets:write`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.AssetsCreateRequest} request
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -205,21 +191,22 @@ export class Assets {
* })
*/
public create(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsCreateRequest,
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__create(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__create(site_id, request, requestOptions));
}
private async __create(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsCreateRequest,
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -227,7 +214,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/assets`,
+ `sites/${core.url.encodePathParam(site_id)}/assets`,
),
method: "POST",
headers: _headers,
@@ -243,6 +230,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -314,21 +303,7 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /sites/{site_id}/assets.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/sites/{site_id}/assets");
}
/**
@@ -336,8 +311,8 @@ export class Assets {
*
* Required scope | `assets:read`
*
- * @param {string} assetId - Unique identifier for an Asset on a site
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} asset_id - Unique identifier for an Asset on a site
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -348,17 +323,21 @@ export class Assets {
* @example
* await client.assets.get("580e63fc8c9a982ac9b8b745")
*/
- public get(assetId: string, requestOptions?: Assets.RequestOptions): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__get(assetId, requestOptions));
+ public get(
+ asset_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
+ ): core.HttpResponsePromise {
+ return core.HttpResponsePromise.fromPromise(this.__get(asset_id, requestOptions));
}
private async __get(
- assetId: string,
- requestOptions?: Assets.RequestOptions,
+ asset_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -366,7 +345,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `assets/${core.url.encodePathParam(assetId)}`,
+ `assets/${core.url.encodePathParam(asset_id)}`,
),
method: "GET",
headers: _headers,
@@ -374,6 +353,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -445,21 +426,7 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /assets/{asset_id}.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/assets/{asset_id}");
}
/**
@@ -467,8 +434,8 @@ export class Assets {
*
* Required Scope: `assets: write`
*
- * @param {string} assetId - Unique identifier for an Asset on a site
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} asset_id - Unique identifier for an Asset on a site
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -479,17 +446,18 @@ export class Assets {
* @example
* await client.assets.delete("580e63fc8c9a982ac9b8b745")
*/
- public delete(assetId: string, requestOptions?: Assets.RequestOptions): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__delete(assetId, requestOptions));
+ public delete(asset_id: string, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise {
+ return core.HttpResponsePromise.fromPromise(this.__delete(asset_id, requestOptions));
}
private async __delete(
- assetId: string,
- requestOptions?: Assets.RequestOptions,
+ asset_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -497,7 +465,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `assets/${core.url.encodePathParam(assetId)}`,
+ `assets/${core.url.encodePathParam(asset_id)}`,
),
method: "DELETE",
headers: _headers,
@@ -505,6 +473,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -567,21 +537,7 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling DELETE /assets/{asset_id}.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/assets/{asset_id}");
}
/**
@@ -589,9 +545,9 @@ export class Assets {
*
* Required scope | `assets:write`
*
- * @param {string} assetId - Unique identifier for an Asset on a site
+ * @param {string} asset_id - Unique identifier for an Asset on a site
* @param {Webflow.AssetsUpdateRequest} request
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -603,21 +559,22 @@ export class Assets {
* await client.assets.update("580e63fc8c9a982ac9b8b745")
*/
public update(
- assetId: string,
+ asset_id: string,
request: Webflow.AssetsUpdateRequest = {},
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__update(assetId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__update(asset_id, request, requestOptions));
}
private async __update(
- assetId: string,
+ asset_id: string,
request: Webflow.AssetsUpdateRequest = {},
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -625,7 +582,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `assets/${core.url.encodePathParam(assetId)}`,
+ `assets/${core.url.encodePathParam(asset_id)}`,
),
method: "PATCH",
headers: _headers,
@@ -641,6 +598,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -712,21 +671,7 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling PATCH /assets/{asset_id}.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/assets/{asset_id}");
}
/**
@@ -734,8 +679,8 @@ export class Assets {
*
* Required scope | `assets:read`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -747,19 +692,20 @@ export class Assets {
* await client.assets.listFolders("580e63e98c9a982ac9b8b741")
*/
public listFolders(
- siteId: string,
- requestOptions?: Assets.RequestOptions,
+ site_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__listFolders(siteId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__listFolders(site_id, requestOptions));
}
private async __listFolders(
- siteId: string,
- requestOptions?: Assets.RequestOptions,
+ site_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -767,7 +713,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/asset_folders`,
+ `sites/${core.url.encodePathParam(site_id)}/asset_folders`,
),
method: "GET",
headers: _headers,
@@ -775,6 +721,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -846,23 +794,12 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /sites/{site_id}/asset_folders.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/sites/{site_id}/asset_folders",
+ );
}
/**
@@ -870,9 +807,9 @@ export class Assets {
*
* Required scope | `assets:write`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.AssetsCreateFolderRequest} request
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -886,21 +823,22 @@ export class Assets {
* })
*/
public createFolder(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsCreateFolderRequest,
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__createFolder(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__createFolder(site_id, request, requestOptions));
}
private async __createFolder(
- siteId: string,
+ site_id: string,
request: Webflow.AssetsCreateFolderRequest,
- requestOptions?: Assets.RequestOptions,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -908,7 +846,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/asset_folders`,
+ `sites/${core.url.encodePathParam(site_id)}/asset_folders`,
),
method: "POST",
headers: _headers,
@@ -924,6 +862,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -995,23 +935,12 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /sites/{site_id}/asset_folders.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/sites/{site_id}/asset_folders",
+ );
}
/**
@@ -1019,8 +948,8 @@ export class Assets {
*
* Required scope | `assets:read`
*
- * @param {string} assetFolderId - Unique identifier for an Asset Folder
- * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} asset_folder_id - Unique identifier for an Asset Folder
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1032,19 +961,20 @@ export class Assets {
* await client.assets.getFolder("6390c49774a71f0e3c1a08ee")
*/
public getFolder(
- assetFolderId: string,
- requestOptions?: Assets.RequestOptions,
+ asset_folder_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getFolder(assetFolderId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__getFolder(asset_folder_id, requestOptions));
}
private async __getFolder(
- assetFolderId: string,
- requestOptions?: Assets.RequestOptions,
+ asset_folder_id: string,
+ requestOptions?: AssetsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1052,7 +982,7 @@ export class Assets {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `asset_folders/${core.url.encodePathParam(assetFolderId)}`,
+ `asset_folders/${core.url.encodePathParam(asset_folder_id)}`,
),
method: "GET",
headers: _headers,
@@ -1060,6 +990,8 @@ export class Assets {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -1131,26 +1063,11 @@ export class Assets {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /asset_folders/{asset_folder_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/asset_folders/{asset_folder_id}",
+ );
}
}
diff --git a/src/api/resources/assets/exports.ts b/src/api/resources/assets/exports.ts
new file mode 100644
index 00000000..5aeeb704
--- /dev/null
+++ b/src/api/resources/assets/exports.ts
@@ -0,0 +1,4 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { AssetsClient } from "./client/Client";
+export * from "./client/index";
diff --git a/src/api/resources/collections/client/Client.ts b/src/api/resources/collections/client/Client.ts
index 122d017e..4f52633b 100644
--- a/src/api/resources/collections/client/Client.ts
+++ b/src/api/resources/collections/client/Client.ts
@@ -1,17 +1,19 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient";
import * as core from "../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers";
+import { mergeHeaders } from "../../../../core/headers";
import * as environments from "../../../../environments";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../errors/index";
import * as serializers from "../../../../serialization/index";
import * as Webflow from "../../../index";
-import { Fields } from "../resources/fields/client/Client";
-import { Items } from "../resources/items/client/Client";
+import { FieldsClient } from "../resources/fields/client/Client";
+import { ItemsClient } from "../resources/items/client/Client";
-export declare namespace Collections {
- export interface Options extends BaseClientOptions {}
+export declare namespace CollectionsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
@@ -19,21 +21,21 @@ export declare namespace Collections {
/**
* Collections are CMS collections of items.
*/
-export class Collections {
- protected readonly _options: Collections.Options;
- protected _fields: Fields | undefined;
- protected _items: Items | undefined;
+export class CollectionsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
+ protected _fields: FieldsClient | undefined;
+ protected _items: ItemsClient | undefined;
- constructor(_options: Collections.Options) {
- this._options = _options;
+ constructor(options: CollectionsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
- public get fields(): Fields {
- return (this._fields ??= new Fields(this._options));
+ public get fields(): FieldsClient {
+ return (this._fields ??= new FieldsClient(this._options));
}
- public get items(): Items {
- return (this._items ??= new Items(this._options));
+ public get items(): ItemsClient {
+ return (this._items ??= new ItemsClient(this._options));
}
/**
@@ -41,8 +43,8 @@ export class Collections {
*
* Required scope | `cms:read`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {CollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -54,19 +56,20 @@ export class Collections {
* await client.collections.list("580e63e98c9a982ac9b8b741")
*/
public list(
- siteId: string,
- requestOptions?: Collections.RequestOptions,
+ site_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__list(siteId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__list(site_id, requestOptions));
}
private async __list(
- siteId: string,
- requestOptions?: Collections.RequestOptions,
+ site_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -74,7 +77,7 @@ export class Collections {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/collections`,
+ `sites/${core.url.encodePathParam(site_id)}/collections`,
),
method: "GET",
headers: _headers,
@@ -82,6 +85,8 @@ export class Collections {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -153,21 +158,7 @@ export class Collections {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/collections.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/sites/{site_id}/collections");
}
/**
@@ -177,9 +168,9 @@ export class Collections {
*
* Required scope | `cms:write`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.CollectionsCreateRequest} request
- * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {CollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -215,21 +206,22 @@ export class Collections {
* })
*/
public create(
- siteId: string,
+ site_id: string,
request: Webflow.CollectionsCreateRequest,
- requestOptions?: Collections.RequestOptions,
+ requestOptions?: CollectionsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__create(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__create(site_id, request, requestOptions));
}
private async __create(
- siteId: string,
+ site_id: string,
request: Webflow.CollectionsCreateRequest,
- requestOptions?: Collections.RequestOptions,
+ requestOptions?: CollectionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -237,7 +229,7 @@ export class Collections {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/collections`,
+ `sites/${core.url.encodePathParam(site_id)}/collections`,
),
method: "POST",
headers: _headers,
@@ -253,6 +245,8 @@ export class Collections {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -326,23 +320,7 @@ export class Collections {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /sites/{site_id}/collections.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/sites/{site_id}/collections");
}
/**
@@ -350,8 +328,8 @@ export class Collections {
*
* Required scope | `cms:read`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {CollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -363,19 +341,20 @@ export class Collections {
* await client.collections.get("580e63fc8c9a982ac9b8b745")
*/
public get(
- collectionId: string,
- requestOptions?: Collections.RequestOptions,
+ collection_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__get(collectionId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__get(collection_id, requestOptions));
}
private async __get(
- collectionId: string,
- requestOptions?: Collections.RequestOptions,
+ collection_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -383,7 +362,7 @@ export class Collections {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}`,
),
method: "GET",
headers: _headers,
@@ -391,6 +370,8 @@ export class Collections {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -462,21 +443,7 @@ export class Collections {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /collections/{collection_id}.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/collections/{collection_id}");
}
/**
@@ -484,8 +451,8 @@ export class Collections {
*
* Required scope | `cms:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {Collections.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {CollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -496,17 +463,21 @@ export class Collections {
* @example
* await client.collections.delete("580e63fc8c9a982ac9b8b745")
*/
- public delete(collectionId: string, requestOptions?: Collections.RequestOptions): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__delete(collectionId, requestOptions));
+ public delete(
+ collection_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
+ ): core.HttpResponsePromise {
+ return core.HttpResponsePromise.fromPromise(this.__delete(collection_id, requestOptions));
}
private async __delete(
- collectionId: string,
- requestOptions?: Collections.RequestOptions,
+ collection_id: string,
+ requestOptions?: CollectionsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -514,7 +485,7 @@ export class Collections {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}`,
),
method: "DELETE",
headers: _headers,
@@ -522,6 +493,8 @@ export class Collections {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -584,26 +557,11 @@ export class Collections {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}",
+ );
}
}
diff --git a/src/api/resources/collections/exports.ts b/src/api/resources/collections/exports.ts
new file mode 100644
index 00000000..a866048f
--- /dev/null
+++ b/src/api/resources/collections/exports.ts
@@ -0,0 +1,5 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { CollectionsClient } from "./client/Client";
+export * from "./client/index";
+export * from "./resources/index";
diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts
index 963d7656..f368a0a8 100644
--- a/src/api/resources/collections/resources/fields/client/Client.ts
+++ b/src/api/resources/collections/resources/fields/client/Client.ts
@@ -1,24 +1,26 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient";
import * as core from "../../../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers";
+import { mergeHeaders } from "../../../../../../core/headers";
import * as environments from "../../../../../../environments";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../../../errors/index";
import * as serializers from "../../../../../../serialization/index";
import * as Webflow from "../../../../../index";
-export declare namespace Fields {
- export interface Options extends BaseClientOptions {}
+export declare namespace FieldsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Fields {
- protected readonly _options: Fields.Options;
+export class FieldsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Fields.Options) {
- this._options = _options;
+ constructor(options: FieldsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -30,9 +32,9 @@ export class Fields {
*
* Required scope | `cms:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.FieldCreate} request
- * @param {Fields.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {FieldsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -84,21 +86,22 @@ export class Fields {
* })
*/
public create(
- collectionId: string,
+ collection_id: string,
request: Webflow.FieldCreate,
- requestOptions?: Fields.RequestOptions,
+ requestOptions?: FieldsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__create(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__create(collection_id, request, requestOptions));
}
private async __create(
- collectionId: string,
+ collection_id: string,
request: Webflow.FieldCreate,
- requestOptions?: Fields.RequestOptions,
+ requestOptions?: FieldsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -106,7 +109,7 @@ export class Fields {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/fields`,
+ `collections/${core.url.encodePathParam(collection_id)}/fields`,
),
method: "POST",
headers: _headers,
@@ -122,6 +125,8 @@ export class Fields {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -195,23 +200,12 @@ export class Fields {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /collections/{collection_id}/fields.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/collections/{collection_id}/fields",
+ );
}
/**
@@ -219,9 +213,9 @@ export class Fields {
*
* Required scope | `cms:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} fieldId - Unique identifier for a Field in a collection
- * @param {Fields.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} field_id - Unique identifier for a Field in a collection
+ * @param {FieldsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -233,21 +227,22 @@ export class Fields {
* await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745")
*/
public delete(
- collectionId: string,
- fieldId: string,
- requestOptions?: Fields.RequestOptions,
+ collection_id: string,
+ field_id: string,
+ requestOptions?: FieldsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__delete(collectionId, fieldId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__delete(collection_id, field_id, requestOptions));
}
private async __delete(
- collectionId: string,
- fieldId: string,
- requestOptions?: Fields.RequestOptions,
+ collection_id: string,
+ field_id: string,
+ requestOptions?: FieldsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -255,7 +250,7 @@ export class Fields {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/fields/${core.url.encodePathParam(fieldId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}/fields/${core.url.encodePathParam(field_id)}`,
),
method: "DELETE",
headers: _headers,
@@ -263,6 +258,8 @@ export class Fields {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -325,23 +322,12 @@ export class Fields {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}/fields/{field_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}/fields/{field_id}",
+ );
}
/**
@@ -349,10 +335,10 @@ export class Fields {
*
* Required scope | `cms:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} fieldId - Unique identifier for a Field in a collection
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} field_id - Unique identifier for a Field in a collection
* @param {Webflow.collections.FieldUpdate} request
- * @param {Fields.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {FieldsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -368,23 +354,24 @@ export class Fields {
* })
*/
public update(
- collectionId: string,
- fieldId: string,
+ collection_id: string,
+ field_id: string,
request: Webflow.collections.FieldUpdate = {},
- requestOptions?: Fields.RequestOptions,
+ requestOptions?: FieldsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__update(collectionId, fieldId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__update(collection_id, field_id, request, requestOptions));
}
private async __update(
- collectionId: string,
- fieldId: string,
+ collection_id: string,
+ field_id: string,
request: Webflow.collections.FieldUpdate = {},
- requestOptions?: Fields.RequestOptions,
+ requestOptions?: FieldsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -392,7 +379,7 @@ export class Fields {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/fields/${core.url.encodePathParam(fieldId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}/fields/${core.url.encodePathParam(field_id)}`,
),
method: "PATCH",
headers: _headers,
@@ -408,6 +395,8 @@ export class Fields {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -479,26 +468,11 @@ export class Fields {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling PATCH /collections/{collection_id}/fields/{field_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/collections/{collection_id}/fields/{field_id}",
+ );
}
}
diff --git a/src/api/resources/collections/resources/fields/exports.ts b/src/api/resources/collections/resources/fields/exports.ts
new file mode 100644
index 00000000..5635a275
--- /dev/null
+++ b/src/api/resources/collections/resources/fields/exports.ts
@@ -0,0 +1,4 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { FieldsClient } from "./client/Client";
+export * from "./client/index";
diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts
index 3ffc6cea..d920aec0 100644
--- a/src/api/resources/collections/resources/items/client/Client.ts
+++ b/src/api/resources/collections/resources/items/client/Client.ts
@@ -1,24 +1,26 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../../../BaseClient";
import * as core from "../../../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers";
+import { mergeHeaders } from "../../../../../../core/headers";
import * as environments from "../../../../../../environments";
+import { handleNonStatusCodeError } from "../../../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../../../errors/index";
import * as serializers from "../../../../../../serialization/index";
import * as Webflow from "../../../../../index";
-export declare namespace Items {
- export interface Options extends BaseClientOptions {}
+export declare namespace ItemsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Items {
- protected readonly _options: Items.Options;
+export class ItemsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Items.Options) {
- this._options = _options;
+ constructor(options: ItemsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -26,9 +28,9 @@ export class Items {
*
* Required scope | `CMS:read`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsListItemsRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -48,71 +50,58 @@ export class Items {
* })
*/
public listItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsListItemsRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__listItems(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__listItems(collection_id, request, requestOptions));
}
private async __listItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsListItemsRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (name != null) {
- _queryParams.name = name;
- }
-
- if (slug != null) {
- _queryParams.slug = slug;
- }
-
- if (lastPublished != null) {
- _queryParams.lastPublished = serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- breadcrumbsPrefix: ["request", "lastPublished"],
- });
- }
-
- if (sortBy != null) {
- _queryParams.sortBy = serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- });
- }
-
- if (sortOrder != null) {
- _queryParams.sortOrder = serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- });
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ offset,
+ limit,
+ name,
+ slug,
+ lastPublished:
+ lastPublished != null
+ ? serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ breadcrumbsPrefix: ["request", "lastPublished"],
+ })
+ : lastPublished,
+ sortBy:
+ sortBy != null
+ ? serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ })
+ : undefined,
+ sortOrder:
+ sortOrder != null
+ ? serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ })
+ : undefined,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -120,7 +109,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items`,
+ `collections/${core.url.encodePathParam(collection_id)}/items`,
),
method: "GET",
headers: _headers,
@@ -128,6 +117,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -199,23 +190,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /collections/{collection_id}/items.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/collections/{collection_id}/items",
+ );
}
/**
@@ -226,9 +206,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsCreateItemRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -310,27 +290,26 @@ export class Items {
* })
*/
public createItem(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsCreateItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__createItem(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__createItem(collection_id, request, requestOptions));
}
private async __createItem(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsCreateItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, body: _body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -338,7 +317,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items`,
+ `collections/${core.url.encodePathParam(collection_id)}/items`,
),
method: "POST",
headers: _headers,
@@ -354,6 +333,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -425,23 +406,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /collections/{collection_id}/items.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/collections/{collection_id}/items",
+ );
}
/**
@@ -451,9 +421,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsDeleteItemsRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -470,21 +440,22 @@ export class Items {
* })
*/
public deleteItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsDeleteItemsRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__deleteItems(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__deleteItems(collection_id, request, requestOptions));
}
private async __deleteItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsDeleteItemsRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -492,7 +463,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items`,
+ `collections/${core.url.encodePathParam(collection_id)}/items`,
),
method: "DELETE",
headers: _headers,
@@ -508,6 +479,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -572,23 +545,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}/items.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}/items",
+ );
}
/**
@@ -600,9 +562,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsUpdateItemsRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -675,27 +637,26 @@ export class Items {
* })
*/
public updateItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsUpdateItemsRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__updateItems(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__updateItems(collection_id, request, requestOptions));
}
private async __updateItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsUpdateItemsRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, ..._body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -703,7 +664,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items`,
+ `collections/${core.url.encodePathParam(collection_id)}/items`,
),
method: "PATCH",
headers: _headers,
@@ -719,6 +680,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -790,23 +753,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling PATCH /collections/{collection_id}/items.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/collections/{collection_id}/items",
+ );
}
/**
@@ -818,9 +770,9 @@ export class Items {
*
* Required scope | `CMS:read`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsListItemsLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -840,71 +792,58 @@ export class Items {
* })
*/
public listItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsListItemsLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__listItemsLive(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__listItemsLive(collection_id, request, requestOptions));
}
private async __listItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsListItemsLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (name != null) {
- _queryParams.name = name;
- }
-
- if (slug != null) {
- _queryParams.slug = slug;
- }
-
- if (lastPublished != null) {
- _queryParams.lastPublished = serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow(lastPublished, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- breadcrumbsPrefix: ["request", "lastPublished"],
- });
- }
-
- if (sortBy != null) {
- _queryParams.sortBy = serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- });
- }
-
- if (sortOrder != null) {
- _queryParams.sortOrder = serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow(sortOrder, {
- unrecognizedObjectKeys: "passthrough",
- allowUnrecognizedUnionMembers: true,
- allowUnrecognizedEnumValues: true,
- omitUndefined: true,
- });
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ offset,
+ limit,
+ name,
+ slug,
+ lastPublished:
+ lastPublished != null
+ ? serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow(lastPublished, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ breadcrumbsPrefix: ["request", "lastPublished"],
+ })
+ : lastPublished,
+ sortBy:
+ sortBy != null
+ ? serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ })
+ : undefined,
+ sortOrder:
+ sortOrder != null
+ ? serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow(sortOrder, {
+ unrecognizedObjectKeys: "passthrough",
+ allowUnrecognizedUnionMembers: true,
+ allowUnrecognizedEnumValues: true,
+ omitUndefined: true,
+ })
+ : undefined,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -912,7 +851,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/live`,
),
method: "GET",
headers: _headers,
@@ -920,6 +859,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -991,23 +932,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /collections/{collection_id}/items/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/collections/{collection_id}/items/live",
+ );
}
/**
@@ -1019,9 +949,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsCreateItemLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1103,27 +1033,26 @@ export class Items {
* })
*/
public createItemLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsCreateItemLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__createItemLive(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__createItemLive(collection_id, request, requestOptions));
}
private async __createItemLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsCreateItemLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, body: _body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1131,7 +1060,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/live`,
),
method: "POST",
headers: _headers,
@@ -1147,6 +1076,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -1218,23 +1149,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /collections/{collection_id}/items/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/collections/{collection_id}/items/live",
+ );
}
/**
@@ -1244,9 +1164,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsDeleteItemsLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1262,21 +1182,22 @@ export class Items {
* })
*/
public deleteItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsDeleteItemsLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__deleteItemsLive(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__deleteItemsLive(collection_id, request, requestOptions));
}
private async __deleteItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsDeleteItemsLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1284,7 +1205,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/live`,
),
method: "DELETE",
headers: _headers,
@@ -1300,6 +1221,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -1362,23 +1285,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}/items/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}/items/live",
+ );
}
/**
@@ -1388,9 +1300,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsUpdateItemsLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1464,27 +1376,26 @@ export class Items {
* })
*/
public updateItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsUpdateItemsLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__updateItemsLive(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__updateItemsLive(collection_id, request, requestOptions));
}
private async __updateItemsLive(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsUpdateItemsLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, ..._body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1492,7 +1403,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/live`,
),
method: "PATCH",
headers: _headers,
@@ -1508,6 +1419,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -1581,23 +1494,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling PATCH /collections/{collection_id}/items/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/collections/{collection_id}/items/live",
+ );
}
/**
@@ -1610,9 +1512,9 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1648,27 +1550,26 @@ export class Items {
* })
*/
public createItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.CreateBulkCollectionItemRequestBody,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__createItems(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__createItems(collection_id, request, requestOptions));
}
private async __createItems(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.CreateBulkCollectionItemRequestBody,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, ..._body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1676,7 +1577,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/bulk`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/bulk`,
),
method: "POST",
headers: _headers,
@@ -1692,6 +1593,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -1763,23 +1666,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /collections/{collection_id}/items/bulk.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/collections/{collection_id}/items/bulk",
+ );
}
/**
@@ -1787,10 +1679,10 @@ export class Items {
*
* Required scope | `CMS:read`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsGetItemRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1804,29 +1696,28 @@ export class Items {
* })
*/
public getItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsGetItemRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getItem(collectionId, itemId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__getItem(collection_id, item_id, request, requestOptions));
}
private async __getItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsGetItemRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1834,7 +1725,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}`,
),
method: "GET",
headers: _headers,
@@ -1842,6 +1733,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -1913,23 +1806,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/collections/{collection_id}/items/{item_id}",
+ );
}
/**
@@ -1937,10 +1819,10 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsDeleteItemRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -1954,29 +1836,28 @@ export class Items {
* })
*/
public deleteItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsDeleteItemRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__deleteItem(collectionId, itemId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__deleteItem(collection_id, item_id, request, requestOptions));
}
private async __deleteItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsDeleteItemRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -1984,7 +1865,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}`,
),
method: "DELETE",
headers: _headers,
@@ -1992,6 +1873,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -2054,23 +1937,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}/items/{item_id}",
+ );
}
/**
@@ -2078,10 +1950,10 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsUpdateItemRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -2137,29 +2009,28 @@ export class Items {
* })
*/
public updateItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsUpdateItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__updateItem(collectionId, itemId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__updateItem(collection_id, item_id, request, requestOptions));
}
private async __updateItem(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsUpdateItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, body: _body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -2167,7 +2038,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}`,
),
method: "PATCH",
headers: _headers,
@@ -2183,6 +2054,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -2254,23 +2127,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/collections/{collection_id}/items/{item_id}",
+ );
}
/**
@@ -2282,10 +2144,10 @@ export class Items {
*
* Required scope | `CMS:read`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsGetItemLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -2299,29 +2161,30 @@ export class Items {
* })
*/
public getItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsGetItemLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getItemLive(collectionId, itemId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(
+ this.__getItemLive(collection_id, item_id, request, requestOptions),
+ );
}
private async __getItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsGetItemLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -2329,7 +2192,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}/live`,
),
method: "GET",
headers: _headers,
@@ -2337,6 +2200,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -2408,23 +2273,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /collections/{collection_id}/items/{item_id}/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/collections/{collection_id}/items/{item_id}/live",
+ );
}
/**
@@ -2434,10 +2288,10 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsDeleteItemLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -2451,31 +2305,30 @@ export class Items {
* })
*/
public deleteItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsDeleteItemLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(
- this.__deleteItemLive(collectionId, itemId, request, requestOptions),
+ this.__deleteItemLive(collection_id, item_id, request, requestOptions),
);
}
private async __deleteItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsDeleteItemLiveRequest = {},
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { cmsLocaleId } = request;
- const _queryParams: Record = {};
- if (cmsLocaleId != null) {
- _queryParams.cmsLocaleId = cmsLocaleId;
- }
-
+ const _queryParams: Record = {
+ cmsLocaleId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -2483,7 +2336,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}/live`,
),
method: "DELETE",
headers: _headers,
@@ -2491,6 +2344,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return { data: undefined, rawResponse: _response.rawResponse };
@@ -2553,23 +2408,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling DELETE /collections/{collection_id}/items/{item_id}/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "DELETE",
+ "/collections/{collection_id}/items/{item_id}/live",
+ );
}
/**
@@ -2577,10 +2421,10 @@ export class Items {
*
* Required scope | `CMS:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
- * @param {string} itemId - Unique identifier for an Item
+ * @param {string} collection_id - Unique identifier for a Collection
+ * @param {string} item_id - Unique identifier for an Item
* @param {Webflow.collections.ItemsUpdateItemLiveRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -2637,31 +2481,30 @@ export class Items {
* })
*/
public updateItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsUpdateItemLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(
- this.__updateItemLive(collectionId, itemId, request, requestOptions),
+ this.__updateItemLive(collection_id, item_id, request, requestOptions),
);
}
private async __updateItemLive(
- collectionId: string,
- itemId: string,
+ collection_id: string,
+ item_id: string,
request: Webflow.collections.ItemsUpdateItemLiveRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
const { skipInvalidFiles, body: _body } = request;
- const _queryParams: Record = {};
- if (skipInvalidFiles != null) {
- _queryParams.skipInvalidFiles = skipInvalidFiles.toString();
- }
-
+ const _queryParams: Record = {
+ skipInvalidFiles,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -2669,7 +2512,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/${core.url.encodePathParam(item_id)}/live`,
),
method: "PATCH",
headers: _headers,
@@ -2685,6 +2528,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -2758,23 +2603,12 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling PATCH /collections/{collection_id}/items/{item_id}/live.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "PATCH",
+ "/collections/{collection_id}/items/{item_id}/live",
+ );
}
/**
@@ -2782,9 +2616,9 @@ export class Items {
*
* Required scope | `cms:write`
*
- * @param {string} collectionId - Unique identifier for a Collection
+ * @param {string} collection_id - Unique identifier for a Collection
* @param {Webflow.collections.ItemsPublishItemRequest} request
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ItemsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -2821,21 +2655,22 @@ export class Items {
* })
*/
public publishItem(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsPublishItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__publishItem(collectionId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__publishItem(collection_id, request, requestOptions));
}
private async __publishItem(
- collectionId: string,
+ collection_id: string,
request: Webflow.collections.ItemsPublishItemRequest,
- requestOptions?: Items.RequestOptions,
+ requestOptions?: ItemsClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -2843,7 +2678,7 @@ export class Items {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `collections/${core.url.encodePathParam(collectionId)}/items/publish`,
+ `collections/${core.url.encodePathParam(collection_id)}/items/publish`,
),
method: "POST",
headers: _headers,
@@ -2859,6 +2694,8 @@ export class Items {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -2932,26 +2769,11 @@ export class Items {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling POST /collections/{collection_id}/items/publish.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/collections/{collection_id}/items/publish",
+ );
}
}
diff --git a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts
index d6bf9384..711bf0b3 100644
--- a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts
+++ b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts
@@ -29,30 +29,6 @@ import type * as Webflow from "../../../../../../index";
* slug: "so-long-and-thanks"
* }]
* }
- *
- * @example
- * {
- * skipInvalidFiles: true,
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
- * isArchived: false,
- * isDraft: false,
- * fieldData: {
- * name: "Don\u2019t Panic",
- * slug: "dont-panic"
- * }
- * }
- *
- * @example
- * {
- * skipInvalidFiles: true,
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
- * isArchived: false,
- * isDraft: false,
- * fieldData: {
- * name: "Don\u2019t Panic",
- * slug: "dont-panic"
- * }
- * }
*/
export interface CreateBulkCollectionItemRequestBody {
/** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */
diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts
index 15df2cca..e34c72d9 100644
--- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts
+++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts
@@ -66,82 +66,6 @@ import type * as Webflow from "../../../../../../index";
* }
* }]
* }
- *
- * @example
- * {
- * skipInvalidFiles: true,
- * items: [{
- * id: "66f6ed9576ddacf3149d5ea6",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca5",
- * fieldData: {
- * name: "Ne Paniquez Pas",
- * slug: "ne-paniquez-pas",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5ea6",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca4",
- * fieldData: {
- * name: "No Entrar en P\u00E1nico",
- * slug: "no-entrar-en-panico",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5eaa",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca5",
- * fieldData: {
- * name: "Au Revoir et Merci pour Tous les Poissons",
- * slug: "au-revoir-et-merci",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5eaa",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca4",
- * fieldData: {
- * name: "Hasta Luego y Gracias por Todo el Pescado",
- * slug: "hasta-luego-y-gracias",
- * featured: false
- * }
- * }]
- * }
- *
- * @example
- * {
- * skipInvalidFiles: true,
- * items: [{
- * id: "66f6ed9576ddacf3149d5ea6",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca5",
- * fieldData: {
- * name: "Ne Paniquez Pas",
- * slug: "ne-paniquez-pas",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5ea6",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca4",
- * fieldData: {
- * name: "No Entrar en P\u00E1nico",
- * slug: "no-entrar-en-panico",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5eaa",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca5",
- * fieldData: {
- * name: "Au Revoir et Merci pour Tous les Poissons",
- * slug: "au-revoir-et-merci",
- * featured: false
- * }
- * }, {
- * id: "66f6ed9576ddacf3149d5eaa",
- * cmsLocaleId: "66f6e966c9e1dc700a857ca4",
- * fieldData: {
- * name: "Hasta Luego y Gracias por Todo el Pescado",
- * slug: "hasta-luego-y-gracias",
- * featured: false
- * }
- * }]
- * }
*/
export interface ItemsUpdateItemsLiveRequest {
/** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */
diff --git a/src/api/resources/collections/resources/items/exports.ts b/src/api/resources/collections/resources/items/exports.ts
new file mode 100644
index 00000000..abdbe0fc
--- /dev/null
+++ b/src/api/resources/collections/resources/items/exports.ts
@@ -0,0 +1,4 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { ItemsClient } from "./client/Client";
+export * from "./client/index";
diff --git a/src/api/resources/comments/exports.ts b/src/api/resources/comments/exports.ts
new file mode 100644
index 00000000..4aaf2fd6
--- /dev/null
+++ b/src/api/resources/comments/exports.ts
@@ -0,0 +1,3 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export * from "./index";
diff --git a/src/api/resources/comments/index.ts b/src/api/resources/comments/index.ts
new file mode 100644
index 00000000..cb0ff5c3
--- /dev/null
+++ b/src/api/resources/comments/index.ts
@@ -0,0 +1 @@
+export {};
diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts
index 92607369..4b876713 100644
--- a/src/api/resources/components/client/Client.ts
+++ b/src/api/resources/components/client/Client.ts
@@ -1,24 +1,26 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient";
import * as core from "../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers";
+import { mergeHeaders } from "../../../../core/headers";
import * as environments from "../../../../environments";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../errors/index";
import * as serializers from "../../../../serialization/index";
import * as Webflow from "../../../index";
-export declare namespace Components {
- export interface Options extends BaseClientOptions {}
+export declare namespace ComponentsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Components {
- protected readonly _options: Components.Options;
+export class ComponentsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Components.Options) {
- this._options = _options;
+ constructor(options: ComponentsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -26,9 +28,9 @@ export class Components {
*
* Required scope | `components:read`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.ComponentsListRequest} request
- * @param {Components.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -44,35 +46,28 @@ export class Components {
* })
*/
public list(
- siteId: string,
+ site_id: string,
request: Webflow.ComponentsListRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__list(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__list(site_id, request, requestOptions));
}
private async __list(
- siteId: string,
+ site_id: string,
request: Webflow.ComponentsListRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): Promise> {
const { branchId, limit, offset } = request;
- const _queryParams: Record = {};
- if (branchId != null) {
- _queryParams.branchId = branchId;
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
+ const _queryParams: Record = {
+ branchId,
+ limit,
+ offset,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -80,7 +75,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/components`,
+ `sites/${core.url.encodePathParam(site_id)}/components`,
),
method: "GET",
headers: _headers,
@@ -88,6 +83,8 @@ export class Components {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -159,21 +156,7 @@ export class Components {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- 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,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/sites/{site_id}/components");
}
/**
@@ -184,10 +167,10 @@ export class Components {
*
* Required scope | `components:read`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {string} componentId - Unique identifier for a Component
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {string} component_id - Unique identifier for a Component
* @param {Webflow.ComponentsGetContentRequest} request
- * @param {Components.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -204,41 +187,31 @@ export class Components {
* })
*/
public getContent(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentsGetContentRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getContent(siteId, componentId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__getContent(site_id, component_id, request, requestOptions));
}
private async __getContent(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentsGetContentRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): Promise> {
const { localeId, branchId, limit, offset } = request;
- const _queryParams: Record = {};
- if (localeId != null) {
- _queryParams.localeId = localeId;
- }
-
- if (branchId != null) {
- _queryParams.branchId = branchId;
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
+ const _queryParams: Record = {
+ localeId,
+ branchId,
+ limit,
+ offset,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -246,7 +219,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/dom`,
+ `sites/${core.url.encodePathParam(site_id)}/components/${core.url.encodePathParam(component_id)}/dom`,
),
method: "GET",
headers: _headers,
@@ -254,6 +227,8 @@ export class Components {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -325,23 +300,12 @@ export class Components {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- 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,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/sites/{site_id}/components/{component_id}/dom",
+ );
}
/**
@@ -358,10 +322,10 @@ export class Components {
*
* Required scope | `components:write`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {string} componentId - Unique identifier for a Component
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {string} component_id - Unique identifier for a Component
* @param {Webflow.ComponentDomWrite} request
- * @param {Components.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -409,33 +373,31 @@ export class Components {
* })
*/
public updateContent(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentDomWrite,
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__updateContent(siteId, componentId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(
+ this.__updateContent(site_id, component_id, request, requestOptions),
+ );
}
private async __updateContent(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentDomWrite,
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): Promise> {
const { localeId, branchId, ..._body } = request;
- const _queryParams: Record = {};
- if (localeId != null) {
- _queryParams.localeId = localeId;
- }
-
- if (branchId != null) {
- _queryParams.branchId = branchId;
- }
-
+ const _queryParams: Record = {
+ localeId,
+ branchId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -443,7 +405,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/dom`,
+ `sites/${core.url.encodePathParam(site_id)}/components/${core.url.encodePathParam(component_id)}/dom`,
),
method: "POST",
headers: _headers,
@@ -459,6 +421,8 @@ export class Components {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -532,23 +496,12 @@ export class Components {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- 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,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/sites/{site_id}/components/{component_id}/dom",
+ );
}
/**
@@ -558,10 +511,10 @@ export class Components {
*
* Required scope | `components:read`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {string} componentId - Unique identifier for a Component
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {string} component_id - Unique identifier for a Component
* @param {Webflow.ComponentsGetPropertiesRequest} request
- * @param {Components.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -578,41 +531,33 @@ export class Components {
* })
*/
public getProperties(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentsGetPropertiesRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getProperties(siteId, componentId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(
+ this.__getProperties(site_id, component_id, request, requestOptions),
+ );
}
private async __getProperties(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentsGetPropertiesRequest = {},
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): Promise> {
const { localeId, branchId, limit, offset } = request;
- const _queryParams: Record = {};
- if (localeId != null) {
- _queryParams.localeId = localeId;
- }
-
- if (branchId != null) {
- _queryParams.branchId = branchId;
- }
-
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
+ const _queryParams: Record = {
+ localeId,
+ branchId,
+ limit,
+ offset,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -620,7 +565,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/properties`,
+ `sites/${core.url.encodePathParam(site_id)}/components/${core.url.encodePathParam(component_id)}/properties`,
),
method: "GET",
headers: _headers,
@@ -628,6 +573,8 @@ export class Components {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -699,23 +646,12 @@ export class Components {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- 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,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/sites/{site_id}/components/{component_id}/properties",
+ );
}
/**
@@ -729,10 +665,10 @@ export class Components {
*
* Required scope | `components:write`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {string} componentId - Unique identifier for a Component
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {string} component_id - Unique identifier for a Component
* @param {Webflow.ComponentPropertiesWrite} request
- * @param {Components.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {ComponentsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -754,35 +690,31 @@ export class Components {
* })
*/
public updateProperties(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentPropertiesWrite,
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): core.HttpResponsePromise {
return core.HttpResponsePromise.fromPromise(
- this.__updateProperties(siteId, componentId, request, requestOptions),
+ this.__updateProperties(site_id, component_id, request, requestOptions),
);
}
private async __updateProperties(
- siteId: string,
- componentId: string,
+ site_id: string,
+ component_id: string,
request: Webflow.ComponentPropertiesWrite,
- requestOptions?: Components.RequestOptions,
+ requestOptions?: ComponentsClient.RequestOptions,
): Promise> {
const { localeId, branchId, ..._body } = request;
- const _queryParams: Record = {};
- if (localeId != null) {
- _queryParams.localeId = localeId;
- }
-
- if (branchId != null) {
- _queryParams.branchId = branchId;
- }
-
+ const _queryParams: Record = {
+ localeId,
+ branchId,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -790,7 +722,7 @@ export class Components {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/components/${core.url.encodePathParam(componentId)}/properties`,
+ `sites/${core.url.encodePathParam(site_id)}/components/${core.url.encodePathParam(component_id)}/properties`,
),
method: "POST",
headers: _headers,
@@ -806,6 +738,8 @@ export class Components {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -877,26 +811,11 @@ export class Components {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- 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,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "POST",
+ "/sites/{site_id}/components/{component_id}/properties",
+ );
}
}
diff --git a/src/api/resources/components/exports.ts b/src/api/resources/components/exports.ts
new file mode 100644
index 00000000..fbca1f00
--- /dev/null
+++ b/src/api/resources/components/exports.ts
@@ -0,0 +1,4 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { ComponentsClient } from "./client/Client";
+export * from "./client/index";
diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts
index e693dea4..66aea189 100644
--- a/src/api/resources/ecommerce/client/Client.ts
+++ b/src/api/resources/ecommerce/client/Client.ts
@@ -1,24 +1,26 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient";
import * as core from "../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers";
+import { mergeHeaders } from "../../../../core/headers";
import * as environments from "../../../../environments";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../errors/index";
import * as serializers from "../../../../serialization/index";
import * as Webflow from "../../../index";
-export declare namespace Ecommerce {
- export interface Options extends BaseClientOptions {}
+export declare namespace EcommerceClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
-export class Ecommerce {
- protected readonly _options: Ecommerce.Options;
+export class EcommerceClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Ecommerce.Options) {
- this._options = _options;
+ constructor(options: EcommerceClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -26,8 +28,8 @@ export class Ecommerce {
*
* Required scope | `ecommerce:read`
*
- * @param {string} siteId - Unique identifier for a Site
- * @param {Ecommerce.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} site_id - Unique identifier for a Site
+ * @param {EcommerceClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -41,19 +43,20 @@ export class Ecommerce {
* await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741")
*/
public getSettings(
- siteId: string,
- requestOptions?: Ecommerce.RequestOptions,
+ site_id: string,
+ requestOptions?: EcommerceClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__getSettings(siteId, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__getSettings(site_id, requestOptions));
}
private async __getSettings(
- siteId: string,
- requestOptions?: Ecommerce.RequestOptions,
+ site_id: string,
+ requestOptions?: EcommerceClient.RequestOptions,
): Promise> {
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -61,7 +64,7 @@ export class Ecommerce {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/ecommerce/settings`,
+ `sites/${core.url.encodePathParam(site_id)}/ecommerce/settings`,
),
method: "GET",
headers: _headers,
@@ -69,6 +72,8 @@ export class Ecommerce {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -144,26 +149,11 @@ export class Ecommerce {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError(
- "Timeout exceeded when calling GET /sites/{site_id}/ecommerce/settings.",
- );
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
- }
-
- protected async _getAuthorizationHeader(): Promise {
- return `Bearer ${await core.Supplier.get(this._options.accessToken)}`;
+ return handleNonStatusCodeError(
+ _response.error,
+ _response.rawResponse,
+ "GET",
+ "/sites/{site_id}/ecommerce/settings",
+ );
}
}
diff --git a/src/api/resources/ecommerce/exports.ts b/src/api/resources/ecommerce/exports.ts
new file mode 100644
index 00000000..d5dda6c1
--- /dev/null
+++ b/src/api/resources/ecommerce/exports.ts
@@ -0,0 +1,4 @@
+// This file was auto-generated by Fern from our API Definition.
+
+export { EcommerceClient } from "./client/Client";
+export * from "./client/index";
diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts
index 1233afe8..f64a6472 100644
--- a/src/api/resources/forms/client/Client.ts
+++ b/src/api/resources/forms/client/Client.ts
@@ -1,15 +1,17 @@
// This file was auto-generated by Fern from our API Definition.
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient";
+import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "../../../../BaseClient";
import * as core from "../../../../core";
-import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers";
+import { mergeHeaders } from "../../../../core/headers";
import * as environments from "../../../../environments";
+import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError";
import * as errors from "../../../../errors/index";
import * as serializers from "../../../../serialization/index";
import * as Webflow from "../../../index";
-export declare namespace Forms {
- export interface Options extends BaseClientOptions {}
+export declare namespace FormsClient {
+ export type Options = BaseClientOptions;
export interface RequestOptions extends BaseRequestOptions {}
}
@@ -17,11 +19,11 @@ export declare namespace Forms {
/**
* Forms are forms that are created on your Webflow site.
*/
-export class Forms {
- protected readonly _options: Forms.Options;
+export class FormsClient {
+ protected readonly _options: NormalizedClientOptionsWithAuth;
- constructor(_options: Forms.Options) {
- this._options = _options;
+ constructor(options: FormsClient.Options) {
+ this._options = normalizeClientOptionsWithAuth(options);
}
/**
@@ -29,9 +31,9 @@ export class Forms {
*
* Required scope | `forms:read`
*
- * @param {string} siteId - Unique identifier for a Site
+ * @param {string} site_id - Unique identifier for a Site
* @param {Webflow.FormsListRequest} request
- * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {FormsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -48,31 +50,27 @@ export class Forms {
* })
*/
public list(
- siteId: string,
+ site_id: string,
request: Webflow.FormsListRequest = {},
- requestOptions?: Forms.RequestOptions,
+ requestOptions?: FormsClient.RequestOptions,
): core.HttpResponsePromise {
- return core.HttpResponsePromise.fromPromise(this.__list(siteId, request, requestOptions));
+ return core.HttpResponsePromise.fromPromise(this.__list(site_id, request, requestOptions));
}
private async __list(
- siteId: string,
+ site_id: string,
request: Webflow.FormsListRequest = {},
- requestOptions?: Forms.RequestOptions,
+ requestOptions?: FormsClient.RequestOptions,
): Promise> {
const { limit, offset } = request;
- const _queryParams: Record = {};
- if (limit != null) {
- _queryParams.limit = limit.toString();
- }
-
- if (offset != null) {
- _queryParams.offset = offset.toString();
- }
-
+ const _queryParams: Record = {
+ limit,
+ offset,
+ };
+ const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest();
const _headers: core.Fetcher.Args["headers"] = mergeHeaders(
+ _authRequest.headers,
this._options?.headers,
- mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }),
requestOptions?.headers,
);
const _response = await core.fetcher({
@@ -80,7 +78,7 @@ export class Forms {
(await core.Supplier.get(this._options.baseUrl)) ??
((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi)
.base,
- `sites/${core.url.encodePathParam(siteId)}/forms`,
+ `sites/${core.url.encodePathParam(site_id)}/forms`,
),
method: "GET",
headers: _headers,
@@ -88,6 +86,8 @@ export class Forms {
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
abortSignal: requestOptions?.abortSignal,
+ fetchFn: this._options?.fetch,
+ logging: this._options.logging,
});
if (_response.ok) {
return {
@@ -163,21 +163,7 @@ export class Forms {
}
}
- switch (_response.error.reason) {
- case "non-json":
- throw new errors.WebflowError({
- statusCode: _response.error.statusCode,
- body: _response.error.rawBody,
- rawResponse: _response.rawResponse,
- });
- case "timeout":
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling GET /sites/{site_id}/forms.");
- case "unknown":
- throw new errors.WebflowError({
- message: _response.error.errorMessage,
- rawResponse: _response.rawResponse,
- });
- }
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/sites/{site_id}/forms");
}
/**
@@ -185,8 +171,8 @@ export class Forms {
*
* Required scope | `forms:read`
*
- * @param {string} formId - Unique identifier for a Form
- * @param {Forms.RequestOptions} requestOptions - Request-specific configuration.
+ * @param {string} form_id - Unique identifier for a Form
+ * @param {FormsClient.RequestOptions} requestOptions - Request-specific configuration.
*
* @throws {@link Webflow.BadRequestError}
* @throws {@link Webflow.UnauthorizedError}
@@ -198,17 +184,18 @@ export class Forms {
* @example
* await client.forms.get("580e63e98c9a982ac9b8b741")
*/
- public get(formId: string, requestOptions?: Forms.RequestOptions): core.HttpResponsePromise