diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c39c7866..9424323c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,10 @@ jobs: uses: actions/checkout@v4 - name: Set up node - uses: actions/setup-node@v4 - - - name: Install dependencies - run: yarn install + uses: actions/setup-node@v3 - name: Compile - run: yarn build + run: yarn && yarn build test: runs-on: ubuntu-latest @@ -27,42 +24,34 @@ jobs: uses: actions/checkout@v4 - name: Set up node - uses: actions/setup-node@v4 + uses: actions/setup-node@v3 - - name: Install dependencies - run: yarn install - - - name: Test - run: yarn test + - name: Compile + run: yarn && yarn test publish: needs: [ compile, test ] if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest - permissions: - id-token: write # Required for OIDC steps: - name: Checkout repo uses: actions/checkout@v4 - - name: Set up node - uses: actions/setup-node@v4 - + uses: actions/setup-node@v3 - name: Install dependencies run: yarn install - - name: Build run: yarn build - name: Publish to npm run: | - publish() { # use latest npm to ensure OIDC support - npx -y npm@latest publish "$@" - } + npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN} if [[ ${GITHUB_REF} == *alpha* ]]; then - publish --access public --tag alpha + npm publish --access public --tag alpha elif [[ ${GITHUB_REF} == *beta* ]]; then - publish --access public --tag beta + npm publish --access public --tag beta else - publish --access public - fi \ No newline at end of file + npm publish --access public + fi + env: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.mock/definition/__package__.yml b/.mock/definition/__package__.yml index 86ca446a..eaeceb5f 100644 --- a/.mock/definition/__package__.yml +++ b/.mock/definition/__package__.yml @@ -657,15 +657,15 @@ types: docs: Pagination object properties: limit: - type: optional + type: optional docs: The limit used for pagination access: read-only offset: - type: optional + type: optional docs: The offset used for pagination access: read-only total: - type: optional + type: optional docs: The total number of records access: read-only source: @@ -1243,15 +1243,15 @@ types: CollectionItemListPagination: properties: limit: - type: optional + type: optional docs: The limit specified in the request default: 100 offset: - type: optional + type: optional docs: The offset specified for pagination default: 0 total: - type: optional + type: optional docs: Total number of items in the collection source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -1563,15 +1563,15 @@ types: CommentThreadListPagination: properties: limit: - type: double + type: integer docs: The limit specified in the request (default 100) default: 100 offset: - type: double + type: integer docs: The offset specified for pagination default: 0 total: - type: double + type: integer docs: Total number of comment threads source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -1664,15 +1664,15 @@ types: CommentReplyListPagination: properties: limit: - type: double + type: integer docs: The limit specified in the request (default 100) default: 100 offset: - type: double + type: integer docs: The offset specified for pagination default: 0 total: - type: double + type: integer docs: Total number of comment replies source: openapi: ../../../openapi/referenced-specs/v2.yml @@ -2881,18 +2881,18 @@ types: docs: The list users results properties: count: - type: optional + type: optional docs: Number of users returned limit: - type: optional + type: optional docs: The limit specified in the request default: 10 offset: - type: optional + type: optional docs: The offset specified for pagination default: 0 total: - type: optional + type: optional docs: Total number of users in the collection users: type: optional> @@ -2929,18 +2929,18 @@ types: docs: The list access groups results properties: count: - type: optional + type: optional docs: Number of access groups returned limit: - type: optional + type: optional docs: The limit specified in the request default: 10 offset: - type: optional + type: optional docs: The offset specified for pagination default: 0 total: - type: optional + type: optional docs: Total number of access groups in the collection accessGroups: type: optional> diff --git a/.mock/definition/accessGroups.yml b/.mock/definition/accessGroups.yml index 391abe22..ed51e955 100644 --- a/.mock/definition/accessGroups.yml +++ b/.mock/definition/accessGroups.yml @@ -36,12 +36,12 @@ service: name: AccessGroupsListRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' sort: type: optional @@ -63,8 +63,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 sort: CreatedOn response: body: diff --git a/.mock/definition/assets.yml b/.mock/definition/assets.yml index 8c142ae3..dcdff949 100644 --- a/.mock/definition/assets.yml +++ b/.mock/definition/assets.yml @@ -25,12 +25,12 @@ service: name: AssetsListRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -46,8 +46,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: assets: diff --git a/.mock/definition/collections/items.yml b/.mock/definition/collections/items.yml index 53672488..57e6402d 100644 --- a/.mock/definition/collections/items.yml +++ b/.mock/definition/collections/items.yml @@ -200,12 +200,12 @@ service: response. To query multiple locales, input a comma separated string. offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' name: type: optional @@ -237,8 +237,8 @@ service: collection_id: 580e63fc8c9a982ac9b8b745 query-parameters: cmsLocaleId: cmsLocaleId - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 name: name slug: slug sortBy: lastPublished @@ -696,12 +696,12 @@ service: response. To query multiple locales, input a comma separated string. offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' name: type: optional @@ -734,8 +734,8 @@ service: collection_id: 580e63fc8c9a982ac9b8b745 query-parameters: cmsLocaleId: cmsLocaleId - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 name: name slug: slug sortBy: lastPublished diff --git a/.mock/definition/components.yml b/.mock/definition/components.yml index 9bca51f3..3370a4f6 100644 --- a/.mock/definition/components.yml +++ b/.mock/definition/components.yml @@ -28,10 +28,10 @@ service: type: optional docs: Scope the operation to work on a specific branch. limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -50,8 +50,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 query-parameters: branchId: 68026fa68ef6dc744c75b833 - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: components: @@ -129,10 +129,10 @@ service: type: optional docs: Scope the operation to work on a specific branch. limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -153,8 +153,8 @@ service: query-parameters: localeId: 65427cf400e02b306eaa04a0 branchId: 68026fa68ef6dc744c75b833 - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: componentId: 69118560-d0bc-15fc-bbf8-b8fe5f6535b5 @@ -357,10 +357,10 @@ service: type: optional docs: Scope the operation to work on a specific branch. limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -381,8 +381,8 @@ service: query-parameters: localeId: 65427cf400e02b306eaa04a0 branchId: 68026fa68ef6dc744c75b833 - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: componentId: 658205daa3e8206a523b5ad4 diff --git a/.mock/definition/forms.yml b/.mock/definition/forms.yml index 14bc2ad6..08f2926b 100644 --- a/.mock/definition/forms.yml +++ b/.mock/definition/forms.yml @@ -25,10 +25,10 @@ service: name: FormsListRequest query-parameters: limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -48,8 +48,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: forms: @@ -187,12 +187,12 @@ service: name: FormsListSubmissionsRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -209,8 +209,8 @@ service: - path-parameters: form_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: formSubmissions: diff --git a/.mock/definition/orders.yml b/.mock/definition/orders.yml index 82affd79..1f9711e8 100644 --- a/.mock/definition/orders.yml +++ b/.mock/definition/orders.yml @@ -49,12 +49,12 @@ service: type: optional docs: Filter the orders by status offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -73,8 +73,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 query-parameters: status: pending - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: orders: diff --git a/.mock/definition/pages.yml b/.mock/definition/pages.yml index a4f63b00..12d954e1 100644 --- a/.mock/definition/pages.yml +++ b/.mock/definition/pages.yml @@ -33,10 +33,10 @@ service: [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -55,8 +55,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 query-parameters: localeId: 65427cf400e02b306eaa04a0 - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: pages: @@ -332,10 +332,10 @@ service: [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -355,8 +355,8 @@ service: page_id: 63c720f9347c2139b248e552 query-parameters: localeId: 65427cf400e02b306eaa04a0 - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: pageId: 658205daa3e8206a523b5ad4 diff --git a/.mock/definition/products.yml b/.mock/definition/products.yml index 712a4ef5..94749786 100644 --- a/.mock/definition/products.yml +++ b/.mock/definition/products.yml @@ -33,12 +33,12 @@ service: name: ProductsListRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -56,8 +56,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: items: diff --git a/.mock/definition/sites/activityLogs.yml b/.mock/definition/sites/activityLogs.yml index fc8d76f3..01f30f97 100644 --- a/.mock/definition/sites/activityLogs.yml +++ b/.mock/definition/sites/activityLogs.yml @@ -30,10 +30,10 @@ service: name: ActivityLogsListRequest query-parameters: limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -50,8 +50,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 response: body: items: diff --git a/.mock/definition/sites/comments.yml b/.mock/definition/sites/comments.yml index e2afdd16..3885152d 100644 --- a/.mock/definition/sites/comments.yml +++ b/.mock/definition/sites/comments.yml @@ -74,12 +74,12 @@ service: [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' sortBy: type: optional @@ -104,8 +104,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 query-parameters: localeId: 65427cf400e02b306eaa04a0 - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 sortBy: createdOn sortOrder: asc response: @@ -193,12 +193,12 @@ service: [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' sortBy: type: optional @@ -224,8 +224,8 @@ service: comment_thread_id: 580e63e98c9a982ac9b8b741 query-parameters: localeId: 65427cf400e02b306eaa04a0 - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 sortBy: createdOn sortOrder: asc response: @@ -286,12 +286,12 @@ service: [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' sortBy: type: optional @@ -317,8 +317,8 @@ service: comment_thread_id: 580e63e98c9a982ac9b8b741 query-parameters: localeId: 65427cf400e02b306eaa04a0 - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 sortBy: createdOn sortOrder: asc response: diff --git a/.mock/definition/sites/forms.yml b/.mock/definition/sites/forms.yml index 2e550af4..27e1e1d8 100644 --- a/.mock/definition/sites/forms.yml +++ b/.mock/definition/sites/forms.yml @@ -51,12 +51,12 @@ service: type: optional docs: Identifier for an element offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -74,8 +74,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 query-parameters: elementId: 18259716-3e5a-646a-5f41-5dc4b9405aa0 - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: formSubmissions: @@ -130,12 +130,12 @@ service: name: FormsListSubmissionsRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -153,8 +153,8 @@ service: site_id: 580e63e98c9a982ac9b8b741 form_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: formSubmissions: diff --git a/.mock/definition/sites/scripts.yml b/.mock/definition/sites/scripts.yml index 5128cef5..6762c85e 100644 --- a/.mock/definition/sites/scripts.yml +++ b/.mock/definition/sites/scripts.yml @@ -189,12 +189,12 @@ service: name: ScriptsListCustomCodeBlocksRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' response: docs: Request was successful @@ -210,8 +210,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 response: body: blocks: diff --git a/.mock/definition/users.yml b/.mock/definition/users.yml index 2a7f08e5..f6f2cd66 100644 --- a/.mock/definition/users.yml +++ b/.mock/definition/users.yml @@ -198,12 +198,12 @@ service: name: UsersListRequest query-parameters: offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' sort: type: optional @@ -228,8 +228,8 @@ service: - path-parameters: site_id: 580e63e98c9a982ac9b8b741 query-parameters: - offset: 1.1 - limit: 1.1 + offset: 1 + limit: 1 sort: CreatedOn response: body: diff --git a/.mock/definition/workspaces/auditLogs.yml b/.mock/definition/workspaces/auditLogs.yml index d30d7aec..b519105d 100644 --- a/.mock/definition/workspaces/auditLogs.yml +++ b/.mock/definition/workspaces/auditLogs.yml @@ -48,10 +48,10 @@ service: name: AuditLogsGetWorkspaceAuditLogsRequest query-parameters: limit: - type: optional + type: optional docs: 'Maximum number of records to be returned (max limit: 100)' offset: - type: optional + type: optional docs: >- Offset used for pagination if the results have more than limit records @@ -81,8 +81,8 @@ service: - path-parameters: workspace_id_or_slug: hitchhikers-workspace query-parameters: - limit: 1.1 - offset: 1.1 + limit: 1 + offset: 1 sortOrder: asc eventType: user_access from: '2025-06-22T16:00:31Z' diff --git a/.npmignore b/.npmignore index c0c40ac1..6db0876c 100644 --- a/.npmignore +++ b/.npmignore @@ -5,7 +5,5 @@ tests .github .fernignore .prettierrc.yml -biome.json tsconfig.json -yarn.lock -pnpm-lock.yaml \ No newline at end of file +yarn.lock \ No newline at end of file diff --git a/.prettierrc.yml b/.prettierrc.yml new file mode 100644 index 00000000..0c06786b --- /dev/null +++ b/.prettierrc.yml @@ -0,0 +1,2 @@ +tabWidth: 4 +printWidth: 120 diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 709200b3..00000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Copyright (c) 2025 Webflow, Inc - -Permission is hereby granted, free of charge, to any person ob- -taining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without restric- -tion, including without limitation the rights to use, copy, modi- -fy, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is fur- -nished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONIN- -FRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/biome.json b/biome.json deleted file mode 100644 index a777468e..00000000 --- a/biome.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", - "root": true, - "vcs": { - "enabled": false - }, - "files": { - "ignoreUnknown": true, - "includes": [ - "**", - "!!dist", - "!!**/dist", - "!!lib", - "!!**/lib", - "!!_tmp_*", - "!!**/_tmp_*", - "!!*.tmp", - "!!**/*.tmp", - "!!.tmp/", - "!!**/.tmp/", - "!!*.log", - "!!**/*.log", - "!!**/.DS_Store", - "!!**/Thumbs.db" - ] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 4, - "lineWidth": 120 - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } - }, - "linter": { - "rules": { - "style": { - "useNodejsImportProtocol": "off" - }, - "suspicious": { - "noAssignInExpressions": "warn", - "noUselessEscapeInString": { - "level": "warn", - "fix": "none", - "options": {} - }, - "noThenProperty": "warn", - "useIterableCallbackReturn": "warn", - "noShadowRestrictedNames": "warn", - "noTsIgnore": { - "level": "warn", - "fix": "none", - "options": {} - }, - "noConfusingVoidType": { - "level": "warn", - "fix": "none", - "options": {} - } - } - } - } -} diff --git a/jest.config.mjs b/jest.config.mjs index d4960c28..3ad4cdb8 100644 --- a/jest.config.mjs +++ b/jest.config.mjs @@ -2,29 +2,8 @@ export default { preset: "ts-jest", testEnvironment: "node", - projects: [ - { - displayName: "unit", - preset: "ts-jest", - testEnvironment: "node", - moduleNameMapper: { - "^(\.{1,2}/.*)\.js$": "$1", - }, - roots: ["/tests"], - testPathIgnorePatterns: ["/tests/wire/"], - setupFilesAfterEnv: [], - }, - { - displayName: "wire", - preset: "ts-jest", - testEnvironment: "node", - moduleNameMapper: { - "^(\.{1,2}/.*)\.js$": "$1", - }, - roots: ["/tests/wire"], - setupFilesAfterEnv: ["/tests/mock-server/setup.ts"], - }, - ], - workerThreads: false, - passWithNoTests: true, + moduleNameMapper: { + "^(\.{1,2}/.*)\.js$": "$1", + }, + setupFilesAfterEnv: ["/tests/mock-server/setup.ts"], }; diff --git a/package.json b/package.json index a8cf5a2c..46626bee 100644 --- a/package.json +++ b/package.json @@ -1,31 +1,31 @@ { "name": "webflow-api", - "version": "3.3.0-beta", + "version": "3.2.2", "private": false, - "repository": "github:webflow/js-webflow-api", + "repository": "https://github.com/webflow/js-webflow-api", "main": "./index.js", "types": "./index.d.ts", "scripts": { - "format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", - "check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none", + "format": "prettier . --write --ignore-unknown", "build": "tsc", "prepack": "cp -rv dist/. .", - "test": "jest --config jest.config.mjs", - "test:unit": "jest --selectProjects unit", - "test:wire": "jest --selectProjects wire" + "test": "jest tests/unit --passWithNoTests", + "test:wire": "jest tests/wire --passWithNoTests", + "wire:test": "yarn test:wire" }, "dependencies": { - "form-data": "^4.0.4", + "url-join": "4.0.1", + "form-data": "^4.0.0", "formdata-node": "^6.0.3", "node-fetch": "^2.7.0", + "qs": "^6.13.1", "readable-stream": "^4.5.2", + "js-base64": "3.7.7", "crypto-browserify": "^3.12.1" }, "devDependencies": { + "@types/url-join": "4.0.1", + "@types/qs": "^6.9.17", "@types/node-fetch": "^2.6.12", "@types/readable-stream": "^4.0.18", "webpack": "^5.97.1", @@ -35,24 +35,19 @@ "@types/jest": "^29.5.14", "ts-jest": "^29.3.4", "jest-environment-jsdom": "^29.7.0", - "msw": "2.11.2", + "msw": "^2.8.4", "@types/node": "^18.19.70", + "prettier": "^3.4.2", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1", "jest-fetch-mock": "^3.0.3" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false, "crypto": false }, "packageManager": "yarn@1.22.22", - "engines": { - "node": ">=18.0.0" - }, - "sideEffects": false, "resolutions": { "pbkdf2": "^3.1.3", "@types/babel__traverse": "7.20.6" diff --git a/reference.md b/reference.md index b5bdce51..90f24bee 100644 --- a/reference.md +++ b/reference.md @@ -1,5 +1,7 @@ # Reference + ## Token +
client.token.authorizedBy() -> Webflow.AuthorizedUser
@@ -15,6 +17,7 @@ Information about the Authorized User Required Scope | `authorized_user:read` +
@@ -30,8 +33,8 @@ Required Scope | `authorized_user:read` ```typescript await client.token.authorizedBy(); - ``` + @@ -45,14 +48,13 @@ await client.token.authorizedBy();
-**requestOptions:** `Token.RequestOptions` - +**requestOptions:** `Token.RequestOptions` +
-
@@ -72,6 +74,7 @@ await client.token.authorizedBy(); Information about the authorization token Access to this endpoint requires a bearer token from a [Data Client App](/data/docs/getting-started-data-clients). + @@ -87,8 +90,8 @@ Information about the authorization token ```typescript await client.token.introspect(); - ``` + @@ -102,19 +105,19 @@ await client.token.introspect();
-**requestOptions:** `Token.RequestOptions` - +**requestOptions:** `Token.RequestOptions` +
- ## Sites +
client.sites.create(workspaceId, { ...params }) -> Webflow.Site
@@ -127,11 +130,12 @@ await client.token.introspect();
-Create a site. +Create a site. This endpoint requires an Enterprise workspace. Required scope | `workspace:write` +
@@ -147,10 +151,10 @@ Required scope | `workspace:write` ```typescript await client.sites.create("580e63e98c9a982ac9b8b741", { - name: "The Hitchhiker's Guide to the Galaxy" + name: "The Hitchhiker's Guide to the Galaxy", }); - ``` +
@@ -165,29 +169,28 @@ await client.sites.create("580e63e98c9a982ac9b8b741", {
**workspaceId:** `string` — Unique identifier for a Workspace - +
-**request:** `Webflow.SitesCreateRequest` - +**request:** `Webflow.SitesCreateRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
-
@@ -207,6 +210,7 @@ await client.sites.create("580e63e98c9a982ac9b8b741", { List of all sites the provided access token is able to access. Required scope | `sites:read` + @@ -222,8 +226,8 @@ Required scope | `sites:read` ```typescript await client.sites.list(); - ``` + @@ -237,14 +241,13 @@ await client.sites.list();
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- @@ -264,6 +267,7 @@ await client.sites.list(); Get details of a site. Required scope | `sites:read` + @@ -279,8 +283,8 @@ Required scope | `sites:read` ```typescript await client.sites.get("580e63e98c9a982ac9b8b741"); - ``` + @@ -295,21 +299,20 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- @@ -326,11 +329,12 @@ await client.sites.get("580e63e98c9a982ac9b8b741");
-Delete a site. +Delete a site. This endpoint requires an Enterprise workspace. Required scope | `sites:write` +
@@ -346,8 +350,8 @@ Required scope | `sites:write` ```typescript await client.sites.delete("580e63e98c9a982ac9b8b741"); - ``` + @@ -362,21 +366,20 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- @@ -393,11 +396,12 @@ await client.sites.delete("580e63e98c9a982ac9b8b741");
-Update a site. +Update a site. This endpoint requires an Enterprise workspace. Required scope | `sites:write` +
@@ -413,8 +417,8 @@ Required scope | `sites:write` ```typescript await client.sites.update("580e63e98c9a982ac9b8b741"); - ``` + @@ -429,29 +433,28 @@ await client.sites.update("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.SitesUpdateRequest` - +**request:** `Webflow.SitesUpdateRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- @@ -471,6 +474,7 @@ await client.sites.update("580e63e98c9a982ac9b8b741"); Get a list of all custom domains related to site. Required scope | `sites:read` + @@ -486,8 +490,8 @@ Required scope | `sites:read` ```typescript await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741"); - ``` + @@ -502,21 +506,20 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- @@ -533,13 +536,14 @@ await client.sites.getCustomDomain("580e63e98c9a982ac9b8b741");
-Publishes a site to one or more more domains. +Publishes a site to one or more more domains. To publish to a specific custom domain, use the domain IDs from the [Get Custom Domains](/data/reference/sites/get-custom-domain) endpoint. This endpoint has a specific rate limit of one successful publish queue per minute. Required scope | `sites:write` +
@@ -556,10 +560,10 @@ Required scope | `sites:write` ```typescript await client.sites.publish("580e63e98c9a982ac9b8b741", { customDomains: ["660c6449dd97ebc7346ac629", "660c6449dd97ebc7346ac62f"], - publishToWebflowSubdomain: false + publishToWebflowSubdomain: false, }); - ``` + @@ -574,34 +578,34 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.SitesPublishRequest` - +**request:** `Webflow.SitesPublishRequest` +
-**requestOptions:** `Sites.RequestOptions` - +**requestOptions:** `Sites.RequestOptions` +
- ## Collections +
client.collections.list(siteId) -> Webflow.CollectionList
@@ -617,6 +621,7 @@ await client.sites.publish("580e63e98c9a982ac9b8b741", { List of all Collections within a Site. Required scope | `cms:read` +
@@ -632,8 +637,8 @@ Required scope | `cms:read` ```typescript await client.collections.list("580e63e98c9a982ac9b8b741"); - ``` + @@ -648,21 +653,20 @@ await client.collections.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
-
@@ -684,6 +688,7 @@ Create a Collection for a site with collection fields. Each collection includes the required _name_ and _slug_ fields, which are generated automatically. You can update the `displayName` of these fields, but the slug for them cannot be changed. Fields slugs are automatically converted to lowercase. Spaces in slugs are replaced with hyphens. Required scope | `cms:write` + @@ -702,28 +707,32 @@ await client.collections.create("580e63e98c9a982ac9b8b741", { displayName: "Blog Posts", singularName: "Blog Post", slug: "posts", - fields: [{ + fields: [ + { isRequired: true, type: "PlainText", displayName: "Title", - helpText: "The title of the blog post" - }, { + helpText: "The title of the blog post", + }, + { isRequired: true, type: "RichText", displayName: "Content", - helpText: "The content of the blog post" - }, { + helpText: "The content of the blog post", + }, + { isRequired: true, type: "Reference", displayName: "Author", helpText: "The author of the blog post", metadata: { - collectionId: "23cc2d952d4e4631ffd4345d2743db4e" - } - }] + collectionId: "23cc2d952d4e4631ffd4345d2743db4e", + }, + }, + ], }); - ``` + @@ -738,29 +747,28 @@ await client.collections.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CollectionsCreateRequest` - +**request:** `Webflow.CollectionsCreateRequest` +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
- @@ -780,6 +788,7 @@ await client.collections.create("580e63e98c9a982ac9b8b741", { Get the full details of a collection from its ID. Required scope | `cms:read` + @@ -795,8 +804,8 @@ Required scope | `cms:read` ```typescript await client.collections.get("580e63fc8c9a982ac9b8b745"); - ``` + @@ -811,21 +820,20 @@ await client.collections.get("580e63fc8c9a982ac9b8b745");
**collectionId:** `string` — Unique identifier for a Collection - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
- @@ -845,6 +853,7 @@ await client.collections.get("580e63fc8c9a982ac9b8b745"); Delete a collection using its ID. Required scope | `cms:write` + @@ -860,8 +869,8 @@ Required scope | `cms:write` ```typescript await client.collections.delete("580e63fc8c9a982ac9b8b745"); - ``` + @@ -876,26 +885,26 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745");
**collectionId:** `string` — Unique identifier for a Collection - +
-**requestOptions:** `Collections.RequestOptions` - +**requestOptions:** `Collections.RequestOptions` +
- ## Pages +
client.pages.list(siteId, { ...params }) -> Webflow.PageList
@@ -911,6 +920,7 @@ await client.collections.delete("580e63fc8c9a982ac9b8b745"); List of all pages for a site. Required scope | `pages:read` +
@@ -927,11 +937,11 @@ Required scope | `pages:read` ```typescript await client.pages.list("580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -946,29 +956,28 @@ await client.pages.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.PagesListRequest` - +**request:** `Webflow.PagesListRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
-
@@ -988,6 +997,7 @@ await client.pages.list("580e63e98c9a982ac9b8b741", { Get metadata information for a single page. Required scope | `pages:read` + @@ -1003,10 +1013,10 @@ Required scope | `pages:read` ```typescript await client.pages.getMetadata("63c720f9347c2139b248e552", { - localeId: "65427cf400e02b306eaa04a0" + localeId: "65427cf400e02b306eaa04a0", }); - ``` + @@ -1021,29 +1031,28 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PagesGetMetadataRequest` - +**request:** `Webflow.PagesGetMetadataRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
- @@ -1063,6 +1072,7 @@ await client.pages.getMetadata("63c720f9347c2139b248e552", { Update Page-level metadata, including SEO and Open Graph fields. Required scope | `pages:write` + @@ -1083,17 +1093,18 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", { slug: "guide-to-the-galaxy", seo: { title: "The Ultimate Hitchhiker's Guide to the Galaxy", - description: "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels." + description: + "Everything you need to know about the galaxy, from avoiding Vogon poetry to the importance of towels.", }, openGraph: { title: "Explore the Cosmos with The Ultimate Guide", titleCopied: false, description: "Dive deep into the mysteries of the universe with your guide to everything galactic.", - descriptionCopied: false - } + descriptionCopied: false, + }, }); - ``` + @@ -1108,29 +1119,28 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PageMetadataWrite` - +**request:** `Webflow.PageMetadataWrite` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
- @@ -1149,9 +1159,10 @@ await client.pages.updatePageSettings("63c720f9347c2139b248e552", { Get text and component instance content from a static page. -Localization +Localization Required scope | `pages:read` + @@ -1168,11 +1179,11 @@ Required scope | `pages:read` ```typescript await client.pages.getContent("63c720f9347c2139b248e552", { localeId: "65427cf400e02b306eaa04a0", - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -1187,29 +1198,28 @@ await client.pages.getContent("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PagesGetContentRequest` - +**request:** `Webflow.PagesGetContentRequest` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
- @@ -1229,6 +1239,7 @@ await client.pages.getContent("63c720f9347c2139b248e552", { This endpoint updates content on a static page in **secondary locales**. It supports updating up to 1000 nodes in a single request. Before making updates: + 1. Use the [get page content](/data/reference/pages-and-components/pages/get-content) endpoint to identify available content nodes and their types. 2. If the page has component instances, retrieve the component's properties that you'll override using the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint. 3. DOM elements may include a `data-w-id` attribute. This attribute is used by Webflow to maintain custom attributes and links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. @@ -1238,6 +1249,7 @@ Before making updates: Required scope | `pages:write` + @@ -1254,41 +1266,54 @@ Required scope | `pages:write` ```typescript await client.pages.updateStaticContent("63c720f9347c2139b248e552", { localeId: "localeId", - nodes: [{ + nodes: [ + { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker's Guide to the Galaxy

" - }, { + text: "

The Hitchhiker's Guide to the Galaxy

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

Don't Panic!

Always know where your towel is.

" - }, { + text: "

Don't Panic!

Always know where your towel is.

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

Time is an illusion

" - }, { + text: "

Time is an illusion

", + }, + { propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", - text: "Life, the Universe and Everything" - }] - }] + text: "Life, the Universe and Everything", + }, + ], + }, + ], }); - ``` + @@ -1303,34 +1328,34 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.PageDomWrite` - +**request:** `Webflow.PageDomWrite` +
-**requestOptions:** `Pages.RequestOptions` - +**requestOptions:** `Pages.RequestOptions` +
- ## Components +
client.components.list(siteId, { ...params }) -> Webflow.ComponentList
@@ -1346,6 +1371,7 @@ await client.pages.updateStaticContent("63c720f9347c2139b248e552", { List of all components for a site. Required scope | `components:read` +
@@ -1362,11 +1388,11 @@ Required scope | `components:read` ```typescript await client.components.list("580e63e98c9a982ac9b8b741", { branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -1381,29 +1407,28 @@ await client.components.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ComponentsListRequest` - +**request:** `Webflow.ComponentsListRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
-
@@ -1426,6 +1451,7 @@ To retrieve dynamic content set by component properties, use the [get component If you do not provide a Locale ID in your request, the response will return any content that can be localized from the Primary locale. Required scope | `components:read` + @@ -1443,11 +1469,11 @@ Required scope | `components:read` await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -1462,7 +1488,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
**siteId:** `string` — Unique identifier for a Site - +
@@ -1470,29 +1496,28 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentsGetContentRequest` - +**request:** `Webflow.ComponentsGetContentRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
- @@ -1512,6 +1537,7 @@ await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-62 This endpoint updates content within a component defintion for **secondary locales**. It supports updating up to 1000 nodes in a single request. Before making updates: + 1. Use the [get component content](/data/reference/pages-and-components/components/get-content) endpoint to identify available content nodes and their types. 2. If your component definition has a component instance nested within it, retrieve the nested component instance's properties that you'll override using the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint. 3. DOM elements may include a `data-w-id` attribute. This attribute is used by Webflow to maintain custom attributes and links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. @@ -1521,6 +1547,7 @@ Before making updates: Required scope | `components:write` + @@ -1538,41 +1565,54 @@ Required scope | `components:write` await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - nodes: [{ + nodes: [ + { nodeId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "

The Hitchhiker's Guide to the Galaxy

" - }, { + text: "

The Hitchhiker's Guide to the Galaxy

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

Don't Panic!

Always know where your towel is.

" - }, { + text: "

Don't Panic!

Always know where your towel is.

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

Time is an illusion

" - }, { + text: "

Time is an illusion

", + }, + { propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f1", - text: "Life, the Universe and Everything" - }] - }] + text: "Life, the Universe and Everything", + }, + ], + }, + ], }); - ``` + @@ -1587,7 +1627,7 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**siteId:** `string` — Unique identifier for a Site - +
@@ -1595,29 +1635,28 @@ await client.components.updateContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentDomWrite` - +**request:** `Webflow.ComponentDomWrite` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
- @@ -1639,6 +1678,7 @@ Get the default property values of a component definition. If you do not include a `localeId` in your request, the response will return any properties that can be localized from the Primary locale. Required scope | `components:read` + @@ -1656,11 +1696,11 @@ Required scope | `components:read` await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -1675,7 +1715,7 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**siteId:** `string` — Unique identifier for a Site - +
@@ -1683,29 +1723,28 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentsGetPropertiesRequest` - +**request:** `Webflow.ComponentsGetPropertiesRequest` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
- @@ -1725,12 +1764,14 @@ await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72 Update the default property values of a component definition in a specificed locale. Before making updates: + 1. Use the [get component properties](/data/reference/pages-and-components/components/get-properties) endpoint to identify properties that can be updated in a secondary locale. 2. Rich Text properties may include a `data-w-id` attribute. This attribute is used by Webflow to maintain links across locales. Always include the original `data-w-id` value in your update requests to ensure consistent behavior across all locales. The request requires a secondary locale ID. If a `localeId` is missing, the request will not be processed and will result in an error. Required scope | `components:write` + @@ -1748,16 +1789,19 @@ Required scope | `components:write` await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - properties: [{ + properties: [ + { propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad623", - text: "The Hitchhiker\u2019s Guide to the Galaxy" - }, { + text: "The Hitchhiker\u2019s Guide to the Galaxy", + }, + { propertyId: "a245c12d-995b-55ee-5ec7-aa36a6cad627", - text: "

Dont Panic!

Always know where your towel is.

" - }] + text: "

Dont Panic!

Always know where your towel is.

", + }, + ], }); - ``` + @@ -1772,7 +1816,7 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
**siteId:** `string` — Unique identifier for a Site - +
@@ -1780,34 +1824,34 @@ await client.components.updateProperties("580e63e98c9a982ac9b8b741", "8505ba55-e
**componentId:** `string` — Unique identifier for a Component - +
-**request:** `Webflow.ComponentPropertiesWrite` - +**request:** `Webflow.ComponentPropertiesWrite` +
-**requestOptions:** `Components.RequestOptions` - +**requestOptions:** `Components.RequestOptions` +
- ## Scripts +
client.scripts.list(siteId) -> Webflow.RegisteredScriptList
@@ -1827,6 +1871,7 @@ Get a list of scripts that have been registered to a site. A site can have a max Required scope | `custom_code:read` +
@@ -1842,8 +1887,8 @@ Required scope | `custom_code:read` ```typescript await client.scripts.list("580e63e98c9a982ac9b8b741"); - ``` + @@ -1858,21 +1903,20 @@ await client.scripts.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
-
@@ -1896,6 +1940,7 @@ Register a hosted script to a site. Required scope | `custom_code:write` + @@ -1914,10 +1959,10 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", { hostedLocation: "hostedLocation", integrityHash: "integrityHash", version: "version", - displayName: "displayName" + displayName: "displayName", }); - ``` + @@ -1932,29 +1977,28 @@ await client.scripts.registerHosted("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CustomCodeHostedRequest` - +**request:** `Webflow.CustomCodeHostedRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- @@ -1978,6 +2022,7 @@ Register an inline script to a site. Inline scripts are limited to 2000 characte Required scope | `custom_code:write` + @@ -1995,10 +2040,10 @@ Required scope | `custom_code:write` await client.scripts.registerInline("580e63e98c9a982ac9b8b741", { sourceCode: "alert('hello world');", version: "0.0.1", - displayName: "Alert" + displayName: "Alert", }); - ``` + @@ -2013,34 +2058,34 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.CustomCodeInlineRequest` - +**request:** `Webflow.CustomCodeInlineRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- ## Assets +
client.assets.list(siteId, { ...params }) -> Webflow.Assets
@@ -2056,6 +2101,7 @@ await client.scripts.registerInline("580e63e98c9a982ac9b8b741", { List of assets uploaded to a site Required scope | `assets:read` +
@@ -2071,11 +2117,11 @@ Required scope | `assets:read` ```typescript await client.assets.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -2090,29 +2136,28 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsListRequest` - +**request:** `Webflow.AssetsListRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
-
@@ -2129,18 +2174,16 @@ await client.assets.list("580e63e98c9a982ac9b8b741", {
-The first step in uploading an asset to a site. - +The first step in uploading an asset to a site. This endpoint generates a response with the following information: `uploadUrl` and `uploadDetails`. - Use these properties in the header of a [POST request to Amazson s3](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPOST.html) to complete the upload. - To learn more about how to upload assets to Webflow, see our [assets guide](/data/docs/working-with-assets). - - Required scope | `assets:write` + +Required scope | `assets:write` +
@@ -2157,10 +2200,10 @@ To learn more about how to upload assets to Webflow, see our [assets guide](/dat ```typescript await client.assets.create("580e63e98c9a982ac9b8b741", { fileName: "file.png", - fileHash: "3c7d87c9575702bc3b1e991f4d3c638e" + fileHash: "3c7d87c9575702bc3b1e991f4d3c638e", }); - ``` + @@ -2175,29 +2218,28 @@ await client.assets.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsCreateRequest` - +**request:** `Webflow.AssetsCreateRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2217,6 +2259,7 @@ await client.assets.create("580e63e98c9a982ac9b8b741", { Get details about an asset Required scope | `assets:read` + @@ -2232,8 +2275,8 @@ Required scope | `assets:read` ```typescript await client.assets.get("580e63fc8c9a982ac9b8b745"); - ``` + @@ -2248,21 +2291,20 @@ await client.assets.get("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2282,6 +2324,7 @@ await client.assets.get("580e63fc8c9a982ac9b8b745"); Delete an Asset Required Scope: `assets: write` + @@ -2297,8 +2340,8 @@ Required Scope: `assets: write` ```typescript await client.assets.delete("580e63fc8c9a982ac9b8b745"); - ``` + @@ -2313,21 +2356,20 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2347,6 +2389,7 @@ await client.assets.delete("580e63fc8c9a982ac9b8b745"); Update details of an Asset. Required scope | `assets:write` + @@ -2362,8 +2405,8 @@ Required scope | `assets:write` ```typescript await client.assets.update("580e63fc8c9a982ac9b8b745"); - ``` + @@ -2378,29 +2421,28 @@ await client.assets.update("580e63fc8c9a982ac9b8b745");
**assetId:** `string` — Unique identifier for an Asset on a site - +
-**request:** `Webflow.AssetsUpdateRequest` - +**request:** `Webflow.AssetsUpdateRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2420,6 +2462,7 @@ await client.assets.update("580e63fc8c9a982ac9b8b745"); List Asset Folders within a given site Required scope | `assets:read` + @@ -2435,8 +2478,8 @@ Required scope | `assets:read` ```typescript await client.assets.listFolders("580e63e98c9a982ac9b8b741"); - ``` + @@ -2451,21 +2494,20 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2485,6 +2527,7 @@ await client.assets.listFolders("580e63e98c9a982ac9b8b741"); Create an Asset Folder within a given site Required scope | `assets:write` + @@ -2500,10 +2543,10 @@ Required scope | `assets:write` ```typescript await client.assets.createFolder("580e63e98c9a982ac9b8b741", { - displayName: "my asset folder" + displayName: "my asset folder", }); - ``` + @@ -2518,29 +2561,28 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AssetsCreateFolderRequest` - +**request:** `Webflow.AssetsCreateFolderRequest` +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- @@ -2560,6 +2602,7 @@ await client.assets.createFolder("580e63e98c9a982ac9b8b741", { Get details about a specific Asset Folder Required scope | `assets:read` + @@ -2575,8 +2618,8 @@ Required scope | `assets:read` ```typescript await client.assets.getFolder("6390c49774a71f0e3c1a08ee"); - ``` + @@ -2591,26 +2634,26 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee");
**assetFolderId:** `string` — Unique identifier for an Asset Folder - +
-**requestOptions:** `Assets.RequestOptions` - +**requestOptions:** `Assets.RequestOptions` +
- ## Webhooks +
client.webhooks.list(siteId) -> Webflow.WebhookList
@@ -2626,6 +2669,7 @@ await client.assets.getFolder("6390c49774a71f0e3c1a08ee"); List all App-created Webhooks registered for a given site Required scope | `sites:read` +
@@ -2641,8 +2685,8 @@ Required scope | `sites:read` ```typescript await client.webhooks.list("580e63e98c9a982ac9b8b741"); - ``` + @@ -2657,21 +2701,20 @@ await client.webhooks.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
-
@@ -2694,6 +2737,7 @@ Limit of 75 registrations per `triggerType`, per site. Access to this endpoint requires a bearer token from a [Data Client App](/data/docs/getting-started-data-clients). Required scope | `sites:write` + @@ -2715,10 +2759,10 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", { workspaceId: "4f4e46fd476ea8c507000001", siteId: "562ac0395358780a1f5e6fbd", lastTriggered: new Date("2023-02-08T23:59:28.000Z"), - createdOn: new Date("2022-11-08T23:59:28.000Z") + createdOn: new Date("2022-11-08T23:59:28.000Z"), }); - ``` + @@ -2733,29 +2777,28 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Webhook` - +**request:** `Webflow.Webhook` +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
- @@ -2775,6 +2818,7 @@ await client.webhooks.create("580e63e98c9a982ac9b8b741", { Get a specific Webhook instance Required scope: `sites:read` + @@ -2790,8 +2834,8 @@ Required scope: `sites:read` ```typescript await client.webhooks.get("580e64008c9a982ac9b8b754"); - ``` + @@ -2806,21 +2850,20 @@ await client.webhooks.get("580e64008c9a982ac9b8b754");
**webhookId:** `string` — Unique identifier for a Webhook - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
- @@ -2840,6 +2883,7 @@ await client.webhooks.get("580e64008c9a982ac9b8b754"); Remove a Webhook Required scope: `sites:read` + @@ -2855,8 +2899,8 @@ Required scope: `sites:read` ```typescript await client.webhooks.delete("580e64008c9a982ac9b8b754"); - ``` + @@ -2871,26 +2915,26 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754");
**webhookId:** `string` — Unique identifier for a Webhook - +
-**requestOptions:** `Webhooks.RequestOptions` - +**requestOptions:** `Webhooks.RequestOptions` +
- ## Forms +
client.forms.list(siteId, { ...params }) -> Webflow.FormList
@@ -2906,6 +2950,7 @@ await client.webhooks.delete("580e64008c9a982ac9b8b754"); List forms for a given site. Required scope | `forms:read` +
@@ -2921,11 +2966,11 @@ Required scope | `forms:read` ```typescript await client.forms.list("580e63e98c9a982ac9b8b741", { - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` + @@ -2940,29 +2985,28 @@ await client.forms.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.FormsListRequest` - +**request:** `Webflow.FormsListRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
-
@@ -2982,6 +3026,7 @@ await client.forms.list("580e63e98c9a982ac9b8b741", { Get information about a given form. Required scope | `forms:read` + @@ -2997,8 +3042,8 @@ Required scope | `forms:read` ```typescript await client.forms.get("580e63e98c9a982ac9b8b741"); - ``` + @@ -3013,21 +3058,20 @@ await client.forms.get("580e63e98c9a982ac9b8b741");
**formId:** `string` — Unique identifier for a Form - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -3053,6 +3097,7 @@ List form submissions for a given form Required scope | `forms:read` + @@ -3068,11 +3113,11 @@ Required scope | `forms:read` ```typescript await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -3087,29 +3132,28 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", {
**formId:** `string` — Unique identifier for a Form - +
-**request:** `Webflow.FormsListSubmissionsRequest` - +**request:** `Webflow.FormsListSubmissionsRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -3129,6 +3173,7 @@ await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { Get information about a given form submissio. Required scope | `forms:read` + @@ -3144,8 +3189,8 @@ Required scope | `forms:read` ```typescript await client.forms.getSubmission("580e63e98c9a982ac9b8b741"); - ``` + @@ -3160,21 +3205,20 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -3193,8 +3237,8 @@ await client.forms.getSubmission("580e63e98c9a982ac9b8b741"); Delete a form submission - Required scope | `forms:write` + @@ -3210,8 +3254,8 @@ Required scope | `forms:write` ```typescript await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); - ``` + @@ -3226,21 +3270,20 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -3260,6 +3303,7 @@ await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); Update hidden fields on a form submission Required scope | `forms:write` + @@ -3275,8 +3319,8 @@ Required scope | `forms:write` ```typescript await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); - ``` + @@ -3291,34 +3335,34 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741");
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**request:** `Webflow.FormsUpdateSubmissionRequest` - +**request:** `Webflow.FormsUpdateSubmissionRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- ## Users +
client.users.list(siteId, { ...params }) -> Webflow.UserList
@@ -3334,6 +3378,7 @@ await client.forms.updateSubmission("580e63e98c9a982ac9b8b741"); Get a list of users for a site Required scope | `users:read` +
@@ -3349,12 +3394,12 @@ Required scope | `users:read` ```typescript await client.users.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, - sort: "CreatedOn" + offset: 1, + limit: 1, + sort: "CreatedOn", }); - ``` + @@ -3369,29 +3414,28 @@ await client.users.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.UsersListRequest` - +**request:** `Webflow.UsersListRequest` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
-
@@ -3411,6 +3455,7 @@ await client.users.list("580e63e98c9a982ac9b8b741", { Get a User by ID Required scope | `users:read` + @@ -3426,8 +3471,8 @@ Required scope | `users:read` ```typescript await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); - ``` + @@ -3442,7 +3487,7 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
@@ -3450,21 +3495,20 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741");
**userId:** `string` — Unique identifier for a User - +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
- @@ -3484,6 +3528,7 @@ await client.users.get("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); Delete a User by ID Required scope | `users:write` + @@ -3499,8 +3544,8 @@ Required scope | `users:write` ```typescript await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); - ``` + @@ -3515,7 +3560,7 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**siteId:** `string` — Unique identifier for a Site - +
@@ -3523,21 +3568,20 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**userId:** `string` — Unique identifier for a User - +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
- @@ -3554,12 +3598,13 @@ await client.users.delete("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Update a User by ID +Update a User by ID - Required scope | `users:write` +Required scope | `users:write` The email and password fields cannot be updated using this endpoint +
@@ -3582,13 +3627,15 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741" createdOn: new Date("2022-05-20T13:46:12.000Z"), lastLogin: new Date("2022-05-20T13:46:12.000Z"), status: "verified", - accessGroups: [{ + accessGroups: [ + { slug: "webflowers", - type: "admin" - }] + type: "admin", + }, + ], }); - ``` + @@ -3603,7 +3650,7 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**siteId:** `string` — Unique identifier for a Site - +
@@ -3611,29 +3658,28 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
**userId:** `string` — Unique identifier for a User - +
-**request:** `Webflow.User` - +**request:** `Webflow.User` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
- @@ -3650,11 +3696,12 @@ await client.users.update("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"
-Create and invite a user with an email address. +Create and invite a user with an email address. -The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. +The user will be sent and invite via email, which they will need to accept in order to join paid any paid access group. Required scope | `users:write` +
@@ -3671,10 +3718,10 @@ Required scope | `users:write` ```typescript await client.users.invite("580e63e98c9a982ac9b8b741", { email: "some.one@home.com", - accessGroups: ["accessGroups"] + accessGroups: ["accessGroups"], }); - ``` + @@ -3689,34 +3736,34 @@ await client.users.invite("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.UsersInviteRequest` - +**request:** `Webflow.UsersInviteRequest` +
-**requestOptions:** `Users.RequestOptions` - +**requestOptions:** `Users.RequestOptions` +
- ## AccessGroups +
client.accessGroups.list(siteId, { ...params }) -> Webflow.AccessGroupList
@@ -3732,6 +3779,7 @@ await client.users.invite("580e63e98c9a982ac9b8b741", { Get a list of access groups for a site Required scope | `users:read` +
@@ -3747,12 +3795,12 @@ Required scope | `users:read` ```typescript await client.accessGroups.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, - sort: "CreatedOn" + offset: 1, + limit: 1, + sort: "CreatedOn", }); - ``` + @@ -3767,34 +3815,34 @@ await client.accessGroups.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.AccessGroupsListRequest` - +**request:** `Webflow.AccessGroupsListRequest` +
-**requestOptions:** `AccessGroups.RequestOptions` - +**requestOptions:** `AccessGroups.RequestOptions` +
-
## Products +
client.products.list(siteId, { ...params }) -> Webflow.ProductAndSkUsList
@@ -3807,12 +3855,13 @@ await client.accessGroups.list("580e63e98c9a982ac9b8b741", {
-Retrieve all products for a site. +Retrieve all products for a site. Use `limit` and `offset` to page through all products with subsequent requests. All SKUs for each product will also be fetched and returned. The `limit`, `offset` and `total` values represent Products only and do not include any SKUs. Required scope | `ecommerce:read` +
@@ -3828,11 +3877,11 @@ Required scope | `ecommerce:read` ```typescript await client.products.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` +
@@ -3847,29 +3896,28 @@ await client.products.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ProductsListRequest` - +**request:** `Webflow.ProductsListRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
-
@@ -3889,13 +3937,15 @@ await client.products.list("580e63e98c9a982ac9b8b741", { Create a new ecommerce product and defaultSKU. A product, at minimum, must have a single SKU. To create a product with multiple SKUs: - - First, create a list of `sku-properties`, also known as [product options](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). For example, a T-shirt product may have a "color" `sku-property`, with a list of enum values: red, yellow, and blue, another `sku-property` may be "size", with a list of enum values: small, medium, and large. - - Once, a product is created with a list of `sku-properties`, Webflow will create a **default SKU**, which is always a combination of the first `enum` values of each `sku-property`. (e.g. Small - Red - T-Shirt) - - After creation, you can create additional SKUs for the product, using the [Create SKUs endpoint.](/data/reference/ecommerce/products/create-sku) + +- First, create a list of `sku-properties`, also known as [product options](https://help.webflow.com/hc/en-us/articles/33961334531347-Create-product-options-and-variants). For example, a T-shirt product may have a "color" `sku-property`, with a list of enum values: red, yellow, and blue, another `sku-property` may be "size", with a list of enum values: small, medium, and large. +- Once, a product is created with a list of `sku-properties`, Webflow will create a **default SKU**, which is always a combination of the first `enum` values of each `sku-property`. (e.g. Small - Red - T-Shirt) +- After creation, you can create additional SKUs for the product, using the [Create SKUs endpoint.](/data/reference/ecommerce/products/create-sku) Upon creation, the default product type will be `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` + @@ -3917,40 +3967,51 @@ await client.products.create("580e63e98c9a982ac9b8b741", { name: "Colorful T-shirt", slug: "colorful-t-shirt", description: "Our best-selling t-shirt available in multiple colors and sizes", - skuProperties: [{ + skuProperties: [ + { id: "color", name: "Color", - "enum": [{ + enum: [ + { id: "red", name: "Red", - slug: "red" - }, { + slug: "red", + }, + { id: "yellow", name: "Yellow", - slug: "yellow" - }, { + slug: "yellow", + }, + { id: "blue", name: "Blue", - slug: "blue" - }] - }, { + slug: "blue", + }, + ], + }, + { id: "size", name: "Size", - "enum": [{ + enum: [ + { id: "small", name: "Small", - slug: "small" - }, { + slug: "small", + }, + { id: "medium", name: "Medium", - slug: "medium" - }, { + slug: "medium", + }, + { id: "large", name: "Large", - slug: "large" - }] - }] - } + slug: "large", + }, + ], + }, + ], + }, }, sku: { fieldData: { @@ -3959,14 +4020,15 @@ await client.products.create("580e63e98c9a982ac9b8b741", { price: { value: 2499, unit: "USD", - currency: "USD" + currency: "USD", }, - mainImage: "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987" - } - } + mainImage: + "https://rocketamp-sample-store.myshopify.com/cdn/shop/products/Gildan_2000_Antique_Cherry_Red_Front_1024x1024.jpg?v=1527232987", + }, + }, }); - ``` + @@ -3981,29 +4043,28 @@ await client.products.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ProductSkuCreate` - +**request:** `Webflow.ProductSkuCreate` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
- @@ -4024,6 +4085,7 @@ Retrieve a single product by its ID. All of its SKUs will also be retrieved. Required scope | `ecommerce:read` + @@ -4039,8 +4101,8 @@ Required scope | `ecommerce:read` ```typescript await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); - ``` + @@ -4055,7 +4117,7 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
**siteId:** `string` — Unique identifier for a Site - +
@@ -4063,21 +4125,20 @@ await client.products.get("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"
**productId:** `string` — Unique identifier for a Product - +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
- @@ -4099,6 +4160,7 @@ Update an existing Product. Updating an existing Product will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` + @@ -4114,8 +4176,8 @@ Required scope | `ecommerce:write` ```typescript await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745"); - ``` + @@ -4130,7 +4192,7 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
**siteId:** `string` — Unique identifier for a Site - +
@@ -4138,29 +4200,28 @@ await client.products.update("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b7
**productId:** `string` — Unique identifier for a Product - +
-**request:** `Webflow.ProductSkuUpdate` - +**request:** `Webflow.ProductSkuUpdate` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
- @@ -4182,6 +4243,7 @@ Create additional SKUs to manage every [option and variant of your Product.](htt Creating SKUs through the API will set the product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` + @@ -4197,7 +4259,8 @@ Required scope | `ecommerce:write` ```typescript await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b8b745", { - skus: [{ + skus: [ + { id: "66072fb71b89448912e2681c", cmsLocaleId: "653ad57de882f528b32e810e", lastPublished: new Date("2023-03-17T18:47:35.000Z"), @@ -4209,13 +4272,14 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b price: { value: 2499, unit: "USD", - currency: "USD" - } - } - }] + currency: "USD", + }, + }, + }, + ], }); - ``` + @@ -4230,7 +4294,7 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**siteId:** `string` — Unique identifier for a Site - +
@@ -4238,29 +4302,28 @@ await client.products.createSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**productId:** `string` — Unique identifier for a Product - +
-**request:** `Webflow.ProductsCreateSkuRequest` - +**request:** `Webflow.ProductsCreateSkuRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
- @@ -4282,6 +4345,7 @@ Update a specified SKU. Updating an existing SKU will set the Product type to `Advanced`, which ensures all Product and SKU fields will be shown to users in the Designer. Required scope | `ecommerce:write` + @@ -4309,13 +4373,13 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b price: { value: 2499, unit: "USD", - currency: "USD" - } - } - } + currency: "USD", + }, + }, + }, }); - ``` + @@ -4330,7 +4394,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**siteId:** `string` — Unique identifier for a Site - +
@@ -4338,7 +4402,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**productId:** `string` — Unique identifier for a Product - +
@@ -4346,34 +4410,34 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b
**skuId:** `string` — Unique identifier for a SKU - +
-**request:** `Webflow.ProductsUpdateSkuRequest` - +**request:** `Webflow.ProductsUpdateSkuRequest` +
-**requestOptions:** `Products.RequestOptions` - +**requestOptions:** `Products.RequestOptions` +
- ## Orders +
client.orders.list(siteId, { ...params }) -> Webflow.OrderList
@@ -4389,6 +4453,7 @@ await client.products.updateSku("580e63e98c9a982ac9b8b741", "580e63fc8c9a982ac9b List all orders created for a given site. Required scope | `ecommerce:read` +
@@ -4405,11 +4470,11 @@ Required scope | `ecommerce:read` ```typescript await client.orders.list("580e63e98c9a982ac9b8b741", { status: "pending", - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -4424,29 +4489,28 @@ await client.orders.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.OrdersListRequest` - +**request:** `Webflow.OrdersListRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
-
@@ -4467,6 +4531,7 @@ Retrieve a single product by its ID. All of its SKUs will also be retrieved. Required scope | `ecommerce:read` + @@ -4482,8 +4547,8 @@ Required scope | `ecommerce:read` ```typescript await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); - ``` + @@ -4498,7 +4563,7 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
**siteId:** `string` — Unique identifier for a Site - +
@@ -4506,21 +4571,20 @@ await client.orders.get("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415");
**orderId:** `string` — Unique identifier for an Order - +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -4542,6 +4606,7 @@ and/or `shippingTracking` for a given order. All three fields can be updated simultaneously or independently. Required scope | `ecommerce:write` + @@ -4557,8 +4622,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); - ``` + @@ -4573,7 +4638,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**siteId:** `string` — Unique identifier for a Site - +
@@ -4581,29 +4646,28 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersUpdateRequest` - +**request:** `Webflow.OrdersUpdateRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -4623,6 +4687,7 @@ await client.orders.update("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415 Updates an order's status to fulfilled Required scope | `ecommerce:write` + @@ -4638,8 +4703,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); - ``` + @@ -4654,7 +4719,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
**siteId:** `string` — Unique identifier for a Site - +
@@ -4662,29 +4727,28 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersUpdateFulfillRequest` - +**request:** `Webflow.OrdersUpdateFulfillRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -4704,6 +4768,7 @@ await client.orders.updateFulfill("580e63e98c9a982ac9b8b741", "5e8518516e1470407 Updates an order's status to unfulfilled Required scope | `ecommerce:write` + @@ -4719,8 +4784,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); - ``` + @@ -4735,7 +4800,7 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
**siteId:** `string` — Unique identifier for a Site - +
@@ -4743,21 +4808,20 @@ await client.orders.updateUnfulfill("580e63e98c9a982ac9b8b741", "5e8518516e14704
**orderId:** `string` — Unique identifier for an Order - +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- @@ -4778,6 +4842,7 @@ This API will reverse a Stripe charge and refund an order back to a customer. It will also set the order's status to `refunded`. Required scope | `ecommerce:write` + @@ -4793,8 +4858,8 @@ Required scope | `ecommerce:write` ```typescript await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415"); - ``` + @@ -4809,7 +4874,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**siteId:** `string` — Unique identifier for a Site - +
@@ -4817,34 +4882,34 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415
**orderId:** `string` — Unique identifier for an Order - +
-**request:** `Webflow.OrdersRefundRequest` - +**request:** `Webflow.OrdersRefundRequest` +
-**requestOptions:** `Orders.RequestOptions` - +**requestOptions:** `Orders.RequestOptions` +
- ## Inventory +
client.inventory.list(skuCollectionId, skuId) -> Webflow.InventoryItem
@@ -4860,6 +4925,7 @@ await client.orders.refund("580e63e98c9a982ac9b8b741", "5e8518516e147040726cc415 List the current inventory levels for a particular SKU item. Required scope | `ecommerce:read` +
@@ -4875,8 +4941,8 @@ Required scope | `ecommerce:read` ```typescript await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc415"); - ``` + @@ -4891,7 +4957,7 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID. - +
@@ -4899,21 +4965,20 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
**skuId:** `string` — Unique identifier for a SKU - +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
-
@@ -4930,13 +4995,15 @@ await client.inventory.list("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc41
-Updates the current inventory levels for a particular SKU item. +Updates the current inventory levels for a particular SKU item. + +Updates may be given in one or two methods, absolutely or incrementally. -Updates may be given in one or two methods, absolutely or incrementally. -- Absolute updates are done by setting `quantity` directly. +- Absolute updates are done by setting `quantity` directly. - Incremental updates are by specifying the inventory delta in `updateQuantity` which is then added to the `quantity` stored on the server. Required scope | `ecommerce:write` +
@@ -4952,10 +5019,10 @@ Required scope | `ecommerce:write` ```typescript await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc415", { - inventoryType: "infinite" + inventoryType: "infinite", }); - ``` + @@ -4970,7 +5037,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
**skuCollectionId:** `string` — Unique identifier for a SKU collection. Use the List Collections API to find this ID. - +
@@ -4978,34 +5045,34 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc
**skuId:** `string` — Unique identifier for a SKU - +
-**request:** `Webflow.InventoryUpdateRequest` - +**request:** `Webflow.InventoryUpdateRequest` +
-**requestOptions:** `Inventory.RequestOptions` - +**requestOptions:** `Inventory.RequestOptions` +
- ## Ecommerce +
client.ecommerce.getSettings(siteId) -> Webflow.EcommerceSettings
@@ -5021,6 +5088,7 @@ await client.inventory.update("6377a7c4b7a79608c34a46f7", "5e8518516e147040726cc Retrieve ecommerce settings for a site. Required scope | `ecommerce:read` +
@@ -5036,8 +5104,8 @@ Required scope | `ecommerce:read` ```typescript await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741"); - ``` + @@ -5052,26 +5120,26 @@ await client.ecommerce.getSettings("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Ecommerce.RequestOptions` - +**requestOptions:** `Ecommerce.RequestOptions` +
-
## Collections Fields +
client.collections.fields.create(collectionId, { ...params }) -> Webflow.FieldCreate
@@ -5091,6 +5159,7 @@ Field validation is currently not available through the API. Bulk creation of fields is not supported with this endpoint. To add multiple fields at once, include them when you [create the collection.](/data/v2.0.0/reference/cms/collections/create) Required scope | `cms:write` +
@@ -5111,10 +5180,10 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { isRequired: false, type: "RichText", displayName: "Post Body", - helpText: "Add the body of your post here" + helpText: "Add the body of your post here", }); - ``` + @@ -5129,29 +5198,28 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.FieldCreate` - +**request:** `Webflow.FieldCreate` +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
-
@@ -5171,6 +5239,7 @@ await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { Delete a custom field in a collection. This endpoint does not currently support bulk deletion. Required scope | `cms:write` + @@ -5186,8 +5255,8 @@ Required scope | `cms:write` ```typescript await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745"); - ``` + @@ -5202,7 +5271,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -5210,21 +5279,20 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**fieldId:** `string` — Unique identifier for a Field in a collection - +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
- @@ -5244,6 +5312,7 @@ await client.collections.fields.delete("580e63fc8c9a982ac9b8b745", "580e63fc8c9a Update a custom field in a collection. Required scope | `cms:write` + @@ -5261,10 +5330,10 @@ Required scope | `cms:write` await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a982ac9b8b745", { isRequired: false, displayName: "Post Body", - helpText: "Add the body of your post here" + helpText: "Add the body of your post here", }); - ``` + @@ -5279,7 +5348,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -5287,34 +5356,34 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a
**fieldId:** `string` — Unique identifier for a Field in a collection - +
-**request:** `Webflow.collections.FieldUpdate` - +**request:** `Webflow.collections.FieldUpdate` +
-**requestOptions:** `Fields.RequestOptions` - +**requestOptions:** `Fields.RequestOptions` +
- ## Collections Items +
client.collections.items.listItems(collectionId, { ...params }) -> Webflow.CollectionItemList
@@ -5330,6 +5399,7 @@ await client.collections.fields.update("580e63fc8c9a982ac9b8b745", "580e63fc8c9a List of all Items within a Collection. Required scope | `CMS:read` +
@@ -5346,15 +5416,15 @@ Required scope | `CMS:read` ```typescript await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { cmsLocaleId: "cmsLocaleId", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, name: "name", slug: "slug", sortBy: "lastPublished", - sortOrder: "asc" + sortOrder: "asc", }); - ``` + @@ -5369,29 +5439,28 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsListItemsRequest` - +**request:** `Webflow.collections.ItemsListItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
-
@@ -5410,10 +5479,10 @@ await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { Create Item(s) in a Collection. - To create items across multiple locales, please use [this endpoint.](/data/reference/cms/collection-items/staged-items/create-items) Required scope | `CMS:write` + @@ -5436,45 +5505,11 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - }, - "image-gallery": [ - { - "fileId": "62b720ef280c7a7a3be8cabd", - "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - }, - { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - } - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: [ - "62b720ef280c7a7a3be8cab1", - "62b720ef280c7a7a3be8cab2" - ], - "downloadable-asset": { - "fileId": "62b720ef280c7a7a3be8cab3", - "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - } - } - } + }, + }, }); - ``` + @@ -5489,29 +5524,28 @@ await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsCreateItemRequest` - +**request:** `Webflow.collections.ItemsCreateItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -5533,6 +5567,7 @@ Delete Items from a Collection. Items will only be deleted in the primary locale unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` + @@ -5548,12 +5583,14 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { - items: [{ - id: "580e64008c9a982ac9b8b754" - }] + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], }); - ``` + @@ -5568,29 +5605,28 @@ await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsDeleteItemsRequest` - +**request:** `Webflow.collections.ItemsDeleteItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -5614,6 +5650,7 @@ The limit for this endpoint is 100 items. Items will only be updated in the primary locale, unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` + @@ -5630,42 +5667,43 @@ Required scope | `CMS:write` ```typescript await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, - items: [{ + 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 - } - }] + }, + }, + ], }); - ``` + @@ -5680,29 +5718,28 @@ await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsUpdateItemsRequest` - +**request:** `Webflow.collections.ItemsUpdateItemsRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -5726,6 +5763,7 @@ List all published items in a collection. Required scope | `CMS:read` + @@ -5742,15 +5780,15 @@ Required scope | `CMS:read` ```typescript await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { cmsLocaleId: "cmsLocaleId", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, name: "name", slug: "slug", sortBy: "lastPublished", - sortOrder: "asc" + sortOrder: "asc", }); - ``` + @@ -5765,29 +5803,28 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsListItemsLiveRequest` - +**request:** `Webflow.collections.ItemsListItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -5806,11 +5843,10 @@ await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { Create item(s) in a collection that will be immediately published to the live site. - To create items across multiple locales, [please use this endpoint.](/data/reference/cms/collection-items/staged-items/create-items) - Required scope | `CMS:write` + @@ -5833,45 +5869,11 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - }, - "image-gallery": [ - { - "fileId": "62b720ef280c7a7a3be8cabd", - "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - }, - { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - } - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: [ - "62b720ef280c7a7a3be8cab1", - "62b720ef280c7a7a3be8cab2" - ], - "downloadable-asset": { - "fileId": "62b720ef280c7a7a3be8cab3", - "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - } - } - } + }, + }, }); - ``` + @@ -5886,29 +5888,28 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsCreateItemLiveRequest` - +**request:** `Webflow.collections.ItemsCreateItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -5925,11 +5926,12 @@ await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
-Unpublish up to 100 items from the live site and set the `isDraft` property to `true`. +Unpublish up to 100 items from the live site and set the `isDraft` property to `true`. Items will only be unpublished in the primary locale unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` +
@@ -5945,12 +5947,14 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { - items: [{ - id: "580e64008c9a982ac9b8b754" - }] + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], }); - ``` + @@ -5965,29 +5969,28 @@ await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsDeleteItemsLiveRequest` - +**request:** `Webflow.collections.ItemsDeleteItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6009,6 +6012,7 @@ Update a single published item or multiple published items (up to 100) in a Coll Items will only be updated in the primary locale, unless a `cmsLocaleId` is included in the request. Required scope | `CMS:write` + @@ -6025,42 +6029,43 @@ Required scope | `CMS:write` ```typescript await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { skipInvalidFiles: true, - items: [{ + 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 - } - }] + }, + }, + ], }); - ``` + @@ -6075,29 +6080,28 @@ await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.ItemsUpdateItemsLiveRequest` - +**request:** `Webflow.collections.ItemsUpdateItemsLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6122,6 +6126,7 @@ Create an item or multiple items in a CMS Collection across multiple correspondi Required scope | `CMS:write` + @@ -6143,11 +6148,11 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { isDraft: false, fieldData: { name: "Don\u2019t Panic", - slug: "dont-panic" - } + slug: "dont-panic", + }, }); - ``` + @@ -6162,29 +6167,28 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.collections.CreateBulkCollectionItemRequestBody` - +**request:** `Webflow.collections.CreateBulkCollectionItemRequestBody` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6204,6 +6208,7 @@ await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { Get details of a selected Collection Item. Required scope | `CMS:read` + @@ -6219,10 +6224,10 @@ Required scope | `CMS:read` ```typescript await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId" + cmsLocaleId: "cmsLocaleId", }); - ``` + @@ -6237,7 +6242,7 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6245,29 +6250,28 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsGetItemRequest` - +**request:** `Webflow.collections.ItemsGetItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6284,9 +6288,10 @@ await client.collections.items.getItem("580e63fc8c9a982ac9b8b745", "580e64008c9a
-Delete an item from a collection. +Delete an item from a collection. Required scope | `CMS:write` +
@@ -6302,10 +6307,10 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId" + cmsLocaleId: "cmsLocaleId", }); - ``` + @@ -6320,7 +6325,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6328,29 +6333,28 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsDeleteItemRequest` - +**request:** `Webflow.collections.ItemsDeleteItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6370,6 +6374,7 @@ await client.collections.items.deleteItem("580e63fc8c9a982ac9b8b745", "580e64008 Update a selected Item in a Collection. Required scope | `CMS:write` + @@ -6392,45 +6397,11 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008 fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - }, - "image-gallery": [ - { - "fileId": "62b720ef280c7a7a3be8cabd", - "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - }, - { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - } - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: [ - "62b720ef280c7a7a3be8cab1", - "62b720ef280c7a7a3be8cab2" - ], - "downloadable-asset": { - "fileId": "62b720ef280c7a7a3be8cab3", - "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - } - } - } + }, + }, }); - ``` + @@ -6445,7 +6416,7 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6453,29 +6424,28 @@ await client.collections.items.updateItem("580e63fc8c9a982ac9b8b745", "580e64008
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsUpdateItemRequest` - +**request:** `Webflow.collections.ItemsUpdateItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6499,6 +6469,7 @@ Get details of a selected Collection live Item. Required scope | `CMS:read` + @@ -6514,10 +6485,10 @@ Required scope | `CMS:read` ```typescript await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId" + cmsLocaleId: "cmsLocaleId", }); - ``` + @@ -6532,7 +6503,7 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6540,29 +6511,28 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsGetItemLiveRequest` - +**request:** `Webflow.collections.ItemsGetItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6579,11 +6549,12 @@ await client.collections.items.getItemLive("580e63fc8c9a982ac9b8b745", "580e6400
-Unpublish a live item from the site and set the `isDraft` property to `true`. +Unpublish a live item from the site and set the `isDraft` property to `true`. For bulk unpublishing, please use [this endpoint.](/data/v2.0.0/reference/cms/collection-items/live-items/delete-items-live) Required scope | `CMS:write` +
@@ -6599,10 +6570,10 @@ Required scope | `CMS:write` ```typescript await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e64008c9a982ac9b8b754", { - cmsLocaleId: "cmsLocaleId" + cmsLocaleId: "cmsLocaleId", }); - ``` + @@ -6617,7 +6588,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6625,29 +6596,28 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsDeleteItemLiveRequest` - +**request:** `Webflow.collections.ItemsDeleteItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6667,6 +6637,7 @@ await client.collections.items.deleteItemLive("580e63fc8c9a982ac9b8b745", "580e6 Update a selected live Item in a Collection. The updates for this Item will be published to the live site. Required scope | `CMS:write` + @@ -6689,45 +6660,11 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6 fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - }, - "image-gallery": [ - { - "fileId": "62b720ef280c7a7a3be8cabd", - "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - }, - { - "fileId": "62b720ef280c7a7a3be8cabe", - "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - } - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: [ - "62b720ef280c7a7a3be8cab1", - "62b720ef280c7a7a3be8cab2" - ], - "downloadable-asset": { - "fileId": "62b720ef280c7a7a3be8cab3", - "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - } - } - } + }, + }, }); - ``` + @@ -6742,7 +6679,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
**collectionId:** `string` — Unique identifier for a Collection - +
@@ -6750,29 +6687,28 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6
**itemId:** `string` — Unique identifier for an Item - +
-**request:** `Webflow.collections.ItemsUpdateItemLiveRequest` - +**request:** `Webflow.collections.ItemsUpdateItemLiveRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- @@ -6792,6 +6728,7 @@ await client.collections.items.updateItemLive("580e63fc8c9a982ac9b8b745", "580e6 Publish an item or multiple items. Required scope | `cms:write` + @@ -6807,10 +6744,10 @@ Required scope | `cms:write` ```typescript await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"] + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], }); - ``` + @@ -6825,34 +6762,34 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
**collectionId:** `string` — Unique identifier for a Collection - +
-**request:** `Webflow.ItemsPublishItemRequest` - +**request:** `Webflow.ItemsPublishItemRequest` +
-**requestOptions:** `Items.RequestOptions` - +**requestOptions:** `Items.RequestOptions` +
- ## Pages Scripts +
client.pages.scripts.getCustomCode(pageId) -> Webflow.ScriptApplyList
@@ -6865,9 +6802,10 @@ await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", {
-Get all scripts applied to a page. +Get all scripts applied to a page. Required scope | `custom_code:read` +
@@ -6883,8 +6821,8 @@ Required scope | `custom_code:read` ```typescript await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552"); - ``` +
@@ -6899,21 +6837,20 @@ await client.pages.scripts.getCustomCode("63c720f9347c2139b248e552");
**pageId:** `string` — Unique identifier for a Page - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
-
@@ -6937,6 +6874,7 @@ Apply registered scripts to a page. If you have multiple scripts your App needs Required scope | `custom_code:write` + @@ -6952,21 +6890,24 @@ Required scope | `custom_code:write` ```typescript await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", { - scripts: [{ + scripts: [ + { id: "cms_slider", location: "header", version: "1.0.0", attributes: { - "my-attribute": "some-value" - } - }, { + "my-attribute": "some-value", + }, + }, + { id: "alert", location: "header", - version: "0.0.1" - }] + version: "0.0.1", + }, + ], }); - ``` + @@ -6981,29 +6922,28 @@ await client.pages.scripts.upsertCustomCode("63c720f9347c2139b248e552", {
**pageId:** `string` — Unique identifier for a Page - +
-**request:** `Webflow.ScriptApplyList` - +**request:** `Webflow.ScriptApplyList` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- @@ -7027,6 +6967,7 @@ To remove individual scripts applied by the App, use the [Add/Update Custom Code Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app). Required scope | `custom_code:write` + @@ -7042,8 +6983,8 @@ Required scope | `custom_code:write` ```typescript await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552"); - ``` + @@ -7058,26 +6999,26 @@ await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552");
**pageId:** `string` — Unique identifier for a Page - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- ## Sites Redirects +
client.sites.redirects.list(siteId) -> Webflow.Redirects
@@ -7097,6 +7038,7 @@ Use this endpoint to review, audit, or manage the redirection rules that control This endpoint requires an Enterprise workspace. Required scope: `sites:read` +
@@ -7112,8 +7054,8 @@ Required scope: `sites:read` ```typescript await client.sites.redirects.list("580e63e98c9a982ac9b8b741"); - ``` + @@ -7128,21 +7070,20 @@ await client.sites.redirects.list("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
-
@@ -7166,6 +7107,7 @@ This endpoint allows you to define a source path (`fromUrl`) and its correspondi This endpoint requires an Enterprise workspace. Required scope: `sites:write` + @@ -7183,10 +7125,10 @@ Required scope: `sites:write` await client.sites.redirects.create("580e63e98c9a982ac9b8b741", { id: "42e1a2b7aa1a13f768a0042a", fromUrl: "/mostly-harmless", - toUrl: "/earth" + toUrl: "/earth", }); - ``` + @@ -7201,29 +7143,28 @@ await client.sites.redirects.create("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Redirect` - +**request:** `Webflow.Redirect` +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
- @@ -7247,6 +7188,7 @@ This is useful for cleaning up outdated or unnecessary redirects, ensuring that This endpoint requires an Enterprise workspace. Required scope: `sites:write` + @@ -7262,8 +7204,8 @@ Required scope: `sites:write` ```typescript await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6"); - ``` + @@ -7278,7 +7220,7 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**siteId:** `string` — Unique identifier for a Site - +
@@ -7286,21 +7228,20 @@ await client.sites.redirects.delete("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**redirectId:** `string` — Unique identifier site rediect - +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
- @@ -7322,6 +7263,7 @@ Update a 301 redirection rule from a site. This endpoint requires an Enterprise workspace. Required scope: `sites:write` + @@ -7339,10 +7281,10 @@ Required scope: `sites:write` await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35ed19500e6", { id: "42e1a2b7aa1a13f768a0042a", fromUrl: "/mostly-harmless", - toUrl: "/earth" + toUrl: "/earth", }); - ``` + @@ -7357,7 +7299,7 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**siteId:** `string` — Unique identifier for a Site - +
@@ -7365,34 +7307,34 @@ await client.sites.redirects.update("580e63e98c9a982ac9b8b741", "66c4cb9a20cac35
**redirectId:** `string` — Unique identifier site rediect - +
-**request:** `Webflow.Redirect` - +**request:** `Webflow.Redirect` +
-**requestOptions:** `Redirects.RequestOptions` - +**requestOptions:** `Redirects.RequestOptions` +
- ## Sites Plans +
client.sites.plans.getSitePlan(siteId) -> Webflow.SitePlan
@@ -7410,6 +7352,7 @@ Get site plan details for the specified Site. This endpoint requires an Enterprise workspace. Required scope | `sites:read` +
@@ -7425,8 +7368,8 @@ Required scope | `sites:read` ```typescript await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741"); - ``` + @@ -7441,26 +7384,26 @@ await client.sites.plans.getSitePlan("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Plans.RequestOptions` - +**requestOptions:** `Plans.RequestOptions` +
-
## Sites RobotsTxt +
client.sites.robotsTxt.get(siteId) -> Webflow.Robots
@@ -7478,6 +7421,7 @@ Retrieve the robots.txt configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope: `site_config:read` +
@@ -7493,8 +7437,8 @@ Required scope: `site_config:read` ```typescript await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741"); - ``` + @@ -7509,21 +7453,20 @@ await client.sites.robotsTxt.get("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
-
@@ -7545,6 +7488,7 @@ Replace the `robots.txt` configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope | `site_config:write` + @@ -7560,15 +7504,17 @@ Required scope | `site_config:write` ```typescript await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", { - rules: [{ + rules: [ + { userAgent: "googlebot", allows: ["/public"], - disallows: ["/vogon-poetry", "/total-perspective-vortex"] - }], - sitemap: "https://heartofgold.ship/sitemap.xml" + disallows: ["/vogon-poetry", "/total-perspective-vortex"], + }, + ], + sitemap: "https://heartofgold.ship/sitemap.xml", }); - ``` + @@ -7583,29 +7529,28 @@ await client.sites.robotsTxt.put("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
- @@ -7629,6 +7574,7 @@ Remove specific rules for a user-agent in your `robots.txt` file. To delete all This endpoint requires an Enterprise workspace. Required scope: `site_config:write` + @@ -7644,14 +7590,16 @@ Required scope: `site_config:write` ```typescript await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", { - rules: [{ + rules: [ + { userAgent: "*", allows: ["/public"], - disallows: ["/bubbles"] - }] + disallows: ["/bubbles"], + }, + ], }); - ``` + @@ -7666,29 +7614,28 @@ await client.sites.robotsTxt.delete("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
- @@ -7710,6 +7657,7 @@ Update the `robots.txt` configuration for various user agents. This endpoint requires an Enterprise workspace. Required scope | `site_config:write` + @@ -7725,15 +7673,17 @@ Required scope | `site_config:write` ```typescript await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", { - rules: [{ + rules: [ + { userAgent: "googlebot", allows: ["/public"], - disallows: ["/vogon-poetry", "/total-perspective-vortex"] - }], - sitemap: "https://heartofgold.ship/sitemap.xml" + disallows: ["/vogon-poetry", "/total-perspective-vortex"], + }, + ], + sitemap: "https://heartofgold.ship/sitemap.xml", }); - ``` + @@ -7748,34 +7698,34 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.Robots` - +**request:** `Webflow.Robots` +
-**requestOptions:** `RobotsTxt.RequestOptions` - +**requestOptions:** `RobotsTxt.RequestOptions` +
- ## Sites WellKnown +
client.sites.wellKnown.put(siteId, { ...params }) -> void
@@ -7791,10 +7741,11 @@ await client.sites.robotsTxt.patch("580e63e98c9a982ac9b8b741", { Upload a supported well-known file to a site. The current restrictions on well-known files are as follows: - - Each file must be smaller than 100kb - - Less than 30 total files - - Have one of the following file extensions (or no extension): `.txt`, `.json`, `.noext` - + +- Each file must be smaller than 100kb +- Less than 30 total files +- Have one of the following file extensions (or no extension): `.txt`, `.json`, `.noext` + `.noext` is a special file extension that removes other extensions. For example, `apple-app-site-association.noext.txt` will be uploaded as `apple-app-site-association`. Use this extension for tools that have trouble uploading extensionless files. @@ -7802,6 +7753,7 @@ The current restrictions on well-known files are as follows: This endpoint requires an Enterprise workspace. Required scope: `site_config:write` +
@@ -7818,11 +7770,12 @@ Required scope: `site_config:write` ```typescript await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", { fileName: "apple-app-site-association.txt", - fileData: "{\n \"applinks\": {\n \"apps\": [],\n \"details\": [\n {\n \"appID\": \"ABCDE12345.com.example.app\",\n \"paths\": [ \"/*\", \"/some/path/*\" ]\n }\n ]\n }\n}\n", - contentType: "application/json" + fileData: + '{\n "applinks": {\n "apps": [],\n "details": [\n {\n "appID": "ABCDE12345.com.example.app",\n "paths": [ "/*", "/some/path/*" ]\n }\n ]\n }\n}\n', + contentType: "application/json", }); - ``` + @@ -7837,29 +7790,28 @@ await client.sites.wellKnown.put("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.WellKnownFile` - +**request:** `Webflow.sites.WellKnownFile` +
-**requestOptions:** `WellKnown.RequestOptions` - +**requestOptions:** `WellKnown.RequestOptions` +
-
@@ -7881,6 +7833,7 @@ Delete existing well-known files from a site. This endpoint requires an Enterprise workspace. Required scope: `site_config:write` + @@ -7896,8 +7849,8 @@ Required scope: `site_config:write` ```typescript await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741"); - ``` + @@ -7912,34 +7865,34 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.WellKnownDeleteRequest` - +**request:** `Webflow.sites.WellKnownDeleteRequest` +
-**requestOptions:** `WellKnown.RequestOptions` - +**requestOptions:** `WellKnown.RequestOptions` +
- ## Sites ActivityLogs +
client.sites.activityLogs.list(siteId, { ...params }) -> Webflow.SiteActivityLogResponse
@@ -7952,11 +7905,12 @@ await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741");
-Retrieve Activity Logs for a specific Site. +Retrieve Activity Logs for a specific Site. This endpoint requires an Enterprise workspace. Required scope: `site_activity:read` +
@@ -7972,11 +7926,11 @@ Required scope: `site_activity:read` ```typescript await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", { - limit: 1.1, - offset: 1.1 + limit: 1, + offset: 1, }); - ``` +
@@ -7991,34 +7945,34 @@ await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.ActivityLogsListRequest` - +**request:** `Webflow.sites.ActivityLogsListRequest` +
-**requestOptions:** `ActivityLogs.RequestOptions` - +**requestOptions:** `ActivityLogs.RequestOptions` +
-
## Sites Comments +
client.sites.comments.listCommentThreads(siteId, { ...params }) -> Webflow.CommentThreadList
@@ -8038,6 +7992,7 @@ List all comment threads for a site. Required scope | `comments:read` +
@@ -8054,13 +8009,13 @@ Required scope | `comments:read` ```typescript await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", - sortOrder: "asc" + sortOrder: "asc", }); - ``` + @@ -8075,29 +8030,28 @@ await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.CommentsListCommentThreadsRequest` - +**request:** `Webflow.sites.CommentsListCommentThreadsRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
-
@@ -8121,6 +8075,7 @@ Get details of a specific comment thread. Required scope | `comments:read` + @@ -8137,13 +8092,13 @@ Required scope | `comments:read` ```typescript await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", - sortOrder: "asc" + sortOrder: "asc", }); - ``` + @@ -8158,7 +8113,7 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
**siteId:** `string` — Unique identifier for a Site - +
@@ -8166,29 +8121,28 @@ await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63
**commentThreadId:** `string` — Unique identifier for a Comment Thread - +
-**request:** `Webflow.sites.CommentsGetCommentThreadRequest` - +**request:** `Webflow.sites.CommentsGetCommentThreadRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
- @@ -8212,6 +8166,7 @@ List all replies to a specific comment thread. Required scope | `comments:read` + @@ -8228,13 +8183,13 @@ Required scope | `comments:read` ```typescript await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", - sortOrder: "asc" + sortOrder: "asc", }); - ``` + @@ -8249,7 +8204,7 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
**siteId:** `string` — Unique identifier for a Site - +
@@ -8257,34 +8212,34 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
**commentThreadId:** `string` — Unique identifier for a Comment Thread - +
-**request:** `Webflow.sites.CommentsListCommentRepliesRequest` - +**request:** `Webflow.sites.CommentsListCommentRepliesRequest` +
-**requestOptions:** `Comments.RequestOptions` - +**requestOptions:** `Comments.RequestOptions` +
- ## Sites Scripts +
client.sites.scripts.getCustomCode(siteId) -> Webflow.ScriptApplyList
@@ -8297,13 +8252,14 @@ await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e
-Get all scripts applied to a site by the App. +Get all scripts applied to a site by the App. To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information. - + Required scope | `custom_code:read` +
@@ -8319,8 +8275,8 @@ Required scope | `custom_code:read` ```typescript await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741"); - ``` +
@@ -8335,21 +8291,20 @@ await client.sites.scripts.getCustomCode("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
-
@@ -8373,6 +8328,7 @@ Apply registered scripts to a site. If you have multiple scripts your App needs Required scope | `custom_code:write` + @@ -8388,21 +8344,24 @@ Required scope | `custom_code:write` ```typescript await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", { - scripts: [{ + scripts: [ + { id: "cms_slider", location: "header", version: "1.0.0", attributes: { - "my-attribute": "some-value" - } - }, { + "my-attribute": "some-value", + }, + }, + { id: "alert", location: "header", - version: "0.0.1" - }] + version: "0.0.1", + }, + ], }); - ``` + @@ -8417,29 +8376,28 @@ await client.sites.scripts.upsertCustomCode("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.ScriptApplyList` - +**request:** `Webflow.ScriptApplyList` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- @@ -8463,6 +8421,7 @@ To remove individual scripts applied by the App, use the [Add/Update Custom Code Access to this endpoint requires a bearer token obtained from an [OAuth Code Grant Flow](/data/reference/oauth-app). Required scope | `custom_code:write` + @@ -8478,8 +8437,8 @@ Required scope | `custom_code:write` ```typescript await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741"); - ``` + @@ -8494,21 +8453,20 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
**siteId:** `string` — Unique identifier for a Site - +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- @@ -8525,7 +8483,7 @@ await client.sites.scripts.deleteCustomCode("580e63e98c9a982ac9b8b741");
-Get a list of scripts that have been applied to a site and/or individual pages. +Get a list of scripts that have been applied to a site and/or individual pages. To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. @@ -8534,6 +8492,7 @@ Get a list of scripts that have been applied to a site and/or individual pages. Required scope | `custom_code:read` +
@@ -8549,11 +8508,11 @@ Required scope | `custom_code:read` ```typescript await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -8568,34 +8527,34 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.ScriptsListCustomCodeBlocksRequest` - +**request:** `Webflow.sites.ScriptsListCustomCodeBlocksRequest` +
-**requestOptions:** `Scripts.RequestOptions` - +**requestOptions:** `Scripts.RequestOptions` +
- ## Sites Forms +
client.sites.forms.listSubmissionsBySite(siteId, { ...params }) -> Webflow.FormSubmissionList
@@ -8610,7 +8569,7 @@ await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { List all form submissions for a given site with the ability to filter submissions by a centralized `elementId`. -Add `elementId` when you want to filter form submissions to a specific form in a site. You can get the `elementId` from the [List forms endpoint](/data/reference/forms/forms/list) (displayed as `formElementId` in the response). +Add `elementId` when you want to filter form submissions to a specific form in a site. You can get the `elementId` from the [List forms endpoint](/data/reference/forms/forms/list) (displayed as `formElementId` in the response). When a form is used in a Webflow component definition, each instance of the component will yield a unique form. Adding the `elementId` in this request ensures this API response includes all submissions from that core form, wherever that form is used in instantiated components. @@ -8619,6 +8578,7 @@ When a form is used in a Webflow component definition, each instance of the comp Use the [List Form Submissions endpoint](/data/reference/forms/form-submissions/list-submissions) to list form submissions for a given form ID. Required scope | `forms:read` +
@@ -8635,11 +8595,11 @@ Required scope | `forms:read` ```typescript await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", { elementId: "18259716-3e5a-646a-5f41-5dc4b9405aa0", - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -8654,29 +8614,28 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
**siteId:** `string` — Unique identifier for a Site - +
-**request:** `Webflow.sites.FormsListSubmissionsBySiteRequest` - +**request:** `Webflow.sites.FormsListSubmissionsBySiteRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
-
@@ -8693,11 +8652,12 @@ await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", {
-List form submissions for a given form ID within a specific site. +List form submissions for a given form ID within a specific site. Use the [List Form Submissions by Site endpoint](/data/reference/forms/form-submissions/list-submissions-by-site) to list form submissions for a given site with the ability to filter by a `formElementId`. Required scope | `forms:read` +
@@ -8713,11 +8673,11 @@ Required scope | `forms:read` ```typescript await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1 + offset: 1, + limit: 1, }); - ``` + @@ -8732,7 +8692,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
**siteId:** `string` — Unique identifier for a Site - +
@@ -8740,29 +8700,28 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c
**formId:** `string` — Unique identifier for a Form - +
-**request:** `Webflow.sites.FormsListSubmissionsRequest` - +**request:** `Webflow.sites.FormsListSubmissionsRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -8782,6 +8741,7 @@ await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c Get information about a form submission within a specific site. Required scope | `forms:read` + @@ -8797,8 +8757,8 @@ Required scope | `forms:read` ```typescript await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); - ``` + @@ -8813,7 +8773,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
**siteId:** `string` — Unique identifier for a Site - +
@@ -8821,21 +8781,20 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -8855,6 +8814,7 @@ await client.sites.forms.getSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a Delete a form submission within a specific site. Required scope | `forms:write` + @@ -8870,8 +8830,8 @@ Required scope | `forms:write` ```typescript await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); - ``` + @@ -8886,7 +8846,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**siteId:** `string` — Unique identifier for a Site - +
@@ -8894,21 +8854,20 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- @@ -8928,6 +8887,7 @@ await client.sites.forms.deleteSubmission("580e63e98c9a982ac9b8b741", "580e63e98 Update hidden fields on a form submission within a specific site. Required scope | `forms:write` + @@ -8943,8 +8903,8 @@ Required scope | `forms:write` ```typescript await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741"); - ``` + @@ -8959,7 +8919,7 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**siteId:** `string` — Unique identifier for a Site - +
@@ -8967,34 +8927,34 @@ await client.sites.forms.updateSubmission("580e63e98c9a982ac9b8b741", "580e63e98
**formSubmissionId:** `string` — Unique identifier for a Form Submission - +
-**request:** `Webflow.sites.FormsUpdateSubmissionRequest` - +**request:** `Webflow.sites.FormsUpdateSubmissionRequest` +
-**requestOptions:** `Forms.RequestOptions` - +**requestOptions:** `Forms.RequestOptions` +
- ## Workspaces AuditLogs +
client.workspaces.auditLogs.getWorkspaceAuditLogs(workspaceIdOrSlug, { ...params }) -> Webflow.WorkspaceAuditLogResponse
@@ -9012,6 +8972,7 @@ Get audit logs for a workspace. This endpoint requires an Enterprise workspace and a workspace token with the `workspace_activity:read` scope. Create a workspace token from your workspace dashboard integrations page to use this endpoint. Required scope | `workspace_activity:read` +
@@ -9027,15 +8988,15 @@ Required scope | `workspace_activity:read` ```typescript await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace", { - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, sortOrder: "asc", eventType: "user_access", from: new Date("2025-06-22T16:00:31.000Z"), - to: new Date("2025-07-22T16:00:31.000Z") + to: new Date("2025-07-22T16:00:31.000Z"), }); - ``` + @@ -9050,29 +9011,28 @@ await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace",
**workspaceIdOrSlug:** `string` — Unique identifier or slug for a Workspace - +
-**request:** `Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequest` - +**request:** `Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequest` +
-**requestOptions:** `AuditLogs.RequestOptions` - +**requestOptions:** `AuditLogs.RequestOptions` +
-
diff --git a/src/BaseClient.ts b/src/BaseClient.ts deleted file mode 100644 index 4243fb9e..00000000 --- a/src/BaseClient.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as core from "./core"; -import type * as environments from "./environments"; - -export interface 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; -} - -export interface BaseRequestOptions { - /** The maximum time to wait for a response in seconds. */ - timeoutInSeconds?: number; - /** The number of times to retry the request. Defaults to 2. */ - maxRetries?: number; - /** A hook to abort the request. */ - abortSignal?: AbortSignal; - /** Additional query string parameters to include in the request. */ - queryParams?: Record; - /** Additional headers to include in the request. */ - headers?: Record | null | undefined>; -} diff --git a/src/Client.ts b/src/Client.ts index 85aad5a2..a06fbc3e 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -1,29 +1,47 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import { AccessGroups } from "./api/resources/accessGroups/client/Client"; -import { Assets } from "./api/resources/assets/client/Client"; +import * as environments from "./environments"; +import * as core from "./core"; +import { mergeHeaders } from "./core/headers.js"; +import { Token } from "./api/resources/token/client/Client"; +import { Sites } from "./api/resources/sites/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 { Components } from "./api/resources/components/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 { Users } from "./api/resources/users/client/Client"; +import { Assets } from "./api/resources/assets/client/Client"; import { Webhooks } from "./api/resources/webhooks/client/Client"; +import { Forms } from "./api/resources/forms/client/Client"; +import { Users } from "./api/resources/users/client/Client"; +import { AccessGroups } from "./api/resources/accessGroups/client/Client"; +import { Products } from "./api/resources/products/client/Client"; +import { Orders } from "./api/resources/orders/client/Client"; +import { Inventory } from "./api/resources/inventory/client/Client"; +import { Ecommerce } from "./api/resources/ecommerce/client/Client"; import { Workspaces } from "./api/resources/workspaces/client/Client"; -import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; -import * as core from "./core"; -import { mergeHeaders } from "./core/headers"; export declare namespace WebflowClient { - export interface Options extends BaseClientOptions {} - - export interface RequestOptions extends BaseRequestOptions {} + export interface Options { + 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 | undefined>; + } + + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class WebflowClient { @@ -52,8 +70,8 @@ export class WebflowClient { { "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", - "X-Fern-SDK-Version": "3.3.0-beta", - "User-Agent": "webflow-api/3.3.0-beta", + "X-Fern-SDK-Version": "3.2.2", + "User-Agent": "webflow-api/3.2.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, diff --git a/src/api/errors/BadRequestError.ts b/src/api/errors/BadRequestError.ts index 82b8c800..1bb67d02 100644 --- a/src/api/errors/BadRequestError.ts +++ b/src/api/errors/BadRequestError.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; +import * as core from "../../core"; export class BadRequestError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/ConflictError.ts b/src/api/errors/ConflictError.ts index c26d504e..ca91b050 100644 --- a/src/api/errors/ConflictError.ts +++ b/src/api/errors/ConflictError.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; +import * as core from "../../core"; export class ConflictError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/ForbiddenError.ts b/src/api/errors/ForbiddenError.ts index 42c8a436..c0b23d1a 100644 --- a/src/api/errors/ForbiddenError.ts +++ b/src/api/errors/ForbiddenError.ts @@ -1,7 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; +import * as core from "../../core"; export class ForbiddenError extends errors.WebflowError { constructor(body?: unknown, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/InternalServerError.ts b/src/api/errors/InternalServerError.ts index 6891f521..c99b6865 100644 --- a/src/api/errors/InternalServerError.ts +++ b/src/api/errors/InternalServerError.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; -import type * as Webflow from "../index"; +import * as Webflow from "../index"; +import * as core from "../../core"; export class InternalServerError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/NotFoundError.ts b/src/api/errors/NotFoundError.ts index 3a23bbcd..29b6a8cc 100644 --- a/src/api/errors/NotFoundError.ts +++ b/src/api/errors/NotFoundError.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; -import type * as Webflow from "../index"; +import * as Webflow from "../index"; +import * as core from "../../core"; export class NotFoundError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/TooManyRequestsError.ts b/src/api/errors/TooManyRequestsError.ts index b446eae7..b7a3fa74 100644 --- a/src/api/errors/TooManyRequestsError.ts +++ b/src/api/errors/TooManyRequestsError.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; -import type * as Webflow from "../index"; +import * as Webflow from "../index"; +import * as core from "../../core"; export class TooManyRequestsError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/UnauthorizedError.ts b/src/api/errors/UnauthorizedError.ts index 00be898b..8d01eef6 100644 --- a/src/api/errors/UnauthorizedError.ts +++ b/src/api/errors/UnauthorizedError.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../../core"; import * as errors from "../../errors/index"; -import type * as Webflow from "../index"; +import * as Webflow from "../index"; +import * as core from "../../core"; export class UnauthorizedError extends errors.WebflowError { constructor(body: Webflow.Error_, rawResponse?: core.RawResponse) { diff --git a/src/api/errors/index.ts b/src/api/errors/index.ts index fc45046b..764085c5 100644 --- a/src/api/errors/index.ts +++ b/src/api/errors/index.ts @@ -1,7 +1,7 @@ -export * from "./BadRequestError"; -export * from "./ConflictError"; +export * from "./UnauthorizedError"; export * from "./ForbiddenError"; -export * from "./InternalServerError"; +export * from "./BadRequestError"; export * from "./NotFoundError"; export * from "./TooManyRequestsError"; -export * from "./UnauthorizedError"; +export * from "./InternalServerError"; +export * from "./ConflictError"; diff --git a/src/api/index.ts b/src/api/index.ts index 456653b2..30060724 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -1,3 +1,3 @@ -export * from "./errors"; export * from "./resources"; export * from "./types"; +export * from "./errors"; diff --git a/src/api/resources/accessGroups/client/Client.ts b/src/api/resources/accessGroups/client/Client.ts index 6c82a2cd..8fa9f2fb 100644 --- a/src/api/resources/accessGroups/client/Client.ts +++ b/src/api/resources/accessGroups/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; export declare namespace AccessGroups { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class AccessGroups { @@ -39,8 +57,8 @@ export class AccessGroups { * * @example * await client.accessGroups.list("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sort: "CreatedOn" * }) */ @@ -60,38 +78,37 @@ export class AccessGroups { const { offset, limit, sort } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (sort != null) { - _queryParams.sort = serializers.AccessGroupsListRequestSort.jsonOrThrow(sort, { + _queryParams["sort"] = serializers.AccessGroupsListRequestSort.jsonOrThrow(sort, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/accessgroups`, + `sites/${encodeURIComponent(siteId)}/accessgroups`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/accessGroups/client/index.ts b/src/api/resources/accessGroups/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/accessGroups/client/index.ts +++ b/src/api/resources/accessGroups/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts b/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts index d2d894bc..23cdab3c 100644 --- a/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts +++ b/src/api/resources/accessGroups/client/requests/AccessGroupsListRequest.ts @@ -1,19 +1,25 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example * { - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sort: "CreatedOn" * } */ export interface AccessGroupsListRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; /** * Sort string to use when ordering access groups diff --git a/src/api/resources/accessGroups/client/requests/index.ts b/src/api/resources/accessGroups/client/requests/index.ts index 016ac082..709463a1 100644 --- a/src/api/resources/accessGroups/client/requests/index.ts +++ b/src/api/resources/accessGroups/client/requests/index.ts @@ -1 +1 @@ -export type { AccessGroupsListRequest } from "./AccessGroupsListRequest"; +export { type AccessGroupsListRequest } from "./AccessGroupsListRequest"; diff --git a/src/api/resources/accessGroups/index.ts b/src/api/resources/accessGroups/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/accessGroups/index.ts +++ b/src/api/resources/accessGroups/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts b/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts index 6beca044..6daa7813 100644 --- a/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts +++ b/src/api/resources/accessGroups/types/AccessGroupsListRequestSort.ts @@ -1,12 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -export const AccessGroupsListRequestSort = { +export type AccessGroupsListRequestSort = /** * Sorts users in ascending order based on their created date */ - CreatedOnAscending: "CreatedOn", + | "CreatedOn" /** * Sorts users in descending order based on their created date */ + | "-CreatedOn"; +export const AccessGroupsListRequestSort = { + CreatedOnAscending: "CreatedOn", CreatedOnDescending: "-CreatedOn", } as const; -export type AccessGroupsListRequestSort = - (typeof AccessGroupsListRequestSort)[keyof typeof AccessGroupsListRequestSort]; diff --git a/src/api/resources/assets/client/Client.ts b/src/api/resources/assets/client/Client.ts index 9bf65e68..bd39bd85 100644 --- a/src/api/resources/assets/client/Client.ts +++ b/src/api/resources/assets/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Assets { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -41,8 +59,8 @@ export class Assets { * * @example * await client.assets.list("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public list( @@ -61,30 +79,29 @@ export class Assets { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/assets`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -217,30 +234,28 @@ export class Assets { request: Webflow.AssetsCreateRequest, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/assets`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -355,23 +370,21 @@ export class Assets { assetId: string, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${core.url.encodePathParam(assetId)}`, + `assets/${encodeURIComponent(assetId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -486,23 +499,21 @@ export class Assets { assetId: string, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${core.url.encodePathParam(assetId)}`, + `assets/${encodeURIComponent(assetId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -614,30 +625,28 @@ export class Assets { request: Webflow.AssetsUpdateRequest = {}, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `assets/${core.url.encodePathParam(assetId)}`, + `assets/${encodeURIComponent(assetId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -755,23 +764,21 @@ export class Assets { siteId: string, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/asset_folders`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -896,30 +903,28 @@ export class Assets { request: Webflow.AssetsCreateFolderRequest, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/asset_folders`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.AssetsCreateFolderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1039,23 +1044,21 @@ export class Assets { assetFolderId: string, requestOptions?: Assets.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(assetFolderId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/assets/client/index.ts b/src/api/resources/assets/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/assets/client/index.ts +++ b/src/api/resources/assets/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts b/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts index 8f51e850..88a07fcd 100644 --- a/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsCreateFolderRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts index 847e2e05..71adecd7 100644 --- a/src/api/resources/assets/client/requests/AssetsCreateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsCreateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/assets/client/requests/AssetsListRequest.ts b/src/api/resources/assets/client/requests/AssetsListRequest.ts index 2b902dc9..d6382b24 100644 --- a/src/api/resources/assets/client/requests/AssetsListRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsListRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface AssetsListRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts index bf2e4a76..a01981af 100644 --- a/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/api/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/assets/client/requests/index.ts b/src/api/resources/assets/client/requests/index.ts index 3a711eb1..93250a4c 100644 --- a/src/api/resources/assets/client/requests/index.ts +++ b/src/api/resources/assets/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; -export type { AssetsCreateRequest } from "./AssetsCreateRequest"; -export type { AssetsListRequest } from "./AssetsListRequest"; -export type { AssetsUpdateRequest } from "./AssetsUpdateRequest"; +export { type AssetsListRequest } from "./AssetsListRequest"; +export { type AssetsCreateRequest } from "./AssetsCreateRequest"; +export { type AssetsUpdateRequest } from "./AssetsUpdateRequest"; +export { type AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; diff --git a/src/api/resources/collections/client/Client.ts b/src/api/resources/collections/client/Client.ts index 45978fd5..e04ee1fc 100644 --- a/src/api/resources/collections/client/Client.ts +++ b/src/api/resources/collections/client/Client.ts @@ -1,19 +1,37 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; import { Fields } from "../resources/fields/client/Client"; import { Items } from "../resources/items/client/Client"; export declare namespace Collections { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -64,23 +82,21 @@ export class Collections { siteId: string, requestOptions?: Collections.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/collections`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -227,30 +243,28 @@ export class Collections { request: Webflow.CollectionsCreateRequest, requestOptions?: Collections.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/collections`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CollectionsCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -372,23 +386,21 @@ export class Collections { collectionId: string, requestOptions?: Collections.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${core.url.encodePathParam(collectionId)}`, + `collections/${encodeURIComponent(collectionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -503,23 +515,21 @@ export class Collections { collectionId: string, requestOptions?: Collections.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${core.url.encodePathParam(collectionId)}`, + `collections/${encodeURIComponent(collectionId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/client/index.ts b/src/api/resources/collections/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/collections/client/index.ts +++ b/src/api/resources/collections/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts b/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts index 2efe1ada..63664ff4 100644 --- a/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts +++ b/src/api/resources/collections/client/requests/CollectionsCreateRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/collections/client/requests/index.ts b/src/api/resources/collections/client/requests/index.ts index 00a158e5..ea1464e5 100644 --- a/src/api/resources/collections/client/requests/index.ts +++ b/src/api/resources/collections/client/requests/index.ts @@ -1 +1 @@ -export type { CollectionsCreateRequest } from "./CollectionsCreateRequest"; +export { type CollectionsCreateRequest } from "./CollectionsCreateRequest"; diff --git a/src/api/resources/collections/index.ts b/src/api/resources/collections/index.ts index 33a87f10..4ce0f390 100644 --- a/src/api/resources/collections/index.ts +++ b/src/api/resources/collections/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./resources"; +export * from "./client"; diff --git a/src/api/resources/collections/resources/fields/client/Client.ts b/src/api/resources/collections/resources/fields/client/Client.ts index ded9b0b7..0324c0a1 100644 --- a/src/api/resources/collections/resources/fields/client/Client.ts +++ b/src/api/resources/collections/resources/fields/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as serializers from "../../../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; export declare namespace Fields { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Fields { @@ -96,30 +114,28 @@ export class Fields { request: Webflow.FieldCreate, requestOptions?: Fields.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/fields`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.FieldCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -244,23 +260,21 @@ export class Fields { fieldId: string, requestOptions?: Fields.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -381,30 +395,28 @@ export class Fields { request: Webflow.collections.FieldUpdate = {}, requestOptions?: Fields.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/fields/${encodeURIComponent(fieldId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.FieldUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/resources/fields/client/index.ts b/src/api/resources/collections/resources/fields/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/collections/resources/fields/client/index.ts +++ b/src/api/resources/collections/resources/fields/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts b/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts index 61239be2..cf3b7b1c 100644 --- a/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts +++ b/src/api/resources/collections/resources/fields/client/requests/FieldUpdate.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/collections/resources/fields/client/requests/index.ts b/src/api/resources/collections/resources/fields/client/requests/index.ts index 9d47d72a..49626c31 100644 --- a/src/api/resources/collections/resources/fields/client/requests/index.ts +++ b/src/api/resources/collections/resources/fields/client/requests/index.ts @@ -1 +1 @@ -export type { FieldUpdate } from "./FieldUpdate"; +export { type FieldUpdate } from "./FieldUpdate"; diff --git a/src/api/resources/collections/resources/index.ts b/src/api/resources/collections/resources/index.ts index db2e1bdc..2452d24a 100644 --- a/src/api/resources/collections/resources/index.ts +++ b/src/api/resources/collections/resources/index.ts @@ -1,5 +1,5 @@ +export * as items from "./items"; +export * from "./items/types"; export * as fields from "./fields"; export * from "./fields/client/requests"; -export * as items from "./items"; export * from "./items/client/requests"; -export * from "./items/types"; diff --git a/src/api/resources/collections/resources/items/client/Client.ts b/src/api/resources/collections/resources/items/client/Client.ts index c779706d..45a5870c 100644 --- a/src/api/resources/collections/resources/items/client/Client.ts +++ b/src/api/resources/collections/resources/items/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; export declare namespace Items { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Items { @@ -39,8 +57,8 @@ export class Items { * @example * await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { * cmsLocaleId: "cmsLocaleId", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * name: "name", * slug: "slug", * sortBy: "lastPublished", @@ -63,27 +81,27 @@ export class Items { const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (name != null) { - _queryParams.name = name; + _queryParams["name"] = name; } if (slug != null) { - _queryParams.slug = slug; + _queryParams["slug"] = slug; } if (lastPublished != null) { - _queryParams.lastPublished = serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, { + _queryParams["lastPublished"] = serializers.ItemsListItemsRequestLastPublished.jsonOrThrow(lastPublished, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -92,7 +110,7 @@ export class Items { } if (sortBy != null) { - _queryParams.sortBy = serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, { + _queryParams["sortBy"] = serializers.collections.ItemsListItemsRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -100,30 +118,29 @@ export class Items { } if (sortOrder != null) { - _queryParams.sortOrder = serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, { + _queryParams["sortOrder"] = serializers.collections.ItemsListItemsRequestSortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -241,41 +258,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * }) @@ -289,18 +272,14 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } @@ -322,33 +301,32 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.collections.ItemsCreateItemRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -478,30 +456,28 @@ export class Items { request: Webflow.collections.ItemsDeleteItemsRequest, requestOptions?: Items.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items`, ), method: "DELETE", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsDeleteItemsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -613,32 +589,28 @@ export class Items { * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * }) @@ -652,9 +624,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -662,9 +632,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * }) @@ -685,33 +653,32 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.collections.ItemsUpdateItemsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -825,8 +792,8 @@ export class Items { * @example * await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { * cmsLocaleId: "cmsLocaleId", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * name: "name", * slug: "slug", * sortBy: "lastPublished", @@ -849,36 +816,39 @@ export class Items { const { cmsLocaleId, offset, limit, name, slug, lastPublished, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (name != null) { - _queryParams.name = name; + _queryParams["name"] = name; } if (slug != null) { - _queryParams.slug = slug; + _queryParams["slug"] = slug; } if (lastPublished != null) { - _queryParams.lastPublished = serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow(lastPublished, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - breadcrumbsPrefix: ["request", "lastPublished"], - }); + _queryParams["lastPublished"] = serializers.ItemsListItemsLiveRequestLastPublished.jsonOrThrow( + lastPublished, + { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + breadcrumbsPrefix: ["request", "lastPublished"], + }, + ); } if (sortBy != null) { - _queryParams.sortBy = serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, { + _queryParams["sortBy"] = serializers.collections.ItemsListItemsLiveRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -886,30 +856,32 @@ export class Items { } if (sortOrder != null) { - _queryParams.sortOrder = serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow(sortOrder, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - }); + _queryParams["sortOrder"] = serializers.collections.ItemsListItemsLiveRequestSortOrder.jsonOrThrow( + sortOrder, + { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }, + ); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .dataApi, - `collections/${core.url.encodePathParam(collectionId)}/items/live`, + `collections/${encodeURIComponent(collectionId)}/items/live`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1028,41 +1000,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * }) @@ -1076,18 +1014,14 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } @@ -1109,33 +1043,32 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/live`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.collections.ItemsCreateItemLiveRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1264,30 +1197,28 @@ export class Items { request: Webflow.collections.ItemsDeleteItemsLiveRequest, requestOptions?: Items.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/live`, ), method: "DELETE", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsDeleteItemsLiveRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1396,32 +1327,28 @@ export class Items { * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * }) @@ -1435,9 +1362,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -1445,9 +1370,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * }) @@ -1468,33 +1391,32 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/live`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.collections.ItemsUpdateItemsLiveRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1651,33 +1573,32 @@ export class Items { const { skipInvalidFiles, ..._body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/bulk`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.collections.CreateBulkCollectionItemRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1808,26 +1729,25 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -1958,26 +1878,25 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2084,41 +2003,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * }) @@ -2141,33 +2026,32 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.CollectionItemPatchSingle.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2302,26 +2186,25 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .dataApi, - `collections/${core.url.encodePathParam(collectionId)}/items/${core.url.encodePathParam(itemId)}/live`, + `collections/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2456,26 +2339,25 @@ export class Items { const { cmsLocaleId } = request; const _queryParams: Record = {}; if (cmsLocaleId != null) { - _queryParams.cmsLocaleId = cmsLocaleId; + _queryParams["cmsLocaleId"] = cmsLocaleId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, ), method: "DELETE", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2583,41 +2465,7 @@ export class Items { * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * }) @@ -2642,33 +2490,32 @@ export class Items { const { skipInvalidFiles, body: _body } = request; const _queryParams: Record = {}; if (skipInvalidFiles != null) { - _queryParams.skipInvalidFiles = skipInvalidFiles.toString(); + _queryParams["skipInvalidFiles"] = skipInvalidFiles.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/${encodeURIComponent(itemId)}/live`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.CollectionItemPatchSingle.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -2818,30 +2665,28 @@ export class Items { request: Webflow.collections.ItemsPublishItemRequest, requestOptions?: Items.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(collectionId)}/items/publish`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.collections.ItemsPublishItemRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/collections/resources/items/client/index.ts b/src/api/resources/collections/resources/items/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/collections/resources/items/client/index.ts +++ b/src/api/resources/collections/resources/items/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; 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..c5fb0327 100644 --- a/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts +++ b/src/api/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -55,7 +57,9 @@ import type * as Webflow from "../../../../../../index"; * } */ export interface CreateBulkCollectionItemRequestBody { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; /** Array of identifiers for the locales where the item will be created */ cmsLocaleIds?: string[]; diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts index 40e21ced..7f7178e4 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemLiveRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,41 +13,7 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * } @@ -59,25 +27,23 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } * } */ export interface ItemsCreateItemLiveRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; body: Webflow.collections.ItemsCreateItemLiveRequestBody; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts index 4f47afe0..77c0c974 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsCreateItemRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,41 +13,7 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * } @@ -59,25 +27,23 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * isArchived: false, * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } * } */ export interface ItemsCreateItemRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; body: Webflow.collections.ItemsCreateItemRequestBody; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts index 796b7504..dfe4d6f6 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemLiveRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ItemsDeleteItemLiveRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts index 6dd9a64d..49073411 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ItemsDeleteItemRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts index e24be1ca..779fb410 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts index 6fb7bd03..503c93a0 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts index 9db7bd09..4b21ecae 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemLiveRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ItemsGetItemLiveRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts index 1bc89dbc..13e082bc 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsGetItemRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example @@ -7,6 +9,8 @@ * } */ export interface ItemsGetItemRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts index 35cda933..8394c945 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsLiveRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { * cmsLocaleId: "cmsLocaleId", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * name: "name", * slug: "slug", * sortBy: "lastPublished", @@ -15,20 +17,36 @@ import type * as Webflow from "../../../../../../index"; * } */ export interface ItemsListItemsLiveRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Filter by the exact name of the item(s) */ + /** + * Filter by the exact name of the item(s) + */ name?: string; - /** Filter by the exact slug of the item */ + /** + * Filter by the exact slug of the item + */ slug?: string; - /** Filter by the last published date of the item(s) */ + /** + * Filter by the last published date of the item(s) + */ lastPublished?: Webflow.ItemsListItemsLiveRequestLastPublished; - /** Sort results by the provided value */ + /** + * Sort results by the provided value + */ sortBy?: Webflow.collections.ItemsListItemsLiveRequestSortBy; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.collections.ItemsListItemsLiveRequestSortOrder; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts index cb8e37aa..b3311332 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsListItemsRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { * cmsLocaleId: "cmsLocaleId", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * name: "name", * slug: "slug", * sortBy: "lastPublished", @@ -15,20 +17,36 @@ import type * as Webflow from "../../../../../../index"; * } */ export interface ItemsListItemsRequest { - /** Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. */ + /** + * Unique identifier for a CMS Locale. This UID is different from the Site locale identifier and is listed as `cmsLocaleId` in the Sites response. To query multiple locales, input a comma separated string. + */ cmsLocaleId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Filter by the exact name of the item(s) */ + /** + * Filter by the exact name of the item(s) + */ name?: string; - /** Filter by the exact slug of the item */ + /** + * Filter by the exact slug of the item + */ slug?: string; - /** Filter by the last published date of the item(s) */ + /** + * Filter by the last published date of the item(s) + */ lastPublished?: Webflow.ItemsListItemsRequestLastPublished; - /** Sort results by the provided value */ + /** + * Sort results by the provided value + */ sortBy?: Webflow.collections.ItemsListItemsRequestSortBy; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.collections.ItemsListItemsRequestSortOrder; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts index dc9d50b1..6ba836d8 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemLiveRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,47 +13,15 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * } */ export interface ItemsUpdateItemLiveRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; body: Webflow.CollectionItemPatchSingle; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts index f36c6ae9..3f1db05a 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,47 +13,15 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "The Hitchhiker's Guide to the Galaxy", - * slug: "hitchhikers-guide-to-the-galaxy", - * "plain-text": "Don't Panic.", - * "rich-text": "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - * "main-image": { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * }, - * "image-gallery": [ - * { - * "fileId": "62b720ef280c7a7a3be8cabd", - * "url": "/files/62b720ef280c7a7a3be8cabd_image.png" - * }, - * { - * "fileId": "62b720ef280c7a7a3be8cabe", - * "url": "/files/62b720ef280c7a7a3be8cabe_image.png" - * } - * ], - * "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - * "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - * "contact-email": "zaphod.beeblebrox@heartofgold.gov", - * "support-phone": "424-242-4242", - * "answer-to-everything": 42, - * "release-date": "1979-10-12T00:00:00.000Z", - * "is-featured": true, - * "brand-color": "#000000", - * category: "62b720ef280c7a7a3be8cabf", - * author: "62b720ef280c7a7a3be8cab0", - * tags: [ - * "62b720ef280c7a7a3be8cab1", - * "62b720ef280c7a7a3be8cab2" - * ], - * "downloadable-asset": { - * "fileId": "62b720ef280c7a7a3be8cab3", - * "url": "/files/62b720ef280c7a7a3be8cab3_document.pdf" - * } + * slug: "hitchhikers-guide-to-the-galaxy" * } * } * } */ export interface ItemsUpdateItemRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; body: Webflow.CollectionItemPatchSingle; } 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..29caff27 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,32 +13,28 @@ import type * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * } @@ -50,9 +48,7 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -60,9 +56,7 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } @@ -75,32 +69,28 @@ import type * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * } @@ -113,38 +103,36 @@ import type * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * } */ export interface ItemsUpdateItemsLiveRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; items?: Webflow.CollectionItemWithIdInput[]; } diff --git a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts index b3944779..303c316e 100644 --- a/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts +++ b/src/api/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example @@ -11,32 +13,28 @@ import type * as Webflow from "../../../../../../index"; * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Ne Paniquez Pas", - * slug: "ne-paniquez-pas", - * featured: false + * slug: "ne-paniquez-pas" * } * }, { * id: "66f6ed9576ddacf3149d5ea6", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "No Entrar en P\u00E1nico", - * slug: "no-entrar-en-panico", - * featured: false + * slug: "no-entrar-en-panico" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca5", * fieldData: { * name: "Au Revoir et Merci pour Tous les Poissons", - * slug: "au-revoir-et-merci", - * featured: false + * slug: "au-revoir-et-merci" * } * }, { * id: "66f6ed9576ddacf3149d5eaa", * cmsLocaleId: "66f6e966c9e1dc700a857ca4", * fieldData: { * name: "Hasta Luego y Gracias por Todo el Pescado", - * slug: "hasta-luego-y-gracias", - * featured: false + * slug: "hasta-luego-y-gracias" * } * }] * } @@ -50,9 +48,7 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Senior Data Analyst", - * slug: "senior-data-analyst", - * url: "https://boards.greenhouse.io/webflow/jobs/26567701", - * department: "Data" + * slug: "senior-data-analyst" * } * }, { * id: "580e64008c9a982ac9b8b754", @@ -60,15 +56,15 @@ import type * as Webflow from "../../../../../../index"; * isDraft: false, * fieldData: { * name: "Product Manager", - * slug: "product-manager", - * url: "https://boards.greenhouse.io/webflow/jobs/31234567", - * department: "Product" + * slug: "product-manager" * } * }] * } */ export interface ItemsUpdateItemsRequest { - /** When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. */ + /** + * When true, invalid files are skipped and processing continues. When false, the entire request fails if any file is invalid. + */ skipInvalidFiles?: boolean; items?: Webflow.CollectionItemWithIdInput[]; } diff --git a/src/api/resources/collections/resources/items/client/requests/index.ts b/src/api/resources/collections/resources/items/client/requests/index.ts index 4bb198d5..b00981ff 100644 --- a/src/api/resources/collections/resources/items/client/requests/index.ts +++ b/src/api/resources/collections/resources/items/client/requests/index.ts @@ -1,15 +1,15 @@ -export type { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; -export type { ItemsCreateItemLiveRequest } from "./ItemsCreateItemLiveRequest"; -export type { ItemsCreateItemRequest } from "./ItemsCreateItemRequest"; -export type { ItemsDeleteItemLiveRequest } from "./ItemsDeleteItemLiveRequest"; -export type { ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest"; -export type { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; -export type { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; -export type { ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest"; -export type { ItemsGetItemRequest } from "./ItemsGetItemRequest"; -export type { ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest"; -export type { ItemsListItemsRequest } from "./ItemsListItemsRequest"; -export type { ItemsUpdateItemLiveRequest } from "./ItemsUpdateItemLiveRequest"; -export type { ItemsUpdateItemRequest } from "./ItemsUpdateItemRequest"; -export type { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; -export type { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; +export { type ItemsListItemsRequest } from "./ItemsListItemsRequest"; +export { type ItemsCreateItemRequest } from "./ItemsCreateItemRequest"; +export { type ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; +export { type ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; +export { type ItemsListItemsLiveRequest } from "./ItemsListItemsLiveRequest"; +export { type ItemsCreateItemLiveRequest } from "./ItemsCreateItemLiveRequest"; +export { type ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export { type ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; +export { type CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; +export { type ItemsGetItemRequest } from "./ItemsGetItemRequest"; +export { type ItemsDeleteItemRequest } from "./ItemsDeleteItemRequest"; +export { type ItemsUpdateItemRequest } from "./ItemsUpdateItemRequest"; +export { type ItemsGetItemLiveRequest } from "./ItemsGetItemLiveRequest"; +export { type ItemsDeleteItemLiveRequest } from "./ItemsDeleteItemLiveRequest"; +export { type ItemsUpdateItemLiveRequest } from "./ItemsUpdateItemLiveRequest"; diff --git a/src/api/resources/collections/resources/items/index.ts b/src/api/resources/collections/resources/items/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/collections/resources/items/index.ts +++ b/src/api/resources/collections/resources/items/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts index 3b4ef4b4..94272dd3 100644 --- a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export type CreateBulkCollectionItemRequestBodyFieldData = | Webflow.collections.SingleCmsItem diff --git a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts index 4d0a3004..70f4bf43 100644 --- a/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts +++ b/src/api/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A single CMS item to create diff --git a/src/api/resources/collections/resources/items/types/ItemIDs.ts b/src/api/resources/collections/resources/items/types/ItemIDs.ts index f1c4b610..eeebf56c 100644 --- a/src/api/resources/collections/resources/items/types/ItemIDs.ts +++ b/src/api/resources/collections/resources/items/types/ItemIDs.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An array of Item IDs in a single locale diff --git a/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts b/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts index 5c02ae6b..e69cf839 100644 --- a/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts +++ b/src/api/resources/collections/resources/items/types/ItemIDsWithLocales.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; /** * An array of Item IDs with included `cmsLocaleIds` diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts index 840de801..e6574a22 100644 --- a/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export type ItemsCreateItemLiveRequestBody = Webflow.CollectionItem | Webflow.collections.MultipleLiveItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts index b94a1487..2788a6d9 100644 --- a/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts +++ b/src/api/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export type ItemsCreateItemRequestBody = Webflow.CollectionItemPostSingle | Webflow.collections.MultipleItems; diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts index 807c8179..074dd8a3 100644 --- a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsDeleteItemsLiveRequestItemsItem { /** Unique identifier for the Item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts index 6739ee64..f7758491 100644 --- a/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsDeleteItemsRequestItemsItem { /** Unique identifier for the Item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts index 62738ae3..e463aa98 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ItemsListItemsLiveRequestSortBy = "lastPublished" | "name" | "slug"; export const ItemsListItemsLiveRequestSortBy = { LastPublished: "lastPublished", Name: "name", Slug: "slug", } as const; -export type ItemsListItemsLiveRequestSortBy = - (typeof ItemsListItemsLiveRequestSortBy)[keyof typeof ItemsListItemsLiveRequestSortBy]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts index 5e07f510..504484c6 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ItemsListItemsLiveRequestSortOrder = "asc" | "desc"; export const ItemsListItemsLiveRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type ItemsListItemsLiveRequestSortOrder = - (typeof ItemsListItemsLiveRequestSortOrder)[keyof typeof ItemsListItemsLiveRequestSortOrder]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts index c4c612ce..bc7cefc1 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ItemsListItemsRequestSortBy = "lastPublished" | "name" | "slug"; export const ItemsListItemsRequestSortBy = { LastPublished: "lastPublished", Name: "name", Slug: "slug", } as const; -export type ItemsListItemsRequestSortBy = - (typeof ItemsListItemsRequestSortBy)[keyof typeof ItemsListItemsRequestSortBy]; diff --git a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts index 261a8155..5f2dc236 100644 --- a/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts +++ b/src/api/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type ItemsListItemsRequestSortOrder = "asc" | "desc"; export const ItemsListItemsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type ItemsListItemsRequestSortOrder = - (typeof ItemsListItemsRequestSortOrder)[keyof typeof ItemsListItemsRequestSortOrder]; diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts index 416cc69e..08c7af48 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export type ItemsPublishItemRequest = /** diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts index 051daa2a..0d36cd03 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsPublishItemRequestItemsItemsItem { /** The ID of the CMS item */ diff --git a/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts b/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts index ef4ef5b9..94e2b8c1 100644 --- a/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts +++ b/src/api/resources/collections/resources/items/types/ItemsPublishItemResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsPublishItemResponse { publishedItemIds?: string[]; diff --git a/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts b/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts index 024e5218..610c3130 100644 --- a/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts +++ b/src/api/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export type ItemsUpdateItemsResponse = Webflow.CollectionItem | Webflow.CollectionItemList; diff --git a/src/api/resources/collections/resources/items/types/MultipleItems.ts b/src/api/resources/collections/resources/items/types/MultipleItems.ts index d1dca68c..2c774eaa 100644 --- a/src/api/resources/collections/resources/items/types/MultipleItems.ts +++ b/src/api/resources/collections/resources/items/types/MultipleItems.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export interface MultipleItems { /** An array of items to create */ diff --git a/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts b/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts index cfec53db..f794cfed 100644 --- a/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts +++ b/src/api/resources/collections/resources/items/types/MultipleLiveItems.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../index"; +import * as Webflow from "../../../../../index"; export interface MultipleLiveItems { /** List of collection items to create */ diff --git a/src/api/resources/collections/resources/items/types/SingleCmsItem.ts b/src/api/resources/collections/resources/items/types/SingleCmsItem.ts index 1a81d7ff..c321f2ff 100644 --- a/src/api/resources/collections/resources/items/types/SingleCmsItem.ts +++ b/src/api/resources/collections/resources/items/types/SingleCmsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SingleCmsItem { /** The name of the item. */ diff --git a/src/api/resources/collections/resources/items/types/index.ts b/src/api/resources/collections/resources/items/types/index.ts index 423ca368..92acdcb3 100644 --- a/src/api/resources/collections/resources/items/types/index.ts +++ b/src/api/resources/collections/resources/items/types/index.ts @@ -1,19 +1,19 @@ -export * from "./CreateBulkCollectionItemRequestBodyFieldData"; -export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; -export * from "./ItemIDs"; -export * from "./ItemIDsWithLocales"; -export * from "./ItemsCreateItemLiveRequestBody"; +export * from "./ItemsListItemsRequestSortBy"; +export * from "./ItemsListItemsRequestSortOrder"; +export * from "./MultipleItems"; export * from "./ItemsCreateItemRequestBody"; -export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./ItemsDeleteItemsRequestItemsItem"; +export * from "./ItemsUpdateItemsResponse"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; -export * from "./ItemsListItemsRequestSortBy"; -export * from "./ItemsListItemsRequestSortOrder"; -export * from "./ItemsPublishItemRequest"; -export * from "./ItemsPublishItemRequestItemsItemsItem"; -export * from "./ItemsPublishItemResponse"; -export * from "./ItemsUpdateItemsResponse"; -export * from "./MultipleItems"; export * from "./MultipleLiveItems"; +export * from "./ItemsCreateItemLiveRequestBody"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./SingleCmsItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; +export * from "./ItemIDs"; +export * from "./ItemsPublishItemRequestItemsItemsItem"; +export * from "./ItemIDsWithLocales"; +export * from "./ItemsPublishItemRequest"; +export * from "./ItemsPublishItemResponse"; diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 32029c62..ef844c00 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Components { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Components { @@ -39,8 +57,8 @@ export class Components { * @example * await client.components.list("580e63e98c9a982ac9b8b741", { * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public list( @@ -59,34 +77,33 @@ export class Components { const { branchId, limit, offset } = request; const _queryParams: Record = {}; if (branchId != null) { - _queryParams.branchId = branchId; + _queryParams["branchId"] = branchId; } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/components`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -199,8 +216,8 @@ export class Components { * await client.components.getContent("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0", * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public getContent( @@ -221,38 +238,37 @@ export class Components { const { localeId, branchId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (branchId != null) { - _queryParams.branchId = branchId; + _queryParams["branchId"] = branchId; } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -426,37 +442,36 @@ export class Components { const { localeId, branchId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (branchId != null) { - _queryParams.branchId = branchId; + _queryParams["branchId"] = branchId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/dom`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.ComponentDomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -572,8 +587,8 @@ export class Components { * await client.components.getProperties("580e63e98c9a982ac9b8b741", "8505ba55-ef72-629e-f85c-33e4b703d48b", { * localeId: "65427cf400e02b306eaa04a0", * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public getProperties( @@ -594,38 +609,37 @@ export class Components { const { localeId, branchId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (branchId != null) { - _queryParams.branchId = branchId; + _queryParams["branchId"] = branchId; } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -772,37 +786,36 @@ export class Components { const { localeId, branchId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (branchId != null) { - _queryParams.branchId = branchId; + _queryParams["branchId"] = branchId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/components/${encodeURIComponent(componentId)}/properties`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.ComponentPropertiesWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/components/client/index.ts b/src/api/resources/components/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/components/client/index.ts +++ b/src/api/resources/components/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/components/client/requests/ComponentDomWrite.ts b/src/api/resources/components/client/requests/ComponentDomWrite.ts index cab01181..421ed0b0 100644 --- a/src/api/resources/components/client/requests/ComponentDomWrite.ts +++ b/src/api/resources/components/client/requests/ComponentDomWrite.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example @@ -48,7 +50,9 @@ export interface ComponentDomWrite { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Scope the operation to work on a specific branch. */ + /** + * Scope the operation to work on a specific branch. + */ branchId?: string; /** List of DOM Nodes with the new content that will be updated in each node. */ nodes: Webflow.ComponentDomWriteNodesItem[]; diff --git a/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts index 306872f2..7c79d5a7 100644 --- a/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts +++ b/src/api/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example @@ -23,7 +25,9 @@ export interface ComponentPropertiesWrite { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Scope the operation to work on a specific branch. */ + /** + * Scope the operation to work on a specific branch. + */ branchId?: string; /** A list of component properties to update within the specified secondary locale. */ properties: Webflow.ComponentPropertiesWritePropertiesItem[]; diff --git a/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts index 7836c5c3..d4df41fc 100644 --- a/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsGetContentRequest.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * localeId: "65427cf400e02b306eaa04a0", * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface ComponentsGetContentRequest { @@ -16,10 +18,16 @@ export interface ComponentsGetContentRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Scope the operation to work on a specific branch. */ + /** + * Scope the operation to work on a specific branch. + */ branchId?: string; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts index 25f9b06e..c7e045d6 100644 --- a/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsGetPropertiesRequest.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * localeId: "65427cf400e02b306eaa04a0", * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface ComponentsGetPropertiesRequest { @@ -16,10 +18,16 @@ export interface ComponentsGetPropertiesRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Scope the operation to work on a specific branch. */ + /** + * Scope the operation to work on a specific branch. + */ branchId?: string; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/components/client/requests/ComponentsListRequest.ts b/src/api/resources/components/client/requests/ComponentsListRequest.ts index ac00e2b1..efff7503 100644 --- a/src/api/resources/components/client/requests/ComponentsListRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsListRequest.ts @@ -1,18 +1,26 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * branchId: "68026fa68ef6dc744c75b833", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface ComponentsListRequest { - /** Scope the operation to work on a specific branch. */ + /** + * Scope the operation to work on a specific branch. + */ branchId?: string; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/components/client/requests/index.ts b/src/api/resources/components/client/requests/index.ts index 1a3c508d..c8f88ea5 100644 --- a/src/api/resources/components/client/requests/index.ts +++ b/src/api/resources/components/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { ComponentDomWrite } from "./ComponentDomWrite"; -export type { ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; -export type { ComponentsGetContentRequest } from "./ComponentsGetContentRequest"; -export type { ComponentsGetPropertiesRequest } from "./ComponentsGetPropertiesRequest"; -export type { ComponentsListRequest } from "./ComponentsListRequest"; +export { type ComponentsListRequest } from "./ComponentsListRequest"; +export { type ComponentsGetContentRequest } from "./ComponentsGetContentRequest"; +export { type ComponentDomWrite } from "./ComponentDomWrite"; +export { type ComponentsGetPropertiesRequest } from "./ComponentsGetPropertiesRequest"; +export { type ComponentPropertiesWrite } from "./ComponentPropertiesWrite"; diff --git a/src/api/resources/components/index.ts b/src/api/resources/components/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/components/index.ts +++ b/src/api/resources/components/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/components/types/ComponentDomWriteNodesItem.ts b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts index 9b8b8674..4437947d 100644 --- a/src/api/resources/components/types/ComponentDomWriteNodesItem.ts +++ b/src/api/resources/components/types/ComponentDomWriteNodesItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export type ComponentDomWriteNodesItem = | Webflow.TextNodeWrite diff --git a/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts index 0467ccad..dac54dc0 100644 --- a/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts +++ b/src/api/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ComponentPropertiesWritePropertiesItem { /** The ID of the property. */ diff --git a/src/api/resources/components/types/ComponentsUpdateContentResponse.ts b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts index d81ab1d9..3bb712bd 100644 --- a/src/api/resources/components/types/ComponentsUpdateContentResponse.ts +++ b/src/api/resources/components/types/ComponentsUpdateContentResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ComponentsUpdateContentResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts index 1c251cbc..8c1f4142 100644 --- a/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts +++ b/src/api/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ComponentsUpdatePropertiesResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/components/types/index.ts b/src/api/resources/components/types/index.ts index d72e3728..1bdf297c 100644 --- a/src/api/resources/components/types/index.ts +++ b/src/api/resources/components/types/index.ts @@ -1,4 +1,4 @@ export * from "./ComponentDomWriteNodesItem"; -export * from "./ComponentPropertiesWritePropertiesItem"; export * from "./ComponentsUpdateContentResponse"; +export * from "./ComponentPropertiesWritePropertiesItem"; export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/api/resources/ecommerce/client/Client.ts b/src/api/resources/ecommerce/client/Client.ts index 168b57ae..f2e260ed 100644 --- a/src/api/resources/ecommerce/client/Client.ts +++ b/src/api/resources/ecommerce/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Ecommerce { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Ecommerce { @@ -51,23 +69,21 @@ export class Ecommerce { siteId: string, requestOptions?: Ecommerce.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/ecommerce/settings`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/forms/client/Client.ts b/src/api/resources/forms/client/Client.ts index 4330d772..1a5a6c6b 100644 --- a/src/api/resources/forms/client/Client.ts +++ b/src/api/resources/forms/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Forms { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -43,8 +61,8 @@ export class Forms { * * @example * await client.forms.list("580e63e98c9a982ac9b8b741", { - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public list( @@ -63,30 +81,29 @@ export class Forms { const { limit, offset } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (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/${encodeURIComponent(siteId)}/forms`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -206,23 +223,21 @@ export class Forms { formId: string, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `forms/${core.url.encodePathParam(formId)}`, + `forms/${encodeURIComponent(formId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -338,8 +353,8 @@ export class Forms { * * @example * await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public listSubmissions( @@ -358,30 +373,29 @@ export class Forms { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `forms/${core.url.encodePathParam(formId)}/submissions`, + `forms/${encodeURIComponent(formId)}/submissions`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -502,23 +516,21 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -643,23 +655,21 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -779,30 +789,28 @@ export class Forms { request: Webflow.FormsUpdateSubmissionRequest = {}, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.FormsUpdateSubmissionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/forms/client/index.ts b/src/api/resources/forms/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/forms/client/index.ts +++ b/src/api/resources/forms/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/forms/client/requests/FormsListRequest.ts b/src/api/resources/forms/client/requests/FormsListRequest.ts index ad5859ab..7fe7f897 100644 --- a/src/api/resources/forms/client/requests/FormsListRequest.ts +++ b/src/api/resources/forms/client/requests/FormsListRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface FormsListRequest { - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts b/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts index 91c686e5..b4c1b12a 100644 --- a/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts +++ b/src/api/resources/forms/client/requests/FormsListSubmissionsRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface FormsListSubmissionsRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index 16be9837..d0c8dfb4 100644 --- a/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/api/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/forms/client/requests/index.ts b/src/api/resources/forms/client/requests/index.ts index 752836de..b3189128 100644 --- a/src/api/resources/forms/client/requests/index.ts +++ b/src/api/resources/forms/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { FormsListRequest } from "./FormsListRequest"; -export type { FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; -export type { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; +export { type FormsListRequest } from "./FormsListRequest"; +export { type FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; +export { type FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; diff --git a/src/api/resources/index.ts b/src/api/resources/index.ts index d10e5259..8ce422fe 100644 --- a/src/api/resources/index.ts +++ b/src/api/resources/index.ts @@ -1,36 +1,36 @@ -export * as accessGroups from "./accessGroups"; -export * from "./accessGroups/client/requests"; -export * from "./accessGroups/types"; -export * as assets from "./assets"; -export * from "./assets/client/requests"; -export * as collections from "./collections"; -export * from "./collections/client/requests"; -export * as components from "./components"; -export * from "./components/client/requests"; -export * from "./components/types"; -export * as ecommerce from "./ecommerce"; -export * as forms from "./forms"; -export * from "./forms/client/requests"; -export * as inventory from "./inventory"; -export * from "./inventory/client/requests"; -export * from "./inventory/types"; -export * as orders from "./orders"; -export * from "./orders/client/requests"; -export * from "./orders/types"; +export * as sites from "./sites"; +export * from "./sites/types"; export * as pages from "./pages"; -export * from "./pages/client/requests"; export * from "./pages/types"; +export * as components from "./components"; +export * from "./components/types"; +export * as users from "./users"; +export * from "./users/types"; +export * as accessGroups from "./accessGroups"; +export * from "./accessGroups/types"; export * as products from "./products"; -export * from "./products/client/requests"; export * from "./products/types"; +export * as orders from "./orders"; +export * from "./orders/types"; +export * as inventory from "./inventory"; +export * from "./inventory/types"; +export * as collections from "./collections"; +export * as workspaces from "./workspaces"; +export * as token from "./token"; export * as scripts from "./scripts"; -export * from "./scripts/client/requests"; -export * as sites from "./sites"; +export * as assets from "./assets"; +export * as webhooks from "./webhooks"; +export * as forms from "./forms"; +export * as ecommerce from "./ecommerce"; export * from "./sites/client/requests"; -export * from "./sites/types"; -export * as token from "./token"; -export * as users from "./users"; +export * from "./collections/client/requests"; +export * from "./pages/client/requests"; +export * from "./components/client/requests"; +export * from "./scripts/client/requests"; +export * from "./assets/client/requests"; +export * from "./forms/client/requests"; export * from "./users/client/requests"; -export * from "./users/types"; -export * as webhooks from "./webhooks"; -export * as workspaces from "./workspaces"; +export * from "./accessGroups/client/requests"; +export * from "./products/client/requests"; +export * from "./orders/client/requests"; +export * from "./inventory/client/requests"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index 2237c45a..7448e5be 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Inventory { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -57,23 +75,21 @@ export class Inventory { skuId: string, requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${core.url.encodePathParam(skuCollectionId)}/items/${core.url.encodePathParam(skuId)}/inventory`, + `collections/${encodeURIComponent(skuCollectionId)}/items/${encodeURIComponent(skuId)}/inventory`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -211,30 +227,28 @@ export class Inventory { request: Webflow.InventoryUpdateRequest, requestOptions?: Inventory.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `collections/${core.url.encodePathParam(skuCollectionId)}/items/${core.url.encodePathParam(skuId)}/inventory`, + `collections/${encodeURIComponent(skuCollectionId)}/items/${encodeURIComponent(skuId)}/inventory`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.InventoryUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/inventory/client/index.ts b/src/api/resources/inventory/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/inventory/client/index.ts +++ b/src/api/resources/inventory/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts b/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts index 873436ba..6dd3bbee 100644 --- a/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts +++ b/src/api/resources/inventory/client/requests/InventoryUpdateRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/inventory/client/requests/index.ts b/src/api/resources/inventory/client/requests/index.ts index 52df383e..3ec833cc 100644 --- a/src/api/resources/inventory/client/requests/index.ts +++ b/src/api/resources/inventory/client/requests/index.ts @@ -1 +1 @@ -export type { InventoryUpdateRequest } from "./InventoryUpdateRequest"; +export { type InventoryUpdateRequest } from "./InventoryUpdateRequest"; diff --git a/src/api/resources/inventory/index.ts b/src/api/resources/inventory/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/inventory/index.ts +++ b/src/api/resources/inventory/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts b/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts index c20a7924..41e8a1f7 100644 --- a/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts +++ b/src/api/resources/inventory/types/EcommInventoryChangedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface EcommInventoryChangedPayload { triggerType?: "ecomm_inventory_changed"; diff --git a/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts b/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts index 235406e6..a762d082 100644 --- a/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts +++ b/src/api/resources/inventory/types/InventoryUpdateRequestInventoryType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** infinite or finite */ +/** + * infinite or finite + */ +export type InventoryUpdateRequestInventoryType = "infinite" | "finite"; export const InventoryUpdateRequestInventoryType = { Infinite: "infinite", Finite: "finite", } as const; -export type InventoryUpdateRequestInventoryType = - (typeof InventoryUpdateRequestInventoryType)[keyof typeof InventoryUpdateRequestInventoryType]; diff --git a/src/api/resources/inventory/types/index.ts b/src/api/resources/inventory/types/index.ts index f48b48ca..a225550f 100644 --- a/src/api/resources/inventory/types/index.ts +++ b/src/api/resources/inventory/types/index.ts @@ -1,2 +1,2 @@ -export * from "./EcommInventoryChangedPayload"; export * from "./InventoryUpdateRequestInventoryType"; +export * from "./EcommInventoryChangedPayload"; diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index 78887001..b6febae5 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; export declare namespace Orders { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -44,8 +62,8 @@ export class Orders { * @example * await client.orders.list("580e63e98c9a982ac9b8b741", { * status: "pending", - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public list( @@ -64,7 +82,7 @@ export class Orders { const { status, offset, limit } = request; const _queryParams: Record = {}; if (status != null) { - _queryParams.status = serializers.OrdersListRequestStatus.jsonOrThrow(status, { + _queryParams["status"] = serializers.OrdersListRequestStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -72,30 +90,29 @@ export class Orders { } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders`, + `sites/${encodeURIComponent(siteId)}/orders`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -223,23 +240,21 @@ export class Orders { orderId: string, requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}`, + `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -373,30 +388,28 @@ export class Orders { request: Webflow.OrdersUpdateRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}`, + `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -528,30 +541,28 @@ export class Orders { request: Webflow.OrdersUpdateFulfillRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/fulfill`, + `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/fulfill`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersUpdateFulfillRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -680,23 +691,21 @@ export class Orders { orderId: string, requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/unfulfill`, + `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/unfulfill`, ), method: "POST", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -829,30 +838,28 @@ export class Orders { request: Webflow.OrdersRefundRequest = {}, requestOptions?: Orders.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/orders/${core.url.encodePathParam(orderId)}/refund`, + `sites/${encodeURIComponent(siteId)}/orders/${encodeURIComponent(orderId)}/refund`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.OrdersRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/orders/client/index.ts b/src/api/resources/orders/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/orders/client/index.ts +++ b/src/api/resources/orders/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/orders/client/requests/OrdersListRequest.ts b/src/api/resources/orders/client/requests/OrdersListRequest.ts index 8481fd5e..28d06e09 100644 --- a/src/api/resources/orders/client/requests/OrdersListRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersListRequest.ts @@ -1,20 +1,28 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example * { * status: "pending", - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface OrdersListRequest { - /** Filter the orders by status */ + /** + * Filter the orders by status + */ status?: Webflow.OrdersListRequestStatus; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/orders/client/requests/OrdersRefundRequest.ts b/src/api/resources/orders/client/requests/OrdersRefundRequest.ts index e51bc31b..68d1b5ac 100644 --- a/src/api/resources/orders/client/requests/OrdersRefundRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersRefundRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts b/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts index accb07e4..45c67a6f 100644 --- a/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts b/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts index 93d22f1e..fea7c2b3 100644 --- a/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts +++ b/src/api/resources/orders/client/requests/OrdersUpdateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/orders/client/requests/index.ts b/src/api/resources/orders/client/requests/index.ts index 3eb7507e..f9f70048 100644 --- a/src/api/resources/orders/client/requests/index.ts +++ b/src/api/resources/orders/client/requests/index.ts @@ -1,4 +1,4 @@ -export type { OrdersListRequest } from "./OrdersListRequest"; -export type { OrdersRefundRequest } from "./OrdersRefundRequest"; -export type { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; -export type { OrdersUpdateRequest } from "./OrdersUpdateRequest"; +export { type OrdersListRequest } from "./OrdersListRequest"; +export { type OrdersUpdateRequest } from "./OrdersUpdateRequest"; +export { type OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; +export { type OrdersRefundRequest } from "./OrdersRefundRequest"; diff --git a/src/api/resources/orders/index.ts b/src/api/resources/orders/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/orders/index.ts +++ b/src/api/resources/orders/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/orders/types/OrdersListRequestStatus.ts b/src/api/resources/orders/types/OrdersListRequestStatus.ts index f93b09e6..38e60f53 100644 --- a/src/api/resources/orders/types/OrdersListRequestStatus.ts +++ b/src/api/resources/orders/types/OrdersListRequestStatus.ts @@ -1,5 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type OrdersListRequestStatus = + | "pending" + | "refunded" + | "dispute-lost" + | "fulfilled" + | "disputed" + | "unfulfilled"; export const OrdersListRequestStatus = { Pending: "pending", Refunded: "refunded", @@ -8,4 +17,3 @@ export const OrdersListRequestStatus = { Disputed: "disputed", Unfulfilled: "unfulfilled", } as const; -export type OrdersListRequestStatus = (typeof OrdersListRequestStatus)[keyof typeof OrdersListRequestStatus]; diff --git a/src/api/resources/orders/types/OrdersRefundRequestReason.ts b/src/api/resources/orders/types/OrdersRefundRequestReason.ts index 0e971d34..1fceae18 100644 --- a/src/api/resources/orders/types/OrdersRefundRequestReason.ts +++ b/src/api/resources/orders/types/OrdersRefundRequestReason.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The reason for the refund */ +/** + * The reason for the refund + */ +export type OrdersRefundRequestReason = "duplicate" | "fraudulent" | "requested"; export const OrdersRefundRequestReason = { Duplicate: "duplicate", Fraudulent: "fraudulent", Requested: "requested", } as const; -export type OrdersRefundRequestReason = (typeof OrdersRefundRequestReason)[keyof typeof OrdersRefundRequestReason]; diff --git a/src/api/resources/pages/client/Client.ts b/src/api/resources/pages/client/Client.ts index 93c9c245..50c1eadf 100644 --- a/src/api/resources/pages/client/Client.ts +++ b/src/api/resources/pages/client/Client.ts @@ -1,18 +1,36 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; import { Scripts } from "../resources/scripts/client/Client"; export declare namespace Pages { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -48,8 +66,8 @@ export class Pages { * @example * await client.pages.list("580e63e98c9a982ac9b8b741", { * localeId: "65427cf400e02b306eaa04a0", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public list( @@ -68,34 +86,33 @@ export class Pages { const { localeId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/pages`, + `sites/${encodeURIComponent(siteId)}/pages`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -221,26 +238,25 @@ export class Pages { const { localeId } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}`, + `pages/${encodeURIComponent(pageId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -378,33 +394,32 @@ export class Pages { const { localeId, ..._body } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}`, + `pages/${encodeURIComponent(pageId)}`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.PageMetadataWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -515,8 +530,8 @@ export class Pages { * @example * await client.pages.getContent("63c720f9347c2139b248e552", { * localeId: "65427cf400e02b306eaa04a0", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public getContent( @@ -535,34 +550,33 @@ export class Pages { const { localeId, limit, offset } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}/dom`, + `pages/${encodeURIComponent(pageId)}/dom`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -731,31 +745,30 @@ export class Pages { ): Promise> { const { localeId, ..._body } = request; const _queryParams: Record = {}; - _queryParams.localeId = localeId; - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); + _queryParams["localeId"] = localeId; const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}/dom`, + `pages/${encodeURIComponent(pageId)}/dom`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryParameters: _queryParams, requestType: "json", body: serializers.PageDomWrite.jsonOrThrow(_body, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/pages/client/index.ts b/src/api/resources/pages/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/pages/client/index.ts +++ b/src/api/resources/pages/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/pages/client/requests/PageDomWrite.ts b/src/api/resources/pages/client/requests/PageDomWrite.ts index 8537fb66..84e5f5f3 100644 --- a/src/api/resources/pages/client/requests/PageDomWrite.ts +++ b/src/api/resources/pages/client/requests/PageDomWrite.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example @@ -41,7 +43,9 @@ import type * as Webflow from "../../../../index"; * } */ export interface PageDomWrite { - /** The locale identifier. */ + /** + * The locale identifier. + */ localeId: string; /** List of DOM Nodes with the new content that will be updated in each node. */ nodes: Webflow.PageDomWriteNodesItem[]; diff --git a/src/api/resources/pages/client/requests/PageMetadataWrite.ts b/src/api/resources/pages/client/requests/PageMetadataWrite.ts index 61dc8a5a..6b91f91c 100644 --- a/src/api/resources/pages/client/requests/PageMetadataWrite.ts +++ b/src/api/resources/pages/client/requests/PageMetadataWrite.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts index 8f2cd2ce..b0ee8ec9 100644 --- a/src/api/resources/pages/client/requests/PagesGetContentRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetContentRequest.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * localeId: "65427cf400e02b306eaa04a0", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface PagesGetContentRequest { @@ -15,8 +17,12 @@ export interface PagesGetContentRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts index 9bab5f28..68114fa7 100644 --- a/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts +++ b/src/api/resources/pages/client/requests/PagesGetMetadataRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/pages/client/requests/PagesListRequest.ts b/src/api/resources/pages/client/requests/PagesListRequest.ts index 7f9d8e48..58bf1225 100644 --- a/src/api/resources/pages/client/requests/PagesListRequest.ts +++ b/src/api/resources/pages/client/requests/PagesListRequest.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * localeId: "65427cf400e02b306eaa04a0", - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface PagesListRequest { @@ -15,8 +17,12 @@ export interface PagesListRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/pages/client/requests/index.ts b/src/api/resources/pages/client/requests/index.ts index ab79f4da..0c99edcc 100644 --- a/src/api/resources/pages/client/requests/index.ts +++ b/src/api/resources/pages/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { PageDomWrite } from "./PageDomWrite"; -export type { PageMetadataWrite } from "./PageMetadataWrite"; -export type { PagesGetContentRequest } from "./PagesGetContentRequest"; -export type { PagesGetMetadataRequest } from "./PagesGetMetadataRequest"; -export type { PagesListRequest } from "./PagesListRequest"; +export { type PagesListRequest } from "./PagesListRequest"; +export { type PagesGetMetadataRequest } from "./PagesGetMetadataRequest"; +export { type PageMetadataWrite } from "./PageMetadataWrite"; +export { type PagesGetContentRequest } from "./PagesGetContentRequest"; +export { type PageDomWrite } from "./PageDomWrite"; diff --git a/src/api/resources/pages/index.ts b/src/api/resources/pages/index.ts index fb00ab43..848e75ab 100644 --- a/src/api/resources/pages/index.ts +++ b/src/api/resources/pages/index.ts @@ -1,3 +1,3 @@ +export * from "./types"; export * from "./client"; export * from "./resources"; -export * from "./types"; diff --git a/src/api/resources/pages/resources/scripts/client/Client.ts b/src/api/resources/pages/resources/scripts/client/Client.ts index cf83b3bb..2622188b 100644 --- a/src/api/resources/pages/resources/scripts/client/Client.ts +++ b/src/api/resources/pages/resources/scripts/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace Scripts { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Scripts { @@ -49,23 +67,21 @@ export class Scripts { pageId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}/custom_code`, + `pages/${encodeURIComponent(pageId)}/custom_code`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -204,30 +220,28 @@ export class Scripts { request: Webflow.ScriptApplyList, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}/custom_code`, + `pages/${encodeURIComponent(pageId)}/custom_code`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -348,23 +362,21 @@ export class Scripts { pageId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `pages/${core.url.encodePathParam(pageId)}/custom_code`, + `pages/${encodeURIComponent(pageId)}/custom_code`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/pages/types/PageDomWriteNodesItem.ts b/src/api/resources/pages/types/PageDomWriteNodesItem.ts index 23bf52d8..09895469 100644 --- a/src/api/resources/pages/types/PageDomWriteNodesItem.ts +++ b/src/api/resources/pages/types/PageDomWriteNodesItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export type PageDomWriteNodesItem = | Webflow.TextNodeWrite diff --git a/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts b/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts index 2f27ce9a..ceeb14ca 100644 --- a/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts +++ b/src/api/resources/pages/types/PageMetadataWriteOpenGraph.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Open Graph fields for the Page diff --git a/src/api/resources/pages/types/PageMetadataWriteSeo.ts b/src/api/resources/pages/types/PageMetadataWriteSeo.ts index 1acc6082..7d162ad1 100644 --- a/src/api/resources/pages/types/PageMetadataWriteSeo.ts +++ b/src/api/resources/pages/types/PageMetadataWriteSeo.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * SEO-related fields for the Page diff --git a/src/api/resources/pages/types/UpdateStaticContentResponse.ts b/src/api/resources/pages/types/UpdateStaticContentResponse.ts index 88b4a1e9..70339d41 100644 --- a/src/api/resources/pages/types/UpdateStaticContentResponse.ts +++ b/src/api/resources/pages/types/UpdateStaticContentResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface UpdateStaticContentResponse { /** A list of error messages, if any. */ diff --git a/src/api/resources/pages/types/index.ts b/src/api/resources/pages/types/index.ts index f2f4beb2..9fecb32e 100644 --- a/src/api/resources/pages/types/index.ts +++ b/src/api/resources/pages/types/index.ts @@ -1,4 +1,4 @@ -export * from "./PageDomWriteNodesItem"; -export * from "./PageMetadataWriteOpenGraph"; export * from "./PageMetadataWriteSeo"; +export * from "./PageMetadataWriteOpenGraph"; +export * from "./PageDomWriteNodesItem"; export * from "./UpdateStaticContentResponse"; diff --git a/src/api/resources/products/client/Client.ts b/src/api/resources/products/client/Client.ts index ba3e9199..078a7b57 100644 --- a/src/api/resources/products/client/Client.ts +++ b/src/api/resources/products/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Products { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Products { @@ -43,8 +61,8 @@ export class Products { * * @example * await client.products.list("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public list( @@ -63,30 +81,29 @@ export class Products { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products`, + `sites/${encodeURIComponent(siteId)}/products`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -274,30 +291,28 @@ export class Products { request: Webflow.ProductSkuCreate, requestOptions?: Products.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products`, + `sites/${encodeURIComponent(siteId)}/products`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductSkuCreate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -425,23 +440,21 @@ export class Products { productId: string, requestOptions?: Products.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}`, + `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -575,30 +588,28 @@ export class Products { request: Webflow.ProductSkuUpdate = {}, requestOptions?: Products.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}`, + `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductSkuUpdate.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -749,30 +760,28 @@ export class Products { request: Webflow.ProductsCreateSkuRequest, requestOptions?: Products.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}/skus`, + `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}/skus`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductsCreateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -928,30 +937,28 @@ export class Products { request: Webflow.ProductsUpdateSkuRequest, requestOptions?: Products.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/products/${core.url.encodePathParam(productId)}/skus/${core.url.encodePathParam(skuId)}`, + `sites/${encodeURIComponent(siteId)}/products/${encodeURIComponent(productId)}/skus/${encodeURIComponent(skuId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ProductsUpdateSkuRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/products/client/index.ts b/src/api/resources/products/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/products/client/index.ts +++ b/src/api/resources/products/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/products/client/requests/ProductSkuCreate.ts b/src/api/resources/products/client/requests/ProductSkuCreate.ts index afb2d2cc..319a8369 100644 --- a/src/api/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/api/resources/products/client/requests/ProductSkuCreate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductSkuUpdate.ts b/src/api/resources/products/client/requests/ProductSkuUpdate.ts index 63c42173..76e3f601 100644 --- a/src/api/resources/products/client/requests/ProductSkuUpdate.ts +++ b/src/api/resources/products/client/requests/ProductSkuUpdate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts index 4a0a2f94..6e57238c 100644 --- a/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsCreateSkuRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/ProductsListRequest.ts b/src/api/resources/products/client/requests/ProductsListRequest.ts index 90999786..82b96f56 100644 --- a/src/api/resources/products/client/requests/ProductsListRequest.ts +++ b/src/api/resources/products/client/requests/ProductsListRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface ProductsListRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts index 4641f6d1..9cb1d368 100644 --- a/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts +++ b/src/api/resources/products/client/requests/ProductsUpdateSkuRequest.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example diff --git a/src/api/resources/products/client/requests/index.ts b/src/api/resources/products/client/requests/index.ts index 8ff3294f..4d8035a5 100644 --- a/src/api/resources/products/client/requests/index.ts +++ b/src/api/resources/products/client/requests/index.ts @@ -1,5 +1,5 @@ -export type { ProductSkuCreate } from "./ProductSkuCreate"; -export type { ProductSkuUpdate } from "./ProductSkuUpdate"; -export type { ProductsCreateSkuRequest } from "./ProductsCreateSkuRequest"; -export type { ProductsListRequest } from "./ProductsListRequest"; -export type { ProductsUpdateSkuRequest } from "./ProductsUpdateSkuRequest"; +export { type ProductsListRequest } from "./ProductsListRequest"; +export { type ProductSkuCreate } from "./ProductSkuCreate"; +export { type ProductSkuUpdate } from "./ProductSkuUpdate"; +export { type ProductsCreateSkuRequest } from "./ProductsCreateSkuRequest"; +export { type ProductsUpdateSkuRequest } from "./ProductsUpdateSkuRequest"; diff --git a/src/api/resources/products/index.ts b/src/api/resources/products/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/products/index.ts +++ b/src/api/resources/products/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/products/types/ProductSkuCreateProduct.ts b/src/api/resources/products/types/ProductSkuCreateProduct.ts index 1a666686..c8638f46 100644 --- a/src/api/resources/products/types/ProductSkuCreateProduct.ts +++ b/src/api/resources/products/types/ProductSkuCreateProduct.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface ProductSkuCreateProduct { fieldData?: Webflow.ProductFieldData; diff --git a/src/api/resources/products/types/ProductSkuCreateSku.ts b/src/api/resources/products/types/ProductSkuCreateSku.ts index 90ee1f39..c704fa2f 100644 --- a/src/api/resources/products/types/ProductSkuCreateSku.ts +++ b/src/api/resources/products/types/ProductSkuCreateSku.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface ProductSkuCreateSku { fieldData?: Webflow.SkuFieldData; diff --git a/src/api/resources/products/types/ProductsCreateSkuResponse.ts b/src/api/resources/products/types/ProductsCreateSkuResponse.ts index 3e8e25fb..c0a565fa 100644 --- a/src/api/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/api/resources/products/types/ProductsCreateSkuResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface ProductsCreateSkuResponse { skus: Webflow.Sku[]; diff --git a/src/api/resources/scripts/client/Client.ts b/src/api/resources/scripts/client/Client.ts index 0be75acc..dce2f569 100644 --- a/src/api/resources/scripts/client/Client.ts +++ b/src/api/resources/scripts/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Scripts { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Scripts { @@ -53,23 +71,21 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/registered_scripts`, + `sites/${encodeURIComponent(siteId)}/registered_scripts`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -201,30 +217,28 @@ export class Scripts { request: Webflow.CustomCodeHostedRequest, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/registered_scripts/hosted`, + `sites/${encodeURIComponent(siteId)}/registered_scripts/hosted`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CustomCodeHostedRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -355,30 +369,28 @@ export class Scripts { request: Webflow.CustomCodeInlineRequest, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/registered_scripts/inline`, + `sites/${encodeURIComponent(siteId)}/registered_scripts/inline`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.CustomCodeInlineRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/scripts/client/index.ts b/src/api/resources/scripts/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/scripts/client/index.ts +++ b/src/api/resources/scripts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts b/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts index 3c99646d..3a5e5830 100644 --- a/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts +++ b/src/api/resources/scripts/client/requests/CustomCodeHostedRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts b/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts index 0a088d3a..d65f3d0e 100644 --- a/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts +++ b/src/api/resources/scripts/client/requests/CustomCodeInlineRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/scripts/client/requests/index.ts b/src/api/resources/scripts/client/requests/index.ts index 7a2d21e4..30d6b835 100644 --- a/src/api/resources/scripts/client/requests/index.ts +++ b/src/api/resources/scripts/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { CustomCodeHostedRequest } from "./CustomCodeHostedRequest"; -export type { CustomCodeInlineRequest } from "./CustomCodeInlineRequest"; +export { type CustomCodeHostedRequest } from "./CustomCodeHostedRequest"; +export { type CustomCodeInlineRequest } from "./CustomCodeInlineRequest"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index 87f7654e..4d3407a1 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -1,25 +1,43 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; -import { ActivityLogs } from "../resources/activityLogs/client/Client"; -import { Comments } from "../resources/comments/client/Client"; -import { Forms } from "../resources/forms/client/Client"; -import { Plans } from "../resources/plans/client/Client"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import * as serializers from "../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; import { Redirects } from "../resources/redirects/client/Client"; +import { Plans } from "../resources/plans/client/Client"; import { RobotsTxt } from "../resources/robotsTxt/client/Client"; -import { Scripts } from "../resources/scripts/client/Client"; import { WellKnown } from "../resources/wellKnown/client/Client"; +import { ActivityLogs } from "../resources/activityLogs/client/Client"; +import { Comments } from "../resources/comments/client/Client"; +import { Scripts } from "../resources/scripts/client/Client"; +import { Forms } from "../resources/forms/client/Client"; export declare namespace Sites { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -108,30 +126,28 @@ export class Sites { request: Webflow.SitesCreateRequest, requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `workspaces/${core.url.encodePathParam(workspaceId)}/sites`, + `workspaces/${encodeURIComponent(workspaceId)}/sites`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -244,23 +260,21 @@ export class Sites { } private async __list(requestOptions?: Sites.RequestOptions): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "sites", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -362,23 +376,21 @@ export class Sites { siteId: string, requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}`, + `sites/${encodeURIComponent(siteId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -493,23 +505,21 @@ export class Sites { } private async __delete(siteId: string, requestOptions?: Sites.RequestOptions): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}`, + `sites/${encodeURIComponent(siteId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -626,30 +636,28 @@ export class Sites { request: Webflow.SitesUpdateRequest = {}, requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}`, + `sites/${encodeURIComponent(siteId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -769,23 +777,21 @@ export class Sites { siteId: string, requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/custom_domains`, + `sites/${encodeURIComponent(siteId)}/custom_domains`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -915,30 +921,28 @@ export class Sites { request: Webflow.SitesPublishRequest = {}, requestOptions?: Sites.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/publish`, + `sites/${encodeURIComponent(siteId)}/publish`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.SitesPublishRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/client/index.ts b/src/api/resources/sites/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/client/index.ts +++ b/src/api/resources/sites/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/client/requests/SitesCreateRequest.ts b/src/api/resources/sites/client/requests/SitesCreateRequest.ts index ee2378a3..c7911a56 100644 --- a/src/api/resources/sites/client/requests/SitesCreateRequest.ts +++ b/src/api/resources/sites/client/requests/SitesCreateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/sites/client/requests/SitesPublishRequest.ts b/src/api/resources/sites/client/requests/SitesPublishRequest.ts index 55b7a596..1cc22308 100644 --- a/src/api/resources/sites/client/requests/SitesPublishRequest.ts +++ b/src/api/resources/sites/client/requests/SitesPublishRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/sites/client/requests/SitesUpdateRequest.ts b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts index ef6e8d1b..99058677 100644 --- a/src/api/resources/sites/client/requests/SitesUpdateRequest.ts +++ b/src/api/resources/sites/client/requests/SitesUpdateRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/sites/client/requests/index.ts b/src/api/resources/sites/client/requests/index.ts index 7fc59b25..b802fad3 100644 --- a/src/api/resources/sites/client/requests/index.ts +++ b/src/api/resources/sites/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { SitesCreateRequest } from "./SitesCreateRequest"; -export type { SitesPublishRequest } from "./SitesPublishRequest"; -export type { SitesUpdateRequest } from "./SitesUpdateRequest"; +export { type SitesCreateRequest } from "./SitesCreateRequest"; +export { type SitesUpdateRequest } from "./SitesUpdateRequest"; +export { type SitesPublishRequest } from "./SitesPublishRequest"; diff --git a/src/api/resources/sites/index.ts b/src/api/resources/sites/index.ts index fb00ab43..a931b363 100644 --- a/src/api/resources/sites/index.ts +++ b/src/api/resources/sites/index.ts @@ -1,3 +1,3 @@ -export * from "./client"; -export * from "./resources"; export * from "./types"; +export * from "./resources"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/activityLogs/client/Client.ts b/src/api/resources/sites/resources/activityLogs/client/Client.ts index 881dd856..655a8810 100644 --- a/src/api/resources/sites/resources/activityLogs/client/Client.ts +++ b/src/api/resources/sites/resources/activityLogs/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace ActivityLogs { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class ActivityLogs { @@ -39,8 +57,8 @@ export class ActivityLogs { * * @example * await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", { - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * }) */ public list( @@ -59,30 +77,29 @@ export class ActivityLogs { const { limit, offset } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/activity_logs`, + `sites/${encodeURIComponent(siteId)}/activity_logs`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/activityLogs/client/index.ts b/src/api/resources/sites/resources/activityLogs/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/resources/activityLogs/client/index.ts +++ b/src/api/resources/sites/resources/activityLogs/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts b/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts index f04d34d8..71ab9084 100644 --- a/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts +++ b/src/api/resources/sites/resources/activityLogs/client/requests/ActivityLogsListRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * limit: 1.1, - * offset: 1.1 + * limit: 1, + * offset: 1 * } */ export interface ActivityLogsListRequest { - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; } diff --git a/src/api/resources/sites/resources/activityLogs/client/requests/index.ts b/src/api/resources/sites/resources/activityLogs/client/requests/index.ts index ddd3248d..c22e9ae2 100644 --- a/src/api/resources/sites/resources/activityLogs/client/requests/index.ts +++ b/src/api/resources/sites/resources/activityLogs/client/requests/index.ts @@ -1 +1 @@ -export type { ActivityLogsListRequest } from "./ActivityLogsListRequest"; +export { type ActivityLogsListRequest } from "./ActivityLogsListRequest"; diff --git a/src/api/resources/sites/resources/comments/client/Client.ts b/src/api/resources/sites/resources/comments/client/Client.ts index b408aeeb..ef712211 100644 --- a/src/api/resources/sites/resources/comments/client/Client.ts +++ b/src/api/resources/sites/resources/comments/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; export declare namespace Comments { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Comments { @@ -43,8 +61,8 @@ export class Comments { * @example * await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * }) @@ -65,19 +83,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (sortBy != null) { - _queryParams.sortBy = serializers.sites.CommentsListCommentThreadsRequestSortBy.jsonOrThrow(sortBy, { + _queryParams["sortBy"] = serializers.sites.CommentsListCommentThreadsRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -85,7 +103,7 @@ export class Comments { } if (sortOrder != null) { - _queryParams.sortOrder = serializers.sites.CommentsListCommentThreadsRequestSortOrder.jsonOrThrow( + _queryParams["sortOrder"] = serializers.sites.CommentsListCommentThreadsRequestSortOrder.jsonOrThrow( sortOrder, { unrecognizedObjectKeys: "passthrough", @@ -95,23 +113,22 @@ export class Comments { ); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/comments`, + `sites/${encodeURIComponent(siteId)}/comments`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -224,8 +241,8 @@ export class Comments { * @example * await client.sites.comments.getCommentThread("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * }) @@ -250,19 +267,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (sortBy != null) { - _queryParams.sortBy = serializers.sites.CommentsGetCommentThreadRequestSortBy.jsonOrThrow(sortBy, { + _queryParams["sortBy"] = serializers.sites.CommentsGetCommentThreadRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -270,30 +287,32 @@ export class Comments { } if (sortOrder != null) { - _queryParams.sortOrder = serializers.sites.CommentsGetCommentThreadRequestSortOrder.jsonOrThrow(sortOrder, { - unrecognizedObjectKeys: "passthrough", - allowUnrecognizedUnionMembers: true, - allowUnrecognizedEnumValues: true, - }); + _queryParams["sortOrder"] = serializers.sites.CommentsGetCommentThreadRequestSortOrder.jsonOrThrow( + sortOrder, + { + unrecognizedObjectKeys: "passthrough", + allowUnrecognizedUnionMembers: true, + allowUnrecognizedEnumValues: true, + }, + ); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/comments/${core.url.encodePathParam(commentThreadId)}`, + `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -408,8 +427,8 @@ export class Comments { * @example * await client.sites.comments.listCommentReplies("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * }) @@ -434,19 +453,19 @@ export class Comments { const { localeId, offset, limit, sortBy, sortOrder } = request; const _queryParams: Record = {}; if (localeId != null) { - _queryParams.localeId = localeId; + _queryParams["localeId"] = localeId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (sortBy != null) { - _queryParams.sortBy = serializers.sites.CommentsListCommentRepliesRequestSortBy.jsonOrThrow(sortBy, { + _queryParams["sortBy"] = serializers.sites.CommentsListCommentRepliesRequestSortBy.jsonOrThrow(sortBy, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, @@ -454,7 +473,7 @@ export class Comments { } if (sortOrder != null) { - _queryParams.sortOrder = serializers.sites.CommentsListCommentRepliesRequestSortOrder.jsonOrThrow( + _queryParams["sortOrder"] = serializers.sites.CommentsListCommentRepliesRequestSortOrder.jsonOrThrow( sortOrder, { unrecognizedObjectKeys: "passthrough", @@ -464,23 +483,22 @@ export class Comments { ); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/comments/${core.url.encodePathParam(commentThreadId)}/replies`, + `sites/${encodeURIComponent(siteId)}/comments/${encodeURIComponent(commentThreadId)}/replies`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/comments/client/index.ts b/src/api/resources/sites/resources/comments/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/resources/comments/client/index.ts +++ b/src/api/resources/sites/resources/comments/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts index 929f218b..681ac970 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsGetCommentThreadRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * } @@ -19,12 +21,20 @@ export interface CommentsGetCommentThreadRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Sort results by the provided value. Only allowed when sortOrder is provided. */ + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ sortBy?: Webflow.sites.CommentsGetCommentThreadRequestSortBy; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.sites.CommentsGetCommentThreadRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts index 5512c9c6..69378328 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentRepliesRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * } @@ -19,12 +21,20 @@ export interface CommentsListCommentRepliesRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Sort results by the provided value. Only allowed when sortOrder is provided. */ + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ sortBy?: Webflow.sites.CommentsListCommentRepliesRequestSortBy; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.sites.CommentsListCommentRepliesRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts index ad313708..bd2d8922 100644 --- a/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts +++ b/src/api/resources/sites/resources/comments/client/requests/CommentsListCommentThreadsRequest.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { * localeId: "65427cf400e02b306eaa04a0", - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sortBy: "createdOn", * sortOrder: "asc" * } @@ -19,12 +21,20 @@ export interface CommentsListCommentThreadsRequest { * [Lear more about localization.](/data/v2.0.0/docs/working-with-localization) */ localeId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Sort results by the provided value. Only allowed when sortOrder is provided. */ + /** + * Sort results by the provided value. Only allowed when sortOrder is provided. + */ sortBy?: Webflow.sites.CommentsListCommentThreadsRequestSortBy; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.sites.CommentsListCommentThreadsRequestSortOrder; } diff --git a/src/api/resources/sites/resources/comments/client/requests/index.ts b/src/api/resources/sites/resources/comments/client/requests/index.ts index 28bcd5b9..6a4c7581 100644 --- a/src/api/resources/sites/resources/comments/client/requests/index.ts +++ b/src/api/resources/sites/resources/comments/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { CommentsGetCommentThreadRequest } from "./CommentsGetCommentThreadRequest"; -export type { CommentsListCommentRepliesRequest } from "./CommentsListCommentRepliesRequest"; -export type { CommentsListCommentThreadsRequest } from "./CommentsListCommentThreadsRequest"; +export { type CommentsListCommentThreadsRequest } from "./CommentsListCommentThreadsRequest"; +export { type CommentsGetCommentThreadRequest } from "./CommentsGetCommentThreadRequest"; +export { type CommentsListCommentRepliesRequest } from "./CommentsListCommentRepliesRequest"; diff --git a/src/api/resources/sites/resources/comments/index.ts b/src/api/resources/sites/resources/comments/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/sites/resources/comments/index.ts +++ b/src/api/resources/sites/resources/comments/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts index aeee91d4..745d5440 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsGetCommentThreadRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsGetCommentThreadRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; -export type CommentsGetCommentThreadRequestSortBy = - (typeof CommentsGetCommentThreadRequestSortBy)[keyof typeof CommentsGetCommentThreadRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts index d999530d..065b226b 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsGetCommentThreadRequestSortOrder = "asc" | "desc"; export const CommentsGetCommentThreadRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type CommentsGetCommentThreadRequestSortOrder = - (typeof CommentsGetCommentThreadRequestSortOrder)[keyof typeof CommentsGetCommentThreadRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts index ff317651..61bb74eb 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsListCommentRepliesRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsListCommentRepliesRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; -export type CommentsListCommentRepliesRequestSortBy = - (typeof CommentsListCommentRepliesRequestSortBy)[keyof typeof CommentsListCommentRepliesRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts index 290ce704..4ca7594b 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsListCommentRepliesRequestSortOrder = "asc" | "desc"; export const CommentsListCommentRepliesRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type CommentsListCommentRepliesRequestSortOrder = - (typeof CommentsListCommentRepliesRequestSortOrder)[keyof typeof CommentsListCommentRepliesRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts index 59340376..d04dd360 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsListCommentThreadsRequestSortBy = "createdOn" | "lastUpdated"; export const CommentsListCommentThreadsRequestSortBy = { CreatedOn: "createdOn", LastUpdated: "lastUpdated", } as const; -export type CommentsListCommentThreadsRequestSortBy = - (typeof CommentsListCommentThreadsRequestSortBy)[keyof typeof CommentsListCommentThreadsRequestSortBy]; diff --git a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts index 005ab1af..1121b941 100644 --- a/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts +++ b/src/api/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CommentsListCommentThreadsRequestSortOrder = "asc" | "desc"; export const CommentsListCommentThreadsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type CommentsListCommentThreadsRequestSortOrder = - (typeof CommentsListCommentThreadsRequestSortOrder)[keyof typeof CommentsListCommentThreadsRequestSortOrder]; diff --git a/src/api/resources/sites/resources/comments/types/index.ts b/src/api/resources/sites/resources/comments/types/index.ts index b2ed8e9b..0d2c5090 100644 --- a/src/api/resources/sites/resources/comments/types/index.ts +++ b/src/api/resources/sites/resources/comments/types/index.ts @@ -1,6 +1,6 @@ +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; export * from "./CommentsGetCommentThreadRequestSortBy"; export * from "./CommentsGetCommentThreadRequestSortOrder"; export * from "./CommentsListCommentRepliesRequestSortBy"; export * from "./CommentsListCommentRepliesRequestSortOrder"; -export * from "./CommentsListCommentThreadsRequestSortBy"; -export * from "./CommentsListCommentThreadsRequestSortOrder"; diff --git a/src/api/resources/sites/resources/forms/client/Client.ts b/src/api/resources/sites/resources/forms/client/Client.ts index 3f11dfc4..6abc04a2 100644 --- a/src/api/resources/sites/resources/forms/client/Client.ts +++ b/src/api/resources/sites/resources/forms/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace Forms { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Forms { @@ -48,8 +66,8 @@ export class Forms { * @example * await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", { * elementId: "18259716-3e5a-646a-5f41-5dc4b9405aa0", - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public listSubmissionsBySite( @@ -68,34 +86,33 @@ export class Forms { const { elementId, offset, limit } = request; const _queryParams: Record = {}; if (elementId != null) { - _queryParams.elementId = elementId; + _queryParams["elementId"] = elementId; } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/form_submissions`, + `sites/${encodeURIComponent(siteId)}/form_submissions`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -210,8 +227,8 @@ export class Forms { * * @example * await client.sites.forms.listSubmissions("580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public listSubmissions( @@ -232,30 +249,29 @@ export class Forms { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/forms/${core.url.encodePathParam(formId)}/submissions`, + `sites/${encodeURIComponent(siteId)}/forms/${encodeURIComponent(formId)}/submissions`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -381,23 +397,21 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -524,23 +538,21 @@ export class Forms { formSubmissionId: string, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -665,30 +677,28 @@ export class Forms { request: Webflow.sites.FormsUpdateSubmissionRequest = {}, requestOptions?: Forms.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/form_submissions/${core.url.encodePathParam(formSubmissionId)}`, + `sites/${encodeURIComponent(siteId)}/form_submissions/${encodeURIComponent(formSubmissionId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.FormsUpdateSubmissionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/forms/client/index.ts b/src/api/resources/sites/resources/forms/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/resources/forms/client/index.ts +++ b/src/api/resources/sites/resources/forms/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts index 08e87c9a..36649c9d 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsBySiteRequest.ts @@ -1,18 +1,26 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { * elementId: "18259716-3e5a-646a-5f41-5dc4b9405aa0", - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface FormsListSubmissionsBySiteRequest { - /** Identifier for an element */ + /** + * Identifier for an element + */ elementId?: string; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts index 91c686e5..b4c1b12a 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsListSubmissionsRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface FormsListSubmissionsRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index 16be9837..d0c8dfb4 100644 --- a/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/api/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/sites/resources/forms/client/requests/index.ts b/src/api/resources/sites/resources/forms/client/requests/index.ts index 7b55dd20..f5f527d3 100644 --- a/src/api/resources/sites/resources/forms/client/requests/index.ts +++ b/src/api/resources/sites/resources/forms/client/requests/index.ts @@ -1,3 +1,3 @@ -export type { FormsListSubmissionsBySiteRequest } from "./FormsListSubmissionsBySiteRequest"; -export type { FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; -export type { FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; +export { type FormsListSubmissionsBySiteRequest } from "./FormsListSubmissionsBySiteRequest"; +export { type FormsListSubmissionsRequest } from "./FormsListSubmissionsRequest"; +export { type FormsUpdateSubmissionRequest } from "./FormsUpdateSubmissionRequest"; diff --git a/src/api/resources/sites/resources/index.ts b/src/api/resources/sites/resources/index.ts index 61f7706e..ae08c39f 100644 --- a/src/api/resources/sites/resources/index.ts +++ b/src/api/resources/sites/resources/index.ts @@ -1,15 +1,15 @@ -export * as activityLogs from "./activityLogs"; -export * from "./activityLogs/client/requests"; +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/types"; export * as comments from "./comments"; -export * from "./comments/client/requests"; export * from "./comments/types"; -export * as forms from "./forms"; -export * from "./forms/client/requests"; -export * as plans from "./plans"; export * as redirects from "./redirects"; +export * as plans from "./plans"; export * as robotsTxt from "./robotsTxt"; +export * as activityLogs from "./activityLogs"; export * as scripts from "./scripts"; -export * from "./scripts/client/requests"; -export * as wellKnown from "./wellKnown"; +export * as forms from "./forms"; export * from "./wellKnown/client/requests"; -export * from "./wellKnown/types"; +export * from "./activityLogs/client/requests"; +export * from "./comments/client/requests"; +export * from "./scripts/client/requests"; +export * from "./forms/client/requests"; diff --git a/src/api/resources/sites/resources/plans/client/Client.ts b/src/api/resources/sites/resources/plans/client/Client.ts index 06b9854f..740813e2 100644 --- a/src/api/resources/sites/resources/plans/client/Client.ts +++ b/src/api/resources/sites/resources/plans/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace Plans { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Plans { @@ -51,23 +69,21 @@ export class Plans { siteId: string, requestOptions?: Plans.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/plan`, + `sites/${encodeURIComponent(siteId)}/plan`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/redirects/client/Client.ts b/src/api/resources/sites/resources/redirects/client/Client.ts index f4c843dc..8d393634 100644 --- a/src/api/resources/sites/resources/redirects/client/Client.ts +++ b/src/api/resources/sites/resources/redirects/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace Redirects { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Redirects { @@ -53,23 +71,21 @@ export class Redirects { siteId: string, requestOptions?: Redirects.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/redirects`, + `sites/${encodeURIComponent(siteId)}/redirects`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -198,30 +214,28 @@ export class Redirects { request: Webflow.Redirect, requestOptions?: Redirects.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/redirects`, + `sites/${encodeURIComponent(siteId)}/redirects`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Redirect.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -346,23 +360,21 @@ export class Redirects { redirectId: string, requestOptions?: Redirects.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/redirects/${core.url.encodePathParam(redirectId)}`, + `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -494,30 +506,28 @@ export class Redirects { request: Webflow.Redirect, requestOptions?: Redirects.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/redirects/${core.url.encodePathParam(redirectId)}`, + `sites/${encodeURIComponent(siteId)}/redirects/${encodeURIComponent(redirectId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Redirect.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/robotsTxt/client/Client.ts b/src/api/resources/sites/resources/robotsTxt/client/Client.ts index 4a922806..719e5607 100644 --- a/src/api/resources/sites/resources/robotsTxt/client/Client.ts +++ b/src/api/resources/sites/resources/robotsTxt/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace RobotsTxt { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class RobotsTxt { @@ -48,23 +66,21 @@ export class RobotsTxt { siteId: string, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/robots_txt`, + `sites/${encodeURIComponent(siteId)}/robots_txt`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -194,30 +210,28 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/robots_txt`, + `sites/${encodeURIComponent(siteId)}/robots_txt`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -348,30 +362,28 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/robots_txt`, + `sites/${encodeURIComponent(siteId)}/robots_txt`, ), method: "DELETE", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -503,30 +515,28 @@ export class RobotsTxt { request: Webflow.Robots, requestOptions?: RobotsTxt.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/robots_txt`, + `sites/${encodeURIComponent(siteId)}/robots_txt`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Robots.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/scripts/client/Client.ts b/src/api/resources/sites/resources/scripts/client/Client.ts index da6bdd3f..350c1125 100644 --- a/src/api/resources/sites/resources/scripts/client/Client.ts +++ b/src/api/resources/sites/resources/scripts/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../../../serialization/index"; +import * as errors from "../../../../../../errors/index"; export declare namespace Scripts { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Scripts { @@ -53,23 +71,21 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/custom_code`, + `sites/${encodeURIComponent(siteId)}/custom_code`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -207,30 +223,28 @@ export class Scripts { request: Webflow.ScriptApplyList, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/custom_code`, + `sites/${encodeURIComponent(siteId)}/custom_code`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.ScriptApplyList.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -349,23 +363,21 @@ export class Scripts { siteId: string, requestOptions?: Scripts.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/custom_code`, + `sites/${encodeURIComponent(siteId)}/custom_code`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -471,8 +483,8 @@ export class Scripts { * * @example * await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * }) */ public listCustomCodeBlocks( @@ -491,30 +503,29 @@ export class Scripts { const { offset, limit } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/custom_code/blocks`, + `sites/${encodeURIComponent(siteId)}/custom_code/blocks`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/scripts/client/index.ts b/src/api/resources/sites/resources/scripts/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/resources/scripts/client/index.ts +++ b/src/api/resources/sites/resources/scripts/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts b/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts index 7f7715c6..e02e66dd 100644 --- a/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts +++ b/src/api/resources/sites/resources/scripts/client/requests/ScriptsListCustomCodeBlocksRequest.ts @@ -1,15 +1,21 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example * { - * offset: 1.1, - * limit: 1.1 + * offset: 1, + * limit: 1 * } */ export interface ScriptsListCustomCodeBlocksRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; } diff --git a/src/api/resources/sites/resources/scripts/client/requests/index.ts b/src/api/resources/sites/resources/scripts/client/requests/index.ts index 01f0ce5d..32e771fa 100644 --- a/src/api/resources/sites/resources/scripts/client/requests/index.ts +++ b/src/api/resources/sites/resources/scripts/client/requests/index.ts @@ -1 +1 @@ -export type { ScriptsListCustomCodeBlocksRequest } from "./ScriptsListCustomCodeBlocksRequest"; +export { type ScriptsListCustomCodeBlocksRequest } from "./ScriptsListCustomCodeBlocksRequest"; diff --git a/src/api/resources/sites/resources/wellKnown/client/Client.ts b/src/api/resources/sites/resources/wellKnown/client/Client.ts index 9c1a48b1..8346e2dd 100644 --- a/src/api/resources/sites/resources/wellKnown/client/Client.ts +++ b/src/api/resources/sites/resources/wellKnown/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import * as serializers from "../../../../../../serialization/index"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; export declare namespace WellKnown { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class WellKnown { @@ -67,30 +85,28 @@ export class WellKnown { request: Webflow.sites.WellKnownFile, requestOptions?: WellKnown.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/well_known`, + `sites/${encodeURIComponent(siteId)}/well_known`, ), method: "PUT", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.WellKnownFile.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -204,30 +220,28 @@ export class WellKnown { request: Webflow.sites.WellKnownDeleteRequest = {}, requestOptions?: WellKnown.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/well_known`, + `sites/${encodeURIComponent(siteId)}/well_known`, ), method: "DELETE", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.sites.WellKnownDeleteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/sites/resources/wellKnown/client/index.ts b/src/api/resources/sites/resources/wellKnown/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/sites/resources/wellKnown/client/index.ts +++ b/src/api/resources/sites/resources/wellKnown/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts index 971b614d..12b026fe 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts index 2168f9da..62a7c2cc 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example diff --git a/src/api/resources/sites/resources/wellKnown/client/requests/index.ts b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts index 1d8b2183..80d597d9 100644 --- a/src/api/resources/sites/resources/wellKnown/client/requests/index.ts +++ b/src/api/resources/sites/resources/wellKnown/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; -export type { WellKnownFile } from "./WellKnownFile"; +export { type WellKnownFile } from "./WellKnownFile"; +export { type WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; diff --git a/src/api/resources/sites/resources/wellKnown/index.ts b/src/api/resources/sites/resources/wellKnown/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/sites/resources/wellKnown/index.ts +++ b/src/api/resources/sites/resources/wellKnown/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts index 1b17879a..c3192e7f 100644 --- a/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts +++ b/src/api/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The content type of the file. Defaults to application/json */ +/** + * The content type of the file. Defaults to application/json + */ +export type WellKnownFileContentType = "application/json" | "text/plain"; export const WellKnownFileContentType = { ApplicationJson: "application/json", TextPlain: "text/plain", } as const; -export type WellKnownFileContentType = (typeof WellKnownFileContentType)[keyof typeof WellKnownFileContentType]; diff --git a/src/api/resources/sites/types/SitesPublishResponse.ts b/src/api/resources/sites/types/SitesPublishResponse.ts index 4b7bb2fb..e427b61a 100644 --- a/src/api/resources/sites/types/SitesPublishResponse.ts +++ b/src/api/resources/sites/types/SitesPublishResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface SitesPublishResponse { /** Array of domains objects */ diff --git a/src/api/resources/token/client/Client.ts b/src/api/resources/token/client/Client.ts index 85c23549..8daffbd1 100644 --- a/src/api/resources/token/client/Client.ts +++ b/src/api/resources/token/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Token { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Token { @@ -41,23 +59,21 @@ export class Token { private async __authorizedBy( requestOptions?: Token.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "token/authorized_by", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -133,23 +149,21 @@ export class Token { private async __introspect( requestOptions?: Token.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, "token/introspect", ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/users/client/Client.ts b/src/api/resources/users/client/Client.ts index 51c906b2..66f9b058 100644 --- a/src/api/resources/users/client/Client.ts +++ b/src/api/resources/users/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import * as serializers from "../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../errors/index"; export declare namespace Users { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class Users { @@ -39,8 +57,8 @@ export class Users { * * @example * await client.users.list("580e63e98c9a982ac9b8b741", { - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sort: "CreatedOn" * }) */ @@ -60,38 +78,37 @@ export class Users { const { offset, limit, sort } = request; const _queryParams: Record = {}; if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (sort != null) { - _queryParams.sort = serializers.UsersListRequestSort.jsonOrThrow(sort, { + _queryParams["sort"] = serializers.UsersListRequestSort.jsonOrThrow(sort, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/users`, + `sites/${encodeURIComponent(siteId)}/users`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -215,23 +232,21 @@ export class Users { userId: string, requestOptions?: Users.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, + `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -357,23 +372,21 @@ export class Users { userId: string, requestOptions?: Users.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, + `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -508,30 +521,28 @@ export class Users { request: Webflow.User, requestOptions?: Users.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/users/${core.url.encodePathParam(userId)}`, + `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`, ), method: "PATCH", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.User.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -663,30 +674,28 @@ export class Users { request: Webflow.UsersInviteRequest, requestOptions?: Users.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/users/invite`, + `sites/${encodeURIComponent(siteId)}/users/invite`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.UsersInviteRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/users/client/index.ts b/src/api/resources/users/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/users/client/index.ts +++ b/src/api/resources/users/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/users/client/requests/UsersInviteRequest.ts b/src/api/resources/users/client/requests/UsersInviteRequest.ts index ee3c353f..6af54ae3 100644 --- a/src/api/resources/users/client/requests/UsersInviteRequest.ts +++ b/src/api/resources/users/client/requests/UsersInviteRequest.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * @example diff --git a/src/api/resources/users/client/requests/UsersListRequest.ts b/src/api/resources/users/client/requests/UsersListRequest.ts index a2b9065d..ce6a4ba1 100644 --- a/src/api/resources/users/client/requests/UsersListRequest.ts +++ b/src/api/resources/users/client/requests/UsersListRequest.ts @@ -1,19 +1,25 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../index"; +import * as Webflow from "../../../../index"; /** * @example * { - * offset: 1.1, - * limit: 1.1, + * offset: 1, + * limit: 1, * sort: "CreatedOn" * } */ export interface UsersListRequest { - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; /** * Sort string to use when ordering users diff --git a/src/api/resources/users/client/requests/index.ts b/src/api/resources/users/client/requests/index.ts index b6d806bb..3912aa4b 100644 --- a/src/api/resources/users/client/requests/index.ts +++ b/src/api/resources/users/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { UsersInviteRequest } from "./UsersInviteRequest"; -export type { UsersListRequest } from "./UsersListRequest"; +export { type UsersListRequest } from "./UsersListRequest"; +export { type UsersInviteRequest } from "./UsersInviteRequest"; diff --git a/src/api/resources/users/index.ts b/src/api/resources/users/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/users/index.ts +++ b/src/api/resources/users/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/users/types/UserAccountAddedPayload.ts b/src/api/resources/users/types/UserAccountAddedPayload.ts index b23d0a7a..fc58a9ba 100644 --- a/src/api/resources/users/types/UserAccountAddedPayload.ts +++ b/src/api/resources/users/types/UserAccountAddedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountAddedPayload { triggerType?: "user_account_added"; diff --git a/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts b/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts index 223d6ff7..bb646a03 100644 --- a/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountAddedPayloadPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountAddedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts index ab0bf8eb..a9c9b712 100644 --- a/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountAddedPayloadPayloadData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UserAccountDeletedPayload.ts b/src/api/resources/users/types/UserAccountDeletedPayload.ts index b9cefe9e..419718d0 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayload.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountDeletedPayload { triggerType?: "user_account_deleted"; diff --git a/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts b/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts index 630739ea..40e3a24d 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayloadPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountDeletedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts index 4cf4deb2..21e16380 100644 --- a/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountDeletedPayloadPayloadData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UserAccountUpdatedPayload.ts b/src/api/resources/users/types/UserAccountUpdatedPayload.ts index e8e4be4e..9718b762 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayload.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountUpdatedPayload { triggerType?: "user_account_updated"; diff --git a/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts b/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts index 9acb7380..1de45d36 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayloadPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../index"; +import * as Webflow from "../../../index"; export interface UserAccountUpdatedPayloadPayload { /** The data about the user account that was added */ diff --git a/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts b/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts index cce2dc0a..a97a6132 100644 --- a/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts +++ b/src/api/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The data about the user account that was added diff --git a/src/api/resources/users/types/UsersListRequestSort.ts b/src/api/resources/users/types/UsersListRequestSort.ts index e31cae7f..e2c62d3f 100644 --- a/src/api/resources/users/types/UsersListRequestSort.ts +++ b/src/api/resources/users/types/UsersListRequestSort.ts @@ -1,35 +1,47 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -export const UsersListRequestSort = { +export type UsersListRequestSort = /** * Sorts users in ascending order based on their created date */ - CreatedOnAscending: "CreatedOn", + | "CreatedOn" /** * Sorts users in descending order based on their created date */ - CreatedOnDescending: "-CreatedOn", + | "-CreatedOn" /** * Sorts users in ascending order based on their email */ - EmailAscending: "Email", + | "Email" /** * Sorts users in descending order based on their email */ - EmailDescending: "-Email", + | "-Email" /** * Sorts users in ascending order based on their status */ - StatusAscending: "Status", + | "Status" /** * Sorts users in descending order based on their status */ - StatusDescending: "-Status", + | "-Status" /** * Sorts users in ascending order based on their last login date */ - LastLoginAscending: "LastLogin", + | "LastLogin" /** * Sorts users in descending order based on their last login date */ - LastLoginDescending: "-LastLogin", + | "-LastLogin" /** * Sorts users in ascending order based on their update date */ - UpdatedOnAscending: "UpdatedOn", + | "UpdatedOn" /** * Sorts users in descending order based on their update date */ + | "-UpdatedOn"; +export const UsersListRequestSort = { + CreatedOnAscending: "CreatedOn", + CreatedOnDescending: "-CreatedOn", + EmailAscending: "Email", + EmailDescending: "-Email", + StatusAscending: "Status", + StatusDescending: "-Status", + LastLoginAscending: "LastLogin", + LastLoginDescending: "-LastLogin", + UpdatedOnAscending: "UpdatedOn", UpdatedOnDescending: "-UpdatedOn", } as const; -export type UsersListRequestSort = (typeof UsersListRequestSort)[keyof typeof UsersListRequestSort]; diff --git a/src/api/resources/users/types/index.ts b/src/api/resources/users/types/index.ts index 38625be7..258617f4 100644 --- a/src/api/resources/users/types/index.ts +++ b/src/api/resources/users/types/index.ts @@ -1,10 +1,10 @@ -export * from "./UserAccountAddedPayload"; -export * from "./UserAccountAddedPayloadPayload"; +export * from "./UsersListRequestSort"; export * from "./UserAccountAddedPayloadPayloadData"; -export * from "./UserAccountDeletedPayload"; -export * from "./UserAccountDeletedPayloadPayload"; -export * from "./UserAccountDeletedPayloadPayloadData"; -export * from "./UserAccountUpdatedPayload"; -export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayload"; +export * from "./UserAccountAddedPayload"; export * from "./UserAccountUpdatedPayloadPayloadData"; -export * from "./UsersListRequestSort"; +export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountUpdatedPayload"; +export * from "./UserAccountDeletedPayloadPayloadData"; +export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountDeletedPayload"; diff --git a/src/api/resources/webhooks/client/Client.ts b/src/api/resources/webhooks/client/Client.ts index 3d55ca36..3fef40e1 100644 --- a/src/api/resources/webhooks/client/Client.ts +++ b/src/api/resources/webhooks/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient"; -import * as core from "../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers"; import * as environments from "../../../../environments"; -import * as errors from "../../../../errors/index"; -import * as serializers from "../../../../serialization/index"; +import * as core from "../../../../core"; import * as Webflow from "../../../index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as serializers from "../../../../serialization/index"; +import * as errors from "../../../../errors/index"; export declare namespace Webhooks { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } /** @@ -52,23 +70,21 @@ export class Webhooks { siteId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/webhooks`, + `sites/${encodeURIComponent(siteId)}/webhooks`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -200,30 +216,28 @@ export class Webhooks { request: Webflow.Webhook, requestOptions?: Webhooks.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `sites/${core.url.encodePathParam(siteId)}/webhooks`, + `sites/${encodeURIComponent(siteId)}/webhooks`, ), method: "POST", - headers: _headers, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), contentType: "application/json", - queryParameters: requestOptions?.queryParams, requestType: "json", body: serializers.Webhook.jsonOrThrow(request, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, }), - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -338,23 +352,21 @@ export class Webhooks { webhookId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `webhooks/${core.url.encodePathParam(webhookId)}`, + `webhooks/${encodeURIComponent(webhookId)}`, ), method: "GET", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { @@ -469,23 +481,21 @@ export class Webhooks { webhookId: string, requestOptions?: Webhooks.RequestOptions, ): Promise> { - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `webhooks/${core.url.encodePathParam(webhookId)}`, + `webhooks/${encodeURIComponent(webhookId)}`, ), method: "DELETE", - headers: _headers, - queryParameters: requestOptions?.queryParams, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/workspaces/client/Client.ts b/src/api/resources/workspaces/client/Client.ts index ecfe1eeb..579b9e20 100644 --- a/src/api/resources/workspaces/client/Client.ts +++ b/src/api/resources/workspaces/client/Client.ts @@ -1,10 +1,20 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions } from "../../../../BaseClient"; +import * as environments from "../../../../environments"; +import * as core from "../../../../core"; import { AuditLogs } from "../resources/auditLogs/client/Client"; export declare namespace Workspaces { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } } export class Workspaces { diff --git a/src/api/resources/workspaces/index.ts b/src/api/resources/workspaces/index.ts index 33a87f10..4ce0f390 100644 --- a/src/api/resources/workspaces/index.ts +++ b/src/api/resources/workspaces/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./resources"; +export * from "./client"; diff --git a/src/api/resources/workspaces/resources/auditLogs/client/Client.ts b/src/api/resources/workspaces/resources/auditLogs/client/Client.ts index 3a0e15e8..b0d1e96b 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/Client.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/Client.ts @@ -1,17 +1,35 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type { BaseClientOptions, BaseRequestOptions } from "../../../../../../BaseClient"; -import * as core from "../../../../../../core"; -import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers"; import * as environments from "../../../../../../environments"; -import * as errors from "../../../../../../errors/index"; -import * as serializers from "../../../../../../serialization/index"; +import * as core from "../../../../../../core"; import * as Webflow from "../../../../../index"; +import * as serializers from "../../../../../../serialization/index"; +import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.js"; +import urlJoin from "url-join"; +import * as errors from "../../../../../../errors/index"; export declare namespace AuditLogs { - export interface Options extends BaseClientOptions {} + export interface Options { + 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 | undefined>; + } - export interface RequestOptions extends BaseRequestOptions {} + export interface RequestOptions { + /** The maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** The number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A hook to abort the request. */ + abortSignal?: AbortSignal; + /** Additional headers to include in the request. */ + headers?: Record | undefined>; + } } export class AuditLogs { @@ -40,8 +58,8 @@ export class AuditLogs { * * @example * await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace", { - * limit: 1.1, - * offset: 1.1, + * limit: 1, + * offset: 1, * sortOrder: "asc", * eventType: "user_access", * from: new Date("2025-06-22T16:00:31.000Z"), @@ -66,60 +84,55 @@ export class AuditLogs { const { limit, offset, sortOrder, eventType, from: from_, to } = request; const _queryParams: Record = {}; if (limit != null) { - _queryParams.limit = limit.toString(); + _queryParams["limit"] = limit.toString(); } if (offset != null) { - _queryParams.offset = offset.toString(); + _queryParams["offset"] = offset.toString(); } if (sortOrder != null) { - _queryParams.sortOrder = serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.jsonOrThrow( - sortOrder, - { + _queryParams["sortOrder"] = + serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, - }, - ); + }); } if (eventType != null) { - _queryParams.eventType = serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.jsonOrThrow( - eventType, - { + _queryParams["eventType"] = + serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.jsonOrThrow(eventType, { unrecognizedObjectKeys: "passthrough", allowUnrecognizedUnionMembers: true, allowUnrecognizedEnumValues: true, - }, - ); + }); } if (from_ != null) { - _queryParams.from = from_.toISOString(); + _queryParams["from"] = from_.toISOString(); } if (to != null) { - _queryParams.to = to.toISOString(); + _queryParams["to"] = to.toISOString(); } - const _headers: core.Fetcher.Args["headers"] = mergeHeaders( - this._options?.headers, - mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), - requestOptions?.headers, - ); const _response = await core.fetcher({ - url: core.url.join( + url: urlJoin( (await core.Supplier.get(this._options.baseUrl)) ?? ((await core.Supplier.get(this._options.environment)) ?? environments.WebflowEnvironment.DataApi) .base, - `workspaces/${core.url.encodePathParam(workspaceIdOrSlug)}/audit_logs`, + `workspaces/${encodeURIComponent(workspaceIdOrSlug)}/audit_logs`, ), method: "GET", - headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, - timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, - maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + headers: mergeHeaders( + this._options?.headers, + mergeOnlyDefinedHeaders({ Authorization: await this._getAuthorizationHeader() }), + requestOptions?.headers, + ), + queryParameters: _queryParams, + timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, + maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { diff --git a/src/api/resources/workspaces/resources/auditLogs/client/index.ts b/src/api/resources/workspaces/resources/auditLogs/client/index.ts index 415726b7..f33205a0 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/index.ts @@ -1 +1,2 @@ +export {}; export * from "./requests"; diff --git a/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts b/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts index 3165c505..f09f23c9 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/requests/AuditLogsGetWorkspaceAuditLogsRequest.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../index"; +import * as Webflow from "../../../../../../index"; /** * @example * { - * limit: 1.1, - * offset: 1.1, + * limit: 1, + * offset: 1, * sortOrder: "asc", * eventType: "user_access", * from: new Date("2025-06-22T16:00:31.000Z"), @@ -14,16 +16,28 @@ import type * as Webflow from "../../../../../../index"; * } */ export interface AuditLogsGetWorkspaceAuditLogsRequest { - /** Maximum number of records to be returned (max limit: 100) */ + /** + * Maximum number of records to be returned (max limit: 100) + */ limit?: number; - /** Offset used for pagination if the results have more than limit records */ + /** + * Offset used for pagination if the results have more than limit records + */ offset?: number; - /** Sorts the results by asc or desc */ + /** + * Sorts the results by asc or desc + */ sortOrder?: Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder; - /** The event type to filter by */ + /** + * The event type to filter by + */ eventType?: Webflow.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType; - /** The start date to filter by */ + /** + * The start date to filter by + */ from?: Date; - /** The end date to filter by */ + /** + * The end date to filter by + */ to?: Date; } diff --git a/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts b/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts index b587fe28..bd4dd6b0 100644 --- a/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/client/requests/index.ts @@ -1 +1 @@ -export type { AuditLogsGetWorkspaceAuditLogsRequest } from "./AuditLogsGetWorkspaceAuditLogsRequest"; +export { type AuditLogsGetWorkspaceAuditLogsRequest } from "./AuditLogsGetWorkspaceAuditLogsRequest"; diff --git a/src/api/resources/workspaces/resources/auditLogs/index.ts b/src/api/resources/workspaces/resources/auditLogs/index.ts index d2ec2302..c9240f83 100644 --- a/src/api/resources/workspaces/resources/auditLogs/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts index bc462606..98d1c579 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts @@ -1,5 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type AuditLogsGetWorkspaceAuditLogsRequestEventType = + | "user_access" + | "custom_role" + | "workspace_membership" + | "site_membership" + | "workspace_invitation"; export const AuditLogsGetWorkspaceAuditLogsRequestEventType = { UserAccess: "user_access", CustomRole: "custom_role", @@ -7,5 +15,3 @@ export const AuditLogsGetWorkspaceAuditLogsRequestEventType = { SiteMembership: "site_membership", WorkspaceInvitation: "workspace_invitation", } as const; -export type AuditLogsGetWorkspaceAuditLogsRequestEventType = - (typeof AuditLogsGetWorkspaceAuditLogsRequestEventType)[keyof typeof AuditLogsGetWorkspaceAuditLogsRequestEventType]; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts index efdcd8be..ba8d6c9d 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type AuditLogsGetWorkspaceAuditLogsRequestSortOrder = "asc" | "desc"; export const AuditLogsGetWorkspaceAuditLogsRequestSortOrder = { Asc: "asc", Desc: "desc", } as const; -export type AuditLogsGetWorkspaceAuditLogsRequestSortOrder = - (typeof AuditLogsGetWorkspaceAuditLogsRequestSortOrder)[keyof typeof AuditLogsGetWorkspaceAuditLogsRequestSortOrder]; diff --git a/src/api/resources/workspaces/resources/auditLogs/types/index.ts b/src/api/resources/workspaces/resources/auditLogs/types/index.ts index 41fb105c..cfaf464d 100644 --- a/src/api/resources/workspaces/resources/auditLogs/types/index.ts +++ b/src/api/resources/workspaces/resources/auditLogs/types/index.ts @@ -1,2 +1,2 @@ -export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; +export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; diff --git a/src/api/resources/workspaces/resources/index.ts b/src/api/resources/workspaces/resources/index.ts index da3e9fbf..7c178d39 100644 --- a/src/api/resources/workspaces/resources/index.ts +++ b/src/api/resources/workspaces/resources/index.ts @@ -1,3 +1,3 @@ export * as auditLogs from "./auditLogs"; -export * from "./auditLogs/client/requests"; export * from "./auditLogs/types"; +export * from "./auditLogs/client/requests"; diff --git a/src/api/types/AccessGroup.ts b/src/api/types/AccessGroup.ts index e98d2e8a..d94688bc 100644 --- a/src/api/types/AccessGroup.ts +++ b/src/api/types/AccessGroup.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface AccessGroup { /** Unique identifier for the Access Group */ diff --git a/src/api/types/AccessGroupList.ts b/src/api/types/AccessGroupList.ts index d4b46af4..f76f25f1 100644 --- a/src/api/types/AccessGroupList.ts +++ b/src/api/types/AccessGroupList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The list access groups results diff --git a/src/api/types/Application.ts b/src/api/types/Application.ts index de739638..18c66866 100644 --- a/src/api/types/Application.ts +++ b/src/api/types/Application.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface Application { /** Unique identifier for the Application */ diff --git a/src/api/types/Asset.ts b/src/api/types/Asset.ts index 3346e95f..3c1ed56f 100644 --- a/src/api/types/Asset.ts +++ b/src/api/types/Asset.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Asset details diff --git a/src/api/types/AssetFolder.ts b/src/api/types/AssetFolder.ts index 7708b8de..9affae5a 100644 --- a/src/api/types/AssetFolder.ts +++ b/src/api/types/AssetFolder.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Asset Folder details diff --git a/src/api/types/AssetFolderList.ts b/src/api/types/AssetFolderList.ts index bd157908..7618d6cb 100644 --- a/src/api/types/AssetFolderList.ts +++ b/src/api/types/AssetFolderList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Asset Folders object diff --git a/src/api/types/AssetUpload.ts b/src/api/types/AssetUpload.ts index 31128215..748fe76e 100644 --- a/src/api/types/AssetUpload.ts +++ b/src/api/types/AssetUpload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface AssetUpload { /** Metadata for uploading the asset binary */ diff --git a/src/api/types/AssetUploadUploadDetails.ts b/src/api/types/AssetUploadUploadDetails.ts index 88a246b7..8226a132 100644 --- a/src/api/types/AssetUploadUploadDetails.ts +++ b/src/api/types/AssetUploadUploadDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Metadata for uploading the asset binary diff --git a/src/api/types/AssetVariant.ts b/src/api/types/AssetVariant.ts index 741f2d3e..86700495 100644 --- a/src/api/types/AssetVariant.ts +++ b/src/api/types/AssetVariant.ts @@ -1,23 +1,25 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Asset variant details */ export interface AssetVariant { /** URL of where the asset variant is hosted */ - hostedUrl?: string; + hostedUrl: string; /** Original file name of the variant */ - originalFileName?: string; + originalFileName: string; /** Display name of the variant */ - displayName?: string; + displayName: string; /** format of the variant */ - format?: string; + format: string; /** Width in pixels */ - width?: number; + width: number; /** Height in pixels */ height?: number; /** Value between 0 and 100 representing the image quality */ - quality?: number; + quality: number; /** Any associated validation errors */ error?: string; } diff --git a/src/api/types/Assets.ts b/src/api/types/Assets.ts index 0879598a..46b4681b 100644 --- a/src/api/types/Assets.ts +++ b/src/api/types/Assets.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A list of assets diff --git a/src/api/types/Authorization.ts b/src/api/types/Authorization.ts index 62dbdc81..192aaa3b 100644 --- a/src/api/types/Authorization.ts +++ b/src/api/types/Authorization.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Authorization { /** The Authorization object */ diff --git a/src/api/types/AuthorizationAuthorization.ts b/src/api/types/AuthorizationAuthorization.ts index f7d57373..3527fde3 100644 --- a/src/api/types/AuthorizationAuthorization.ts +++ b/src/api/types/AuthorizationAuthorization.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Authorization object diff --git a/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts b/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts index 1d9f74b8..0e34e40c 100644 --- a/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts +++ b/src/api/types/AuthorizationAuthorizationAuthorizedTo.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface AuthorizationAuthorizationAuthorizedTo { /** Array of Sites this app is authorized to */ diff --git a/src/api/types/AuthorizedUser.ts b/src/api/types/AuthorizedUser.ts index eeb0e767..c62b63d5 100644 --- a/src/api/types/AuthorizedUser.ts +++ b/src/api/types/AuthorizedUser.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface AuthorizedUser { /** The unique ID of the user */ diff --git a/src/api/types/BadRequestErrorBody.ts b/src/api/types/BadRequestErrorBody.ts index cd3dbab0..4cf0862f 100644 --- a/src/api/types/BadRequestErrorBody.ts +++ b/src/api/types/BadRequestErrorBody.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export type BadRequestErrorBody = Webflow.InvalidDomain | undefined | Webflow.NoDomains | undefined; diff --git a/src/api/types/BulkCollectionItem.ts b/src/api/types/BulkCollectionItem.ts index ecccc63e..00f2bd6c 100644 --- a/src/api/types/BulkCollectionItem.ts +++ b/src/api/types/BulkCollectionItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/BulkCollectionItemFieldData.ts b/src/api/types/BulkCollectionItemFieldData.ts index f0ff85cd..9c7a049b 100644 --- a/src/api/types/BulkCollectionItemFieldData.ts +++ b/src/api/types/BulkCollectionItemFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface BulkCollectionItemFieldData { /** Name of the Item */ diff --git a/src/api/types/Collection.ts b/src/api/types/Collection.ts index 28f37449..5214eec9 100644 --- a/src/api/types/Collection.ts +++ b/src/api/types/Collection.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A collection object diff --git a/src/api/types/CollectionItem.ts b/src/api/types/CollectionItem.ts index 5d17d886..2783d84b 100644 --- a/src/api/types/CollectionItem.ts +++ b/src/api/types/CollectionItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A Collection Item represents a single entry in your collection. Each item includes: diff --git a/src/api/types/CollectionItemChanged.ts b/src/api/types/CollectionItemChanged.ts index e42c8f92..1b301c10 100644 --- a/src/api/types/CollectionItemChanged.ts +++ b/src/api/types/CollectionItemChanged.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Collection Item is changed diff --git a/src/api/types/CollectionItemCreated.ts b/src/api/types/CollectionItemCreated.ts index d7cd331c..63474fa4 100644 --- a/src/api/types/CollectionItemCreated.ts +++ b/src/api/types/CollectionItemCreated.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Collection Item is created diff --git a/src/api/types/CollectionItemFieldData.ts b/src/api/types/CollectionItemFieldData.ts index d17e1e88..818da81f 100644 --- a/src/api/types/CollectionItemFieldData.ts +++ b/src/api/types/CollectionItemFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemList.ts b/src/api/types/CollectionItemList.ts index dce2ee85..357eb694 100644 --- a/src/api/types/CollectionItemList.ts +++ b/src/api/types/CollectionItemList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Results from collection items list diff --git a/src/api/types/CollectionItemListNoPagination.ts b/src/api/types/CollectionItemListNoPagination.ts index 2e72cf38..64e063ac 100644 --- a/src/api/types/CollectionItemListNoPagination.ts +++ b/src/api/types/CollectionItemListNoPagination.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Results from collection items list diff --git a/src/api/types/CollectionItemListPagination.ts b/src/api/types/CollectionItemListPagination.ts index a5c27e8c..f3631d75 100644 --- a/src/api/types/CollectionItemListPagination.ts +++ b/src/api/types/CollectionItemListPagination.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemListPagination { /** The limit specified in the request */ diff --git a/src/api/types/CollectionItemPatchSingle.ts b/src/api/types/CollectionItemPatchSingle.ts index 72fa3fdb..2b750e65 100644 --- a/src/api/types/CollectionItemPatchSingle.ts +++ b/src/api/types/CollectionItemPatchSingle.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/CollectionItemPatchSingleFieldData.ts b/src/api/types/CollectionItemPatchSingleFieldData.ts index 6a71a6a1..d2436c68 100644 --- a/src/api/types/CollectionItemPatchSingleFieldData.ts +++ b/src/api/types/CollectionItemPatchSingleFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemPatchSingleFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemPostSingle.ts b/src/api/types/CollectionItemPostSingle.ts index 19ca4778..98b0bd28 100644 --- a/src/api/types/CollectionItemPostSingle.ts +++ b/src/api/types/CollectionItemPostSingle.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A Collection Item represents a single entry in your collection. Each item includes: diff --git a/src/api/types/CollectionItemPostSingleFieldData.ts b/src/api/types/CollectionItemPostSingleFieldData.ts index ecf0bc80..82d4a3a7 100644 --- a/src/api/types/CollectionItemPostSingleFieldData.ts +++ b/src/api/types/CollectionItemPostSingleFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemPostSingleFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionItemPublished.ts b/src/api/types/CollectionItemPublished.ts index 8740c7bf..ac069407 100644 --- a/src/api/types/CollectionItemPublished.ts +++ b/src/api/types/CollectionItemPublished.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface CollectionItemPublished { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemRemoved.ts b/src/api/types/CollectionItemRemoved.ts index 1301f846..b9c5f1e3 100644 --- a/src/api/types/CollectionItemRemoved.ts +++ b/src/api/types/CollectionItemRemoved.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface CollectionItemRemoved { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemRemovedPayload.ts b/src/api/types/CollectionItemRemovedPayload.ts index a3b5b81a..6a16174a 100644 --- a/src/api/types/CollectionItemRemovedPayload.ts +++ b/src/api/types/CollectionItemRemovedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/CollectionItemRemovedPayloadFieldData.ts b/src/api/types/CollectionItemRemovedPayloadFieldData.ts index 43ab5807..925241e6 100644 --- a/src/api/types/CollectionItemRemovedPayloadFieldData.ts +++ b/src/api/types/CollectionItemRemovedPayloadFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemRemovedPayloadFieldData { name: string; diff --git a/src/api/types/CollectionItemUnpublished.ts b/src/api/types/CollectionItemUnpublished.ts index d6db37e6..f5f73a31 100644 --- a/src/api/types/CollectionItemUnpublished.ts +++ b/src/api/types/CollectionItemUnpublished.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface CollectionItemUnpublished { /** The type of event that triggered the request */ diff --git a/src/api/types/CollectionItemUnpublishedPayload.ts b/src/api/types/CollectionItemUnpublishedPayload.ts index 33d2cf41..41fe6cbb 100644 --- a/src/api/types/CollectionItemUnpublishedPayload.ts +++ b/src/api/types/CollectionItemUnpublishedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts b/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts index e5534d3f..9700c773 100644 --- a/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts +++ b/src/api/types/CollectionItemUnpublishedPayloadFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemUnpublishedPayloadFieldData { name: string; diff --git a/src/api/types/CollectionItemWithIdInput.ts b/src/api/types/CollectionItemWithIdInput.ts index 55399e5c..0320115e 100644 --- a/src/api/types/CollectionItemWithIdInput.ts +++ b/src/api/types/CollectionItemWithIdInput.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/CollectionItemWithIdInputFieldData.ts b/src/api/types/CollectionItemWithIdInputFieldData.ts index 1ccfddab..1b528c07 100644 --- a/src/api/types/CollectionItemWithIdInputFieldData.ts +++ b/src/api/types/CollectionItemWithIdInputFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CollectionItemWithIdInputFieldData { /** Name of the Item */ diff --git a/src/api/types/CollectionList.ts b/src/api/types/CollectionList.ts index 17d56f25..74b6338c 100644 --- a/src/api/types/CollectionList.ts +++ b/src/api/types/CollectionList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface CollectionList { /** An array of Collections */ diff --git a/src/api/types/CollectionListArrayItem.ts b/src/api/types/CollectionListArrayItem.ts index a58fdfb8..2c3ae253 100644 --- a/src/api/types/CollectionListArrayItem.ts +++ b/src/api/types/CollectionListArrayItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A collection object diff --git a/src/api/types/Comment.ts b/src/api/types/Comment.ts index 68e92b4f..8e0c3ce8 100644 --- a/src/api/types/Comment.ts +++ b/src/api/types/Comment.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a comment thread or reply is made on a Site diff --git a/src/api/types/CommentPayload.ts b/src/api/types/CommentPayload.ts index 09946ef0..6f560aac 100644 --- a/src/api/types/CommentPayload.ts +++ b/src/api/types/CommentPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The comment webhook payload contains data for the thread and for replies. Check the type to determine if the payload is for a thread or a reply. The webhook payload may be delayed by up to 5 minutes. diff --git a/src/api/types/CommentPayloadAuthor.ts b/src/api/types/CommentPayloadAuthor.ts index c0ede7cf..576e25f6 100644 --- a/src/api/types/CommentPayloadAuthor.ts +++ b/src/api/types/CommentPayloadAuthor.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentPayloadAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentPayloadMentionedUsersItem.ts b/src/api/types/CommentPayloadMentionedUsersItem.ts index 9fc9accd..b805e191 100644 --- a/src/api/types/CommentPayloadMentionedUsersItem.ts +++ b/src/api/types/CommentPayloadMentionedUsersItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentPayloadMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/CommentReply.ts b/src/api/types/CommentReply.ts index c3b28fef..8ace76a5 100644 --- a/src/api/types/CommentReply.ts +++ b/src/api/types/CommentReply.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A comment thread represents a conversation between users on a specific page. Each comment thread has a unique identifier and can contain multiple comments. diff --git a/src/api/types/CommentReplyAuthor.ts b/src/api/types/CommentReplyAuthor.ts index ad49f050..a2e04427 100644 --- a/src/api/types/CommentReplyAuthor.ts +++ b/src/api/types/CommentReplyAuthor.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentReplyAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentReplyList.ts b/src/api/types/CommentReplyList.ts index 3ae840c3..16884f3c 100644 --- a/src/api/types/CommentReplyList.ts +++ b/src/api/types/CommentReplyList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A list of comment replies. diff --git a/src/api/types/CommentReplyListPagination.ts b/src/api/types/CommentReplyListPagination.ts index 524577d6..e96f3972 100644 --- a/src/api/types/CommentReplyListPagination.ts +++ b/src/api/types/CommentReplyListPagination.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentReplyListPagination { /** The limit specified in the request (default 100) */ diff --git a/src/api/types/CommentReplyMentionedUsersItem.ts b/src/api/types/CommentReplyMentionedUsersItem.ts index 16fb6389..3d1a27ba 100644 --- a/src/api/types/CommentReplyMentionedUsersItem.ts +++ b/src/api/types/CommentReplyMentionedUsersItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentReplyMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/CommentThread.ts b/src/api/types/CommentThread.ts index 80c8d997..c8e3e685 100644 --- a/src/api/types/CommentThread.ts +++ b/src/api/types/CommentThread.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A comment thread represents a conversation between users on a specific page. Each comment thread has a unique identifier and can contain multiple comments. Retrieve comment replies using the replies API endpoint. diff --git a/src/api/types/CommentThreadAuthor.ts b/src/api/types/CommentThreadAuthor.ts index 839622ff..3dd3cdb4 100644 --- a/src/api/types/CommentThreadAuthor.ts +++ b/src/api/types/CommentThreadAuthor.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentThreadAuthor { /** The unique identifier of the author */ diff --git a/src/api/types/CommentThreadList.ts b/src/api/types/CommentThreadList.ts index de157d3b..dd90cfcc 100644 --- a/src/api/types/CommentThreadList.ts +++ b/src/api/types/CommentThreadList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A list of comment threads on the site. Contains the content of the first reply. diff --git a/src/api/types/CommentThreadListPagination.ts b/src/api/types/CommentThreadListPagination.ts index 7f2863bd..6399f3e5 100644 --- a/src/api/types/CommentThreadListPagination.ts +++ b/src/api/types/CommentThreadListPagination.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentThreadListPagination { /** The limit specified in the request (default 100) */ diff --git a/src/api/types/CommentThreadMentionedUsersItem.ts b/src/api/types/CommentThreadMentionedUsersItem.ts index 43ace1e1..851363c9 100644 --- a/src/api/types/CommentThreadMentionedUsersItem.ts +++ b/src/api/types/CommentThreadMentionedUsersItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CommentThreadMentionedUsersItem { /** The unique identifier of the mentioned user */ diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index 32365fb8..f90eff53 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The Component object diff --git a/src/api/types/ComponentDom.ts b/src/api/types/ComponentDom.ts index 4d5d4e87..3f0b29af 100644 --- a/src/api/types/ComponentDom.ts +++ b/src/api/types/ComponentDom.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Component DOM schema represents the content structure of a component. Similar to Page DOM, it captures various content nodes and their associated attributes, but specifically for a component's structure. Each node has a unique identifier and can contain text, images, select or text inputs, submit buttons, or nested component instances. diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts index 8320b4bd..2fe7cd3b 100644 --- a/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Update text property overrides of a component instance diff --git a/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts index 43c9f523..a69d7028 100644 --- a/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts +++ b/src/api/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem { /** The ID of the property. */ diff --git a/src/api/types/ComponentList.ts b/src/api/types/ComponentList.ts index f55e17ca..8af4f455 100644 --- a/src/api/types/ComponentList.ts +++ b/src/api/types/ComponentList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * List of Components on a site. diff --git a/src/api/types/ComponentNode.ts b/src/api/types/ComponentNode.ts index 6fb02cdb..6b1d4a62 100644 --- a/src/api/types/ComponentNode.ts +++ b/src/api/types/ComponentNode.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Represents a component instance within the DOM. It contains details about the component instance, such as its type and properties. diff --git a/src/api/types/ComponentProperties.ts b/src/api/types/ComponentProperties.ts index 1c495453..e2e33ecb 100644 --- a/src/api/types/ComponentProperties.ts +++ b/src/api/types/ComponentProperties.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Component Properties schema represents a list of properties that store text content. Each property has a unique identifier and can be of different types like plain text or rich text. The schema also provides pagination details for scenarios where there more properties than the limit. diff --git a/src/api/types/ComponentProperty.ts b/src/api/types/ComponentProperty.ts index c0a4c7a5..fffc0323 100644 --- a/src/api/types/ComponentProperty.ts +++ b/src/api/types/ComponentProperty.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Represents a property of a component instance in the DOM. A property contains a list of both the raw text and the HTML representation, allowing for flexibility in rendering and processing. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/ComponentPropertyType.ts b/src/api/types/ComponentPropertyType.ts index 5f2d3413..a92aae91 100644 --- a/src/api/types/ComponentPropertyType.ts +++ b/src/api/types/ComponentPropertyType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the property. */ +/** + * The type of the property. + */ +export type ComponentPropertyType = "Plain Text" | "Rich Text" | "Alt Text"; export const ComponentPropertyType = { PlainText: "Plain Text", RichText: "Rich Text", AltText: "Alt Text", } as const; -export type ComponentPropertyType = (typeof ComponentPropertyType)[keyof typeof ComponentPropertyType]; diff --git a/src/api/types/Conflict.ts b/src/api/types/Conflict.ts index 1fe066c3..46a53a5f 100644 --- a/src/api/types/Conflict.ts +++ b/src/api/types/Conflict.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type Conflict = unknown; diff --git a/src/api/types/ConflictErrorBody.ts b/src/api/types/ConflictErrorBody.ts index 7928e326..81bcd8d1 100644 --- a/src/api/types/ConflictErrorBody.ts +++ b/src/api/types/ConflictErrorBody.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export type ConflictErrorBody = Webflow.DuplicateUserEmail | undefined | Webflow.UserLimitReached | undefined; diff --git a/src/api/types/CustomCodeBlock.ts b/src/api/types/CustomCodeBlock.ts index 5c7d1d6f..41acef4b 100644 --- a/src/api/types/CustomCodeBlock.ts +++ b/src/api/types/CustomCodeBlock.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A specific instance of Custom Code applied to a Site or Page diff --git a/src/api/types/CustomCodeBlockType.ts b/src/api/types/CustomCodeBlockType.ts index d72d4f65..d4d2fb23 100644 --- a/src/api/types/CustomCodeBlockType.ts +++ b/src/api/types/CustomCodeBlockType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Whether the Custom Code script is applied at the Site-level or Page-level */ +/** + * Whether the Custom Code script is applied at the Site-level or Page-level + */ +export type CustomCodeBlockType = "page" | "site"; export const CustomCodeBlockType = { Page: "page", Site: "site", } as const; -export type CustomCodeBlockType = (typeof CustomCodeBlockType)[keyof typeof CustomCodeBlockType]; diff --git a/src/api/types/CustomCodeHostedResponse.ts b/src/api/types/CustomCodeHostedResponse.ts index a4d8286a..8a8b1d08 100644 --- a/src/api/types/CustomCodeHostedResponse.ts +++ b/src/api/types/CustomCodeHostedResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Registered custom code for application diff --git a/src/api/types/CustomCodeInlineResponse.ts b/src/api/types/CustomCodeInlineResponse.ts index cd8f2219..feb74a4b 100644 --- a/src/api/types/CustomCodeInlineResponse.ts +++ b/src/api/types/CustomCodeInlineResponse.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Registered custom code for application diff --git a/src/api/types/CustomRole.ts b/src/api/types/CustomRole.ts index 0f0c0033..2e4c1762 100644 --- a/src/api/types/CustomRole.ts +++ b/src/api/types/CustomRole.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface CustomRole { /** The name of the custom role */ diff --git a/src/api/types/CustomRoleAuditLogItem.ts b/src/api/types/CustomRoleAuditLogItem.ts index d7d78567..ec3dced4 100644 --- a/src/api/types/CustomRoleAuditLogItem.ts +++ b/src/api/types/CustomRoleAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface CustomRoleAuditLogItem { eventSubType?: Webflow.CustomRoleAuditLogItemEventSubType; diff --git a/src/api/types/CustomRoleAuditLogItemEventSubType.ts b/src/api/types/CustomRoleAuditLogItemEventSubType.ts index 840bf169..bccd7734 100644 --- a/src/api/types/CustomRoleAuditLogItemEventSubType.ts +++ b/src/api/types/CustomRoleAuditLogItemEventSubType.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type CustomRoleAuditLogItemEventSubType = "role_created" | "role_updated" | "role_deleted"; export const CustomRoleAuditLogItemEventSubType = { RoleCreated: "role_created", RoleUpdated: "role_updated", RoleDeleted: "role_deleted", } as const; -export type CustomRoleAuditLogItemEventSubType = - (typeof CustomRoleAuditLogItemEventSubType)[keyof typeof CustomRoleAuditLogItemEventSubType]; diff --git a/src/api/types/Dom.ts b/src/api/types/Dom.ts index 6e04034d..5a387c24 100644 --- a/src/api/types/Dom.ts +++ b/src/api/types/Dom.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The DOM (Document Object Model) schema represents the content structure of a web page or component. It captures various content nodes along with their associated attributes. Each node has a unique identifier and can be of different types like text, image or component-instance. The schema also provides pagination details for scenarios where the content nodes are too many to be fetched in a single request. diff --git a/src/api/types/Domain.ts b/src/api/types/Domain.ts index b328ad4a..04e9bb96 100644 --- a/src/api/types/Domain.ts +++ b/src/api/types/Domain.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface Domain { /** Unique identifier for the Domain */ diff --git a/src/api/types/Domains.ts b/src/api/types/Domains.ts index 7eb2e5c4..1e156571 100644 --- a/src/api/types/Domains.ts +++ b/src/api/types/Domains.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Domains { customDomains?: Webflow.Domain[]; diff --git a/src/api/types/DuplicateUserEmail.ts b/src/api/types/DuplicateUserEmail.ts index f4b5367d..79b2a95b 100644 --- a/src/api/types/DuplicateUserEmail.ts +++ b/src/api/types/DuplicateUserEmail.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type DuplicateUserEmail = unknown; diff --git a/src/api/types/EcommerceSettings.ts b/src/api/types/EcommerceSettings.ts index 9c037bd8..fa755860 100644 --- a/src/api/types/EcommerceSettings.ts +++ b/src/api/types/EcommerceSettings.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Ecommerce settings for a Webflow Site diff --git a/src/api/types/ErrorCode.ts b/src/api/types/ErrorCode.ts index d0e73bcd..942424c7 100644 --- a/src/api/types/ErrorCode.ts +++ b/src/api/types/ErrorCode.ts @@ -1,6 +1,40 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Error code */ +/** + * Error code + */ +export type ErrorCode = + | "bad_request" + | "collection_not_found" + | "conflict" + | "duplicate_collection" + | "duplicate_user_email" + | "ecommerce_not_enabled" + | "forbidden" + | "forms_require_republish" + | "incompatible_webhook_filter" + | "internal_error" + | "invalid_auth_version" + | "invalid_credentials" + | "invalid_domain" + | "invalid_user_email" + | "item_not_found" + | "missing_scopes" + | "no_domains" + | "not_authorized" + | "not_enterprise_plan_site" + | "not_enterprise_plan_workspace" + | "order_not_found" + | "resource_not_found" + | "too_many_requests" + | "unsupported_version" + | "unsupported_webhook_trigger_type" + | "user_limit_reached" + | "user_not_found" + | "users_not_enabled" + | "validation_error"; export const ErrorCode = { BadRequest: "bad_request", CollectionNotFound: "collection_not_found", @@ -32,4 +66,3 @@ export const ErrorCode = { UsersNotEnabled: "users_not_enabled", ValidationError: "validation_error", } as const; -export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode]; diff --git a/src/api/types/Error_.ts b/src/api/types/Error_.ts index 48014d1a..6295f0e4 100644 --- a/src/api/types/Error_.ts +++ b/src/api/types/Error_.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Error_ { /** Error code */ diff --git a/src/api/types/Field.ts b/src/api/types/Field.ts index 4506ee2e..44300446 100644 --- a/src/api/types/Field.ts +++ b/src/api/types/Field.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The details of a field in a collection diff --git a/src/api/types/FieldCreate.ts b/src/api/types/FieldCreate.ts index f363297a..85a3c879 100644 --- a/src/api/types/FieldCreate.ts +++ b/src/api/types/FieldCreate.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Details about the field of a collection diff --git a/src/api/types/FieldType.ts b/src/api/types/FieldType.ts index 1d0ed650..5f225005 100644 --- a/src/api/types/FieldType.ts +++ b/src/api/types/FieldType.ts @@ -1,6 +1,28 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Choose these appropriate field type for your collection data */ +/** + * Choose these appropriate field type for your collection data + */ +export type FieldType = + | "Color" + | "DateTime" + | "Email" + | "ExtFileRef" + | "File" + | "Image" + | "Link" + | "MultiImage" + | "MultiReference" + | "Number" + | "Option" + | "Phone" + | "PlainText" + | "Reference" + | "RichText" + | "Switch" + | "VideoLink"; export const FieldType = { Color: "Color", DateTime: "DateTime", @@ -20,4 +42,3 @@ export const FieldType = { Switch: "Switch", VideoLink: "VideoLink", } as const; -export type FieldType = (typeof FieldType)[keyof typeof FieldType]; diff --git a/src/api/types/FieldValidations.ts b/src/api/types/FieldValidations.ts index 6963118f..aefb1cc4 100644 --- a/src/api/types/FieldValidations.ts +++ b/src/api/types/FieldValidations.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The validations for the field diff --git a/src/api/types/FieldValidationsAdditionalProperties.ts b/src/api/types/FieldValidationsAdditionalProperties.ts index 0178fad1..b629d590 100644 --- a/src/api/types/FieldValidationsAdditionalProperties.ts +++ b/src/api/types/FieldValidationsAdditionalProperties.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export type FieldValidationsAdditionalProperties = | string diff --git a/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts b/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts index 3232ec5a..f541be1e 100644 --- a/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts +++ b/src/api/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface FieldValidationsAdditionalPropertiesAdditionalProperties { additionalProperties?: unknown; diff --git a/src/api/types/ForbiddenErrorBody.ts b/src/api/types/ForbiddenErrorBody.ts index 21337061..73b8f3f9 100644 --- a/src/api/types/ForbiddenErrorBody.ts +++ b/src/api/types/ForbiddenErrorBody.ts @@ -1,5 +1,7 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export type ForbiddenErrorBody = Webflow.InvalidScopes | undefined | Webflow.UsersNotEnabled | undefined; diff --git a/src/api/types/Form.ts b/src/api/types/Form.ts index 71a5fd64..ec91d181 100644 --- a/src/api/types/Form.ts +++ b/src/api/types/Form.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A Webflow form diff --git a/src/api/types/FormField.ts b/src/api/types/FormField.ts index 5fa59686..63d089ed 100644 --- a/src/api/types/FormField.ts +++ b/src/api/types/FormField.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A collection of form fields with additional properties. diff --git a/src/api/types/FormFieldValue.ts b/src/api/types/FormFieldValue.ts index a19f1040..96717dd7 100644 --- a/src/api/types/FormFieldValue.ts +++ b/src/api/types/FormFieldValue.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * An object containing field info for a specific fieldID. diff --git a/src/api/types/FormFieldValueType.ts b/src/api/types/FormFieldValueType.ts index d7f201d2..cce8be0a 100644 --- a/src/api/types/FormFieldValueType.ts +++ b/src/api/types/FormFieldValueType.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The field type */ +/** + * The field type + */ +export type FormFieldValueType = "Plain" | "Email" | "Password" | "Phone" | "Number"; export const FormFieldValueType = { Plain: "Plain", Email: "Email", @@ -8,4 +13,3 @@ export const FormFieldValueType = { Phone: "Phone", Number: "Number", } as const; -export type FormFieldValueType = (typeof FormFieldValueType)[keyof typeof FormFieldValueType]; diff --git a/src/api/types/FormList.ts b/src/api/types/FormList.ts index 2d490285..cd9736be 100644 --- a/src/api/types/FormList.ts +++ b/src/api/types/FormList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface FormList { forms?: Webflow.Form[]; diff --git a/src/api/types/FormResponseSettings.ts b/src/api/types/FormResponseSettings.ts index 97b863a4..0ad96213 100644 --- a/src/api/types/FormResponseSettings.ts +++ b/src/api/types/FormResponseSettings.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Settings for form responses diff --git a/src/api/types/FormSubmission.ts b/src/api/types/FormSubmission.ts index aef4b732..a156b7d6 100644 --- a/src/api/types/FormSubmission.ts +++ b/src/api/types/FormSubmission.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface FormSubmission { /** The unique ID of the Form submission */ diff --git a/src/api/types/FormSubmissionList.ts b/src/api/types/FormSubmissionList.ts index 4cf5fb3e..0b55b4fb 100644 --- a/src/api/types/FormSubmissionList.ts +++ b/src/api/types/FormSubmissionList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface FormSubmissionList { formSubmissions?: Webflow.FormSubmission[]; diff --git a/src/api/types/FormSubmissionTrigger.ts b/src/api/types/FormSubmissionTrigger.ts index 09db1cea..3141648b 100644 --- a/src/api/types/FormSubmissionTrigger.ts +++ b/src/api/types/FormSubmissionTrigger.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a form is submitted diff --git a/src/api/types/FormSubmissionTriggerPayload.ts b/src/api/types/FormSubmissionTriggerPayload.ts index dfa4b2a9..b8506bc1 100644 --- a/src/api/types/FormSubmissionTriggerPayload.ts +++ b/src/api/types/FormSubmissionTriggerPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts b/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts index 79cfac91..15de25e8 100644 --- a/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts +++ b/src/api/types/FormSubmissionTriggerPayloadSchemaItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface FormSubmissionTriggerPayloadSchemaItem { /** Form field name */ diff --git a/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts b/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts index aed60d88..a691913b 100644 --- a/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts +++ b/src/api/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts @@ -1,6 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Form field type */ +/** + * Form field type + */ +export type FormSubmissionTriggerPayloadSchemaItemFieldType = + | "FormTextInput" + | "FormTextarea" + | "FormCheckboxInput" + | "FormRadioInput" + | "FormFileUploadInput"; export const FormSubmissionTriggerPayloadSchemaItemFieldType = { FormTextInput: "FormTextInput", FormTextarea: "FormTextarea", @@ -8,5 +18,3 @@ export const FormSubmissionTriggerPayloadSchemaItemFieldType = { FormRadioInput: "FormRadioInput", FormFileUploadInput: "FormFileUploadInput", } as const; -export type FormSubmissionTriggerPayloadSchemaItemFieldType = - (typeof FormSubmissionTriggerPayloadSchemaItemFieldType)[keyof typeof FormSubmissionTriggerPayloadSchemaItemFieldType]; diff --git a/src/api/types/ImageNode.ts b/src/api/types/ImageNode.ts index f09028fe..8134be46 100644 --- a/src/api/types/ImageNode.ts +++ b/src/api/types/ImageNode.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Represents an image within the DOM. It contains details about the image, such as its alternative text (alt) for accessibility and an asset identifier for fetching the actual image resource. Additional attributes can be associated with the image for styling or other purposes. diff --git a/src/api/types/ImageNodeImage.ts b/src/api/types/ImageNodeImage.ts index 70360de6..571de582 100644 --- a/src/api/types/ImageNodeImage.ts +++ b/src/api/types/ImageNodeImage.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The image details of the node diff --git a/src/api/types/InvalidDomain.ts b/src/api/types/InvalidDomain.ts index 9e636d31..4da2028b 100644 --- a/src/api/types/InvalidDomain.ts +++ b/src/api/types/InvalidDomain.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type InvalidDomain = unknown; diff --git a/src/api/types/InvalidScopes.ts b/src/api/types/InvalidScopes.ts index f26c69e7..b389c2bb 100644 --- a/src/api/types/InvalidScopes.ts +++ b/src/api/types/InvalidScopes.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type InvalidScopes = unknown; diff --git a/src/api/types/InventoryItem.ts b/src/api/types/InventoryItem.ts index 9e372b7c..93cd7c00 100644 --- a/src/api/types/InventoryItem.ts +++ b/src/api/types/InventoryItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The availabile inventory for an item diff --git a/src/api/types/InventoryItemInventoryType.ts b/src/api/types/InventoryItemInventoryType.ts index b2c7a258..86d6b087 100644 --- a/src/api/types/InventoryItemInventoryType.ts +++ b/src/api/types/InventoryItemInventoryType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** infinite or finite */ +/** + * infinite or finite + */ +export type InventoryItemInventoryType = "infinite" | "finite"; export const InventoryItemInventoryType = { Infinite: "infinite", Finite: "finite", } as const; -export type InventoryItemInventoryType = (typeof InventoryItemInventoryType)[keyof typeof InventoryItemInventoryType]; diff --git a/src/api/types/ItemsListItemsLiveRequestLastPublished.ts b/src/api/types/ItemsListItemsLiveRequestLastPublished.ts index 4211b175..0ff0e748 100644 --- a/src/api/types/ItemsListItemsLiveRequestLastPublished.ts +++ b/src/api/types/ItemsListItemsLiveRequestLastPublished.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsListItemsLiveRequestLastPublished { /** Filter items last published before this date */ diff --git a/src/api/types/ItemsListItemsRequestLastPublished.ts b/src/api/types/ItemsListItemsRequestLastPublished.ts index 7b31ac1a..ab2e4ed4 100644 --- a/src/api/types/ItemsListItemsRequestLastPublished.ts +++ b/src/api/types/ItemsListItemsRequestLastPublished.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface ItemsListItemsRequestLastPublished { /** Filter items last published before this date */ diff --git a/src/api/types/ListCustomCodeBlocks.ts b/src/api/types/ListCustomCodeBlocks.ts index a16cdb2f..6518202a 100644 --- a/src/api/types/ListCustomCodeBlocks.ts +++ b/src/api/types/ListCustomCodeBlocks.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Custom Code Blocks corresponding to where scripts were applied diff --git a/src/api/types/Locale.ts b/src/api/types/Locale.ts index 0bade2d9..38974659 100644 --- a/src/api/types/Locale.ts +++ b/src/api/types/Locale.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface Locale { /** The unique identifier for the locale. */ diff --git a/src/api/types/Locales.ts b/src/api/types/Locales.ts index dd995f6a..f8dc0241 100644 --- a/src/api/types/Locales.ts +++ b/src/api/types/Locales.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Locales { /** The primary locale for the site or application. */ diff --git a/src/api/types/Metadata.ts b/src/api/types/Metadata.ts index 81fe1e3e..d0931da4 100644 --- a/src/api/types/Metadata.ts +++ b/src/api/types/Metadata.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The metadata for the Option field. diff --git a/src/api/types/MetadataOptionsItem.ts b/src/api/types/MetadataOptionsItem.ts index 43ab8d85..b06b88a4 100644 --- a/src/api/types/MetadataOptionsItem.ts +++ b/src/api/types/MetadataOptionsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A single option value for the Option field. diff --git a/src/api/types/NewOrder.ts b/src/api/types/NewOrder.ts index 1755e3ce..70d8da57 100644 --- a/src/api/types/NewOrder.ts +++ b/src/api/types/NewOrder.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a new order is created diff --git a/src/api/types/NoDomains.ts b/src/api/types/NoDomains.ts index ef51694c..d00b6e30 100644 --- a/src/api/types/NoDomains.ts +++ b/src/api/types/NoDomains.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type NoDomains = unknown; diff --git a/src/api/types/Node.ts b/src/api/types/Node.ts index e231935f..3aee1b92 100644 --- a/src/api/types/Node.ts +++ b/src/api/types/Node.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A generic representation of a content element within the Document Object Model (DOM). Each node has a unique identifier and a specific type that determines its content structure and attributes. diff --git a/src/api/types/NotEnterprisePlanSite.ts b/src/api/types/NotEnterprisePlanSite.ts index 1c46d244..20fad119 100644 --- a/src/api/types/NotEnterprisePlanSite.ts +++ b/src/api/types/NotEnterprisePlanSite.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type NotEnterprisePlanSite = unknown; diff --git a/src/api/types/NotEnterprisePlanWorkspace.ts b/src/api/types/NotEnterprisePlanWorkspace.ts index efa63194..fbd758af 100644 --- a/src/api/types/NotEnterprisePlanWorkspace.ts +++ b/src/api/types/NotEnterprisePlanWorkspace.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type NotEnterprisePlanWorkspace = unknown; diff --git a/src/api/types/OptionField.ts b/src/api/types/OptionField.ts index 80e42477..8bfafcdc 100644 --- a/src/api/types/OptionField.ts +++ b/src/api/types/OptionField.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface OptionField { /** Unique identifier for a Field */ diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 24b99dd6..808ff284 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Order { /** diff --git a/src/api/types/OrderAddress.ts b/src/api/types/OrderAddress.ts index 5015c48b..2f3d1072 100644 --- a/src/api/types/OrderAddress.ts +++ b/src/api/types/OrderAddress.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A customer address diff --git a/src/api/types/OrderAddressJapanType.ts b/src/api/types/OrderAddressJapanType.ts index bebad715..975e8fa6 100644 --- a/src/api/types/OrderAddressJapanType.ts +++ b/src/api/types/OrderAddressJapanType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ +/** + * Represents a Japan-only address format. This field will only appear on orders placed from Japan. + */ +export type OrderAddressJapanType = "kana" | "kanji"; export const OrderAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; -export type OrderAddressJapanType = (typeof OrderAddressJapanType)[keyof typeof OrderAddressJapanType]; diff --git a/src/api/types/OrderAddressType.ts b/src/api/types/OrderAddressType.ts index 95a879cd..0fab55da 100644 --- a/src/api/types/OrderAddressType.ts +++ b/src/api/types/OrderAddressType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the order address (billing or shipping) */ +/** + * The type of the order address (billing or shipping) + */ +export type OrderAddressType = "shipping" | "billing"; export const OrderAddressType = { Shipping: "shipping", Billing: "billing", } as const; -export type OrderAddressType = (typeof OrderAddressType)[keyof typeof OrderAddressType]; diff --git a/src/api/types/OrderBillingAddress.ts b/src/api/types/OrderBillingAddress.ts index 01df1fce..ac8667dc 100644 --- a/src/api/types/OrderBillingAddress.ts +++ b/src/api/types/OrderBillingAddress.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The billing address diff --git a/src/api/types/OrderBillingAddressJapanType.ts b/src/api/types/OrderBillingAddressJapanType.ts index a8819241..a5f26409 100644 --- a/src/api/types/OrderBillingAddressJapanType.ts +++ b/src/api/types/OrderBillingAddressJapanType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ +/** + * Represents a Japan-only address format. This field will only appear on orders placed from Japan. + */ +export type OrderBillingAddressJapanType = "kana" | "kanji"; export const OrderBillingAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; -export type OrderBillingAddressJapanType = - (typeof OrderBillingAddressJapanType)[keyof typeof OrderBillingAddressJapanType]; diff --git a/src/api/types/OrderBillingAddressType.ts b/src/api/types/OrderBillingAddressType.ts index 3f641db8..1144bada 100644 --- a/src/api/types/OrderBillingAddressType.ts +++ b/src/api/types/OrderBillingAddressType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the order address (billing or shipping) */ +/** + * The type of the order address (billing or shipping) + */ +export type OrderBillingAddressType = "shipping" | "billing"; export const OrderBillingAddressType = { Shipping: "shipping", Billing: "billing", } as const; -export type OrderBillingAddressType = (typeof OrderBillingAddressType)[keyof typeof OrderBillingAddressType]; diff --git a/src/api/types/OrderCustomerInfo.ts b/src/api/types/OrderCustomerInfo.ts index a03c1ce2..f774e405 100644 --- a/src/api/types/OrderCustomerInfo.ts +++ b/src/api/types/OrderCustomerInfo.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An object with the keys `fullName` and `email`. diff --git a/src/api/types/OrderDisputeLastStatus.ts b/src/api/types/OrderDisputeLastStatus.ts index df838500..660c0393 100644 --- a/src/api/types/OrderDisputeLastStatus.ts +++ b/src/api/types/OrderDisputeLastStatus.ts @@ -1,6 +1,19 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** If an order was disputed by the customer, then this key will be set with the [dispute's status](https://stripe.com/docs/api#dispute_object-status). */ +/** + * If an order was disputed by the customer, then this key will be set with the [dispute's status](https://stripe.com/docs/api#dispute_object-status). + */ +export type OrderDisputeLastStatus = + | "warning_needs_response" + | "warning_under_review" + | "warning_closed" + | "needs_response" + | "under_review" + | "charge_refunded" + | "won" + | "lost"; export const OrderDisputeLastStatus = { WarningNeedsResponse: "warning_needs_response", WarningUnderReview: "warning_under_review", @@ -11,4 +24,3 @@ export const OrderDisputeLastStatus = { Won: "won", Lost: "lost", } as const; -export type OrderDisputeLastStatus = (typeof OrderDisputeLastStatus)[keyof typeof OrderDisputeLastStatus]; diff --git a/src/api/types/OrderDownloadFilesItem.ts b/src/api/types/OrderDownloadFilesItem.ts index 2b0792c8..13774268 100644 --- a/src/api/types/OrderDownloadFilesItem.ts +++ b/src/api/types/OrderDownloadFilesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface OrderDownloadFilesItem { /** The unique identifier for the downloadable file */ diff --git a/src/api/types/OrderList.ts b/src/api/types/OrderList.ts index 7723d868..25518c90 100644 --- a/src/api/types/OrderList.ts +++ b/src/api/types/OrderList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Results from order list diff --git a/src/api/types/OrderMetadata.ts b/src/api/types/OrderMetadata.ts index b2231b0e..4e99ed3b 100644 --- a/src/api/types/OrderMetadata.ts +++ b/src/api/types/OrderMetadata.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface OrderMetadata { isBuyNow?: boolean; diff --git a/src/api/types/OrderPrice.ts b/src/api/types/OrderPrice.ts index acc8bfd9..287163d4 100644 --- a/src/api/types/OrderPrice.ts +++ b/src/api/types/OrderPrice.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface OrderPrice { /** The three-letter ISO currency code */ diff --git a/src/api/types/OrderPurchasedItem.ts b/src/api/types/OrderPurchasedItem.ts index 20cc5f18..a27367bc 100644 --- a/src/api/types/OrderPurchasedItem.ts +++ b/src/api/types/OrderPurchasedItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * An Item that was purchased diff --git a/src/api/types/OrderPurchasedItemVariantImage.ts b/src/api/types/OrderPurchasedItemVariantImage.ts index ce121f75..540c32b5 100644 --- a/src/api/types/OrderPurchasedItemVariantImage.ts +++ b/src/api/types/OrderPurchasedItemVariantImage.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface OrderPurchasedItemVariantImage { /** The hosted location for the Variant's image */ diff --git a/src/api/types/OrderPurchasedItemVariantImageFile.ts b/src/api/types/OrderPurchasedItemVariantImageFile.ts index 88c77d13..f9ef3b8c 100644 --- a/src/api/types/OrderPurchasedItemVariantImageFile.ts +++ b/src/api/types/OrderPurchasedItemVariantImageFile.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface OrderPurchasedItemVariantImageFile { /** The image size in bytes */ diff --git a/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts b/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts index f9f80e1b..0c288fe3 100644 --- a/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts +++ b/src/api/types/OrderPurchasedItemVariantImageFileVariantsItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface OrderPurchasedItemVariantImageFileVariantsItem { /** The hosted location for the Variant's image */ diff --git a/src/api/types/OrderShippingAddress.ts b/src/api/types/OrderShippingAddress.ts index 581f7c88..edb1937f 100644 --- a/src/api/types/OrderShippingAddress.ts +++ b/src/api/types/OrderShippingAddress.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The shipping address diff --git a/src/api/types/OrderShippingAddressJapanType.ts b/src/api/types/OrderShippingAddressJapanType.ts index b91d073d..0e820bd2 100644 --- a/src/api/types/OrderShippingAddressJapanType.ts +++ b/src/api/types/OrderShippingAddressJapanType.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Represents a Japan-only address format. This field will only appear on orders placed from Japan. */ +/** + * Represents a Japan-only address format. This field will only appear on orders placed from Japan. + */ +export type OrderShippingAddressJapanType = "kana" | "kanji"; export const OrderShippingAddressJapanType = { Kana: "kana", Kanji: "kanji", } as const; -export type OrderShippingAddressJapanType = - (typeof OrderShippingAddressJapanType)[keyof typeof OrderShippingAddressJapanType]; diff --git a/src/api/types/OrderShippingAddressType.ts b/src/api/types/OrderShippingAddressType.ts index bf5bafa3..cff20adc 100644 --- a/src/api/types/OrderShippingAddressType.ts +++ b/src/api/types/OrderShippingAddressType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of the order address (billing or shipping) */ +/** + * The type of the order address (billing or shipping) + */ +export type OrderShippingAddressType = "shipping" | "billing"; export const OrderShippingAddressType = { Shipping: "shipping", Billing: "billing", } as const; -export type OrderShippingAddressType = (typeof OrderShippingAddressType)[keyof typeof OrderShippingAddressType]; diff --git a/src/api/types/OrderStatus.ts b/src/api/types/OrderStatus.ts index b1441005..ef868e86 100644 --- a/src/api/types/OrderStatus.ts +++ b/src/api/types/OrderStatus.ts @@ -1,6 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of the Order */ +/** + * The status of the Order + */ +export type OrderStatus = "pending" | "unfulfilled" | "fulfilled" | "disputed" | "dispute-lost" | "refunded"; export const OrderStatus = { Pending: "pending", Unfulfilled: "unfulfilled", @@ -9,4 +14,3 @@ export const OrderStatus = { DisputeLost: "dispute-lost", Refunded: "refunded", } as const; -export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus]; diff --git a/src/api/types/OrderTotals.ts b/src/api/types/OrderTotals.ts index 0f66275e..7502e638 100644 --- a/src/api/types/OrderTotals.ts +++ b/src/api/types/OrderTotals.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * An object describing various pricing totals diff --git a/src/api/types/OrderTotalsExtrasItem.ts b/src/api/types/OrderTotalsExtrasItem.ts index 7226116c..03f059db 100644 --- a/src/api/types/OrderTotalsExtrasItem.ts +++ b/src/api/types/OrderTotalsExtrasItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Extra order items, includes discounts, shipping, and taxes. diff --git a/src/api/types/OrderTotalsExtrasItemType.ts b/src/api/types/OrderTotalsExtrasItemType.ts index 486bd25d..5c88217c 100644 --- a/src/api/types/OrderTotalsExtrasItemType.ts +++ b/src/api/types/OrderTotalsExtrasItemType.ts @@ -1,10 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of extra item this is. */ +/** + * The type of extra item this is. + */ +export type OrderTotalsExtrasItemType = "discount" | "discount-shipping" | "shipping" | "tax"; export const OrderTotalsExtrasItemType = { Discount: "discount", DiscountShipping: "discount-shipping", Shipping: "shipping", Tax: "tax", } as const; -export type OrderTotalsExtrasItemType = (typeof OrderTotalsExtrasItemType)[keyof typeof OrderTotalsExtrasItemType]; diff --git a/src/api/types/Page.ts b/src/api/types/Page.ts index 308b97cb..8c51c4eb 100644 --- a/src/api/types/Page.ts +++ b/src/api/types/Page.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Page object diff --git a/src/api/types/PageCreatedWebhook.ts b/src/api/types/PageCreatedWebhook.ts index a2ddf988..76dc9e10 100644 --- a/src/api/types/PageCreatedWebhook.ts +++ b/src/api/types/PageCreatedWebhook.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Page is created diff --git a/src/api/types/PageCreatedWebhookPayload.ts b/src/api/types/PageCreatedWebhookPayload.ts index 2868ed48..60e88a79 100644 --- a/src/api/types/PageCreatedWebhookPayload.ts +++ b/src/api/types/PageCreatedWebhookPayload.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payload of data sent from Webflow diff --git a/src/api/types/PageDeletedWebhook.ts b/src/api/types/PageDeletedWebhook.ts index 641ef582..1c81b18d 100644 --- a/src/api/types/PageDeletedWebhook.ts +++ b/src/api/types/PageDeletedWebhook.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Page is deleted diff --git a/src/api/types/PageDeletedWebhookPayload.ts b/src/api/types/PageDeletedWebhookPayload.ts index 4af70418..d625ebcc 100644 --- a/src/api/types/PageDeletedWebhookPayload.ts +++ b/src/api/types/PageDeletedWebhookPayload.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payload of data sent from Webflow diff --git a/src/api/types/PageList.ts b/src/api/types/PageList.ts index bcd24e75..09f4f73f 100644 --- a/src/api/types/PageList.ts +++ b/src/api/types/PageList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Page object diff --git a/src/api/types/PageMetadataUpdatedWebhook.ts b/src/api/types/PageMetadataUpdatedWebhook.ts index dc2bbb84..05a3417e 100644 --- a/src/api/types/PageMetadataUpdatedWebhook.ts +++ b/src/api/types/PageMetadataUpdatedWebhook.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Page's metadata is updated diff --git a/src/api/types/PageMetadataUpdatedWebhookPayload.ts b/src/api/types/PageMetadataUpdatedWebhookPayload.ts index 841cbb8e..27a32b61 100644 --- a/src/api/types/PageMetadataUpdatedWebhookPayload.ts +++ b/src/api/types/PageMetadataUpdatedWebhookPayload.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payload of data sent from Webflow diff --git a/src/api/types/PageOpenGraph.ts b/src/api/types/PageOpenGraph.ts index 43619ecd..f288a304 100644 --- a/src/api/types/PageOpenGraph.ts +++ b/src/api/types/PageOpenGraph.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Open Graph fields for the Page diff --git a/src/api/types/PageSeo.ts b/src/api/types/PageSeo.ts index ee956820..42e5879b 100644 --- a/src/api/types/PageSeo.ts +++ b/src/api/types/PageSeo.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * SEO-related fields for the Page diff --git a/src/api/types/Pagination.ts b/src/api/types/Pagination.ts index a5b2ef55..1ee7cd06 100644 --- a/src/api/types/Pagination.ts +++ b/src/api/types/Pagination.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Pagination object diff --git a/src/api/types/Payload.ts b/src/api/types/Payload.ts index 8019c383..4690b4cc 100644 --- a/src/api/types/Payload.ts +++ b/src/api/types/Payload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The payload of data sent from Webflow diff --git a/src/api/types/PayloadFieldData.ts b/src/api/types/PayloadFieldData.ts index a7918a21..526ec184 100644 --- a/src/api/types/PayloadFieldData.ts +++ b/src/api/types/PayloadFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PayloadFieldData { name: string; diff --git a/src/api/types/PaypalDetails.ts b/src/api/types/PaypalDetails.ts index 61bd3793..522ef66a 100644 --- a/src/api/types/PaypalDetails.ts +++ b/src/api/types/PaypalDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface PaypalDetails { /** PayPal order identifier */ diff --git a/src/api/types/Product.ts b/src/api/types/Product.ts index 567c7f80..cca3b59d 100644 --- a/src/api/types/Product.ts +++ b/src/api/types/Product.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Product object diff --git a/src/api/types/ProductAndSkUs.ts b/src/api/types/ProductAndSkUs.ts index 8cd5345c..e2ffc46d 100644 --- a/src/api/types/ProductAndSkUs.ts +++ b/src/api/types/ProductAndSkUs.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A product and its SKUs. diff --git a/src/api/types/ProductAndSkUsList.ts b/src/api/types/ProductAndSkUsList.ts index 8dbe704a..adbb5aad 100644 --- a/src/api/types/ProductAndSkUsList.ts +++ b/src/api/types/ProductAndSkUsList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Results from product list diff --git a/src/api/types/ProductFieldData.ts b/src/api/types/ProductFieldData.ts index a9989fb0..c83f14bb 100644 --- a/src/api/types/ProductFieldData.ts +++ b/src/api/types/ProductFieldData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Contains content-specific details for a product, covering both standard (e.g., title, description) and custom fields tailored to the product setup. diff --git a/src/api/types/ProductFieldDataEcProductType.ts b/src/api/types/ProductFieldDataEcProductType.ts index 13bf05f0..399bd0d9 100644 --- a/src/api/types/ProductFieldDataEcProductType.ts +++ b/src/api/types/ProductFieldDataEcProductType.ts @@ -1,11 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Product types. Enums reflect the following values in order: Physical, Digital, Service, Advanced" */ +/** + * Product types. Enums reflect the following values in order: Physical, Digital, Service, Advanced" + */ +export type ProductFieldDataEcProductType = + | "ff42fee0113744f693a764e3431a9cc2" + | "f22027db68002190aef89a4a2b7ac8a1" + | "c599e43b1a1c34d5a323aedf75d3adf6" + | "b6ccc1830db4b1babeb06a9ac5f6dd76"; export const ProductFieldDataEcProductType = { Ff42Fee0113744F693A764E3431A9Cc2: "ff42fee0113744f693a764e3431a9cc2", F22027Db68002190Aef89A4A2B7Ac8A1: "f22027db68002190aef89a4a2b7ac8a1", C599E43B1A1C34D5A323Aedf75D3Adf6: "c599e43b1a1c34d5a323aedf75d3adf6", B6Ccc1830Db4B1Babeb06A9Ac5F6Dd76: "b6ccc1830db4b1babeb06a9ac5f6dd76", } as const; -export type ProductFieldDataEcProductType = - (typeof ProductFieldDataEcProductType)[keyof typeof ProductFieldDataEcProductType]; diff --git a/src/api/types/ProductFieldDataTaxCategory.ts b/src/api/types/ProductFieldDataTaxCategory.ts index aae7d8a0..8726f67d 100644 --- a/src/api/types/ProductFieldDataTaxCategory.ts +++ b/src/api/types/ProductFieldDataTaxCategory.ts @@ -1,6 +1,40 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Product tax class */ +/** + * Product tax class + */ +export type ProductFieldDataTaxCategory = + | "standard-taxable" + | "standard-exempt" + | "books-religious" + | "books-textbook" + | "clothing" + | "clothing-swimwear" + | "digital-goods" + | "digital-service" + | "drugs-non-prescription" + | "drugs-prescription" + | "food-bottled-water" + | "food-candy" + | "food-groceries" + | "food-prepared" + | "food-soda" + | "food-supplements" + | "magazine-individual" + | "magazine-subscription" + | "service-admission" + | "service-advertising" + | "service-dry-cleaning" + | "service-hairdressing" + | "service-installation" + | "service-miscellaneous" + | "service-parking" + | "service-printing" + | "service-professional" + | "service-repair" + | "service-training"; export const ProductFieldDataTaxCategory = { StandardTaxable: "standard-taxable", StandardExempt: "standard-exempt", @@ -32,5 +66,3 @@ export const ProductFieldDataTaxCategory = { ServiceRepair: "service-repair", ServiceTraining: "service-training", } as const; -export type ProductFieldDataTaxCategory = - (typeof ProductFieldDataTaxCategory)[keyof typeof ProductFieldDataTaxCategory]; diff --git a/src/api/types/PublishStatus.ts b/src/api/types/PublishStatus.ts index 59b058c7..bbfb7053 100644 --- a/src/api/types/PublishStatus.ts +++ b/src/api/types/PublishStatus.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Indicate whether your Product should be set as "staging" or "live" */ +/** + * Indicate whether your Product should be set as "staging" or "live" + */ +export type PublishStatus = "staging" | "live"; export const PublishStatus = { Staging: "staging", Live: "live", } as const; -export type PublishStatus = (typeof PublishStatus)[keyof typeof PublishStatus]; diff --git a/src/api/types/Redirect.ts b/src/api/types/Redirect.ts index ce5f0df2..d0a7a9fc 100644 --- a/src/api/types/Redirect.ts +++ b/src/api/types/Redirect.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A single redirection rule, specifying a source URL and a destination URL. diff --git a/src/api/types/Redirects.ts b/src/api/types/Redirects.ts index 1cf4d147..f6da48d3 100644 --- a/src/api/types/Redirects.ts +++ b/src/api/types/Redirects.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Site redirects response diff --git a/src/api/types/ReferenceField.ts b/src/api/types/ReferenceField.ts index 6711f94f..235f492a 100644 --- a/src/api/types/ReferenceField.ts +++ b/src/api/types/ReferenceField.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface ReferenceField { /** Unique identifier for a Field */ diff --git a/src/api/types/ReferenceFieldMetadata.ts b/src/api/types/ReferenceFieldMetadata.ts index e6834f1b..df20cc41 100644 --- a/src/api/types/ReferenceFieldMetadata.ts +++ b/src/api/types/ReferenceFieldMetadata.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The collectionId for the referenced collection. Only applicable for Reference and MultiReference fields. diff --git a/src/api/types/ReferenceFieldType.ts b/src/api/types/ReferenceFieldType.ts index 1b9e5d67..de30ba70 100644 --- a/src/api/types/ReferenceFieldType.ts +++ b/src/api/types/ReferenceFieldType.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Choose these appropriate field type for your collection data */ +/** + * Choose these appropriate field type for your collection data + */ +export type ReferenceFieldType = "MultiReference" | "Reference"; export const ReferenceFieldType = { MultiReference: "MultiReference", Reference: "Reference", } as const; -export type ReferenceFieldType = (typeof ReferenceFieldType)[keyof typeof ReferenceFieldType]; diff --git a/src/api/types/RegisteredScriptList.ts b/src/api/types/RegisteredScriptList.ts index 6caaccb7..d92cda4f 100644 --- a/src/api/types/RegisteredScriptList.ts +++ b/src/api/types/RegisteredScriptList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A list of scripts registered to the site diff --git a/src/api/types/Robots.ts b/src/api/types/Robots.ts index 94327cd8..12242d47 100644 --- a/src/api/types/Robots.ts +++ b/src/api/types/Robots.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The robots.txt file for a given site diff --git a/src/api/types/RobotsRulesItem.ts b/src/api/types/RobotsRulesItem.ts index 7b4ad0bd..ce55b003 100644 --- a/src/api/types/RobotsRulesItem.ts +++ b/src/api/types/RobotsRulesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface RobotsRulesItem { /** The user agent the rules apply to. */ diff --git a/src/api/types/ScriptApply.ts b/src/api/types/ScriptApply.ts index 2da7a46e..309a6bc0 100644 --- a/src/api/types/ScriptApply.ts +++ b/src/api/types/ScriptApply.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface ScriptApply { /** ID of the registered custom code script */ diff --git a/src/api/types/ScriptApplyList.ts b/src/api/types/ScriptApplyList.ts index 596037da..3d30c3d1 100644 --- a/src/api/types/ScriptApplyList.ts +++ b/src/api/types/ScriptApplyList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface ScriptApplyList { /** A list of scripts applied to a Site or a Page */ diff --git a/src/api/types/ScriptApplyLocation.ts b/src/api/types/ScriptApplyLocation.ts index d3ec67a1..058947d2 100644 --- a/src/api/types/ScriptApplyLocation.ts +++ b/src/api/types/ScriptApplyLocation.ts @@ -1,8 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Location of the script, either in the header or footer of the published site */ +/** + * Location of the script, either in the header or footer of the published site + */ +export type ScriptApplyLocation = "header" | "footer"; export const ScriptApplyLocation = { Header: "header", Footer: "footer", } as const; -export type ScriptApplyLocation = (typeof ScriptApplyLocation)[keyof typeof ScriptApplyLocation]; diff --git a/src/api/types/Scripts.ts b/src/api/types/Scripts.ts index 89f52b64..e3882ce2 100644 --- a/src/api/types/Scripts.ts +++ b/src/api/types/Scripts.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A list of scripts applied to a Site or a Page diff --git a/src/api/types/SearchButtonNode.ts b/src/api/types/SearchButtonNode.ts index bf136b82..5c05178b 100644 --- a/src/api/types/SearchButtonNode.ts +++ b/src/api/types/SearchButtonNode.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents search button elements within the DOM. It contains the text of the button. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SearchButtonNodeWrite.ts b/src/api/types/SearchButtonNodeWrite.ts index d2c1b82c..b3e53d29 100644 --- a/src/api/types/SearchButtonNodeWrite.ts +++ b/src/api/types/SearchButtonNodeWrite.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Update a search button node diff --git a/src/api/types/Select.ts b/src/api/types/Select.ts index 5da581d4..80019663 100644 --- a/src/api/types/Select.ts +++ b/src/api/types/Select.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Update choices on a select node diff --git a/src/api/types/SelectNode.ts b/src/api/types/SelectNode.ts index 228650db..772862be 100644 --- a/src/api/types/SelectNode.ts +++ b/src/api/types/SelectNode.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Represents select elements within the DOM. It contains the list of choices in the select. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SelectNodeChoicesItem.ts b/src/api/types/SelectNodeChoicesItem.ts index a072da3a..770af4d6 100644 --- a/src/api/types/SelectNodeChoicesItem.ts +++ b/src/api/types/SelectNodeChoicesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SelectNodeChoicesItem { /** The value of the choice when selected. */ diff --git a/src/api/types/SelectNodeWriteChoicesItem.ts b/src/api/types/SelectNodeWriteChoicesItem.ts index ba02166c..eb919862 100644 --- a/src/api/types/SelectNodeWriteChoicesItem.ts +++ b/src/api/types/SelectNodeWriteChoicesItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SelectNodeWriteChoicesItem { /** The value of the choice when selected. */ diff --git a/src/api/types/SingleLocaleCreatedPayload.ts b/src/api/types/SingleLocaleCreatedPayload.ts index 2233a254..1cfb8ffe 100644 --- a/src/api/types/SingleLocaleCreatedPayload.ts +++ b/src/api/types/SingleLocaleCreatedPayload.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SingleLocaleCreatedPayload { /** Unique identifier for the Item */ diff --git a/src/api/types/SingleLocaleCreatedPayloadFieldData.ts b/src/api/types/SingleLocaleCreatedPayloadFieldData.ts index c0694521..deb64844 100644 --- a/src/api/types/SingleLocaleCreatedPayloadFieldData.ts +++ b/src/api/types/SingleLocaleCreatedPayloadFieldData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SingleLocaleCreatedPayloadFieldData { name: string; diff --git a/src/api/types/Site.ts b/src/api/types/Site.ts index c5b55454..57dcd424 100644 --- a/src/api/types/Site.ts +++ b/src/api/types/Site.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Site { /** Unique identifier for the Site */ diff --git a/src/api/types/SiteActivityLogItem.ts b/src/api/types/SiteActivityLogItem.ts index 60414917..36040f5d 100644 --- a/src/api/types/SiteActivityLogItem.ts +++ b/src/api/types/SiteActivityLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SiteActivityLogItem { id?: string; diff --git a/src/api/types/SiteActivityLogItemEvent.ts b/src/api/types/SiteActivityLogItemEvent.ts index a352e1ba..ffb4deba 100644 --- a/src/api/types/SiteActivityLogItemEvent.ts +++ b/src/api/types/SiteActivityLogItemEvent.ts @@ -1,5 +1,50 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type SiteActivityLogItemEvent = + | "styles_modified" + | "site_published" + | "ix2_modified_on_page" + | "page_dom_modified" + | "cms_item" + | "backup_created" + | "page_custom_code_modified" + | "symbols_modified" + | "variable_modified" + | "variables_modified" + | "cms_collection" + | "page_settings_modified" + | "page_settings_custom_code_modified" + | "ix2_modified_on_component" + | "ix2_modified_on_class" + | "site_custom_code_modified" + | "page_duplicated" + | "secondary_locale_page_content_modified" + | "page_renamed" + | "page_created" + | "page_deleted" + | "site_unpublished" + | "backup_restored" + | "locale_added" + | "branch_created" + | "locale_display_name_updated" + | "locale_subdirectory_updated" + | "branch_merged" + | "locale_tag_updated" + | "branch_deleted" + | "locale_enabled" + | "locale_removed" + | "locale_disabled" + | "library_shared" + | "library_unshared" + | "library_installed" + | "library_uninstalled" + | "library_update_shared" + | "library_update_accepted" + | "branch_review_created" + | "branch_review_approved" + | "branch_review_canceled"; export const SiteActivityLogItemEvent = { StylesModified: "styles_modified", SitePublished: "site_published", @@ -44,4 +89,3 @@ export const SiteActivityLogItemEvent = { BranchReviewApproved: "branch_review_approved", BranchReviewCanceled: "branch_review_canceled", } as const; -export type SiteActivityLogItemEvent = (typeof SiteActivityLogItemEvent)[keyof typeof SiteActivityLogItemEvent]; diff --git a/src/api/types/SiteActivityLogItemResourceOperation.ts b/src/api/types/SiteActivityLogItemResourceOperation.ts index c1590c71..53d4e841 100644 --- a/src/api/types/SiteActivityLogItemResourceOperation.ts +++ b/src/api/types/SiteActivityLogItemResourceOperation.ts @@ -1,5 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type SiteActivityLogItemResourceOperation = + | "CREATED" + | "MODIFIED" + | "PUBLISHED" + | "UNPUBLISHED" + | "DELETED" + | "GROUP_REORDERED" + | "GROUP_CREATED" + | "GROUP_DELETED" + | "REORDERED"; export const SiteActivityLogItemResourceOperation = { Created: "CREATED", Modified: "MODIFIED", @@ -11,5 +23,3 @@ export const SiteActivityLogItemResourceOperation = { GroupDeleted: "GROUP_DELETED", Reordered: "REORDERED", } as const; -export type SiteActivityLogItemResourceOperation = - (typeof SiteActivityLogItemResourceOperation)[keyof typeof SiteActivityLogItemResourceOperation]; diff --git a/src/api/types/SiteActivityLogItemUser.ts b/src/api/types/SiteActivityLogItemUser.ts index 3c042e32..0645923a 100644 --- a/src/api/types/SiteActivityLogItemUser.ts +++ b/src/api/types/SiteActivityLogItemUser.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface SiteActivityLogItemUser { id?: string; diff --git a/src/api/types/SiteActivityLogResponse.ts b/src/api/types/SiteActivityLogResponse.ts index 643c1104..464261db 100644 --- a/src/api/types/SiteActivityLogResponse.ts +++ b/src/api/types/SiteActivityLogResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SiteActivityLogResponse { items?: Webflow.SiteActivityLogItem[]; diff --git a/src/api/types/SiteDataCollectionType.ts b/src/api/types/SiteDataCollectionType.ts index 255a6b8f..fac20f94 100644 --- a/src/api/types/SiteDataCollectionType.ts +++ b/src/api/types/SiteDataCollectionType.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of data collection enabled for the site. */ +/** + * The type of data collection enabled for the site. + */ +export type SiteDataCollectionType = "always" | "optOut" | "disabled"; export const SiteDataCollectionType = { Always: "always", OptOut: "optOut", Disabled: "disabled", } as const; -export type SiteDataCollectionType = (typeof SiteDataCollectionType)[keyof typeof SiteDataCollectionType]; diff --git a/src/api/types/SiteMembership.ts b/src/api/types/SiteMembership.ts index be91108a..be0c8259 100644 --- a/src/api/types/SiteMembership.ts +++ b/src/api/types/SiteMembership.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SiteMembership { site?: Webflow.WorkspaceAuditLogItemPayloadSiteMembershipSite; diff --git a/src/api/types/SiteMembershipAuditLogItem.ts b/src/api/types/SiteMembershipAuditLogItem.ts index c7206201..3079e592 100644 --- a/src/api/types/SiteMembershipAuditLogItem.ts +++ b/src/api/types/SiteMembershipAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SiteMembershipAuditLogItem { eventSubType?: Webflow.SiteMembershipAuditLogItemEventSubType; diff --git a/src/api/types/SiteMembershipAuditLogItemEventSubType.ts b/src/api/types/SiteMembershipAuditLogItemEventSubType.ts index 39ee3185..7cf2375a 100644 --- a/src/api/types/SiteMembershipAuditLogItemEventSubType.ts +++ b/src/api/types/SiteMembershipAuditLogItemEventSubType.ts @@ -1,10 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type SiteMembershipAuditLogItemEventSubType = + | "user_added" + | "user_removed" + | "user_role_updated" + | "user_granular_access_updated"; export const SiteMembershipAuditLogItemEventSubType = { UserAdded: "user_added", UserRemoved: "user_removed", UserRoleUpdated: "user_role_updated", UserGranularAccessUpdated: "user_granular_access_updated", } as const; -export type SiteMembershipAuditLogItemEventSubType = - (typeof SiteMembershipAuditLogItemEventSubType)[keyof typeof SiteMembershipAuditLogItemEventSubType]; diff --git a/src/api/types/SitePlan.ts b/src/api/types/SitePlan.ts index 7c2e8b7a..3a1c50cf 100644 --- a/src/api/types/SitePlan.ts +++ b/src/api/types/SitePlan.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SitePlan { /** ID of the hosting plan. */ diff --git a/src/api/types/SitePlanId.ts b/src/api/types/SitePlanId.ts index 72bc39d7..0dcffe41 100644 --- a/src/api/types/SitePlanId.ts +++ b/src/api/types/SitePlanId.ts @@ -1,6 +1,23 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** ID of the hosting plan. */ +/** + * ID of the hosting plan. + */ +export type SitePlanId = + | "hosting-basic-v3" + | "hosting-cms-v3" + | "hosting-business-v3" + | "hosting-ecommerce-standard-v2" + | "hosting-ecommerce-plus-v2" + | "hosting-ecommerce-advanced-v2" + | "hosting-basic-v4" + | "hosting-cms-v4" + | "hosting-business-v4" + | "hosting-ecommerce-standard-v3" + | "hosting-ecommerce-plus-v3" + | "hosting-ecommerce-advanced-v3"; export const SitePlanId = { HostingBasicV3: "hosting-basic-v3", HostingCmsV3: "hosting-cms-v3", @@ -15,4 +32,3 @@ export const SitePlanId = { HostingEcommercePlusV3: "hosting-ecommerce-plus-v3", HostingEcommerceAdvancedV3: "hosting-ecommerce-advanced-v3", } as const; -export type SitePlanId = (typeof SitePlanId)[keyof typeof SitePlanId]; diff --git a/src/api/types/SitePlanName.ts b/src/api/types/SitePlanName.ts index 7d24eed8..0b0625c8 100644 --- a/src/api/types/SitePlanName.ts +++ b/src/api/types/SitePlanName.ts @@ -1,6 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Name of the hosting plan. */ +/** + * Name of the hosting plan. + */ +export type SitePlanName = + | "Basic Hosting" + | "CMS Hosting" + | "Business Hosting" + | "ECommerce Standard Hosting" + | "ECommerce Plus Hosting" + | "ECommerce Advanced Hosting"; export const SitePlanName = { BasicHosting: "Basic Hosting", CmsHosting: "CMS Hosting", @@ -9,4 +20,3 @@ export const SitePlanName = { ECommercePlusHosting: "ECommerce Plus Hosting", ECommerceAdvancedHosting: "ECommerce Advanced Hosting", } as const; -export type SitePlanName = (typeof SitePlanName)[keyof typeof SitePlanName]; diff --git a/src/api/types/SitePublish.ts b/src/api/types/SitePublish.ts index 7d36cd61..622ade36 100644 --- a/src/api/types/SitePublish.ts +++ b/src/api/types/SitePublish.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when a Site is published diff --git a/src/api/types/SitePublishPayload.ts b/src/api/types/SitePublishPayload.ts index e715e4cc..51db8046 100644 --- a/src/api/types/SitePublishPayload.ts +++ b/src/api/types/SitePublishPayload.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The payload of data sent from Webflow diff --git a/src/api/types/Sites.ts b/src/api/types/Sites.ts index 52b14f9b..08f27116 100644 --- a/src/api/types/Sites.ts +++ b/src/api/types/Sites.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Sites { sites?: Webflow.Site[]; diff --git a/src/api/types/Sku.ts b/src/api/types/Sku.ts index e17d0746..474348cd 100644 --- a/src/api/types/Sku.ts +++ b/src/api/types/Sku.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The SKU object diff --git a/src/api/types/SkuFieldData.ts b/src/api/types/SkuFieldData.ts index 9ffbaf65..c15373e8 100644 --- a/src/api/types/SkuFieldData.ts +++ b/src/api/types/SkuFieldData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Standard and Custom fields for a SKU diff --git a/src/api/types/SkuFieldDataCompareAtPrice.ts b/src/api/types/SkuFieldDataCompareAtPrice.ts index 748cd30c..5de20c20 100644 --- a/src/api/types/SkuFieldDataCompareAtPrice.ts +++ b/src/api/types/SkuFieldDataCompareAtPrice.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * comparison price of SKU diff --git a/src/api/types/SkuFieldDataEcSkuBillingMethod.ts b/src/api/types/SkuFieldDataEcSkuBillingMethod.ts index 993c2a44..a837c612 100644 --- a/src/api/types/SkuFieldDataEcSkuBillingMethod.ts +++ b/src/api/types/SkuFieldDataEcSkuBillingMethod.ts @@ -1,9 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** [Billing method](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#billing-methods)for the SKU */ +/** + * [Billing method](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#billing-methods)for the SKU + */ +export type SkuFieldDataEcSkuBillingMethod = "one-time" | "subscription"; export const SkuFieldDataEcSkuBillingMethod = { OneTime: "one-time", Subscription: "subscription", } as const; -export type SkuFieldDataEcSkuBillingMethod = - (typeof SkuFieldDataEcSkuBillingMethod)[keyof typeof SkuFieldDataEcSkuBillingMethod]; diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts index 38241b7e..ded3f047 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlan.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * [Subscription plan](https://help.webflow.com/hc/en-us/articles/33961432087955-Add-and-manage-products-and-categories#subscription) for the SKU diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts index ffcdac03..75c559dc 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts @@ -1,11 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Interval of subscription renewal */ +/** + * Interval of subscription renewal + */ +export type SkuFieldDataEcSkuSubscriptionPlanInterval = "day" | "week" | "month" | "year"; export const SkuFieldDataEcSkuSubscriptionPlanInterval = { Day: "day", Week: "week", Month: "month", Year: "year", } as const; -export type SkuFieldDataEcSkuSubscriptionPlanInterval = - (typeof SkuFieldDataEcSkuSubscriptionPlanInterval)[keyof typeof SkuFieldDataEcSkuSubscriptionPlanInterval]; diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts index 59c71228..16299854 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface SkuFieldDataEcSkuSubscriptionPlanPlansItem { /** The platform of the subscription plan */ diff --git a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts index 325fdb84..e62b0982 100644 --- a/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts +++ b/src/api/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of the plan */ +/** + * The status of the plan + */ +export type SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = "active" | "inactive" | "canceled"; export const SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = { Active: "active", Inactive: "inactive", Canceled: "canceled", } as const; -export type SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus = - (typeof SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus)[keyof typeof SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus]; diff --git a/src/api/types/SkuFieldDataPrice.ts b/src/api/types/SkuFieldDataPrice.ts index 810c1b53..d37d51d9 100644 --- a/src/api/types/SkuFieldDataPrice.ts +++ b/src/api/types/SkuFieldDataPrice.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * price of SKU diff --git a/src/api/types/SkuPropertyList.ts b/src/api/types/SkuPropertyList.ts index b4b60bd2..c35efef4 100644 --- a/src/api/types/SkuPropertyList.ts +++ b/src/api/types/SkuPropertyList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * A variant/option type for a SKU diff --git a/src/api/types/SkuPropertyListEnumItem.ts b/src/api/types/SkuPropertyListEnumItem.ts index 9775554b..037188ff 100644 --- a/src/api/types/SkuPropertyListEnumItem.ts +++ b/src/api/types/SkuPropertyListEnumItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Enumerated Product variants/Options for the SKU diff --git a/src/api/types/SkuValueList.ts b/src/api/types/SkuValueList.ts index 87d26460..be5dd1f7 100644 --- a/src/api/types/SkuValueList.ts +++ b/src/api/types/SkuValueList.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * A mapping between SKU properties and their values, represented as key-value pairs. Each key represents a SKU Property ID (e.g. "color") and maps to its corresponding SKU Value ID (e.g. "blue"). This structure defines the specific variant combination for a SKU. diff --git a/src/api/types/StaticField.ts b/src/api/types/StaticField.ts index 0482f771..aee57fdc 100644 --- a/src/api/types/StaticField.ts +++ b/src/api/types/StaticField.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface StaticField { /** Unique identifier for a Field */ diff --git a/src/api/types/StaticFieldType.ts b/src/api/types/StaticFieldType.ts index 7863c82d..d590ff0c 100644 --- a/src/api/types/StaticFieldType.ts +++ b/src/api/types/StaticFieldType.ts @@ -1,6 +1,24 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** Choose these appropriate field type for your collection data */ +/** + * Choose these appropriate field type for your collection data + */ +export type StaticFieldType = + | "Color" + | "DateTime" + | "Email" + | "File" + | "Image" + | "Link" + | "MultiImage" + | "Number" + | "Phone" + | "PlainText" + | "RichText" + | "Switch" + | "VideoLink"; export const StaticFieldType = { Color: "Color", DateTime: "DateTime", @@ -16,4 +34,3 @@ export const StaticFieldType = { Switch: "Switch", VideoLink: "VideoLink", } as const; -export type StaticFieldType = (typeof StaticFieldType)[keyof typeof StaticFieldType]; diff --git a/src/api/types/StripeCard.ts b/src/api/types/StripeCard.ts index 5b929a36..e8b0eca4 100644 --- a/src/api/types/StripeCard.ts +++ b/src/api/types/StripeCard.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Details on the card used to fulfill this order, if this order was finalized with Stripe. diff --git a/src/api/types/StripeCardBrand.ts b/src/api/types/StripeCardBrand.ts index 0b986da1..359400b5 100644 --- a/src/api/types/StripeCardBrand.ts +++ b/src/api/types/StripeCardBrand.ts @@ -1,6 +1,18 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The card's brand (ie. credit card network) */ +/** + * The card's brand (ie. credit card network) + */ +export type StripeCardBrand = + | "Visa" + | "American Express" + | "MasterCard" + | "Discover" + | "JCB" + | "Diners Club" + | "Unknown"; export const StripeCardBrand = { Visa: "Visa", AmericanExpress: "American Express", @@ -10,4 +22,3 @@ export const StripeCardBrand = { DinersClub: "Diners Club", Unknown: "Unknown", } as const; -export type StripeCardBrand = (typeof StripeCardBrand)[keyof typeof StripeCardBrand]; diff --git a/src/api/types/StripeCardExpires.ts b/src/api/types/StripeCardExpires.ts index 10a7d7af..219a0924 100644 --- a/src/api/types/StripeCardExpires.ts +++ b/src/api/types/StripeCardExpires.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The card's expiration date. diff --git a/src/api/types/StripeDetails.ts b/src/api/types/StripeDetails.ts index 356bb059..f0e4f937 100644 --- a/src/api/types/StripeDetails.ts +++ b/src/api/types/StripeDetails.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * An object with various Stripe IDs, useful for linking into the stripe dashboard. diff --git a/src/api/types/SubmitButtonNode.ts b/src/api/types/SubmitButtonNode.ts index d9b55c60..18b31327 100644 --- a/src/api/types/SubmitButtonNode.ts +++ b/src/api/types/SubmitButtonNode.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents submit button elements within the DOM. It contains the text and waiting text of the button. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/SubmitButtonNodeWrite.ts b/src/api/types/SubmitButtonNodeWrite.ts index 492109fa..f7f5e428 100644 --- a/src/api/types/SubmitButtonNodeWrite.ts +++ b/src/api/types/SubmitButtonNodeWrite.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Update a submit button node diff --git a/src/api/types/Text.ts b/src/api/types/Text.ts index 438067fe..9b62448c 100644 --- a/src/api/types/Text.ts +++ b/src/api/types/Text.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The text content of the node diff --git a/src/api/types/TextInputNode.ts b/src/api/types/TextInputNode.ts index 8ccc24d2..17dca89c 100644 --- a/src/api/types/TextInputNode.ts +++ b/src/api/types/TextInputNode.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Represents text input and textarea elements within the DOM. It contains the placeholder text in the input. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/TextInputNodeWrite.ts b/src/api/types/TextInputNodeWrite.ts index b6446772..4e25aded 100644 --- a/src/api/types/TextInputNodeWrite.ts +++ b/src/api/types/TextInputNodeWrite.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Update placeholder text on a text input node diff --git a/src/api/types/TextNode.ts b/src/api/types/TextNode.ts index b5d1ee97..13015905 100644 --- a/src/api/types/TextNode.ts +++ b/src/api/types/TextNode.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Represents text content within the DOM. It contains both the raw text and its HTML representation. Additional attributes can be associated with the text for styling or other purposes. diff --git a/src/api/types/TextNodeText.ts b/src/api/types/TextNodeText.ts index 6edf3291..05f25552 100644 --- a/src/api/types/TextNodeText.ts +++ b/src/api/types/TextNodeText.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The text content of the node diff --git a/src/api/types/TextNodeWrite.ts b/src/api/types/TextNodeWrite.ts index 3003af32..0c52cf2c 100644 --- a/src/api/types/TextNodeWrite.ts +++ b/src/api/types/TextNodeWrite.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Update a text node diff --git a/src/api/types/TriggerType.ts b/src/api/types/TriggerType.ts index ed78a086..a059fadb 100644 --- a/src/api/types/TriggerType.ts +++ b/src/api/types/TriggerType.ts @@ -1,6 +1,28 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The type of event that triggered the request. See the the documentation for details on [supported events](/data/reference/all-events). */ +/** + * The type of event that triggered the request. See the the documentation for details on [supported events](/data/reference/all-events). + */ +export type TriggerType = + | "form_submission" + | "site_publish" + | "page_created" + | "page_metadata_updated" + | "page_deleted" + | "ecomm_new_order" + | "ecomm_order_changed" + | "ecomm_inventory_changed" + | "user_account_added" + | "user_account_updated" + | "user_account_deleted" + | "collection_item_created" + | "collection_item_changed" + | "collection_item_deleted" + | "collection_item_published" + | "collection_item_unpublished" + | "comment_created"; export const TriggerType = { FormSubmission: "form_submission", SitePublish: "site_publish", @@ -20,4 +42,3 @@ export const TriggerType = { CollectionItemUnpublished: "collection_item_unpublished", CommentCreated: "comment_created", } as const; -export type TriggerType = (typeof TriggerType)[keyof typeof TriggerType]; diff --git a/src/api/types/UpdatedOrder.ts b/src/api/types/UpdatedOrder.ts index 09265c46..125471d3 100644 --- a/src/api/types/UpdatedOrder.ts +++ b/src/api/types/UpdatedOrder.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The Webhook payload for when an order is updated diff --git a/src/api/types/User.ts b/src/api/types/User.ts index e8fb20ef..4709c50b 100644 --- a/src/api/types/User.ts +++ b/src/api/types/User.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The fields that define the schema for a given Item are based on the Collection that Item belongs to. Beyond the user defined fields, there are a handful of additional fields that are automatically created for all items diff --git a/src/api/types/UserAccess.ts b/src/api/types/UserAccess.ts index 3824f8bb..bd05d769 100644 --- a/src/api/types/UserAccess.ts +++ b/src/api/types/UserAccess.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface UserAccess { method?: Webflow.WorkspaceAuditLogItemPayloadUserAccessMethod; diff --git a/src/api/types/UserAccessAuditLogItem.ts b/src/api/types/UserAccessAuditLogItem.ts index a0079105..bbc3d213 100644 --- a/src/api/types/UserAccessAuditLogItem.ts +++ b/src/api/types/UserAccessAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface UserAccessAuditLogItem { eventSubType?: Webflow.UserAccessAuditLogItemEventSubType; diff --git a/src/api/types/UserAccessAuditLogItemEventSubType.ts b/src/api/types/UserAccessAuditLogItemEventSubType.ts index d4a5f31a..ca7071a5 100644 --- a/src/api/types/UserAccessAuditLogItemEventSubType.ts +++ b/src/api/types/UserAccessAuditLogItemEventSubType.ts @@ -1,8 +1,9 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type UserAccessAuditLogItemEventSubType = "login" | "logout"; export const UserAccessAuditLogItemEventSubType = { Login: "login", Logout: "logout", } as const; -export type UserAccessAuditLogItemEventSubType = - (typeof UserAccessAuditLogItemEventSubType)[keyof typeof UserAccessAuditLogItemEventSubType]; diff --git a/src/api/types/UserAccessGroupsItem.ts b/src/api/types/UserAccessGroupsItem.ts index db535778..637d39f3 100644 --- a/src/api/types/UserAccessGroupsItem.ts +++ b/src/api/types/UserAccessGroupsItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * Access group slugs and types diff --git a/src/api/types/UserAccessGroupsItemType.ts b/src/api/types/UserAccessGroupsItemType.ts index 1b9d6ee7..ab143a12 100644 --- a/src/api/types/UserAccessGroupsItemType.ts +++ b/src/api/types/UserAccessGroupsItemType.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * The type of access group based on how it was assigned to the user. * * `admin` - Assigned to the user via API or in the designer * * `ecommerce` - Assigned to the user via an ecommerce purchase */ +export type UserAccessGroupsItemType = "admin" | "ecommerce"; export const UserAccessGroupsItemType = { Admin: "admin", Ecommerce: "ecommerce", } as const; -export type UserAccessGroupsItemType = (typeof UserAccessGroupsItemType)[keyof typeof UserAccessGroupsItemType]; diff --git a/src/api/types/UserData.ts b/src/api/types/UserData.ts index a0eba2e4..1dacfea8 100644 --- a/src/api/types/UserData.ts +++ b/src/api/types/UserData.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * An object containing the User's basic info and custom fields diff --git a/src/api/types/UserDataData.ts b/src/api/types/UserDataData.ts index 3331a04b..ad23a6ca 100644 --- a/src/api/types/UserDataData.ts +++ b/src/api/types/UserDataData.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface UserDataData { /** The name of the user */ diff --git a/src/api/types/UserLimitReached.ts b/src/api/types/UserLimitReached.ts index 63391910..ca77b2b9 100644 --- a/src/api/types/UserLimitReached.ts +++ b/src/api/types/UserLimitReached.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type UserLimitReached = unknown; diff --git a/src/api/types/UserList.ts b/src/api/types/UserList.ts index 5af20e80..f7b1869d 100644 --- a/src/api/types/UserList.ts +++ b/src/api/types/UserList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; /** * The list users results diff --git a/src/api/types/UserStatus.ts b/src/api/types/UserStatus.ts index 9b3f689c..66168ff3 100644 --- a/src/api/types/UserStatus.ts +++ b/src/api/types/UserStatus.ts @@ -1,9 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -/** The status of the user */ +/** + * The status of the user + */ +export type UserStatus = "invited" | "verified" | "unverified"; export const UserStatus = { Invited: "invited", Verified: "verified", Unverified: "unverified", } as const; -export type UserStatus = (typeof UserStatus)[keyof typeof UserStatus]; diff --git a/src/api/types/UsersNotEnabled.ts b/src/api/types/UsersNotEnabled.ts index 70087df9..fe129bc3 100644 --- a/src/api/types/UsersNotEnabled.ts +++ b/src/api/types/UsersNotEnabled.ts @@ -1,3 +1,5 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export type UsersNotEnabled = unknown; diff --git a/src/api/types/Webhook.ts b/src/api/types/Webhook.ts index b41baaf6..e68efb78 100644 --- a/src/api/types/Webhook.ts +++ b/src/api/types/Webhook.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface Webhook { /** Unique identifier for the Webhook registration */ diff --git a/src/api/types/WebhookFilter.ts b/src/api/types/WebhookFilter.ts index ce31d751..36b41efb 100644 --- a/src/api/types/WebhookFilter.ts +++ b/src/api/types/WebhookFilter.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ /** * Only supported for the `form_submission` trigger type. Filter for the form you want Webhooks to be sent for. diff --git a/src/api/types/WebhookList.ts b/src/api/types/WebhookList.ts index b65385b8..3eb80995 100644 --- a/src/api/types/WebhookList.ts +++ b/src/api/types/WebhookList.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WebhookList { webhooks?: Webflow.Webhook[]; diff --git a/src/api/types/WorkspaceAuditLogItem.ts b/src/api/types/WorkspaceAuditLogItem.ts index f4fa42e5..1372526b 100644 --- a/src/api/types/WorkspaceAuditLogItem.ts +++ b/src/api/types/WorkspaceAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export type WorkspaceAuditLogItem = | Webflow.WorkspaceAuditLogItem.UserAccess diff --git a/src/api/types/WorkspaceAuditLogItemActor.ts b/src/api/types/WorkspaceAuditLogItemActor.ts index f08d817d..1f8f45bb 100644 --- a/src/api/types/WorkspaceAuditLogItemActor.ts +++ b/src/api/types/WorkspaceAuditLogItemActor.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemActor { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts index 729b3f5d..3e0fbcb7 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts index 3dda5663..950c77de 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts @@ -1,5 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadSiteMembershipMethod = + | "sso" + | "invite" + | "scim" + | "dashboard" + | "admin" + | "access_request"; export const WorkspaceAuditLogItemPayloadSiteMembershipMethod = { Sso: "sso", Invite: "invite", @@ -8,5 +17,3 @@ export const WorkspaceAuditLogItemPayloadSiteMembershipMethod = { Admin: "admin", AccessRequest: "access_request", } as const; -export type WorkspaceAuditLogItemPayloadSiteMembershipMethod = - (typeof WorkspaceAuditLogItemPayloadSiteMembershipMethod)[keyof typeof WorkspaceAuditLogItemPayloadSiteMembershipMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts index fca5867c..d02ed3f9 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadSiteMembershipSite { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts index ec667773..19275a27 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadSiteMembershipTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts index 2bbebd72..07ad34b2 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadSiteMembershipUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadSiteMembershipUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; -export type WorkspaceAuditLogItemPayloadSiteMembershipUserType = - (typeof WorkspaceAuditLogItemPayloadSiteMembershipUserType)[keyof typeof WorkspaceAuditLogItemPayloadSiteMembershipUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts index b83c7891..63ab80aa 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadUserAccessMethod = "dashboard" | "sso" | "api" | "google"; export const WorkspaceAuditLogItemPayloadUserAccessMethod = { Dashboard: "dashboard", Sso: "sso", Api: "api", Google: "google", } as const; -export type WorkspaceAuditLogItemPayloadUserAccessMethod = - (typeof WorkspaceAuditLogItemPayloadUserAccessMethod)[keyof typeof WorkspaceAuditLogItemPayloadUserAccessMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts index dc9a42e4..cd4e89b6 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = "sso" | "dashboard" | "admin"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = { Sso: "sso", Dashboard: "dashboard", Admin: "admin", } as const; -export type WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod = - (typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts index 4c339687..cd74ed4c 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts index dd058556..860cdaad 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts index c57892c1..a79a1f57 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; -export type WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType = - (typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts index f31f0c0d..22b080cc 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = "sso" | "dashboard" | "admin" | "access_request"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = { Sso: "sso", Dashboard: "dashboard", Admin: "admin", AccessRequest: "access_request", } as const; -export type WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod = - (typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod]; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts index 190dd0e8..1747e827 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser { id?: string; diff --git a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts index 17ef8968..02029299 100644 --- a/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts +++ b/src/api/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts @@ -1,10 +1,11 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = "member" | "guest" | "reviewer" | "client"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = { Member: "member", Guest: "guest", Reviewer: "reviewer", Client: "client", } as const; -export type WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType = - (typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType)[keyof typeof WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType]; diff --git a/src/api/types/WorkspaceAuditLogItemWorkspace.ts b/src/api/types/WorkspaceAuditLogItemWorkspace.ts index f29a357f..f60d705b 100644 --- a/src/api/types/WorkspaceAuditLogItemWorkspace.ts +++ b/src/api/types/WorkspaceAuditLogItemWorkspace.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WorkspaceAuditLogItemWorkspace { id?: string; diff --git a/src/api/types/WorkspaceAuditLogResponse.ts b/src/api/types/WorkspaceAuditLogResponse.ts index 9c162042..4c740f8d 100644 --- a/src/api/types/WorkspaceAuditLogResponse.ts +++ b/src/api/types/WorkspaceAuditLogResponse.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WorkspaceAuditLogResponse { items?: Webflow.WorkspaceAuditLogItem[]; diff --git a/src/api/types/WorkspaceInvitation.ts b/src/api/types/WorkspaceInvitation.ts index 0bc52872..448c82ae 100644 --- a/src/api/types/WorkspaceInvitation.ts +++ b/src/api/types/WorkspaceInvitation.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WorkspaceInvitation { targetUser?: Webflow.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser; diff --git a/src/api/types/WorkspaceInvitationAuditLogItem.ts b/src/api/types/WorkspaceInvitationAuditLogItem.ts index 1d36ecb4..0a3dea4c 100644 --- a/src/api/types/WorkspaceInvitationAuditLogItem.ts +++ b/src/api/types/WorkspaceInvitationAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WorkspaceInvitationAuditLogItem { eventSubType?: Webflow.WorkspaceInvitationAuditLogItemEventSubType; diff --git a/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts b/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts index e58a38d6..bc474207 100644 --- a/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts +++ b/src/api/types/WorkspaceInvitationAuditLogItemEventSubType.ts @@ -1,5 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceInvitationAuditLogItemEventSubType = + | "invite_sent" + | "invite_accepted" + | "invite_updated" + | "invite_canceled" + | "invite_declined" + | "access_request_accepted"; export const WorkspaceInvitationAuditLogItemEventSubType = { InviteSent: "invite_sent", InviteAccepted: "invite_accepted", @@ -8,5 +17,3 @@ export const WorkspaceInvitationAuditLogItemEventSubType = { InviteDeclined: "invite_declined", AccessRequestAccepted: "access_request_accepted", } as const; -export type WorkspaceInvitationAuditLogItemEventSubType = - (typeof WorkspaceInvitationAuditLogItemEventSubType)[keyof typeof WorkspaceInvitationAuditLogItemEventSubType]; diff --git a/src/api/types/WorkspaceMembership.ts b/src/api/types/WorkspaceMembership.ts index 03212e6f..62df5b26 100644 --- a/src/api/types/WorkspaceMembership.ts +++ b/src/api/types/WorkspaceMembership.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WorkspaceMembership { targetUser?: Webflow.WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser; diff --git a/src/api/types/WorkspaceMembershipAuditLogItem.ts b/src/api/types/WorkspaceMembershipAuditLogItem.ts index c0ba842e..df5fcff1 100644 --- a/src/api/types/WorkspaceMembershipAuditLogItem.ts +++ b/src/api/types/WorkspaceMembershipAuditLogItem.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../index"; +import * as Webflow from "../index"; export interface WorkspaceMembershipAuditLogItem { eventSubType?: Webflow.WorkspaceMembershipAuditLogItemEventSubType; diff --git a/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts b/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts index 919bfd0f..721ced6c 100644 --- a/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts +++ b/src/api/types/WorkspaceMembershipAuditLogItemEventSubType.ts @@ -1,9 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ +export type WorkspaceMembershipAuditLogItemEventSubType = "user_added" | "user_removed" | "user_role_updated"; export const WorkspaceMembershipAuditLogItemEventSubType = { UserAdded: "user_added", UserRemoved: "user_removed", UserRoleUpdated: "user_role_updated", } as const; -export type WorkspaceMembershipAuditLogItemEventSubType = - (typeof WorkspaceMembershipAuditLogItemEventSubType)[keyof typeof WorkspaceMembershipAuditLogItemEventSubType]; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 05e2bc8a..226d0e81 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,264 +1,264 @@ -export * from "./AccessGroup"; -export * from "./AccessGroupList"; +export * from "./ForbiddenErrorBody"; +export * from "./BadRequestErrorBody"; +export * from "./ItemsListItemsRequestLastPublished"; +export * from "./ItemsListItemsLiveRequestLastPublished"; +export * from "./ConflictErrorBody"; +export * from "./AuthorizedUser"; +export * from "./ErrorCode"; +export * from "./Error_"; export * from "./Application"; -export * from "./Asset"; -export * from "./AssetFolder"; -export * from "./AssetFolderList"; -export * from "./Assets"; -export * from "./AssetUpload"; -export * from "./AssetUploadUploadDetails"; -export * from "./AssetVariant"; -export * from "./Authorization"; -export * from "./AuthorizationAuthorization"; export * from "./AuthorizationAuthorizationAuthorizedTo"; -export * from "./AuthorizedUser"; -export * from "./BadRequestErrorBody"; -export * from "./BulkCollectionItem"; -export * from "./BulkCollectionItemFieldData"; +export * from "./AuthorizationAuthorization"; +export * from "./Authorization"; +export * from "./Domain"; +export * from "./Locale"; +export * from "./Locales"; +export * from "./SiteDataCollectionType"; +export * from "./Site"; +export * from "./InvalidScopes"; +export * from "./NotEnterprisePlanWorkspace"; +export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; +export * from "./UserAccess"; +export * from "./UserAccessAuditLogItemEventSubType"; +export * from "./UserAccessAuditLogItem"; +export * from "./CustomRole"; +export * from "./CustomRoleAuditLogItemEventSubType"; +export * from "./CustomRoleAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; +export * from "./WorkspaceMembership"; +export * from "./WorkspaceMembershipAuditLogItemEventSubType"; +export * from "./WorkspaceMembershipAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; +export * from "./SiteMembership"; +export * from "./SiteMembershipAuditLogItemEventSubType"; +export * from "./SiteMembershipAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +export * from "./WorkspaceInvitation"; +export * from "./WorkspaceInvitationAuditLogItemEventSubType"; +export * from "./WorkspaceInvitationAuditLogItem"; +export * from "./WorkspaceAuditLogItemActor"; +export * from "./WorkspaceAuditLogItemWorkspace"; +export * from "./WorkspaceAuditLogItem"; +export * from "./Pagination"; +export * from "./WorkspaceAuditLogResponse"; +export * from "./Sites"; +export * from "./NotEnterprisePlanSite"; +export * from "./Domains"; +export * from "./InvalidDomain"; +export * from "./NoDomains"; +export * from "./Redirect"; +export * from "./Redirects"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePlan"; +export * from "./RobotsRulesItem"; +export * from "./Robots"; +export * from "./SiteActivityLogItemEvent"; +export * from "./SiteActivityLogItemResourceOperation"; +export * from "./SiteActivityLogItemUser"; +export * from "./SiteActivityLogItem"; +export * from "./SiteActivityLogResponse"; +export * from "./CollectionListArrayItem"; +export * from "./CollectionList"; +export * from "./StaticFieldType"; +export * from "./StaticField"; +export * from "./MetadataOptionsItem"; +export * from "./Metadata"; +export * from "./OptionField"; +export * from "./ReferenceFieldType"; +export * from "./ReferenceFieldMetadata"; +export * from "./ReferenceField"; +export * from "./FieldCreate"; +export * from "./FieldType"; +export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; +export * from "./FieldValidationsAdditionalProperties"; +export * from "./FieldValidations"; +export * from "./Field"; export * from "./Collection"; -export * from "./CollectionItem"; -export * from "./CollectionItemChanged"; -export * from "./CollectionItemCreated"; export * from "./CollectionItemFieldData"; -export * from "./CollectionItemList"; -export * from "./CollectionItemListNoPagination"; +export * from "./CollectionItem"; export * from "./CollectionItemListPagination"; -export * from "./CollectionItemPatchSingle"; -export * from "./CollectionItemPatchSingleFieldData"; -export * from "./CollectionItemPostSingle"; +export * from "./CollectionItemList"; export * from "./CollectionItemPostSingleFieldData"; -export * from "./CollectionItemPublished"; -export * from "./CollectionItemRemoved"; -export * from "./CollectionItemRemovedPayload"; -export * from "./CollectionItemRemovedPayloadFieldData"; -export * from "./CollectionItemUnpublished"; -export * from "./CollectionItemUnpublishedPayload"; -export * from "./CollectionItemUnpublishedPayloadFieldData"; -export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemPostSingle"; export * from "./CollectionItemWithIdInputFieldData"; -export * from "./CollectionList"; -export * from "./CollectionListArrayItem"; -export * from "./Comment"; -export * from "./CommentPayload"; -export * from "./CommentPayloadAuthor"; -export * from "./CommentPayloadMentionedUsersItem"; -export * from "./CommentReply"; -export * from "./CommentReplyAuthor"; -export * from "./CommentReplyList"; -export * from "./CommentReplyListPagination"; -export * from "./CommentReplyMentionedUsersItem"; -export * from "./CommentThread"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemListNoPagination"; +export * from "./Conflict"; +export * from "./BulkCollectionItemFieldData"; +export * from "./BulkCollectionItem"; +export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemPatchSingle"; export * from "./CommentThreadAuthor"; -export * from "./CommentThreadList"; -export * from "./CommentThreadListPagination"; export * from "./CommentThreadMentionedUsersItem"; -export * from "./Component"; -export * from "./ComponentDom"; -export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./CommentThread"; +export * from "./CommentThreadListPagination"; +export * from "./CommentThreadList"; +export * from "./CommentReplyAuthor"; +export * from "./CommentReplyMentionedUsersItem"; +export * from "./CommentReply"; +export * from "./CommentReplyListPagination"; +export * from "./CommentReplyList"; +export * from "./PageSeo"; +export * from "./PageOpenGraph"; +export * from "./Page"; +export * from "./PageList"; +export * from "./TextNodeText"; +export * from "./TextNode"; +export * from "./ImageNodeImage"; +export * from "./ImageNode"; +export * from "./Text"; +export * from "./ComponentPropertyType"; +export * from "./ComponentProperty"; +export * from "./ComponentNode"; +export * from "./TextInputNode"; +export * from "./SelectNodeChoicesItem"; +export * from "./SelectNode"; +export * from "./SubmitButtonNode"; +export * from "./SearchButtonNode"; +export * from "./Node"; +export * from "./Dom"; +export * from "./TextNodeWrite"; export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./SelectNodeWriteChoicesItem"; +export * from "./Select"; +export * from "./TextInputNodeWrite"; +export * from "./SubmitButtonNodeWrite"; +export * from "./SearchButtonNodeWrite"; +export * from "./Component"; export * from "./ComponentList"; -export * from "./ComponentNode"; +export * from "./ComponentDom"; export * from "./ComponentProperties"; -export * from "./ComponentProperty"; -export * from "./ComponentPropertyType"; -export * from "./Conflict"; -export * from "./ConflictErrorBody"; -export * from "./CustomCodeBlock"; -export * from "./CustomCodeBlockType"; +export * from "./ScriptApplyLocation"; +export * from "./ScriptApply"; +export * from "./ScriptApplyList"; export * from "./CustomCodeHostedResponse"; +export * from "./RegisteredScriptList"; export * from "./CustomCodeInlineResponse"; -export * from "./CustomRole"; -export * from "./CustomRoleAuditLogItem"; -export * from "./CustomRoleAuditLogItemEventSubType"; -export * from "./Dom"; -export * from "./Domain"; -export * from "./Domains"; -export * from "./DuplicateUserEmail"; -export * from "./EcommerceSettings"; -export * from "./Error_"; -export * from "./ErrorCode"; -export * from "./Field"; -export * from "./FieldCreate"; -export * from "./FieldType"; -export * from "./FieldValidations"; -export * from "./FieldValidationsAdditionalProperties"; -export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; -export * from "./ForbiddenErrorBody"; -export * from "./Form"; -export * from "./FormField"; -export * from "./FormFieldValue"; +export * from "./Scripts"; +export * from "./CustomCodeBlockType"; +export * from "./CustomCodeBlock"; +export * from "./ListCustomCodeBlocks"; +export * from "./AssetVariant"; +export * from "./Asset"; +export * from "./Assets"; +export * from "./AssetUploadUploadDetails"; +export * from "./AssetUpload"; +export * from "./AssetFolder"; +export * from "./AssetFolderList"; +export * from "./TriggerType"; +export * from "./WebhookFilter"; +export * from "./Webhook"; +export * from "./WebhookList"; export * from "./FormFieldValueType"; -export * from "./FormList"; +export * from "./FormFieldValue"; +export * from "./FormField"; export * from "./FormResponseSettings"; +export * from "./Form"; +export * from "./FormList"; export * from "./FormSubmission"; export * from "./FormSubmissionList"; -export * from "./FormSubmissionTrigger"; -export * from "./FormSubmissionTriggerPayload"; -export * from "./FormSubmissionTriggerPayloadSchemaItem"; -export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; -export * from "./ImageNode"; -export * from "./ImageNodeImage"; -export * from "./InvalidDomain"; -export * from "./InvalidScopes"; -export * from "./InventoryItem"; -export * from "./InventoryItemInventoryType"; -export * from "./ItemsListItemsLiveRequestLastPublished"; -export * from "./ItemsListItemsRequestLastPublished"; -export * from "./ListCustomCodeBlocks"; -export * from "./Locale"; -export * from "./Locales"; -export * from "./Metadata"; -export * from "./MetadataOptionsItem"; -export * from "./NewOrder"; -export * from "./NoDomains"; -export * from "./Node"; -export * from "./NotEnterprisePlanSite"; -export * from "./NotEnterprisePlanWorkspace"; -export * from "./OptionField"; -export * from "./Order"; -export * from "./OrderAddress"; -export * from "./OrderAddressJapanType"; -export * from "./OrderAddressType"; -export * from "./OrderBillingAddress"; -export * from "./OrderBillingAddressJapanType"; -export * from "./OrderBillingAddressType"; -export * from "./OrderCustomerInfo"; -export * from "./OrderDisputeLastStatus"; -export * from "./OrderDownloadFilesItem"; -export * from "./OrderList"; -export * from "./OrderMetadata"; -export * from "./OrderPrice"; -export * from "./OrderPurchasedItem"; -export * from "./OrderPurchasedItemVariantImage"; -export * from "./OrderPurchasedItemVariantImageFile"; -export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; -export * from "./OrderShippingAddress"; -export * from "./OrderShippingAddressJapanType"; -export * from "./OrderShippingAddressType"; -export * from "./OrderStatus"; -export * from "./OrderTotals"; -export * from "./OrderTotalsExtrasItem"; -export * from "./OrderTotalsExtrasItemType"; -export * from "./Page"; -export * from "./PageCreatedWebhook"; -export * from "./PageCreatedWebhookPayload"; -export * from "./PageDeletedWebhook"; -export * from "./PageDeletedWebhookPayload"; -export * from "./PageList"; -export * from "./PageMetadataUpdatedWebhook"; -export * from "./PageMetadataUpdatedWebhookPayload"; -export * from "./PageOpenGraph"; -export * from "./PageSeo"; -export * from "./Pagination"; -export * from "./Payload"; -export * from "./PayloadFieldData"; -export * from "./PaypalDetails"; -export * from "./Product"; -export * from "./ProductAndSkUs"; -export * from "./ProductAndSkUsList"; -export * from "./ProductFieldData"; -export * from "./ProductFieldDataEcProductType"; +export * from "./UserStatus"; +export * from "./UserAccessGroupsItemType"; +export * from "./UserAccessGroupsItem"; +export * from "./UserDataData"; +export * from "./UserData"; +export * from "./User"; +export * from "./UserList"; +export * from "./UsersNotEnabled"; +export * from "./DuplicateUserEmail"; +export * from "./UserLimitReached"; +export * from "./AccessGroup"; +export * from "./AccessGroupList"; +export * from "./SkuPropertyListEnumItem"; +export * from "./SkuPropertyList"; export * from "./ProductFieldDataTaxCategory"; -export * from "./PublishStatus"; -export * from "./Redirect"; -export * from "./Redirects"; -export * from "./ReferenceField"; -export * from "./ReferenceFieldMetadata"; -export * from "./ReferenceFieldType"; -export * from "./RegisteredScriptList"; -export * from "./Robots"; -export * from "./RobotsRulesItem"; -export * from "./ScriptApply"; -export * from "./ScriptApplyList"; -export * from "./ScriptApplyLocation"; -export * from "./Scripts"; -export * from "./SearchButtonNode"; -export * from "./SearchButtonNodeWrite"; -export * from "./Select"; -export * from "./SelectNode"; -export * from "./SelectNodeChoicesItem"; -export * from "./SelectNodeWriteChoicesItem"; -export * from "./SingleLocaleCreatedPayload"; -export * from "./SingleLocaleCreatedPayloadFieldData"; -export * from "./Site"; -export * from "./SiteActivityLogItem"; -export * from "./SiteActivityLogItemEvent"; -export * from "./SiteActivityLogItemResourceOperation"; -export * from "./SiteActivityLogItemUser"; -export * from "./SiteActivityLogResponse"; -export * from "./SiteDataCollectionType"; -export * from "./SiteMembership"; -export * from "./SiteMembershipAuditLogItem"; -export * from "./SiteMembershipAuditLogItemEventSubType"; -export * from "./SitePlan"; -export * from "./SitePlanId"; -export * from "./SitePlanName"; -export * from "./SitePublish"; -export * from "./SitePublishPayload"; -export * from "./Sites"; -export * from "./Sku"; -export * from "./SkuFieldData"; +export * from "./ProductFieldDataEcProductType"; +export * from "./ProductFieldData"; +export * from "./Product"; +export * from "./SkuValueList"; +export * from "./SkuFieldDataPrice"; export * from "./SkuFieldDataCompareAtPrice"; export * from "./SkuFieldDataEcSkuBillingMethod"; -export * from "./SkuFieldDataEcSkuSubscriptionPlan"; export * from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; -export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; -export * from "./SkuFieldDataPrice"; -export * from "./SkuPropertyList"; -export * from "./SkuPropertyListEnumItem"; -export * from "./SkuValueList"; -export * from "./StaticField"; -export * from "./StaticFieldType"; -export * from "./StripeCard"; +export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; +export * from "./SkuFieldDataEcSkuSubscriptionPlan"; +export * from "./SkuFieldData"; +export * from "./Sku"; +export * from "./ProductAndSkUs"; +export * from "./ProductAndSkUsList"; +export * from "./PublishStatus"; +export * from "./OrderPrice"; +export * from "./OrderAddressType"; +export * from "./OrderAddressJapanType"; +export * from "./OrderAddress"; +export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; +export * from "./OrderPurchasedItemVariantImageFile"; +export * from "./OrderPurchasedItemVariantImage"; +export * from "./OrderPurchasedItem"; +export * from "./StripeDetails"; export * from "./StripeCardBrand"; export * from "./StripeCardExpires"; -export * from "./StripeDetails"; -export * from "./SubmitButtonNode"; -export * from "./SubmitButtonNodeWrite"; -export * from "./Text"; -export * from "./TextInputNode"; -export * from "./TextInputNodeWrite"; -export * from "./TextNode"; -export * from "./TextNodeText"; -export * from "./TextNodeWrite"; -export * from "./TriggerType"; +export * from "./StripeCard"; +export * from "./PaypalDetails"; +export * from "./OrderStatus"; +export * from "./OrderDisputeLastStatus"; +export * from "./OrderShippingAddressType"; +export * from "./OrderShippingAddressJapanType"; +export * from "./OrderShippingAddress"; +export * from "./OrderBillingAddressType"; +export * from "./OrderBillingAddressJapanType"; +export * from "./OrderBillingAddress"; +export * from "./OrderCustomerInfo"; +export * from "./OrderMetadata"; +export * from "./OrderTotalsExtrasItemType"; +export * from "./OrderTotalsExtrasItem"; +export * from "./OrderTotals"; +export * from "./OrderDownloadFilesItem"; +export * from "./Order"; +export * from "./OrderList"; +export * from "./InventoryItemInventoryType"; +export * from "./InventoryItem"; +export * from "./EcommerceSettings"; +export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; +export * from "./FormSubmissionTriggerPayloadSchemaItem"; +export * from "./FormSubmissionTriggerPayload"; +export * from "./FormSubmissionTrigger"; +export * from "./SitePublishPayload"; +export * from "./SitePublish"; +export * from "./NewOrder"; export * from "./UpdatedOrder"; -export * from "./User"; -export * from "./UserAccess"; -export * from "./UserAccessAuditLogItem"; -export * from "./UserAccessAuditLogItemEventSubType"; -export * from "./UserAccessGroupsItem"; -export * from "./UserAccessGroupsItemType"; -export * from "./UserData"; -export * from "./UserDataData"; -export * from "./UserLimitReached"; -export * from "./UserList"; -export * from "./UserStatus"; -export * from "./UsersNotEnabled"; -export * from "./Webhook"; -export * from "./WebhookFilter"; -export * from "./WebhookList"; -export * from "./WorkspaceAuditLogItem"; -export * from "./WorkspaceAuditLogItemActor"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; -export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; -export * from "./WorkspaceAuditLogItemWorkspace"; -export * from "./WorkspaceAuditLogResponse"; -export * from "./WorkspaceInvitation"; -export * from "./WorkspaceInvitationAuditLogItem"; -export * from "./WorkspaceInvitationAuditLogItemEventSubType"; -export * from "./WorkspaceMembership"; -export * from "./WorkspaceMembershipAuditLogItem"; -export * from "./WorkspaceMembershipAuditLogItemEventSubType"; +export * from "./SingleLocaleCreatedPayloadFieldData"; +export * from "./SingleLocaleCreatedPayload"; +export * from "./CollectionItemCreated"; +export * from "./CollectionItemChanged"; +export * from "./CollectionItemRemovedPayloadFieldData"; +export * from "./CollectionItemRemovedPayload"; +export * from "./CollectionItemRemoved"; +export * from "./PayloadFieldData"; +export * from "./Payload"; +export * from "./CollectionItemPublished"; +export * from "./CollectionItemUnpublishedPayloadFieldData"; +export * from "./CollectionItemUnpublishedPayload"; +export * from "./CollectionItemUnpublished"; +export * from "./PageCreatedWebhookPayload"; +export * from "./PageCreatedWebhook"; +export * from "./PageMetadataUpdatedWebhookPayload"; +export * from "./PageMetadataUpdatedWebhook"; +export * from "./PageDeletedWebhookPayload"; +export * from "./PageDeletedWebhook"; +export * from "./CommentPayloadAuthor"; +export * from "./CommentPayloadMentionedUsersItem"; +export * from "./CommentPayload"; +export * from "./Comment"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts deleted file mode 100644 index ed076ec5..00000000 --- a/src/core/auth/AuthProvider.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { AuthRequest } from "./AuthRequest"; - -export interface AuthProvider { - getAuthRequest(): Promise; -} diff --git a/src/core/auth/AuthRequest.ts b/src/core/auth/AuthRequest.ts deleted file mode 100644 index f6218b42..00000000 --- a/src/core/auth/AuthRequest.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Request parameters for authentication requests. - */ -export interface AuthRequest { - /** - * The headers to be included in the request. - */ - headers: Record; -} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index c6efa5e2..146df215 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -1,4 +1,4 @@ -import { base64Decode, base64Encode } from "../base64"; +import { Base64 } from "js-base64"; export interface BasicAuth { username: string; @@ -12,14 +12,13 @@ export const BasicAuth = { if (basicAuth == null) { return undefined; } - const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); + const token = Base64.encode(`${basicAuth.username}:${basicAuth.password}`); return `Basic ${token}`; }, fromAuthorizationHeader: (header: string): BasicAuth => { const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, ""); - const decoded = base64Decode(credentials); - const [username, ...passwordParts] = decoded.split(":"); - const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined; + const decoded = Base64.decode(credentials); + const [username, password] = decoded.split(":", 2); if (username == null || password == null) { throw new Error("Invalid basic auth"); diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index c7786e5b..ee293b34 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,4 +1,2 @@ -export type { AuthProvider } from "./AuthProvider"; -export type { AuthRequest } from "./AuthRequest"; export { BasicAuth } from "./BasicAuth"; export { BearerToken } from "./BearerToken"; diff --git a/src/core/base64.ts b/src/core/base64.ts deleted file mode 100644 index 448a0db6..00000000 --- a/src/core/base64.ts +++ /dev/null @@ -1,27 +0,0 @@ -function base64ToBytes(base64: string): Uint8Array { - const binString = atob(base64); - return Uint8Array.from(binString, (m) => m.codePointAt(0)!); -} - -function bytesToBase64(bytes: Uint8Array): string { - const binString = String.fromCodePoint(...bytes); - return btoa(binString); -} - -export function base64Encode(input: string): string { - if (typeof Buffer !== "undefined") { - return Buffer.from(input, "utf8").toString("base64"); - } - - const bytes = new TextEncoder().encode(input); - return bytesToBase64(bytes); -} - -export function base64Decode(input: string): string { - if (typeof Buffer !== "undefined") { - return Buffer.from(input, "base64").toString("utf8"); - } - - const bytes = base64ToBytes(input); - return new TextDecoder().decode(bytes); -} diff --git a/src/core/fetcher/APIResponse.ts b/src/core/fetcher/APIResponse.ts index b703b0a4..6335291b 100644 --- a/src/core/fetcher/APIResponse.ts +++ b/src/core/fetcher/APIResponse.ts @@ -1,4 +1,4 @@ -import type { RawResponse } from "./RawResponse"; +import { RawResponse } from "./RawResponse"; /** * The response of an API call. diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts deleted file mode 100644 index 4b4d0e89..00000000 --- a/src/core/fetcher/BinaryResponse.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { ResponseWithBody } from "./ResponseWithBody.js"; - -export type BinaryResponse = { - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bodyUsed) */ - bodyUsed: boolean; - /** - * Returns a ReadableStream of the response body. - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/body) - */ - stream: () => ReadableStream; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/arrayBuffer) */ - arrayBuffer: () => Promise; - /** [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/blob) */ - blob: () => Promise; - /** - * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) - * Some versions of the Fetch API may not support this method. - */ - bytes?(): Promise; -}; - -export function getBinaryResponse(response: ResponseWithBody): BinaryResponse { - const binaryResponse: BinaryResponse = { - get bodyUsed() { - return response.bodyUsed; - }, - stream: () => response.body, - arrayBuffer: response.arrayBuffer.bind(response), - blob: response.blob.bind(response), - }; - if ("bytes" in response && typeof response.bytes === "function") { - binaryResponse.bytes = response.bytes.bind(response); - } - - return binaryResponse; -} diff --git a/src/core/fetcher/EndpointMetadata.ts b/src/core/fetcher/EndpointMetadata.ts deleted file mode 100644 index 998d68f5..00000000 --- a/src/core/fetcher/EndpointMetadata.ts +++ /dev/null @@ -1,13 +0,0 @@ -export type SecuritySchemeKey = string; -/** - * A collection of security schemes, where the key is the name of the security scheme and the value is the list of scopes required for that scheme. - * All schemes in the collection must be satisfied for authentication to be successful. - */ -export type SecuritySchemeCollection = Record; -export type AuthScope = string; -export type EndpointMetadata = { - /** - * An array of security scheme collections. Each collection represents an alternative way to authenticate. - */ - security?: SecuritySchemeCollection[]; -}; diff --git a/src/core/fetcher/EndpointSupplier.ts b/src/core/fetcher/EndpointSupplier.ts deleted file mode 100644 index f4a99783..00000000 --- a/src/core/fetcher/EndpointSupplier.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { EndpointMetadata } from "./EndpointMetadata"; -import type { Supplier } from "./Supplier"; - -type EndpointSupplierFn = (arg: { endpointMetadata: EndpointMetadata }) => T | Promise; -export type EndpointSupplier = Supplier | EndpointSupplierFn; -export const EndpointSupplier = { - get: async (supplier: EndpointSupplier, arg: { endpointMetadata: EndpointMetadata }): Promise => { - if (typeof supplier === "function") { - return (supplier as EndpointSupplierFn)(arg); - } else { - return supplier; - } - }, -}; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 6c610724..ccc16a26 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,14 +1,12 @@ import { toJson } from "../json"; -import type { APIResponse } from "./APIResponse"; +import { APIResponse } from "./APIResponse"; +import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +import { Supplier } from "./Supplier"; import { createRequestUrl } from "./createRequestUrl"; -import type { EndpointMetadata } from "./EndpointMetadata"; -import { EndpointSupplier } from "./EndpointSupplier"; -import { getErrorResponseBody } from "./getErrorResponseBody"; import { getFetchFn } from "./getFetchFn"; import { getRequestBody } from "./getRequestBody"; import { getResponseBody } from "./getResponseBody"; import { makeRequest } from "./makeRequest"; -import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; import { requestWithRetries } from "./requestWithRetries"; export type FetchFunction = (args: Fetcher.Args) => Promise>; @@ -18,17 +16,16 @@ export declare namespace Fetcher { url: string; method: string; contentType?: string; - headers?: Record | null | undefined>; - queryParameters?: Record; + headers?: Record | undefined>; + queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; - responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; + responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer"; duplex?: "half"; - endpointMetadata?: EndpointMetadata; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -66,7 +63,7 @@ async function getHeaders(args: Fetcher.Args): Promise> { } for (const [key, value] of Object.entries(args.headers)) { - const result = await EndpointSupplier.get(value, { endpointMetadata: args.endpointMetadata ?? {} }); + const result = await Supplier.get(value); if (typeof result === "string") { newHeaders[key] = result; continue; @@ -103,11 +100,12 @@ export async function fetcherImpl(args: Fetcher.Args): Promise= 200 && response.status < 400) { return { ok: true, - body: (await getResponseBody(response, args.responseType)) as R, + body: responseBody as R, headers: response.headers, rawResponse: toRawResponse(response), }; @@ -117,13 +115,13 @@ export async function fetcherImpl(args: Fetcher.Args): Promise; -}; - -export function isResponseWithBody(response: Response): response is ResponseWithBody { - return (response as ResponseWithBody).body != null; -} diff --git a/src/core/fetcher/createRequestUrl.ts b/src/core/fetcher/createRequestUrl.ts index 4bcb1985..f1157ce7 100644 --- a/src/core/fetcher/createRequestUrl.ts +++ b/src/core/fetcher/createRequestUrl.ts @@ -1,6 +1,10 @@ -import { toQueryString } from "../url/qs"; +import qs from "qs"; -export function createRequestUrl(baseUrl: string, queryParameters?: Record): string { - const queryString = toQueryString(queryParameters, { arrayFormat: "repeat" }); - return queryString ? `${baseUrl}?${queryString}` : baseUrl; +export function createRequestUrl( + baseUrl: string, + queryParameters?: Record, +): string { + return Object.keys(queryParameters ?? {}).length > 0 + ? `${baseUrl}?${qs.stringify(queryParameters, { arrayFormat: "repeat" })}` + : baseUrl; } diff --git a/src/core/fetcher/getErrorResponseBody.ts b/src/core/fetcher/getErrorResponseBody.ts deleted file mode 100644 index 34f0047a..00000000 --- a/src/core/fetcher/getErrorResponseBody.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { fromJson } from "../json"; -import { getResponseBody } from "./getResponseBody"; - -export async function getErrorResponseBody(response: Response): Promise { - let contentType = response.headers.get("Content-Type")?.toLowerCase(); - if (contentType == null || contentType.length === 0) { - return getResponseBody(response); - } - - if (contentType.indexOf(";") !== -1) { - contentType = contentType.split(";")[0]?.trim() ?? ""; - } - switch (contentType) { - case "application/hal+json": - case "application/json": - case "application/ld+json": - case "application/problem+json": - case "application/vnd.api+json": - case "text/json": { - const text = await response.text(); - return text.length > 0 ? fromJson(text) : undefined; - } - default: - if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) { - const text = await response.text(); - return text.length > 0 ? fromJson(text) : undefined; - } - - // Fallback to plain text if content type is not recognized - // Even if no body is present, the response will be an empty string - return await response.text(); - } -} diff --git a/src/core/fetcher/getFetchFn.ts b/src/core/fetcher/getFetchFn.ts index 0900cab1..9fd9bfc4 100644 --- a/src/core/fetcher/getFetchFn.ts +++ b/src/core/fetcher/getFetchFn.ts @@ -1,4 +1,4 @@ -import { RUNTIME } from "../runtime/index"; +import { RUNTIME } from "../runtime"; /** * Returns a fetch function based on the runtime @@ -16,7 +16,7 @@ export async function getFetchFn(): Promise { // Otherwise the SDK uses global fetch if available, // and falls back to node-fetch. - if (typeof fetch === "function") { + if (typeof fetch == "function") { return fetch; } diff --git a/src/core/fetcher/getResponseBody.ts b/src/core/fetcher/getResponseBody.ts index c103c6aa..d046e6ea 100644 --- a/src/core/fetcher/getResponseBody.ts +++ b/src/core/fetcher/getResponseBody.ts @@ -1,45 +1,34 @@ -import { fromJson } from "../json"; -import { getBinaryResponse } from "./BinaryResponse"; -import { isResponseWithBody } from "./ResponseWithBody"; - import { chooseStreamWrapper } from "./stream-wrappers/chooseStreamWrapper"; export async function getResponseBody(response: Response, responseType?: string): Promise { - if (!isResponseWithBody(response)) { - return undefined; - } - switch (responseType) { - case "binary-response": - return getBinaryResponse(response); - case "blob": - return await response.blob(); - case "arrayBuffer": - return await response.arrayBuffer(); - case "sse": - return response.body; - case "streaming": - return chooseStreamWrapper(response.body); - - case "text": - return await response.text(); - } - - // if responseType is "json" or not specified, try to parse as JSON - const text = await response.text(); - if (text.length > 0) { - try { - const responseBody = fromJson(text); - return responseBody; - } catch (_err) { - return { - ok: false, - error: { - reason: "non-json", - statusCode: response.status, - rawBody: text, - }, - }; + if (response.body != null && responseType === "blob") { + return await response.blob(); + } else if (response.body != null && responseType === "arrayBuffer") { + return await response.arrayBuffer(); + } else if (response.body != null && responseType === "sse") { + return response.body; + } else if (response.body != null && responseType === "streaming") { + return chooseStreamWrapper(response.body); + } else if (response.body != null && responseType === "text") { + return await response.text(); + } else { + const text = await response.text(); + if (text.length > 0) { + try { + let responseBody = JSON.parse(text); + return responseBody; + } catch (err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text, + }, + }; + } + } else { + return undefined; } } - return undefined; } diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts index 2f32091e..249f5176 100644 --- a/src/core/fetcher/index.ts +++ b/src/core/fetcher/index.ts @@ -1,11 +1,8 @@ export type { APIResponse } from "./APIResponse"; -export type { BinaryResponse } from "./BinaryResponse"; -export type { EndpointMetadata } from "./EndpointMetadata"; -export { EndpointSupplier } from "./EndpointSupplier"; -export type { Fetcher, FetchFunction } from "./Fetcher"; export { fetcher } from "./Fetcher"; +export type { Fetcher, FetchFunction } from "./Fetcher"; export { getHeader } from "./getHeader"; -export { HttpResponsePromise } from "./HttpResponsePromise"; -export type { RawResponse, WithRawResponse } from "./RawResponse"; -export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; export { Supplier } from "./Supplier"; +export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; +export type { RawResponse, WithRawResponse } from "./RawResponse"; +export { HttpResponsePromise } from "./HttpResponsePromise"; diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index 8788d1bb..1af42bb9 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -14,7 +14,7 @@ export const makeRequest = async ( const signals: AbortSignal[] = []; // Add timeout signal - let timeoutAbortId: NodeJS.Timeout | undefined; + let timeoutAbortId: NodeJS.Timeout | undefined = undefined; if (timeoutMs != null) { const { signal, abortId } = getTimeoutSignal(timeoutMs); timeoutAbortId = abortId; @@ -25,7 +25,7 @@ export const makeRequest = async ( if (abortSignal != null) { signals.push(abortSignal); } - const newSignals = anySignal(signals); + let newSignals = anySignal(signals); const response = await fetchFn(url, { method: method, headers, diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 3d30bd1c..add3cce0 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,55 +3,12 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter -function addPositiveJitter(delay: number): number { - // Generate a random value between 0 and +JITTER_FACTOR - const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; +function addJitter(delay: number): number { + // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR + const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; return delay * jitterMultiplier; } -function addSymmetricJitter(delay: number): number { - // Generate a random value in a JITTER_FACTOR-sized percentage range around delay - const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; - return delay * jitterMultiplier; -} - -function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { - // Check for Retry-After header first (RFC 7231), with no jitter - const retryAfter = response.headers.get("Retry-After"); - if (retryAfter) { - // Parse as number of seconds... - const retryAfterSeconds = parseInt(retryAfter, 10); - if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { - return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); - } - - // ...or as an HTTP date; both are valid - const retryAfterDate = new Date(retryAfter); - if (!Number.isNaN(retryAfterDate.getTime())) { - const delay = retryAfterDate.getTime() - Date.now(); - if (delay > 0) { - return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); - } - } - } - - // Then check for industry-standard X-RateLimit-Reset header, with positive jitter - const rateLimitReset = response.headers.get("X-RateLimit-Reset"); - if (rateLimitReset) { - const resetTime = parseInt(rateLimitReset, 10); - if (!Number.isNaN(resetTime)) { - // Assume Unix timestamp in epoch seconds - const delay = resetTime * 1000 - Date.now(); - if (delay > 0) { - return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); - } - } - } - - // Fall back to exponential backoff, with symmetric jitter - return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * 2 ** retryAttempt, MAX_RETRY_DELAY)); -} - export async function requestWithRetries( requestFn: () => Promise, maxRetries: number = DEFAULT_MAX_RETRIES, @@ -60,10 +17,13 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 429].includes(response.status) || response.status >= 500) { - // Get delay with appropriate jitter applied - const delay = getRetryDelayFromHeaders(response, i); + // Calculate base delay using exponential backoff (in milliseconds) + const baseDelay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY); + + // Add jitter to the delay + const delayWithJitter = addJitter(baseDelay); - await new Promise((resolve) => setTimeout(resolve, delay)); + await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); response = await requestFn(); } else { break; diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index aae72d2f..7d83aef2 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -1,11 +1,13 @@ import type { Writable } from "readable-stream"; -import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; -export class Node18UniversalStreamWrapper - implements - StreamWrapper | Writable | WritableStream, ReadFormat> -{ +export class Node18UniversalStreamWrapper< + ReadFormat extends Uint8Array | Uint16Array | Uint32Array, +> implements StreamWrapper< + Node18UniversalStreamWrapper | Writable | WritableStream, + ReadFormat +> { private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts index e0896d9c..23c01a1a 100644 --- a/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/NodePre18StreamWrapper.ts @@ -1,6 +1,6 @@ import type { Readable, Writable } from "readable-stream"; -import type { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; +import { EventCallback, StreamWrapper } from "./chooseStreamWrapper"; export class NodePre18StreamWrapper implements StreamWrapper { private readableStream: Readable; diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 262ac130..e5e8b680 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -1,10 +1,11 @@ -import type { StreamWrapper } from "./chooseStreamWrapper"; +import { StreamWrapper } from "./chooseStreamWrapper"; type EventCallback = (data?: any) => void; -export class UndiciStreamWrapper - implements StreamWrapper | WritableStream, ReadFormat> -{ +export class UndiciStreamWrapper implements StreamWrapper< + UndiciStreamWrapper | WritableStream, + ReadFormat +> { private readableStream: ReadableStream; private reader: ReadableStreamDefaultReader; private events: Record; diff --git a/src/core/headers.ts b/src/core/headers.ts index a723d228..561314d2 100644 --- a/src/core/headers.ts +++ b/src/core/headers.ts @@ -1,7 +1,9 @@ -export function mergeHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +import * as core from "./index.js"; + +export function mergeHeaders( + ...headersArray: (Record | undefined> | undefined)[] +): Record> { + const result: Record> = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) @@ -16,10 +18,10 @@ export function mergeHeaders( return result; } -export function mergeOnlyDefinedHeaders( - ...headersArray: (Record | null | undefined)[] -): Record { - const result: Record = {}; +export function mergeOnlyDefinedHeaders( + ...headersArray: (Record | undefined> | undefined)[] +): Record> { + const result: Record> = {}; for (const [key, value] of headersArray .filter((headers) => headers != null) diff --git a/src/core/index.ts b/src/core/index.ts index b2fa80b1..53948f45 100644 --- a/src/core/index.ts +++ b/src/core/index.ts @@ -1,6 +1,4 @@ -export * from "./auth"; -export * from "./base64"; export * from "./fetcher"; export * from "./runtime"; +export * from "./auth"; export * as serialization from "./schemas"; -export * as url from "./url"; diff --git a/src/core/schemas/Schema.ts b/src/core/schemas/Schema.ts index 57b782b0..921a1546 100644 --- a/src/core/schemas/Schema.ts +++ b/src/core/schemas/Schema.ts @@ -1,4 +1,4 @@ -import type { SchemaUtils } from "./builders/index"; +import { SchemaUtils } from "./builders"; export type Schema = BaseSchema & SchemaUtils; diff --git a/src/core/schemas/builders/bigint/bigint.ts b/src/core/schemas/builders/bigint/bigint.ts index 9d8a63d4..e69bb791 100644 --- a/src/core/schemas/builders/bigint/bigint.ts +++ b/src/core/schemas/builders/bigint/bigint.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; export function bigint(): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/date/date.ts b/src/core/schemas/builders/date/date.ts index bc507e08..b70f24b0 100644 --- a/src/core/schemas/builders/date/date.ts +++ b/src/core/schemas/builders/date/date.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; // https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime const ISO_8601_REGEX = diff --git a/src/core/schemas/builders/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts index c2c49a32..69aced6b 100644 --- a/src/core/schemas/builders/enum/enum.ts +++ b/src/core/schemas/builders/enum/enum.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/index.ts b/src/core/schemas/builders/index.ts index be23de25..65211f92 100644 --- a/src/core/schemas/builders/index.ts +++ b/src/core/schemas/builders/index.ts @@ -1,14 +1,14 @@ -export * from "./bigint/index"; -export * from "./date/index"; -export * from "./enum/index"; -export * from "./lazy/index"; -export * from "./list/index"; -export * from "./literals/index"; -export * from "./object/index"; -export * from "./object-like/index"; -export * from "./primitives/index"; -export * from "./record/index"; -export * from "./schema-utils/index"; -export * from "./set/index"; -export * from "./undiscriminated-union/index"; -export * from "./union/index"; +export * from "./bigint"; +export * from "./date"; +export * from "./enum"; +export * from "./lazy"; +export * from "./list"; +export * from "./literals"; +export * from "./object"; +export * from "./object-like"; +export * from "./primitives"; +export * from "./record"; +export * from "./schema-utils"; +export * from "./set"; +export * from "./undiscriminated-union"; +export * from "./union"; diff --git a/src/core/schemas/builders/lazy/index.ts b/src/core/schemas/builders/lazy/index.ts index 2221abd8..77420fb0 100644 --- a/src/core/schemas/builders/lazy/index.ts +++ b/src/core/schemas/builders/lazy/index.ts @@ -1,3 +1,3 @@ -export type { SchemaGetter } from "./lazy"; export { lazy } from "./lazy"; +export type { SchemaGetter } from "./lazy"; export { lazyObject } from "./lazyObject"; diff --git a/src/core/schemas/builders/lazy/lazy.ts b/src/core/schemas/builders/lazy/lazy.ts index a7273518..2962bdfe 100644 --- a/src/core/schemas/builders/lazy/lazy.ts +++ b/src/core/schemas/builders/lazy/lazy.ts @@ -1,5 +1,5 @@ -import type { BaseSchema, Schema } from "../../Schema"; -import { getSchemaUtils } from "../schema-utils/index"; +import { BaseSchema, Schema } from "../../Schema"; +import { getSchemaUtils } from "../schema-utils"; export type SchemaGetter> = () => SchemaType; diff --git a/src/core/schemas/builders/lazy/lazyObject.ts b/src/core/schemas/builders/lazy/lazyObject.ts index 2a58a2ab..d8ee6ec5 100644 --- a/src/core/schemas/builders/lazy/lazyObject.ts +++ b/src/core/schemas/builders/lazy/lazyObject.ts @@ -1,8 +1,8 @@ -import { getObjectUtils } from "../object/index"; -import type { BaseObjectSchema, ObjectSchema } from "../object/types"; -import { getObjectLikeUtils } from "../object-like/index"; -import { getSchemaUtils } from "../schema-utils/index"; -import { constructLazyBaseSchema, getMemoizedSchema, type SchemaGetter } from "./lazy"; +import { getObjectUtils } from "../object"; +import { getObjectLikeUtils } from "../object-like"; +import { BaseObjectSchema, ObjectSchema } from "../object/types"; +import { getSchemaUtils } from "../schema-utils"; +import { SchemaGetter, constructLazyBaseSchema, getMemoizedSchema } from "./lazy"; export function lazyObject(getter: SchemaGetter>): ObjectSchema { const baseSchema: BaseObjectSchema = { diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index 7c8fd6e8..a6167a5b 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -1,7 +1,7 @@ -import { type BaseSchema, type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getSchemaUtils } from "../schema-utils"; export function list(schema: Schema): Schema { const baseSchema: BaseSchema = { diff --git a/src/core/schemas/builders/literals/booleanLiteral.ts b/src/core/schemas/builders/literals/booleanLiteral.ts index fb06cc00..5c004133 100644 --- a/src/core/schemas/builders/literals/booleanLiteral.ts +++ b/src/core/schemas/builders/literals/booleanLiteral.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/literals/index.ts b/src/core/schemas/builders/literals/index.ts index ae738906..d2bf08fc 100644 --- a/src/core/schemas/builders/literals/index.ts +++ b/src/core/schemas/builders/literals/index.ts @@ -1,2 +1,2 @@ -export { booleanLiteral } from "./booleanLiteral"; export { stringLiteral } from "./stringLiteral"; +export { booleanLiteral } from "./booleanLiteral"; diff --git a/src/core/schemas/builders/literals/stringLiteral.ts b/src/core/schemas/builders/literals/stringLiteral.ts index 98fe0622..334bbdc4 100644 --- a/src/core/schemas/builders/literals/stringLiteral.ts +++ b/src/core/schemas/builders/literals/stringLiteral.ts @@ -1,4 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { Schema, SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index ed96cf77..8885586e 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -1,9 +1,9 @@ -import type { BaseSchema } from "../../Schema"; +import { BaseSchema } from "../../Schema"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { ObjectLikeSchema, ObjectLikeUtils } from "./types"; export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { diff --git a/src/core/schemas/builders/object-like/types.ts b/src/core/schemas/builders/object-like/types.ts index a8401d7c..75b36987 100644 --- a/src/core/schemas/builders/object-like/types.ts +++ b/src/core/schemas/builders/object-like/types.ts @@ -1,13 +1,11 @@ -import type { BaseSchema, Schema } from "../../Schema"; +import { BaseSchema, Schema } from "../../Schema"; export type ObjectLikeSchema = Schema & BaseSchema & ObjectLikeUtils; export interface ObjectLikeUtils { - withParsedProperties: >( - properties: { - [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); - }, - ) => ObjectLikeSchema; + withParsedProperties: >(properties: { + [K in keyof T]: T[K] | ((parsed: Parsed) => T[K]); + }) => ObjectLikeSchema; } diff --git a/src/core/schemas/builders/object/index.ts b/src/core/schemas/builders/object/index.ts index 58ce0b48..e3f4388d 100644 --- a/src/core/schemas/builders/object/index.ts +++ b/src/core/schemas/builders/object/index.ts @@ -1,11 +1,11 @@ export { getObjectUtils, object } from "./object"; +export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties"; -export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties"; -export type { Property } from "./property"; export { isProperty, property } from "./property"; +export type { Property } from "./property"; export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index c239249e..05fbca8a 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -1,4 +1,4 @@ -import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { filterObject } from "../../utils/filterObject"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; @@ -6,17 +6,17 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { partition } from "../../utils/partition"; -import { getObjectLikeUtils } from "../object-like/index"; -import { getSchemaUtils } from "../schema-utils/index"; +import { getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; import { isProperty } from "./property"; -import type { +import { BaseObjectSchema, - inferObjectSchemaFromPropertySchemas, - inferParsedObjectFromPropertySchemas, - inferRawObjectFromPropertySchemas, ObjectSchema, ObjectUtils, PropertySchemas, + inferObjectSchemaFromPropertySchemas, + inferParsedObjectFromPropertySchemas, + inferRawObjectFromPropertySchemas, } from "./types"; interface ObjectPropertyWithRawKey { diff --git a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts index bac2e1e1..ce4d3edc 100644 --- a/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts +++ b/src/core/schemas/builders/object/objectWithoutOptionalProperties.ts @@ -1,10 +1,5 @@ import { object } from "./object"; -import type { - inferParsedPropertySchema, - inferRawObjectFromPropertySchemas, - ObjectSchema, - PropertySchemas, -} from "./types"; +import { ObjectSchema, PropertySchemas, inferParsedPropertySchema, inferRawObjectFromPropertySchemas } from "./types"; export function objectWithoutOptionalProperties>( schemas: T, diff --git a/src/core/schemas/builders/object/property.ts b/src/core/schemas/builders/object/property.ts index ef07c2a7..fa9a9be8 100644 --- a/src/core/schemas/builders/object/property.ts +++ b/src/core/schemas/builders/object/property.ts @@ -1,4 +1,4 @@ -import type { Schema } from "../../Schema"; +import { Schema } from "../../Schema"; export function property( rawKey: RawKey, diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index 57f87486..b4f49c88 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -1,8 +1,8 @@ -import type { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema"; -import type { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; -import type { ObjectLikeUtils } from "../object-like/index"; -import type { SchemaUtils } from "../schema-utils/index"; -import type { Property } from "./property"; +import { BaseSchema, Schema, inferParsed, inferRaw } from "../../Schema"; +import { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties"; +import { ObjectLikeUtils } from "../object-like"; +import { SchemaUtils } from "../schema-utils"; +import { Property } from "./property"; export type ObjectSchema = BaseObjectSchema & ObjectLikeUtils & @@ -23,9 +23,8 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; +export type inferParsedObject> = + O extends ObjectSchema ? Parsed : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -47,25 +46,11 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; +export type inferRawPropertySchema

| Schema> = + P extends Property ? Raw : P extends Schema ? inferRaw

: never; -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; +export type inferParsedPropertySchema

| Schema> = + P extends Property ? Parsed : P extends Schema ? inferParsed

: never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/primitives/any.ts b/src/core/schemas/builders/primitives/any.ts index 0652f893..fcaeb042 100644 --- a/src/core/schemas/builders/primitives/any.ts +++ b/src/core/schemas/builders/primitives/any.ts @@ -1,7 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const any: () => Schema = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ - ok: true, - value, -})); +export const any = createIdentitySchemaCreator(SchemaType.ANY, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/primitives/boolean.ts b/src/core/schemas/builders/primitives/boolean.ts index d90a6924..2b559881 100644 --- a/src/core/schemas/builders/primitives/boolean.ts +++ b/src/core/schemas/builders/primitives/boolean.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const boolean: () => Schema = createIdentitySchemaCreator( +export const boolean = createIdentitySchemaCreator( SchemaType.BOOLEAN, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "boolean") { diff --git a/src/core/schemas/builders/primitives/number.ts b/src/core/schemas/builders/primitives/number.ts index 8b3b32cd..3d6be6ff 100644 --- a/src/core/schemas/builders/primitives/number.ts +++ b/src/core/schemas/builders/primitives/number.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const number: () => Schema = createIdentitySchemaCreator( +export const number = createIdentitySchemaCreator( SchemaType.NUMBER, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "number") { diff --git a/src/core/schemas/builders/primitives/string.ts b/src/core/schemas/builders/primitives/string.ts index f9f8e477..e09aceec 100644 --- a/src/core/schemas/builders/primitives/string.ts +++ b/src/core/schemas/builders/primitives/string.ts @@ -1,8 +1,8 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; -export const string: () => Schema = createIdentitySchemaCreator( +export const string = createIdentitySchemaCreator( SchemaType.STRING, (value, { breadcrumbsPrefix = [] } = {}) => { if (typeof value === "string") { diff --git a/src/core/schemas/builders/primitives/unknown.ts b/src/core/schemas/builders/primitives/unknown.ts index 41c9d770..4d524957 100644 --- a/src/core/schemas/builders/primitives/unknown.ts +++ b/src/core/schemas/builders/primitives/unknown.ts @@ -1,7 +1,4 @@ -import { type Schema, SchemaType } from "../../Schema"; +import { SchemaType } from "../../Schema"; import { createIdentitySchemaCreator } from "../../utils/createIdentitySchemaCreator"; -export const unknown: () => Schema = createIdentitySchemaCreator( - SchemaType.UNKNOWN, - (value) => ({ ok: true, value }), -); +export const unknown = createIdentitySchemaCreator(SchemaType.UNKNOWN, (value) => ({ ok: true, value })); diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index ba5307a6..eb3e9a99 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,10 @@ -import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; +import { MaybeValid, Schema, SchemaType, ValidationError } from "../../Schema"; import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { BaseRecordSchema, RecordSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { BaseRecordSchema, RecordSchema } from "./types"; export function record( keySchema: Schema, @@ -90,7 +90,7 @@ function validateAndTransformRecord 0 ? Number(stringKey) : NaN; - if (!Number.isNaN(numberKey)) { + if (!isNaN(numberKey)) { key = numberKey; } } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index b99bb9d8..fec431d4 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -1,5 +1,5 @@ -import type { BaseSchema } from "../../Schema"; -import type { SchemaUtils } from "../schema-utils/index"; +import { BaseSchema } from "../../Schema"; +import { SchemaUtils } from "../schema-utils"; export type RecordSchema< RawKey extends string | number, diff --git a/src/core/schemas/builders/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts index 7573c76b..2b89ca0e 100644 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class JsonError extends Error { diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts index f1914b59..d056eb45 100644 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; import { stringifyValidationError } from "./stringifyValidationErrors"; export class ParseError extends Error { diff --git a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts index 91381a1d..d5e7a955 100644 --- a/src/core/schemas/builders/schema-utils/getSchemaUtils.ts +++ b/src/core/schemas/builders/schema-utils/getSchemaUtils.ts @@ -1,4 +1,4 @@ -import { type BaseSchema, type Schema, type SchemaOptions, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaOptions, SchemaType } from "../../Schema"; import { JsonError } from "./JsonError"; import { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/index.ts b/src/core/schemas/builders/schema-utils/index.ts index 9d0eed7a..aa04e051 100644 --- a/src/core/schemas/builders/schema-utils/index.ts +++ b/src/core/schemas/builders/schema-utils/index.ts @@ -1,4 +1,4 @@ -export type { SchemaUtils } from "./getSchemaUtils"; export { getSchemaUtils, optional, transform } from "./getSchemaUtils"; +export type { SchemaUtils } from "./getSchemaUtils"; export { JsonError } from "./JsonError"; export { ParseError } from "./ParseError"; diff --git a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts index 1066d003..4160f0a2 100644 --- a/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts +++ b/src/core/schemas/builders/schema-utils/stringifyValidationErrors.ts @@ -1,4 +1,4 @@ -import type { ValidationError } from "../../Schema"; +import { ValidationError } from "../../Schema"; export function stringifyValidationError(error: ValidationError): string { if (error.path.length === 0) { diff --git a/src/core/schemas/builders/set/set.ts b/src/core/schemas/builders/set/set.ts index bf31bc5f..e9e6bb7e 100644 --- a/src/core/schemas/builders/set/set.ts +++ b/src/core/schemas/builders/set/set.ts @@ -1,8 +1,8 @@ -import { type BaseSchema, type Schema, SchemaType } from "../../Schema"; +import { BaseSchema, Schema, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { list } from "../list/index"; -import { getSchemaUtils } from "../schema-utils/index"; +import { list } from "../list"; +import { getSchemaUtils } from "../schema-utils"; export function set(schema: Schema): Schema> { const listSchema = list(schema); diff --git a/src/core/schemas/builders/undiscriminated-union/types.ts b/src/core/schemas/builders/undiscriminated-union/types.ts index 3ef19e2c..4f0888aa 100644 --- a/src/core/schemas/builders/undiscriminated-union/types.ts +++ b/src/core/schemas/builders/undiscriminated-union/types.ts @@ -1,4 +1,4 @@ -import type { inferParsed, inferRaw, Schema } from "../../Schema"; +import { Schema, inferParsed, inferRaw } from "../../Schema"; export type UndiscriminatedUnionSchema = Schema< inferRawUnidiscriminatedUnionSchema, diff --git a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts index 26ad5f9b..a5cf01fa 100644 --- a/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts +++ b/src/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.ts @@ -1,14 +1,7 @@ -import { - type BaseSchema, - type MaybeValid, - type Schema, - type SchemaOptions, - SchemaType, - type ValidationError, -} from "../../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType, ValidationError } from "../../Schema"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; +import { getSchemaUtils } from "../schema-utils"; +import { inferParsedUnidiscriminatedUnionSchema, inferRawUnidiscriminatedUnionSchema } from "./types"; export function undiscriminatedUnion, ...Schema[]]>( schemas: Schemas, diff --git a/src/core/schemas/builders/union/index.ts b/src/core/schemas/builders/union/index.ts index 22289b66..85fc008a 100644 --- a/src/core/schemas/builders/union/index.ts +++ b/src/core/schemas/builders/union/index.ts @@ -1,5 +1,5 @@ -export type { Discriminant } from "./discriminant"; export { discriminant } from "./discriminant"; +export type { Discriminant } from "./discriminant"; export type { inferParsedDiscriminant, inferParsedUnion, diff --git a/src/core/schemas/builders/union/types.ts b/src/core/schemas/builders/union/types.ts index 79753436..7ac9d16d 100644 --- a/src/core/schemas/builders/union/types.ts +++ b/src/core/schemas/builders/union/types.ts @@ -1,5 +1,5 @@ -import type { inferParsedObject, inferRawObject, ObjectSchema } from "../object/index"; -import type { Discriminant } from "./discriminant"; +import { ObjectSchema, inferParsedObject, inferRawObject } from "../object"; +import { Discriminant } from "./discriminant"; export type UnionSubtypes = { [K in DiscriminantValues]: ObjectSchema; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index 7da4271a..afdd5a1f 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -1,20 +1,14 @@ -import { type BaseSchema, type MaybeValid, SchemaType } from "../../Schema"; +import { BaseSchema, MaybeValid, SchemaType } from "../../Schema"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { keys } from "../../utils/keys"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; -import { enum_ } from "../enum/index"; -import type { ObjectSchema } from "../object/index"; -import { getObjectLikeUtils, type ObjectLikeSchema } from "../object-like"; -import { getSchemaUtils } from "../schema-utils/index"; -import type { Discriminant } from "./discriminant"; -import type { - inferParsedDiscriminant, - inferParsedUnion, - inferRawDiscriminant, - inferRawUnion, - UnionSubtypes, -} from "./types"; +import { enum_ } from "../enum"; +import { ObjectSchema } from "../object"; +import { ObjectLikeSchema, getObjectLikeUtils } from "../object-like"; +import { getSchemaUtils } from "../schema-utils"; +import { Discriminant } from "./discriminant"; +import { UnionSubtypes, inferParsedDiscriminant, inferParsedUnion, inferRawDiscriminant, inferRawUnion } from "./types"; export function union, U extends UnionSubtypes>( discriminant: D, diff --git a/src/core/schemas/index.ts b/src/core/schemas/index.ts index 60c0b598..5429d8b4 100644 --- a/src/core/schemas/index.ts +++ b/src/core/schemas/index.ts @@ -1,2 +1,2 @@ -export * from "./builders/index"; +export * from "./builders"; export type { inferParsed, inferRaw, Schema, SchemaOptions } from "./Schema"; diff --git a/src/core/schemas/utils/createIdentitySchemaCreator.ts b/src/core/schemas/utils/createIdentitySchemaCreator.ts index d299ada7..4db71be4 100644 --- a/src/core/schemas/utils/createIdentitySchemaCreator.ts +++ b/src/core/schemas/utils/createIdentitySchemaCreator.ts @@ -1,5 +1,5 @@ -import { getSchemaUtils } from "../builders/schema-utils/index"; -import type { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { BaseSchema, MaybeValid, Schema, SchemaOptions, SchemaType } from "../Schema"; +import { getSchemaUtils } from "../builders/schema-utils"; import { maybeSkipValidation } from "./maybeSkipValidation"; export function createIdentitySchemaCreator( diff --git a/src/core/schemas/utils/maybeSkipValidation.ts b/src/core/schemas/utils/maybeSkipValidation.ts index 70be6478..950d5f9c 100644 --- a/src/core/schemas/utils/maybeSkipValidation.ts +++ b/src/core/schemas/utils/maybeSkipValidation.ts @@ -1,4 +1,4 @@ -import type { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; +import { BaseSchema, MaybeValid, SchemaOptions } from "../Schema"; export function maybeSkipValidation, Raw, Parsed>(schema: S): S { return { @@ -15,7 +15,7 @@ function transformAndMaybeSkipValidation( const transformed = transform(value, opts); const { skipValidation = false } = opts ?? {}; if (!transformed.ok && skipValidation) { - // biome-ignore lint/suspicious/noConsole: allow console + // eslint-disable-next-line no-console console.warn( [ "Failed to validate.", diff --git a/src/core/url/encodePathParam.ts b/src/core/url/encodePathParam.ts deleted file mode 100644 index 19b90124..00000000 --- a/src/core/url/encodePathParam.ts +++ /dev/null @@ -1,18 +0,0 @@ -export function encodePathParam(param: unknown): string { - if (param === null) { - return "null"; - } - const typeofParam = typeof param; - switch (typeofParam) { - case "undefined": - return "undefined"; - case "string": - case "number": - case "boolean": - break; - default: - param = String(param); - break; - } - return encodeURIComponent(param as string | number | boolean); -} diff --git a/src/core/url/index.ts b/src/core/url/index.ts deleted file mode 100644 index 62f9123b..00000000 --- a/src/core/url/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export { encodePathParam } from "./encodePathParam"; -export { join } from "./join"; -export { toQueryString } from "./qs"; diff --git a/src/core/url/join.ts b/src/core/url/join.ts deleted file mode 100644 index b872a90a..00000000 --- a/src/core/url/join.ts +++ /dev/null @@ -1,80 +0,0 @@ -export function join(base: string, ...segments: string[]): string { - if (!base) { - return ""; - } - - if (segments.length === 0) { - return base; - } - - if (base.includes("://")) { - let url: URL; - try { - url = new URL(base); - } catch { - // Fallback to path joining if URL is malformed - return joinPath(base, ...segments); - } - - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); - - for (const segment of segments) { - const cleanSegment = trimSlashes(segment); - if (cleanSegment) { - url.pathname = joinPathSegments(url.pathname, cleanSegment); - } - } - - if (shouldPreserveTrailingSlash && !url.pathname.endsWith("/")) { - url.pathname += "/"; - } - - return url.toString(); - } - - return joinPath(base, ...segments); -} - -function joinPath(base: string, ...segments: string[]): string { - if (segments.length === 0) { - return base; - } - - let result = base; - - const lastSegment = segments[segments.length - 1]; - const shouldPreserveTrailingSlash = lastSegment?.endsWith("/"); - - for (const segment of segments) { - const cleanSegment = trimSlashes(segment); - if (cleanSegment) { - result = joinPathSegments(result, cleanSegment); - } - } - - if (shouldPreserveTrailingSlash && !result.endsWith("/")) { - result += "/"; - } - - return result; -} - -function joinPathSegments(left: string, right: string): string { - if (left.endsWith("/")) { - return left + right; - } - return `${left}/${right}`; -} - -function trimSlashes(str: string): string { - if (!str) return str; - - let start = 0; - let end = str.length; - - if (str.startsWith("/")) start = 1; - if (str.endsWith("/")) end = str.length - 1; - - return start === 0 && end === str.length ? str : str.slice(start, end); -} diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts deleted file mode 100644 index 13e89be9..00000000 --- a/src/core/url/qs.ts +++ /dev/null @@ -1,74 +0,0 @@ -interface QueryStringOptions { - arrayFormat?: "indices" | "repeat"; - encode?: boolean; -} - -const defaultQsOptions: Required = { - arrayFormat: "indices", - encode: true, -} as const; - -function encodeValue(value: unknown, shouldEncode: boolean): string { - if (value === undefined) { - return ""; - } - if (value === null) { - return ""; - } - const stringValue = String(value); - return shouldEncode ? encodeURIComponent(stringValue) : stringValue; -} - -function stringifyObject(obj: Record, prefix = "", options: Required): string[] { - const parts: string[] = []; - - for (const [key, value] of Object.entries(obj)) { - const fullKey = prefix ? `${prefix}[${key}]` : key; - - if (value === undefined) { - continue; - } - - if (Array.isArray(value)) { - if (value.length === 0) { - continue; - } - for (let i = 0; i < value.length; i++) { - const item = value[i]; - if (item === undefined) { - continue; - } - if (typeof item === "object" && !Array.isArray(item) && item !== null) { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - parts.push(...stringifyObject(item as Record, arrayKey, options)); - } else { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; - parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); - } - } - } else if (typeof value === "object" && value !== null) { - if (Object.keys(value as Record).length === 0) { - continue; - } - parts.push(...stringifyObject(value as Record, fullKey, options)); - } else { - const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; - parts.push(`${encodedKey}=${encodeValue(value, options.encode)}`); - } - } - - return parts; -} - -export function toQueryString(obj: unknown, options?: QueryStringOptions): string { - if (obj == null || typeof obj !== "object") { - return ""; - } - - const parts = stringifyObject(obj as Record, "", { - ...defaultQsOptions, - ...options, - }); - return parts.join("&"); -} diff --git a/src/environments.ts b/src/environments.ts index 844257d6..33bf50cf 100644 --- a/src/environments.ts +++ b/src/environments.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export interface WebflowEnvironmentUrls { base: string; diff --git a/src/errors/WebflowError.ts b/src/errors/WebflowError.ts index 3a1f3843..7c2de9ae 100644 --- a/src/errors/WebflowError.ts +++ b/src/errors/WebflowError.ts @@ -1,6 +1,8 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as core from "../core"; +import * as core from "../core"; import { toJson } from "../core/json"; export class WebflowError extends Error { @@ -36,7 +38,7 @@ function buildMessage({ statusCode: number | undefined; body: unknown | undefined; }): string { - const lines: string[] = []; + let lines: string[] = []; if (message != null) { lines.push(message); } diff --git a/src/errors/WebflowTimeoutError.ts b/src/errors/WebflowTimeoutError.ts index e0901513..40bd92c0 100644 --- a/src/errors/WebflowTimeoutError.ts +++ b/src/errors/WebflowTimeoutError.ts @@ -1,4 +1,6 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ export class WebflowTimeoutError extends Error { constructor(message: string) { diff --git a/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts b/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts index 22c6f9ea..273e80c3 100644 --- a/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts +++ b/src/serialization/resources/accessGroups/types/AccessGroupsListRequestSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const AccessGroupsListRequestSort: core.serialization.Schema< serializers.AccessGroupsListRequestSort.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts b/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts index 544cea0c..70145288 100644 --- a/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsCreateFolderRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const AssetsCreateFolderRequest: core.serialization.Schema< serializers.AssetsCreateFolderRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts b/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts index 221cc53d..98c2d74c 100644 --- a/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsCreateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const AssetsCreateRequest: core.serialization.Schema< serializers.AssetsCreateRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts index 6ac25a9b..d95d8d35 100644 --- a/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts +++ b/src/serialization/resources/assets/client/requests/AssetsUpdateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const AssetsUpdateRequest: core.serialization.Schema< serializers.AssetsUpdateRequest.Raw, diff --git a/src/serialization/resources/assets/client/requests/index.ts b/src/serialization/resources/assets/client/requests/index.ts index 60527e36..54ebd265 100644 --- a/src/serialization/resources/assets/client/requests/index.ts +++ b/src/serialization/resources/assets/client/requests/index.ts @@ -1,3 +1,3 @@ -export { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; export { AssetsCreateRequest } from "./AssetsCreateRequest"; export { AssetsUpdateRequest } from "./AssetsUpdateRequest"; +export { AssetsCreateFolderRequest } from "./AssetsCreateFolderRequest"; diff --git a/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts b/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts index 67bf1866..a9b6b9bc 100644 --- a/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts +++ b/src/serialization/resources/collections/client/requests/CollectionsCreateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { FieldCreate } from "../../../../types/FieldCreate"; export const CollectionsCreateRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/index.ts b/src/serialization/resources/collections/index.ts index 33a87f10..4ce0f390 100644 --- a/src/serialization/resources/collections/index.ts +++ b/src/serialization/resources/collections/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./resources"; +export * from "./client"; diff --git a/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts b/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts index 4b72790b..adfbb029 100644 --- a/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts +++ b/src/serialization/resources/collections/resources/fields/client/requests/FieldUpdate.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const FieldUpdate: core.serialization.Schema< serializers.collections.FieldUpdate.Raw, diff --git a/src/serialization/resources/collections/resources/index.ts b/src/serialization/resources/collections/resources/index.ts index db2e1bdc..2452d24a 100644 --- a/src/serialization/resources/collections/resources/index.ts +++ b/src/serialization/resources/collections/resources/index.ts @@ -1,5 +1,5 @@ +export * as items from "./items"; +export * from "./items/types"; export * as fields from "./fields"; export * from "./fields/client/requests"; -export * as items from "./items"; export * from "./items/client/requests"; -export * from "./items/types"; diff --git a/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts index b83ac3d4..ba128962 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/CreateBulkCollectionItemRequestBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CreateBulkCollectionItemRequestBodyFieldData } from "../../types/CreateBulkCollectionItemRequestBodyFieldData"; export const CreateBulkCollectionItemRequestBody: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts index a41d5922..1ca3ae62 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsLiveRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { ItemsDeleteItemsLiveRequestItemsItem } from "../../types/ItemsDeleteItemsLiveRequestItemsItem"; export const ItemsDeleteItemsLiveRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts index 8cc6653f..1863b108 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsDeleteItemsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { ItemsDeleteItemsRequestItemsItem } from "../../types/ItemsDeleteItemsRequestItemsItem"; export const ItemsDeleteItemsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts index 888ea4f5..92e07f4f 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsLiveRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; export const ItemsUpdateItemsLiveRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts index 28ecdac7..b2ab9fba 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/ItemsUpdateItemsRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { CollectionItemWithIdInput } from "../../../../../../types/CollectionItemWithIdInput"; export const ItemsUpdateItemsRequest: core.serialization.Schema< diff --git a/src/serialization/resources/collections/resources/items/client/requests/index.ts b/src/serialization/resources/collections/resources/items/client/requests/index.ts index 1db833c1..70354e75 100644 --- a/src/serialization/resources/collections/resources/items/client/requests/index.ts +++ b/src/serialization/resources/collections/resources/items/client/requests/index.ts @@ -1,5 +1,5 @@ -export { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; -export { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; export { ItemsDeleteItemsRequest } from "./ItemsDeleteItemsRequest"; -export { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; export { ItemsUpdateItemsRequest } from "./ItemsUpdateItemsRequest"; +export { ItemsDeleteItemsLiveRequest } from "./ItemsDeleteItemsLiveRequest"; +export { ItemsUpdateItemsLiveRequest } from "./ItemsUpdateItemsLiveRequest"; +export { CreateBulkCollectionItemRequestBody } from "./CreateBulkCollectionItemRequestBody"; diff --git a/src/serialization/resources/collections/resources/items/index.ts b/src/serialization/resources/collections/resources/items/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/collections/resources/items/index.ts +++ b/src/serialization/resources/collections/resources/items/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts index 2e83eb18..75bea9db 100644 --- a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldData.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; -import { CreateBulkCollectionItemRequestBodyFieldDataItem } from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; import { SingleCmsItem } from "./SingleCmsItem"; +import { CreateBulkCollectionItemRequestBodyFieldDataItem } from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; export const CreateBulkCollectionItemRequestBodyFieldData: core.serialization.Schema< serializers.collections.CreateBulkCollectionItemRequestBodyFieldData.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts index 64841788..86f617fc 100644 --- a/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts +++ b/src/serialization/resources/collections/resources/items/types/CreateBulkCollectionItemRequestBodyFieldDataItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CreateBulkCollectionItemRequestBodyFieldDataItem: core.serialization.ObjectSchema< serializers.collections.CreateBulkCollectionItemRequestBodyFieldDataItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemIDs.ts b/src/serialization/resources/collections/resources/items/types/ItemIDs.ts index c4f35bf3..f1e8e450 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemIDs.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemIDs.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemIDs: core.serialization.ObjectSchema< serializers.collections.ItemIDs.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts b/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts index 3cd12321..284a17f9 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemIDsWithLocales.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { ItemsPublishItemRequestItemsItemsItem } from "./ItemsPublishItemRequestItemsItemsItem"; export const ItemIDsWithLocales: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts index 58cf9760..489cf386 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemLiveRequestBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; import { MultipleLiveItems } from "./MultipleLiveItems"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts index 7d3a4197..f570760f 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsCreateItemRequestBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { CollectionItemPostSingle } from "../../../../../types/CollectionItemPostSingle"; import { MultipleItems } from "./MultipleItems"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts index d0753c8a..54db2b67 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsLiveRequestItemsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsDeleteItemsLiveRequestItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsDeleteItemsLiveRequestItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts index 07fc880b..6642af2f 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsDeleteItemsRequestItemsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsDeleteItemsRequestItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsDeleteItemsRequestItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts index 695cd759..54abd267 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortBy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsListItemsLiveRequestSortBy: core.serialization.Schema< serializers.collections.ItemsListItemsLiveRequestSortBy.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts index 7dcae2b1..5373cffe 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsLiveRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsListItemsLiveRequestSortOrder: core.serialization.Schema< serializers.collections.ItemsListItemsLiveRequestSortOrder.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts index 3da20a13..d85d93e3 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortBy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsListItemsRequestSortBy: core.serialization.Schema< serializers.collections.ItemsListItemsRequestSortBy.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts index 3f6e1606..ab399b53 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsListItemsRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsListItemsRequestSortOrder: core.serialization.Schema< serializers.collections.ItemsListItemsRequestSortOrder.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts index b418dc06..d792a450 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { ItemIDs } from "./ItemIDs"; import { ItemIDsWithLocales } from "./ItemIDsWithLocales"; diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts index 561c7e90..761d5469 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemRequestItemsItemsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsPublishItemRequestItemsItemsItem: core.serialization.ObjectSchema< serializers.collections.ItemsPublishItemRequestItemsItemsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts index 9e4d4c42..29994807 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const ItemsPublishItemResponse: core.serialization.ObjectSchema< serializers.collections.ItemsPublishItemResponse.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts b/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts index cd681549..426375fc 100644 --- a/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts +++ b/src/serialization/resources/collections/resources/items/types/ItemsUpdateItemsResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; import { CollectionItemList } from "../../../../../types/CollectionItemList"; diff --git a/src/serialization/resources/collections/resources/items/types/MultipleItems.ts b/src/serialization/resources/collections/resources/items/types/MultipleItems.ts index a9b60927..c4e98048 100644 --- a/src/serialization/resources/collections/resources/items/types/MultipleItems.ts +++ b/src/serialization/resources/collections/resources/items/types/MultipleItems.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { CollectionItemPostSingle } from "../../../../../types/CollectionItemPostSingle"; export const MultipleItems: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts b/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts index d6b19ce5..33f9bf01 100644 --- a/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts +++ b/src/serialization/resources/collections/resources/items/types/MultipleLiveItems.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; import { CollectionItem } from "../../../../../types/CollectionItem"; export const MultipleLiveItems: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts b/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts index d1d43a05..366e8d1e 100644 --- a/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts +++ b/src/serialization/resources/collections/resources/items/types/SingleCmsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const SingleCmsItem: core.serialization.ObjectSchema< serializers.collections.SingleCmsItem.Raw, diff --git a/src/serialization/resources/collections/resources/items/types/index.ts b/src/serialization/resources/collections/resources/items/types/index.ts index 423ca368..92acdcb3 100644 --- a/src/serialization/resources/collections/resources/items/types/index.ts +++ b/src/serialization/resources/collections/resources/items/types/index.ts @@ -1,19 +1,19 @@ -export * from "./CreateBulkCollectionItemRequestBodyFieldData"; -export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; -export * from "./ItemIDs"; -export * from "./ItemIDsWithLocales"; -export * from "./ItemsCreateItemLiveRequestBody"; +export * from "./ItemsListItemsRequestSortBy"; +export * from "./ItemsListItemsRequestSortOrder"; +export * from "./MultipleItems"; export * from "./ItemsCreateItemRequestBody"; -export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./ItemsDeleteItemsRequestItemsItem"; +export * from "./ItemsUpdateItemsResponse"; export * from "./ItemsListItemsLiveRequestSortBy"; export * from "./ItemsListItemsLiveRequestSortOrder"; -export * from "./ItemsListItemsRequestSortBy"; -export * from "./ItemsListItemsRequestSortOrder"; -export * from "./ItemsPublishItemRequest"; -export * from "./ItemsPublishItemRequestItemsItemsItem"; -export * from "./ItemsPublishItemResponse"; -export * from "./ItemsUpdateItemsResponse"; -export * from "./MultipleItems"; export * from "./MultipleLiveItems"; +export * from "./ItemsCreateItemLiveRequestBody"; +export * from "./ItemsDeleteItemsLiveRequestItemsItem"; export * from "./SingleCmsItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldDataItem"; +export * from "./CreateBulkCollectionItemRequestBodyFieldData"; +export * from "./ItemIDs"; +export * from "./ItemsPublishItemRequestItemsItemsItem"; +export * from "./ItemIDsWithLocales"; +export * from "./ItemsPublishItemRequest"; +export * from "./ItemsPublishItemResponse"; diff --git a/src/serialization/resources/components/client/requests/ComponentDomWrite.ts b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts index f8a828ac..71ec0033 100644 --- a/src/serialization/resources/components/client/requests/ComponentDomWrite.ts +++ b/src/serialization/resources/components/client/requests/ComponentDomWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ComponentDomWriteNodesItem } from "../../types/ComponentDomWriteNodesItem"; export const ComponentDomWrite: core.serialization.Schema< diff --git a/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts index 8b5b50fe..aca78c09 100644 --- a/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts +++ b/src/serialization/resources/components/client/requests/ComponentPropertiesWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { ComponentPropertiesWritePropertiesItem } from "../../types/ComponentPropertiesWritePropertiesItem"; export const ComponentPropertiesWrite: core.serialization.Schema< diff --git a/src/serialization/resources/components/index.ts b/src/serialization/resources/components/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/components/index.ts +++ b/src/serialization/resources/components/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts index 5eb74e5f..b26c150f 100644 --- a/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts +++ b/src/serialization/resources/components/types/ComponentDomWriteNodesItem.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; -import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; import { Select } from "../../../types/Select"; -import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; -import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; +import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; export const ComponentDomWriteNodesItem: core.serialization.Schema< serializers.ComponentDomWriteNodesItem.Raw, diff --git a/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts index a34ed53e..c101100b 100644 --- a/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts +++ b/src/serialization/resources/components/types/ComponentPropertiesWritePropertiesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const ComponentPropertiesWritePropertiesItem: core.serialization.ObjectSchema< serializers.ComponentPropertiesWritePropertiesItem.Raw, diff --git a/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts index 8a65923a..d664736a 100644 --- a/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts +++ b/src/serialization/resources/components/types/ComponentsUpdateContentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const ComponentsUpdateContentResponse: core.serialization.ObjectSchema< serializers.ComponentsUpdateContentResponse.Raw, diff --git a/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts index 6abec8dd..65d0b158 100644 --- a/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts +++ b/src/serialization/resources/components/types/ComponentsUpdatePropertiesResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const ComponentsUpdatePropertiesResponse: core.serialization.ObjectSchema< serializers.ComponentsUpdatePropertiesResponse.Raw, diff --git a/src/serialization/resources/components/types/index.ts b/src/serialization/resources/components/types/index.ts index d72e3728..1bdf297c 100644 --- a/src/serialization/resources/components/types/index.ts +++ b/src/serialization/resources/components/types/index.ts @@ -1,4 +1,4 @@ export * from "./ComponentDomWriteNodesItem"; -export * from "./ComponentPropertiesWritePropertiesItem"; export * from "./ComponentsUpdateContentResponse"; +export * from "./ComponentPropertiesWritePropertiesItem"; export * from "./ComponentsUpdatePropertiesResponse"; diff --git a/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index 9289cf55..d64e58c1 100644 --- a/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/serialization/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const FormsUpdateSubmissionRequest: core.serialization.Schema< serializers.FormsUpdateSubmissionRequest.Raw, diff --git a/src/serialization/resources/index.ts b/src/serialization/resources/index.ts index 4a47a0db..dbcf7a65 100644 --- a/src/serialization/resources/index.ts +++ b/src/serialization/resources/index.ts @@ -1,32 +1,32 @@ -export * as accessGroups from "./accessGroups"; -export * from "./accessGroups/types"; -export * as assets from "./assets"; -export * from "./assets/client/requests"; -export * as collections from "./collections"; -export * from "./collections/client/requests"; +export * as sites from "./sites"; +export * from "./sites/types"; +export * as pages from "./pages"; +export * from "./pages/types"; export * as components from "./components"; -export * from "./components/client/requests"; export * from "./components/types"; -export * as forms from "./forms"; -export * from "./forms/client/requests"; -export * as inventory from "./inventory"; -export * from "./inventory/client/requests"; -export * from "./inventory/types"; +export * as users from "./users"; +export * from "./users/types"; +export * as accessGroups from "./accessGroups"; +export * from "./accessGroups/types"; +export * as products from "./products"; +export * from "./products/types"; export * as orders from "./orders"; -export * from "./orders/client/requests"; export * from "./orders/types"; -export * as pages from "./pages"; +export * as inventory from "./inventory"; +export * from "./inventory/types"; +export * as collections from "./collections"; +export * as workspaces from "./workspaces"; +export * from "./sites/client/requests"; +export * from "./collections/client/requests"; export * from "./pages/client/requests"; -export * from "./pages/types"; -export * as products from "./products"; -export * from "./products/client/requests"; -export * from "./products/types"; +export * from "./components/client/requests"; export * as scripts from "./scripts"; export * from "./scripts/client/requests"; -export * as sites from "./sites"; -export * from "./sites/client/requests"; -export * from "./sites/types"; -export * as users from "./users"; +export * as assets from "./assets"; +export * from "./assets/client/requests"; +export * as forms from "./forms"; +export * from "./forms/client/requests"; export * from "./users/client/requests"; -export * from "./users/types"; -export * as workspaces from "./workspaces"; +export * from "./products/client/requests"; +export * from "./orders/client/requests"; +export * from "./inventory/client/requests"; diff --git a/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts b/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts index f3c965cc..c54efef5 100644 --- a/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts +++ b/src/serialization/resources/inventory/client/requests/InventoryUpdateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { InventoryUpdateRequestInventoryType } from "../../types/InventoryUpdateRequestInventoryType"; export const InventoryUpdateRequest: core.serialization.Schema< diff --git a/src/serialization/resources/inventory/index.ts b/src/serialization/resources/inventory/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/inventory/index.ts +++ b/src/serialization/resources/inventory/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts b/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts index 948b36c4..0ca81bd6 100644 --- a/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts +++ b/src/serialization/resources/inventory/types/EcommInventoryChangedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { InventoryItem } from "../../../types/InventoryItem"; export const EcommInventoryChangedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts b/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts index 3fc0d8f6..260d366c 100644 --- a/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts +++ b/src/serialization/resources/inventory/types/InventoryUpdateRequestInventoryType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const InventoryUpdateRequestInventoryType: core.serialization.Schema< serializers.InventoryUpdateRequestInventoryType.Raw, diff --git a/src/serialization/resources/inventory/types/index.ts b/src/serialization/resources/inventory/types/index.ts index f48b48ca..a225550f 100644 --- a/src/serialization/resources/inventory/types/index.ts +++ b/src/serialization/resources/inventory/types/index.ts @@ -1,2 +1,2 @@ -export * from "./EcommInventoryChangedPayload"; export * from "./InventoryUpdateRequestInventoryType"; +export * from "./EcommInventoryChangedPayload"; diff --git a/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts b/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts index aca8b9d5..971bffcb 100644 --- a/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersRefundRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { OrdersRefundRequestReason } from "../../types/OrdersRefundRequestReason"; export const OrdersRefundRequest: core.serialization.Schema< diff --git a/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts b/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts index dad38fc8..a87f7ed6 100644 --- a/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersUpdateFulfillRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const OrdersUpdateFulfillRequest: core.serialization.Schema< serializers.OrdersUpdateFulfillRequest.Raw, diff --git a/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts b/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts index 25dad88e..30d1daed 100644 --- a/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts +++ b/src/serialization/resources/orders/client/requests/OrdersUpdateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const OrdersUpdateRequest: core.serialization.Schema< serializers.OrdersUpdateRequest.Raw, diff --git a/src/serialization/resources/orders/client/requests/index.ts b/src/serialization/resources/orders/client/requests/index.ts index f40362bb..18ba18f8 100644 --- a/src/serialization/resources/orders/client/requests/index.ts +++ b/src/serialization/resources/orders/client/requests/index.ts @@ -1,3 +1,3 @@ -export { OrdersRefundRequest } from "./OrdersRefundRequest"; -export { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; export { OrdersUpdateRequest } from "./OrdersUpdateRequest"; +export { OrdersUpdateFulfillRequest } from "./OrdersUpdateFulfillRequest"; +export { OrdersRefundRequest } from "./OrdersRefundRequest"; diff --git a/src/serialization/resources/orders/index.ts b/src/serialization/resources/orders/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/orders/index.ts +++ b/src/serialization/resources/orders/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/orders/types/OrdersListRequestStatus.ts b/src/serialization/resources/orders/types/OrdersListRequestStatus.ts index a05da95d..f1dcd801 100644 --- a/src/serialization/resources/orders/types/OrdersListRequestStatus.ts +++ b/src/serialization/resources/orders/types/OrdersListRequestStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const OrdersListRequestStatus: core.serialization.Schema< serializers.OrdersListRequestStatus.Raw, diff --git a/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts b/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts index c7277254..0dcafad1 100644 --- a/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts +++ b/src/serialization/resources/orders/types/OrdersRefundRequestReason.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const OrdersRefundRequestReason: core.serialization.Schema< serializers.OrdersRefundRequestReason.Raw, diff --git a/src/serialization/resources/pages/client/requests/PageDomWrite.ts b/src/serialization/resources/pages/client/requests/PageDomWrite.ts index 2d0c8979..01d8cc2f 100644 --- a/src/serialization/resources/pages/client/requests/PageDomWrite.ts +++ b/src/serialization/resources/pages/client/requests/PageDomWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { PageDomWriteNodesItem } from "../../types/PageDomWriteNodesItem"; export const PageDomWrite: core.serialization.Schema< diff --git a/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts b/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts index 02e29c28..62a18c26 100644 --- a/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts +++ b/src/serialization/resources/pages/client/requests/PageMetadataWrite.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { PageMetadataWriteOpenGraph } from "../../types/PageMetadataWriteOpenGraph"; import { PageMetadataWriteSeo } from "../../types/PageMetadataWriteSeo"; +import { PageMetadataWriteOpenGraph } from "../../types/PageMetadataWriteOpenGraph"; export const PageMetadataWrite: core.serialization.Schema< serializers.PageMetadataWrite.Raw, diff --git a/src/serialization/resources/pages/client/requests/index.ts b/src/serialization/resources/pages/client/requests/index.ts index 8633cf29..9bebff04 100644 --- a/src/serialization/resources/pages/client/requests/index.ts +++ b/src/serialization/resources/pages/client/requests/index.ts @@ -1,2 +1,2 @@ -export { PageDomWrite } from "./PageDomWrite"; export { PageMetadataWrite } from "./PageMetadataWrite"; +export { PageDomWrite } from "./PageDomWrite"; diff --git a/src/serialization/resources/pages/index.ts b/src/serialization/resources/pages/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/pages/index.ts +++ b/src/serialization/resources/pages/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts index 65db5715..e6c3c944 100644 --- a/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts +++ b/src/serialization/resources/pages/types/PageDomWriteNodesItem.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; +import { TextNodeWrite } from "../../../types/TextNodeWrite"; import { ComponentInstanceNodePropertyOverridesWrite } from "../../../types/ComponentInstanceNodePropertyOverridesWrite"; -import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; import { Select } from "../../../types/Select"; -import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; import { TextInputNodeWrite } from "../../../types/TextInputNodeWrite"; -import { TextNodeWrite } from "../../../types/TextNodeWrite"; +import { SubmitButtonNodeWrite } from "../../../types/SubmitButtonNodeWrite"; +import { SearchButtonNodeWrite } from "../../../types/SearchButtonNodeWrite"; export const PageDomWriteNodesItem: core.serialization.Schema< serializers.PageDomWriteNodesItem.Raw, diff --git a/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts b/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts index 51949d7e..39bb91f1 100644 --- a/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts +++ b/src/serialization/resources/pages/types/PageMetadataWriteOpenGraph.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const PageMetadataWriteOpenGraph: core.serialization.ObjectSchema< serializers.PageMetadataWriteOpenGraph.Raw, diff --git a/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts b/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts index 4ba81fb3..925d84ea 100644 --- a/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts +++ b/src/serialization/resources/pages/types/PageMetadataWriteSeo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const PageMetadataWriteSeo: core.serialization.ObjectSchema< serializers.PageMetadataWriteSeo.Raw, diff --git a/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts b/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts index 3c17710f..df1f81f3 100644 --- a/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts +++ b/src/serialization/resources/pages/types/UpdateStaticContentResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const UpdateStaticContentResponse: core.serialization.ObjectSchema< serializers.UpdateStaticContentResponse.Raw, diff --git a/src/serialization/resources/pages/types/index.ts b/src/serialization/resources/pages/types/index.ts index f2f4beb2..9fecb32e 100644 --- a/src/serialization/resources/pages/types/index.ts +++ b/src/serialization/resources/pages/types/index.ts @@ -1,4 +1,4 @@ -export * from "./PageDomWriteNodesItem"; -export * from "./PageMetadataWriteOpenGraph"; export * from "./PageMetadataWriteSeo"; +export * from "./PageMetadataWriteOpenGraph"; +export * from "./PageDomWriteNodesItem"; export * from "./UpdateStaticContentResponse"; diff --git a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts index 6f32b2d6..6a03ccbb 100644 --- a/src/serialization/resources/products/client/requests/ProductSkuCreate.ts +++ b/src/serialization/resources/products/client/requests/ProductSkuCreate.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { ProductSkuCreateProduct } from "../../types/ProductSkuCreateProduct"; import { ProductSkuCreateSku } from "../../types/ProductSkuCreateSku"; diff --git a/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts b/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts index 7d1f48b7..27efda47 100644 --- a/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts +++ b/src/serialization/resources/products/client/requests/ProductSkuUpdate.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; -import { Product } from "../../../../types/Product"; import { PublishStatus } from "../../../../types/PublishStatus"; +import { Product } from "../../../../types/Product"; import { Sku } from "../../../../types/Sku"; export const ProductSkuUpdate: core.serialization.Schema = diff --git a/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts b/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts index b7f3ea1f..c9f275db 100644 --- a/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts +++ b/src/serialization/resources/products/client/requests/ProductsCreateSkuRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { Sku } from "../../../../types/Sku"; diff --git a/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts b/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts index 7329e44e..4a05dc69 100644 --- a/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts +++ b/src/serialization/resources/products/client/requests/ProductsUpdateSkuRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; import { PublishStatus } from "../../../../types/PublishStatus"; import { Sku } from "../../../../types/Sku"; diff --git a/src/serialization/resources/products/index.ts b/src/serialization/resources/products/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/products/index.ts +++ b/src/serialization/resources/products/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/products/types/ProductSkuCreateProduct.ts b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts index 47675b5e..8b88d2e9 100644 --- a/src/serialization/resources/products/types/ProductSkuCreateProduct.ts +++ b/src/serialization/resources/products/types/ProductSkuCreateProduct.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { ProductFieldData } from "../../../types/ProductFieldData"; export const ProductSkuCreateProduct: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/products/types/ProductSkuCreateSku.ts b/src/serialization/resources/products/types/ProductSkuCreateSku.ts index 570195be..7bf5f95b 100644 --- a/src/serialization/resources/products/types/ProductSkuCreateSku.ts +++ b/src/serialization/resources/products/types/ProductSkuCreateSku.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { SkuFieldData } from "../../../types/SkuFieldData"; export const ProductSkuCreateSku: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts index 2a112efd..a562379c 100644 --- a/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts +++ b/src/serialization/resources/products/types/ProductsCreateSkuResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { Sku } from "../../../types/Sku"; export const ProductsCreateSkuResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts b/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts index cf048e85..b893f4eb 100644 --- a/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts +++ b/src/serialization/resources/scripts/client/requests/CustomCodeHostedRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CustomCodeHostedRequest: core.serialization.Schema< serializers.CustomCodeHostedRequest.Raw, diff --git a/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts b/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts index 73e18732..2052a553 100644 --- a/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts +++ b/src/serialization/resources/scripts/client/requests/CustomCodeInlineRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const CustomCodeInlineRequest: core.serialization.Schema< serializers.CustomCodeInlineRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts index 62596f32..bed8836d 100644 --- a/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesCreateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const SitesCreateRequest: core.serialization.Schema< serializers.SitesCreateRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts b/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts index 8cb1612c..ff467a89 100644 --- a/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesPublishRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const SitesPublishRequest: core.serialization.Schema< serializers.SitesPublishRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts index deb7afdf..838d8455 100644 --- a/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts +++ b/src/serialization/resources/sites/client/requests/SitesUpdateRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const SitesUpdateRequest: core.serialization.Schema< serializers.SitesUpdateRequest.Raw, diff --git a/src/serialization/resources/sites/client/requests/index.ts b/src/serialization/resources/sites/client/requests/index.ts index 0ce9c8d8..1a807906 100644 --- a/src/serialization/resources/sites/client/requests/index.ts +++ b/src/serialization/resources/sites/client/requests/index.ts @@ -1,3 +1,3 @@ export { SitesCreateRequest } from "./SitesCreateRequest"; -export { SitesPublishRequest } from "./SitesPublishRequest"; export { SitesUpdateRequest } from "./SitesUpdateRequest"; +export { SitesPublishRequest } from "./SitesPublishRequest"; diff --git a/src/serialization/resources/sites/index.ts b/src/serialization/resources/sites/index.ts index fb00ab43..a931b363 100644 --- a/src/serialization/resources/sites/index.ts +++ b/src/serialization/resources/sites/index.ts @@ -1,3 +1,3 @@ -export * from "./client"; -export * from "./resources"; export * from "./types"; +export * from "./resources"; +export * from "./client"; diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts index 4fbf07b8..4bfd02d0 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortBy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsGetCommentThreadRequestSortBy: core.serialization.Schema< serializers.sites.CommentsGetCommentThreadRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts index 2bbc3297..04f43e62 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsGetCommentThreadRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsGetCommentThreadRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsGetCommentThreadRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts index 9f9f8b55..1bb5f3e9 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortBy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsListCommentRepliesRequestSortBy: core.serialization.Schema< serializers.sites.CommentsListCommentRepliesRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts index 98ddd0a1..9163ca20 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentRepliesRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsListCommentRepliesRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsListCommentRepliesRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts index 6a7ff17a..da330041 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortBy.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsListCommentThreadsRequestSortBy: core.serialization.Schema< serializers.sites.CommentsListCommentThreadsRequestSortBy.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts index f49e4a18..9f2e751e 100644 --- a/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts +++ b/src/serialization/resources/sites/resources/comments/types/CommentsListCommentThreadsRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const CommentsListCommentThreadsRequestSortOrder: core.serialization.Schema< serializers.sites.CommentsListCommentThreadsRequestSortOrder.Raw, diff --git a/src/serialization/resources/sites/resources/comments/types/index.ts b/src/serialization/resources/sites/resources/comments/types/index.ts index b2ed8e9b..0d2c5090 100644 --- a/src/serialization/resources/sites/resources/comments/types/index.ts +++ b/src/serialization/resources/sites/resources/comments/types/index.ts @@ -1,6 +1,6 @@ +export * from "./CommentsListCommentThreadsRequestSortBy"; +export * from "./CommentsListCommentThreadsRequestSortOrder"; export * from "./CommentsGetCommentThreadRequestSortBy"; export * from "./CommentsGetCommentThreadRequestSortOrder"; export * from "./CommentsListCommentRepliesRequestSortBy"; export * from "./CommentsListCommentRepliesRequestSortOrder"; -export * from "./CommentsListCommentThreadsRequestSortBy"; -export * from "./CommentsListCommentThreadsRequestSortOrder"; diff --git a/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts b/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts index 668ef58c..d2975c47 100644 --- a/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts +++ b/src/serialization/resources/sites/resources/forms/client/requests/FormsUpdateSubmissionRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const FormsUpdateSubmissionRequest: core.serialization.Schema< serializers.sites.FormsUpdateSubmissionRequest.Raw, diff --git a/src/serialization/resources/sites/resources/index.ts b/src/serialization/resources/sites/resources/index.ts index fbc66e1d..6feaa6ba 100644 --- a/src/serialization/resources/sites/resources/index.ts +++ b/src/serialization/resources/sites/resources/index.ts @@ -1,7 +1,7 @@ +export * as wellKnown from "./wellKnown"; +export * from "./wellKnown/types"; export * as comments from "./comments"; export * from "./comments/types"; +export * from "./wellKnown/client/requests"; export * as forms from "./forms"; export * from "./forms/client/requests"; -export * as wellKnown from "./wellKnown"; -export * from "./wellKnown/client/requests"; -export * from "./wellKnown/types"; diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts index 6d070a7c..0f9f14db 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownDeleteRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; export const WellKnownDeleteRequest: core.serialization.Schema< serializers.sites.WellKnownDeleteRequest.Raw, diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts index 68d8c1c0..3357d6b3 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/WellKnownFile.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../../api/index"; +import * as serializers from "../../../../../../index"; +import * as Webflow from "../../../../../../../api/index"; import * as core from "../../../../../../../core"; -import type * as serializers from "../../../../../../index"; import { WellKnownFileContentType } from "../../types/WellKnownFileContentType"; export const WellKnownFile: core.serialization.Schema< diff --git a/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts index 600ad068..64acd63b 100644 --- a/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts +++ b/src/serialization/resources/sites/resources/wellKnown/client/requests/index.ts @@ -1,2 +1,2 @@ -export { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; export { WellKnownFile } from "./WellKnownFile"; +export { WellKnownDeleteRequest } from "./WellKnownDeleteRequest"; diff --git a/src/serialization/resources/sites/resources/wellKnown/index.ts b/src/serialization/resources/sites/resources/wellKnown/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/sites/resources/wellKnown/index.ts +++ b/src/serialization/resources/sites/resources/wellKnown/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts index f1f3c649..02fc2bfe 100644 --- a/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts +++ b/src/serialization/resources/sites/resources/wellKnown/types/WellKnownFileContentType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const WellKnownFileContentType: core.serialization.Schema< serializers.sites.WellKnownFileContentType.Raw, diff --git a/src/serialization/resources/sites/types/SitesPublishResponse.ts b/src/serialization/resources/sites/types/SitesPublishResponse.ts index f0589df6..cc634504 100644 --- a/src/serialization/resources/sites/types/SitesPublishResponse.ts +++ b/src/serialization/resources/sites/types/SitesPublishResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { Domain } from "../../../types/Domain"; export const SitesPublishResponse: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/client/requests/UsersInviteRequest.ts b/src/serialization/resources/users/client/requests/UsersInviteRequest.ts index 937a3d1d..cd4ea653 100644 --- a/src/serialization/resources/users/client/requests/UsersInviteRequest.ts +++ b/src/serialization/resources/users/client/requests/UsersInviteRequest.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../api/index"; +import * as serializers from "../../../../index"; +import * as Webflow from "../../../../../api/index"; import * as core from "../../../../../core"; -import type * as serializers from "../../../../index"; export const UsersInviteRequest: core.serialization.Schema< serializers.UsersInviteRequest.Raw, diff --git a/src/serialization/resources/users/index.ts b/src/serialization/resources/users/index.ts index d2ec2302..c9240f83 100644 --- a/src/serialization/resources/users/index.ts +++ b/src/serialization/resources/users/index.ts @@ -1,2 +1,2 @@ -export * from "./client"; export * from "./types"; +export * from "./client"; diff --git a/src/serialization/resources/users/types/UserAccountAddedPayload.ts b/src/serialization/resources/users/types/UserAccountAddedPayload.ts index 6f742927..1d82484b 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { UserAccountAddedPayloadPayload } from "./UserAccountAddedPayloadPayload"; export const UserAccountAddedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts index ddc6fa26..aea444b8 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayloadPayload.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; -import { UserStatus } from "../../../types/UserStatus"; import { UserAccountAddedPayloadPayloadData } from "./UserAccountAddedPayloadPayloadData"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; export const UserAccountAddedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountAddedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts index 6802d035..0590ec01 100644 --- a/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountAddedPayloadPayloadData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const UserAccountAddedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountAddedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayload.ts b/src/serialization/resources/users/types/UserAccountDeletedPayload.ts index 0f8bca78..5f5c7a6a 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { UserAccountDeletedPayloadPayload } from "./UserAccountDeletedPayloadPayload"; export const UserAccountDeletedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts index de75d2c6..722f726e 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayload.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; -import { UserStatus } from "../../../types/UserStatus"; import { UserAccountDeletedPayloadPayloadData } from "./UserAccountDeletedPayloadPayloadData"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; export const UserAccountDeletedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountDeletedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts index 238c6710..21a4156e 100644 --- a/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountDeletedPayloadPayloadData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const UserAccountDeletedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountDeletedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts index c0b2a577..3a1a87d2 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; import { UserAccountUpdatedPayloadPayload } from "./UserAccountUpdatedPayloadPayload"; export const UserAccountUpdatedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts index 88bdde1a..d07675a2 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayload.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; -import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; -import { UserStatus } from "../../../types/UserStatus"; import { UserAccountUpdatedPayloadPayloadData } from "./UserAccountUpdatedPayloadPayloadData"; +import { UserStatus } from "../../../types/UserStatus"; +import { UserAccessGroupsItem } from "../../../types/UserAccessGroupsItem"; export const UserAccountUpdatedPayloadPayload: core.serialization.ObjectSchema< serializers.UserAccountUpdatedPayloadPayload.Raw, diff --git a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts index 42a481fd..ecb5998c 100644 --- a/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts +++ b/src/serialization/resources/users/types/UserAccountUpdatedPayloadPayloadData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const UserAccountUpdatedPayloadPayloadData: core.serialization.ObjectSchema< serializers.UserAccountUpdatedPayloadPayloadData.Raw, diff --git a/src/serialization/resources/users/types/UsersListRequestSort.ts b/src/serialization/resources/users/types/UsersListRequestSort.ts index 6c687d52..54e734ff 100644 --- a/src/serialization/resources/users/types/UsersListRequestSort.ts +++ b/src/serialization/resources/users/types/UsersListRequestSort.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../api/index"; +import * as serializers from "../../../index"; +import * as Webflow from "../../../../api/index"; import * as core from "../../../../core"; -import type * as serializers from "../../../index"; export const UsersListRequestSort: core.serialization.Schema< serializers.UsersListRequestSort.Raw, diff --git a/src/serialization/resources/users/types/index.ts b/src/serialization/resources/users/types/index.ts index 38625be7..258617f4 100644 --- a/src/serialization/resources/users/types/index.ts +++ b/src/serialization/resources/users/types/index.ts @@ -1,10 +1,10 @@ -export * from "./UserAccountAddedPayload"; -export * from "./UserAccountAddedPayloadPayload"; +export * from "./UsersListRequestSort"; export * from "./UserAccountAddedPayloadPayloadData"; -export * from "./UserAccountDeletedPayload"; -export * from "./UserAccountDeletedPayloadPayload"; -export * from "./UserAccountDeletedPayloadPayloadData"; -export * from "./UserAccountUpdatedPayload"; -export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountAddedPayloadPayload"; +export * from "./UserAccountAddedPayload"; export * from "./UserAccountUpdatedPayloadPayloadData"; -export * from "./UsersListRequestSort"; +export * from "./UserAccountUpdatedPayloadPayload"; +export * from "./UserAccountUpdatedPayload"; +export * from "./UserAccountDeletedPayloadPayloadData"; +export * from "./UserAccountDeletedPayloadPayload"; +export * from "./UserAccountDeletedPayload"; diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts index c6826f67..85417093 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestEventType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const AuditLogsGetWorkspaceAuditLogsRequestEventType: core.serialization.Schema< serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestEventType.Raw, diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts index d24aab0a..2866b8e0 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/AuditLogsGetWorkspaceAuditLogsRequestSortOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../../../../../api/index"; +import * as serializers from "../../../../../index"; +import * as Webflow from "../../../../../../api/index"; import * as core from "../../../../../../core"; -import type * as serializers from "../../../../../index"; export const AuditLogsGetWorkspaceAuditLogsRequestSortOrder: core.serialization.Schema< serializers.workspaces.AuditLogsGetWorkspaceAuditLogsRequestSortOrder.Raw, diff --git a/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts b/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts index 41fb105c..cfaf464d 100644 --- a/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts +++ b/src/serialization/resources/workspaces/resources/auditLogs/types/index.ts @@ -1,2 +1,2 @@ -export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; export * from "./AuditLogsGetWorkspaceAuditLogsRequestSortOrder"; +export * from "./AuditLogsGetWorkspaceAuditLogsRequestEventType"; diff --git a/src/serialization/types/AccessGroup.ts b/src/serialization/types/AccessGroup.ts index 64b74c06..a468c49d 100644 --- a/src/serialization/types/AccessGroup.ts +++ b/src/serialization/types/AccessGroup.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AccessGroup: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AccessGroupList.ts b/src/serialization/types/AccessGroupList.ts index fd104194..c2f27df0 100644 --- a/src/serialization/types/AccessGroupList.ts +++ b/src/serialization/types/AccessGroupList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AccessGroup } from "./AccessGroup"; export const AccessGroupList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/Application.ts b/src/serialization/types/Application.ts index 06f1b581..5a705ef6 100644 --- a/src/serialization/types/Application.ts +++ b/src/serialization/types/Application.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Application: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Asset.ts b/src/serialization/types/Asset.ts index 3c9b0b10..da74fc7d 100644 --- a/src/serialization/types/Asset.ts +++ b/src/serialization/types/Asset.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AssetVariant } from "./AssetVariant"; export const Asset: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AssetFolder.ts b/src/serialization/types/AssetFolder.ts index 5229d922..67f88d4c 100644 --- a/src/serialization/types/AssetFolder.ts +++ b/src/serialization/types/AssetFolder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AssetFolder: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AssetFolderList.ts b/src/serialization/types/AssetFolderList.ts index 6b585bca..5ba02b2b 100644 --- a/src/serialization/types/AssetFolderList.ts +++ b/src/serialization/types/AssetFolderList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AssetFolder } from "./AssetFolder"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/AssetUpload.ts b/src/serialization/types/AssetUpload.ts index 8eb9929e..0fe1c171 100644 --- a/src/serialization/types/AssetUpload.ts +++ b/src/serialization/types/AssetUpload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AssetUploadUploadDetails } from "./AssetUploadUploadDetails"; export const AssetUpload: core.serialization.ObjectSchema = diff --git a/src/serialization/types/AssetUploadUploadDetails.ts b/src/serialization/types/AssetUploadUploadDetails.ts index 3f8c0ade..2207ea67 100644 --- a/src/serialization/types/AssetUploadUploadDetails.ts +++ b/src/serialization/types/AssetUploadUploadDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AssetUploadUploadDetails: core.serialization.ObjectSchema< serializers.AssetUploadUploadDetails.Raw, diff --git a/src/serialization/types/AssetVariant.ts b/src/serialization/types/AssetVariant.ts index 1110ed0d..85fee020 100644 --- a/src/serialization/types/AssetVariant.ts +++ b/src/serialization/types/AssetVariant.ts @@ -1,30 +1,32 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AssetVariant: core.serialization.ObjectSchema = core.serialization.object({ - hostedUrl: core.serialization.string().optional(), - originalFileName: core.serialization.string().optional(), - displayName: core.serialization.string().optional(), - format: core.serialization.string().optional(), - width: core.serialization.number().optional(), + hostedUrl: core.serialization.string(), + originalFileName: core.serialization.string(), + displayName: core.serialization.string(), + format: core.serialization.string(), + width: core.serialization.number(), height: core.serialization.number().optional(), - quality: core.serialization.number().optional(), + quality: core.serialization.number(), error: core.serialization.string().optional(), }); export declare namespace AssetVariant { export interface Raw { - hostedUrl?: string | null; - originalFileName?: string | null; - displayName?: string | null; - format?: string | null; - width?: number | null; + hostedUrl: string; + originalFileName: string; + displayName: string; + format: string; + width: number; height?: number | null; - quality?: number | null; + quality: number; error?: string | null; } } diff --git a/src/serialization/types/Assets.ts b/src/serialization/types/Assets.ts index 0a34543f..14196a1d 100644 --- a/src/serialization/types/Assets.ts +++ b/src/serialization/types/Assets.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Asset } from "./Asset"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Authorization.ts b/src/serialization/types/Authorization.ts index 0c0f0cbf..c1bf5990 100644 --- a/src/serialization/types/Authorization.ts +++ b/src/serialization/types/Authorization.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Application } from "./Application"; import { AuthorizationAuthorization } from "./AuthorizationAuthorization"; +import { Application } from "./Application"; export const Authorization: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/AuthorizationAuthorization.ts b/src/serialization/types/AuthorizationAuthorization.ts index cbbd2997..232124c1 100644 --- a/src/serialization/types/AuthorizationAuthorization.ts +++ b/src/serialization/types/AuthorizationAuthorization.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { AuthorizationAuthorizationAuthorizedTo } from "./AuthorizationAuthorizationAuthorizedTo"; export const AuthorizationAuthorization: core.serialization.ObjectSchema< diff --git a/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts b/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts index 36e431cb..abcfa91f 100644 --- a/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts +++ b/src/serialization/types/AuthorizationAuthorizationAuthorizedTo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AuthorizationAuthorizationAuthorizedTo: core.serialization.ObjectSchema< serializers.AuthorizationAuthorizationAuthorizedTo.Raw, diff --git a/src/serialization/types/AuthorizedUser.ts b/src/serialization/types/AuthorizedUser.ts index 25c505c6..55607dbb 100644 --- a/src/serialization/types/AuthorizedUser.ts +++ b/src/serialization/types/AuthorizedUser.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const AuthorizedUser: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/BadRequestErrorBody.ts b/src/serialization/types/BadRequestErrorBody.ts index 5617c9cf..a37fbb21 100644 --- a/src/serialization/types/BadRequestErrorBody.ts +++ b/src/serialization/types/BadRequestErrorBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvalidDomain } from "./InvalidDomain"; import { NoDomains } from "./NoDomains"; diff --git a/src/serialization/types/BulkCollectionItem.ts b/src/serialization/types/BulkCollectionItem.ts index 00f73fd2..f84884e8 100644 --- a/src/serialization/types/BulkCollectionItem.ts +++ b/src/serialization/types/BulkCollectionItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { BulkCollectionItemFieldData } from "./BulkCollectionItemFieldData"; export const BulkCollectionItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/BulkCollectionItemFieldData.ts b/src/serialization/types/BulkCollectionItemFieldData.ts index 9c69f648..267c676a 100644 --- a/src/serialization/types/BulkCollectionItemFieldData.ts +++ b/src/serialization/types/BulkCollectionItemFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const BulkCollectionItemFieldData: core.serialization.ObjectSchema< serializers.BulkCollectionItemFieldData.Raw, diff --git a/src/serialization/types/Collection.ts b/src/serialization/types/Collection.ts index 9e3b601b..9075f7d3 100644 --- a/src/serialization/types/Collection.ts +++ b/src/serialization/types/Collection.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Field } from "./Field"; export const Collection: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionItem.ts b/src/serialization/types/CollectionItem.ts index ef999b2c..b744b3b0 100644 --- a/src/serialization/types/CollectionItem.ts +++ b/src/serialization/types/CollectionItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemFieldData } from "./CollectionItemFieldData"; export const CollectionItem: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionItemChanged.ts b/src/serialization/types/CollectionItemChanged.ts index ba6295e8..93bad748 100644 --- a/src/serialization/types/CollectionItemChanged.ts +++ b/src/serialization/types/CollectionItemChanged.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SingleLocaleCreatedPayload } from "./SingleLocaleCreatedPayload"; export const CollectionItemChanged: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemCreated.ts b/src/serialization/types/CollectionItemCreated.ts index 3aefef03..0d508596 100644 --- a/src/serialization/types/CollectionItemCreated.ts +++ b/src/serialization/types/CollectionItemCreated.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SingleLocaleCreatedPayload } from "./SingleLocaleCreatedPayload"; export const CollectionItemCreated: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemFieldData.ts b/src/serialization/types/CollectionItemFieldData.ts index 905a3bee..387dbaaa 100644 --- a/src/serialization/types/CollectionItemFieldData.ts +++ b/src/serialization/types/CollectionItemFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemFieldData: core.serialization.ObjectSchema< serializers.CollectionItemFieldData.Raw, diff --git a/src/serialization/types/CollectionItemList.ts b/src/serialization/types/CollectionItemList.ts index e807f1c9..475bcbb6 100644 --- a/src/serialization/types/CollectionItemList.ts +++ b/src/serialization/types/CollectionItemList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItem } from "./CollectionItem"; import { CollectionItemListPagination } from "./CollectionItemListPagination"; diff --git a/src/serialization/types/CollectionItemListNoPagination.ts b/src/serialization/types/CollectionItemListNoPagination.ts index f83766ce..80bc4d76 100644 --- a/src/serialization/types/CollectionItemListNoPagination.ts +++ b/src/serialization/types/CollectionItemListNoPagination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItem } from "./CollectionItem"; export const CollectionItemListNoPagination: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemListPagination.ts b/src/serialization/types/CollectionItemListPagination.ts index 8dc8ed53..840a77ad 100644 --- a/src/serialization/types/CollectionItemListPagination.ts +++ b/src/serialization/types/CollectionItemListPagination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemListPagination: core.serialization.ObjectSchema< serializers.CollectionItemListPagination.Raw, diff --git a/src/serialization/types/CollectionItemPatchSingle.ts b/src/serialization/types/CollectionItemPatchSingle.ts index b5a48041..401794ec 100644 --- a/src/serialization/types/CollectionItemPatchSingle.ts +++ b/src/serialization/types/CollectionItemPatchSingle.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemPatchSingleFieldData } from "./CollectionItemPatchSingleFieldData"; export const CollectionItemPatchSingle: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemPatchSingleFieldData.ts b/src/serialization/types/CollectionItemPatchSingleFieldData.ts index 1f524cf1..17aef009 100644 --- a/src/serialization/types/CollectionItemPatchSingleFieldData.ts +++ b/src/serialization/types/CollectionItemPatchSingleFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemPatchSingleFieldData: core.serialization.ObjectSchema< serializers.CollectionItemPatchSingleFieldData.Raw, diff --git a/src/serialization/types/CollectionItemPostSingle.ts b/src/serialization/types/CollectionItemPostSingle.ts index 0ff73f6f..7991fcb6 100644 --- a/src/serialization/types/CollectionItemPostSingle.ts +++ b/src/serialization/types/CollectionItemPostSingle.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemPostSingleFieldData } from "./CollectionItemPostSingleFieldData"; export const CollectionItemPostSingle: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemPostSingleFieldData.ts b/src/serialization/types/CollectionItemPostSingleFieldData.ts index 3f8542c4..a5125e94 100644 --- a/src/serialization/types/CollectionItemPostSingleFieldData.ts +++ b/src/serialization/types/CollectionItemPostSingleFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemPostSingleFieldData: core.serialization.ObjectSchema< serializers.CollectionItemPostSingleFieldData.Raw, diff --git a/src/serialization/types/CollectionItemPublished.ts b/src/serialization/types/CollectionItemPublished.ts index 794ad685..dd096d58 100644 --- a/src/serialization/types/CollectionItemPublished.ts +++ b/src/serialization/types/CollectionItemPublished.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Payload } from "./Payload"; export const CollectionItemPublished: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemoved.ts b/src/serialization/types/CollectionItemRemoved.ts index d7ab7e89..e5320343 100644 --- a/src/serialization/types/CollectionItemRemoved.ts +++ b/src/serialization/types/CollectionItemRemoved.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemRemovedPayload } from "./CollectionItemRemovedPayload"; export const CollectionItemRemoved: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemovedPayload.ts b/src/serialization/types/CollectionItemRemovedPayload.ts index 91912f2b..a9c07d47 100644 --- a/src/serialization/types/CollectionItemRemovedPayload.ts +++ b/src/serialization/types/CollectionItemRemovedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemRemovedPayloadFieldData } from "./CollectionItemRemovedPayloadFieldData"; export const CollectionItemRemovedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts b/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts index 4eba5773..9bf7296c 100644 --- a/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts +++ b/src/serialization/types/CollectionItemRemovedPayloadFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemRemovedPayloadFieldData: core.serialization.ObjectSchema< serializers.CollectionItemRemovedPayloadFieldData.Raw, diff --git a/src/serialization/types/CollectionItemUnpublished.ts b/src/serialization/types/CollectionItemUnpublished.ts index 4f1a4d9a..384b1f28 100644 --- a/src/serialization/types/CollectionItemUnpublished.ts +++ b/src/serialization/types/CollectionItemUnpublished.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemUnpublishedPayload } from "./CollectionItemUnpublishedPayload"; export const CollectionItemUnpublished: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemUnpublishedPayload.ts b/src/serialization/types/CollectionItemUnpublishedPayload.ts index 62fb4a1d..2c3c9f63 100644 --- a/src/serialization/types/CollectionItemUnpublishedPayload.ts +++ b/src/serialization/types/CollectionItemUnpublishedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemUnpublishedPayloadFieldData } from "./CollectionItemUnpublishedPayloadFieldData"; export const CollectionItemUnpublishedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts b/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts index fffffa28..8bcfc545 100644 --- a/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts +++ b/src/serialization/types/CollectionItemUnpublishedPayloadFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemUnpublishedPayloadFieldData: core.serialization.ObjectSchema< serializers.CollectionItemUnpublishedPayloadFieldData.Raw, diff --git a/src/serialization/types/CollectionItemWithIdInput.ts b/src/serialization/types/CollectionItemWithIdInput.ts index d40e2e55..5bb61e20 100644 --- a/src/serialization/types/CollectionItemWithIdInput.ts +++ b/src/serialization/types/CollectionItemWithIdInput.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionItemWithIdInputFieldData } from "./CollectionItemWithIdInputFieldData"; export const CollectionItemWithIdInput: core.serialization.ObjectSchema< diff --git a/src/serialization/types/CollectionItemWithIdInputFieldData.ts b/src/serialization/types/CollectionItemWithIdInputFieldData.ts index d59e0709..e3af0be8 100644 --- a/src/serialization/types/CollectionItemWithIdInputFieldData.ts +++ b/src/serialization/types/CollectionItemWithIdInputFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionItemWithIdInputFieldData: core.serialization.ObjectSchema< serializers.CollectionItemWithIdInputFieldData.Raw, diff --git a/src/serialization/types/CollectionList.ts b/src/serialization/types/CollectionList.ts index e8d6c763..6dc49a6f 100644 --- a/src/serialization/types/CollectionList.ts +++ b/src/serialization/types/CollectionList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CollectionListArrayItem } from "./CollectionListArrayItem"; export const CollectionList: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CollectionListArrayItem.ts b/src/serialization/types/CollectionListArrayItem.ts index 6bd8ebfd..2acdf4d0 100644 --- a/src/serialization/types/CollectionListArrayItem.ts +++ b/src/serialization/types/CollectionListArrayItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CollectionListArrayItem: core.serialization.ObjectSchema< serializers.CollectionListArrayItem.Raw, diff --git a/src/serialization/types/Comment.ts b/src/serialization/types/Comment.ts index f4708692..cfe42f0c 100644 --- a/src/serialization/types/Comment.ts +++ b/src/serialization/types/Comment.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentPayload } from "./CommentPayload"; export const Comment: core.serialization.ObjectSchema = diff --git a/src/serialization/types/CommentPayload.ts b/src/serialization/types/CommentPayload.ts index 5bbda6da..0e7d17ef 100644 --- a/src/serialization/types/CommentPayload.ts +++ b/src/serialization/types/CommentPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentPayloadAuthor } from "./CommentPayloadAuthor"; import { CommentPayloadMentionedUsersItem } from "./CommentPayloadMentionedUsersItem"; diff --git a/src/serialization/types/CommentPayloadAuthor.ts b/src/serialization/types/CommentPayloadAuthor.ts index 716f6b96..27533914 100644 --- a/src/serialization/types/CommentPayloadAuthor.ts +++ b/src/serialization/types/CommentPayloadAuthor.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentPayloadAuthor: core.serialization.ObjectSchema< serializers.CommentPayloadAuthor.Raw, diff --git a/src/serialization/types/CommentPayloadMentionedUsersItem.ts b/src/serialization/types/CommentPayloadMentionedUsersItem.ts index 020d18c6..c7b383c8 100644 --- a/src/serialization/types/CommentPayloadMentionedUsersItem.ts +++ b/src/serialization/types/CommentPayloadMentionedUsersItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentPayloadMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentPayloadMentionedUsersItem.Raw, diff --git a/src/serialization/types/CommentReply.ts b/src/serialization/types/CommentReply.ts index 9d39797c..5e8c0c18 100644 --- a/src/serialization/types/CommentReply.ts +++ b/src/serialization/types/CommentReply.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentReplyAuthor } from "./CommentReplyAuthor"; import { CommentReplyMentionedUsersItem } from "./CommentReplyMentionedUsersItem"; diff --git a/src/serialization/types/CommentReplyAuthor.ts b/src/serialization/types/CommentReplyAuthor.ts index 2274b523..d27aad58 100644 --- a/src/serialization/types/CommentReplyAuthor.ts +++ b/src/serialization/types/CommentReplyAuthor.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentReplyAuthor: core.serialization.ObjectSchema< serializers.CommentReplyAuthor.Raw, diff --git a/src/serialization/types/CommentReplyList.ts b/src/serialization/types/CommentReplyList.ts index 30952023..b06554ac 100644 --- a/src/serialization/types/CommentReplyList.ts +++ b/src/serialization/types/CommentReplyList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentReply } from "./CommentReply"; import { CommentReplyListPagination } from "./CommentReplyListPagination"; diff --git a/src/serialization/types/CommentReplyListPagination.ts b/src/serialization/types/CommentReplyListPagination.ts index 151251e6..162c6ee0 100644 --- a/src/serialization/types/CommentReplyListPagination.ts +++ b/src/serialization/types/CommentReplyListPagination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentReplyListPagination: core.serialization.ObjectSchema< serializers.CommentReplyListPagination.Raw, diff --git a/src/serialization/types/CommentReplyMentionedUsersItem.ts b/src/serialization/types/CommentReplyMentionedUsersItem.ts index 930dfa29..9428f294 100644 --- a/src/serialization/types/CommentReplyMentionedUsersItem.ts +++ b/src/serialization/types/CommentReplyMentionedUsersItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentReplyMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentReplyMentionedUsersItem.Raw, diff --git a/src/serialization/types/CommentThread.ts b/src/serialization/types/CommentThread.ts index d9efd1f1..858a4782 100644 --- a/src/serialization/types/CommentThread.ts +++ b/src/serialization/types/CommentThread.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentThreadAuthor } from "./CommentThreadAuthor"; import { CommentThreadMentionedUsersItem } from "./CommentThreadMentionedUsersItem"; diff --git a/src/serialization/types/CommentThreadAuthor.ts b/src/serialization/types/CommentThreadAuthor.ts index af16553b..9f7b9439 100644 --- a/src/serialization/types/CommentThreadAuthor.ts +++ b/src/serialization/types/CommentThreadAuthor.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentThreadAuthor: core.serialization.ObjectSchema< serializers.CommentThreadAuthor.Raw, diff --git a/src/serialization/types/CommentThreadList.ts b/src/serialization/types/CommentThreadList.ts index c9fb99fe..4ebc968b 100644 --- a/src/serialization/types/CommentThreadList.ts +++ b/src/serialization/types/CommentThreadList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CommentThread } from "./CommentThread"; import { CommentThreadListPagination } from "./CommentThreadListPagination"; diff --git a/src/serialization/types/CommentThreadListPagination.ts b/src/serialization/types/CommentThreadListPagination.ts index b054373f..4f4d85be 100644 --- a/src/serialization/types/CommentThreadListPagination.ts +++ b/src/serialization/types/CommentThreadListPagination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentThreadListPagination: core.serialization.ObjectSchema< serializers.CommentThreadListPagination.Raw, diff --git a/src/serialization/types/CommentThreadMentionedUsersItem.ts b/src/serialization/types/CommentThreadMentionedUsersItem.ts index dba8924c..6867e9a6 100644 --- a/src/serialization/types/CommentThreadMentionedUsersItem.ts +++ b/src/serialization/types/CommentThreadMentionedUsersItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CommentThreadMentionedUsersItem: core.serialization.ObjectSchema< serializers.CommentThreadMentionedUsersItem.Raw, diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts index 9763fe40..fb8ce0b7 100644 --- a/src/serialization/types/Component.ts +++ b/src/serialization/types/Component.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Component: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ComponentDom.ts b/src/serialization/types/ComponentDom.ts index 38e207af..b46b6d96 100644 --- a/src/serialization/types/ComponentDom.ts +++ b/src/serialization/types/ComponentDom.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Node } from "./Node"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts index fb762386..b8c3596b 100644 --- a/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem } from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; export const ComponentInstanceNodePropertyOverridesWrite: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts index 34c069ef..25f155f6 100644 --- a/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts +++ b/src/serialization/types/ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem: core.serialization.ObjectSchema< serializers.ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem.Raw, diff --git a/src/serialization/types/ComponentList.ts b/src/serialization/types/ComponentList.ts index 7adb4c2e..00d800e8 100644 --- a/src/serialization/types/ComponentList.ts +++ b/src/serialization/types/ComponentList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Component } from "./Component"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentNode.ts b/src/serialization/types/ComponentNode.ts index e9603f99..ac0e54c9 100644 --- a/src/serialization/types/ComponentNode.ts +++ b/src/serialization/types/ComponentNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ComponentProperty } from "./ComponentProperty"; export const ComponentNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ComponentProperties.ts b/src/serialization/types/ComponentProperties.ts index 6fee89bf..ab8038a5 100644 --- a/src/serialization/types/ComponentProperties.ts +++ b/src/serialization/types/ComponentProperties.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ComponentProperty } from "./ComponentProperty"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/ComponentProperty.ts b/src/serialization/types/ComponentProperty.ts index c0fce8d6..fc1fa626 100644 --- a/src/serialization/types/ComponentProperty.ts +++ b/src/serialization/types/ComponentProperty.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ComponentPropertyType } from "./ComponentPropertyType"; import { Text } from "./Text"; diff --git a/src/serialization/types/ComponentPropertyType.ts b/src/serialization/types/ComponentPropertyType.ts index 654a85ae..808cd3b5 100644 --- a/src/serialization/types/ComponentPropertyType.ts +++ b/src/serialization/types/ComponentPropertyType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ComponentPropertyType: core.serialization.Schema< serializers.ComponentPropertyType.Raw, diff --git a/src/serialization/types/Conflict.ts b/src/serialization/types/Conflict.ts index f2c8a2bf..5ba4873e 100644 --- a/src/serialization/types/Conflict.ts +++ b/src/serialization/types/Conflict.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Conflict: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/ConflictErrorBody.ts b/src/serialization/types/ConflictErrorBody.ts index cce5bdcc..11c1161e 100644 --- a/src/serialization/types/ConflictErrorBody.ts +++ b/src/serialization/types/ConflictErrorBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { DuplicateUserEmail } from "./DuplicateUserEmail"; import { UserLimitReached } from "./UserLimitReached"; diff --git a/src/serialization/types/CustomCodeBlock.ts b/src/serialization/types/CustomCodeBlock.ts index 6b7d0d03..fe5d22c2 100644 --- a/src/serialization/types/CustomCodeBlock.ts +++ b/src/serialization/types/CustomCodeBlock.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomCodeBlockType } from "./CustomCodeBlockType"; import { Scripts } from "./Scripts"; +import { ScriptApply } from "./ScriptApply"; export const CustomCodeBlock: core.serialization.ObjectSchema< serializers.CustomCodeBlock.Raw, diff --git a/src/serialization/types/CustomCodeBlockType.ts b/src/serialization/types/CustomCodeBlockType.ts index 076a7a20..19189c8b 100644 --- a/src/serialization/types/CustomCodeBlockType.ts +++ b/src/serialization/types/CustomCodeBlockType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomCodeBlockType: core.serialization.Schema< serializers.CustomCodeBlockType.Raw, diff --git a/src/serialization/types/CustomCodeHostedResponse.ts b/src/serialization/types/CustomCodeHostedResponse.ts index 78e81122..a03b60d3 100644 --- a/src/serialization/types/CustomCodeHostedResponse.ts +++ b/src/serialization/types/CustomCodeHostedResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomCodeHostedResponse: core.serialization.ObjectSchema< serializers.CustomCodeHostedResponse.Raw, diff --git a/src/serialization/types/CustomCodeInlineResponse.ts b/src/serialization/types/CustomCodeInlineResponse.ts index be9f6997..3e2fe040 100644 --- a/src/serialization/types/CustomCodeInlineResponse.ts +++ b/src/serialization/types/CustomCodeInlineResponse.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomCodeInlineResponse: core.serialization.ObjectSchema< serializers.CustomCodeInlineResponse.Raw, diff --git a/src/serialization/types/CustomRole.ts b/src/serialization/types/CustomRole.ts index 1fa03c7d..d0383251 100644 --- a/src/serialization/types/CustomRole.ts +++ b/src/serialization/types/CustomRole.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomRole: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/CustomRoleAuditLogItem.ts b/src/serialization/types/CustomRoleAuditLogItem.ts index 3b2b4755..400d6e07 100644 --- a/src/serialization/types/CustomRoleAuditLogItem.ts +++ b/src/serialization/types/CustomRoleAuditLogItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { CustomRole } from "./CustomRole"; import { CustomRoleAuditLogItemEventSubType } from "./CustomRoleAuditLogItemEventSubType"; +import { CustomRole } from "./CustomRole"; export const CustomRoleAuditLogItem: core.serialization.ObjectSchema< serializers.CustomRoleAuditLogItem.Raw, diff --git a/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts b/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts index 13dcb460..1c7f4925 100644 --- a/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts +++ b/src/serialization/types/CustomRoleAuditLogItemEventSubType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const CustomRoleAuditLogItemEventSubType: core.serialization.Schema< serializers.CustomRoleAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/Dom.ts b/src/serialization/types/Dom.ts index a9b09d23..1e9191ca 100644 --- a/src/serialization/types/Dom.ts +++ b/src/serialization/types/Dom.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Node } from "./Node"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Domain.ts b/src/serialization/types/Domain.ts index a8fdd430..8e1db208 100644 --- a/src/serialization/types/Domain.ts +++ b/src/serialization/types/Domain.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Domain: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Domains.ts b/src/serialization/types/Domains.ts index f1adf425..945ae35c 100644 --- a/src/serialization/types/Domains.ts +++ b/src/serialization/types/Domains.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Domain } from "./Domain"; export const Domains: core.serialization.ObjectSchema = diff --git a/src/serialization/types/DuplicateUserEmail.ts b/src/serialization/types/DuplicateUserEmail.ts index 1e930a19..2444c7b0 100644 --- a/src/serialization/types/DuplicateUserEmail.ts +++ b/src/serialization/types/DuplicateUserEmail.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const DuplicateUserEmail: core.serialization.Schema< serializers.DuplicateUserEmail.Raw, diff --git a/src/serialization/types/EcommerceSettings.ts b/src/serialization/types/EcommerceSettings.ts index 4c62c909..f3a702b2 100644 --- a/src/serialization/types/EcommerceSettings.ts +++ b/src/serialization/types/EcommerceSettings.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const EcommerceSettings: core.serialization.ObjectSchema< serializers.EcommerceSettings.Raw, diff --git a/src/serialization/types/ErrorCode.ts b/src/serialization/types/ErrorCode.ts index 36e3fe74..3f389c28 100644 --- a/src/serialization/types/ErrorCode.ts +++ b/src/serialization/types/ErrorCode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ErrorCode: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/Error_.ts b/src/serialization/types/Error_.ts index cfc822dc..1f0b2f9a 100644 --- a/src/serialization/types/Error_.ts +++ b/src/serialization/types/Error_.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ErrorCode } from "./ErrorCode"; export const Error_: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Field.ts b/src/serialization/types/Field.ts index bc0393f1..5ff572c2 100644 --- a/src/serialization/types/Field.ts +++ b/src/serialization/types/Field.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FieldType } from "./FieldType"; import { FieldValidations } from "./FieldValidations"; diff --git a/src/serialization/types/FieldCreate.ts b/src/serialization/types/FieldCreate.ts index 77024f79..1de23f4f 100644 --- a/src/serialization/types/FieldCreate.ts +++ b/src/serialization/types/FieldCreate.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { StaticField } from "./StaticField"; import { OptionField } from "./OptionField"; import { ReferenceField } from "./ReferenceField"; -import { StaticField } from "./StaticField"; export const FieldCreate: core.serialization.Schema = core.serialization.undiscriminatedUnion([StaticField, OptionField, ReferenceField]); diff --git a/src/serialization/types/FieldType.ts b/src/serialization/types/FieldType.ts index 16357cf0..cf674fc2 100644 --- a/src/serialization/types/FieldType.ts +++ b/src/serialization/types/FieldType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FieldType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/FieldValidations.ts b/src/serialization/types/FieldValidations.ts index 5728014c..37080409 100644 --- a/src/serialization/types/FieldValidations.ts +++ b/src/serialization/types/FieldValidations.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FieldValidationsAdditionalProperties } from "./FieldValidationsAdditionalProperties"; export const FieldValidations: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FieldValidationsAdditionalProperties.ts b/src/serialization/types/FieldValidationsAdditionalProperties.ts index 4331fb42..a1f33741 100644 --- a/src/serialization/types/FieldValidationsAdditionalProperties.ts +++ b/src/serialization/types/FieldValidationsAdditionalProperties.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FieldValidationsAdditionalPropertiesAdditionalProperties } from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; export const FieldValidationsAdditionalProperties: core.serialization.Schema< diff --git a/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts b/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts index 0fb06eaa..8d75dec8 100644 --- a/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts +++ b/src/serialization/types/FieldValidationsAdditionalPropertiesAdditionalProperties.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FieldValidationsAdditionalPropertiesAdditionalProperties: core.serialization.ObjectSchema< serializers.FieldValidationsAdditionalPropertiesAdditionalProperties.Raw, diff --git a/src/serialization/types/ForbiddenErrorBody.ts b/src/serialization/types/ForbiddenErrorBody.ts index 40c3c7bc..32edae7e 100644 --- a/src/serialization/types/ForbiddenErrorBody.ts +++ b/src/serialization/types/ForbiddenErrorBody.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InvalidScopes } from "./InvalidScopes"; import { UsersNotEnabled } from "./UsersNotEnabled"; diff --git a/src/serialization/types/Form.ts b/src/serialization/types/Form.ts index 795e8ed0..ae0ecbcc 100644 --- a/src/serialization/types/Form.ts +++ b/src/serialization/types/Form.ts @@ -1,10 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormField } from "./FormField"; import { FormResponseSettings } from "./FormResponseSettings"; +import { FormFieldValue } from "./FormFieldValue"; export const Form: core.serialization.ObjectSchema = core.serialization.object({ displayName: core.serialization.string().optional(), diff --git a/src/serialization/types/FormField.ts b/src/serialization/types/FormField.ts index a6f10222..b6691873 100644 --- a/src/serialization/types/FormField.ts +++ b/src/serialization/types/FormField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormFieldValue } from "./FormFieldValue"; export const FormField: core.serialization.Schema = diff --git a/src/serialization/types/FormFieldValue.ts b/src/serialization/types/FormFieldValue.ts index 4fc03633..62894755 100644 --- a/src/serialization/types/FormFieldValue.ts +++ b/src/serialization/types/FormFieldValue.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormFieldValueType } from "./FormFieldValueType"; export const FormFieldValue: core.serialization.ObjectSchema = diff --git a/src/serialization/types/FormFieldValueType.ts b/src/serialization/types/FormFieldValueType.ts index 4ecb9a5d..898f16de 100644 --- a/src/serialization/types/FormFieldValueType.ts +++ b/src/serialization/types/FormFieldValueType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FormFieldValueType: core.serialization.Schema< serializers.FormFieldValueType.Raw, diff --git a/src/serialization/types/FormList.ts b/src/serialization/types/FormList.ts index fdc54d82..cc171f16 100644 --- a/src/serialization/types/FormList.ts +++ b/src/serialization/types/FormList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Form } from "./Form"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/FormResponseSettings.ts b/src/serialization/types/FormResponseSettings.ts index 1ef9ebc8..0b6f3f6f 100644 --- a/src/serialization/types/FormResponseSettings.ts +++ b/src/serialization/types/FormResponseSettings.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FormResponseSettings: core.serialization.ObjectSchema< serializers.FormResponseSettings.Raw, diff --git a/src/serialization/types/FormSubmission.ts b/src/serialization/types/FormSubmission.ts index d091353d..f56e5948 100644 --- a/src/serialization/types/FormSubmission.ts +++ b/src/serialization/types/FormSubmission.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FormSubmission: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/FormSubmissionList.ts b/src/serialization/types/FormSubmissionList.ts index faedc5a9..4628143b 100644 --- a/src/serialization/types/FormSubmissionList.ts +++ b/src/serialization/types/FormSubmissionList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormSubmission } from "./FormSubmission"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/FormSubmissionTrigger.ts b/src/serialization/types/FormSubmissionTrigger.ts index 82e415d4..57cdd891 100644 --- a/src/serialization/types/FormSubmissionTrigger.ts +++ b/src/serialization/types/FormSubmissionTrigger.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormSubmissionTriggerPayload } from "./FormSubmissionTriggerPayload"; export const FormSubmissionTrigger: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayload.ts b/src/serialization/types/FormSubmissionTriggerPayload.ts index e0e7f9a9..8613025a 100644 --- a/src/serialization/types/FormSubmissionTriggerPayload.ts +++ b/src/serialization/types/FormSubmissionTriggerPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormSubmissionTriggerPayloadSchemaItem } from "./FormSubmissionTriggerPayloadSchemaItem"; export const FormSubmissionTriggerPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts index 65cc474f..b7e170e3 100644 --- a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts +++ b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { FormSubmissionTriggerPayloadSchemaItemFieldType } from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; export const FormSubmissionTriggerPayloadSchemaItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts index c1d2faf7..d9d3915c 100644 --- a/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts +++ b/src/serialization/types/FormSubmissionTriggerPayloadSchemaItemFieldType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const FormSubmissionTriggerPayloadSchemaItemFieldType: core.serialization.Schema< serializers.FormSubmissionTriggerPayloadSchemaItemFieldType.Raw, diff --git a/src/serialization/types/ImageNode.ts b/src/serialization/types/ImageNode.ts index 5b03ec57..a95eb1b7 100644 --- a/src/serialization/types/ImageNode.ts +++ b/src/serialization/types/ImageNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ImageNodeImage } from "./ImageNodeImage"; export const ImageNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ImageNodeImage.ts b/src/serialization/types/ImageNodeImage.ts index e0e2c933..ef4340f4 100644 --- a/src/serialization/types/ImageNodeImage.ts +++ b/src/serialization/types/ImageNodeImage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ImageNodeImage: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/InvalidDomain.ts b/src/serialization/types/InvalidDomain.ts index 6bacd931..ad4832a8 100644 --- a/src/serialization/types/InvalidDomain.ts +++ b/src/serialization/types/InvalidDomain.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvalidDomain: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/InvalidScopes.ts b/src/serialization/types/InvalidScopes.ts index 5e0e0a6a..e33b236f 100644 --- a/src/serialization/types/InvalidScopes.ts +++ b/src/serialization/types/InvalidScopes.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InvalidScopes: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/InventoryItem.ts b/src/serialization/types/InventoryItem.ts index 05beae46..8c04d934 100644 --- a/src/serialization/types/InventoryItem.ts +++ b/src/serialization/types/InventoryItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { InventoryItemInventoryType } from "./InventoryItemInventoryType"; export const InventoryItem: core.serialization.ObjectSchema = diff --git a/src/serialization/types/InventoryItemInventoryType.ts b/src/serialization/types/InventoryItemInventoryType.ts index 26dbaf75..6509ef29 100644 --- a/src/serialization/types/InventoryItemInventoryType.ts +++ b/src/serialization/types/InventoryItemInventoryType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const InventoryItemInventoryType: core.serialization.Schema< serializers.InventoryItemInventoryType.Raw, diff --git a/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts b/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts index 65fbf435..1389d533 100644 --- a/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts +++ b/src/serialization/types/ItemsListItemsLiveRequestLastPublished.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ItemsListItemsLiveRequestLastPublished: core.serialization.ObjectSchema< serializers.ItemsListItemsLiveRequestLastPublished.Raw, diff --git a/src/serialization/types/ItemsListItemsRequestLastPublished.ts b/src/serialization/types/ItemsListItemsRequestLastPublished.ts index 0df27009..c15212f3 100644 --- a/src/serialization/types/ItemsListItemsRequestLastPublished.ts +++ b/src/serialization/types/ItemsListItemsRequestLastPublished.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ItemsListItemsRequestLastPublished: core.serialization.ObjectSchema< serializers.ItemsListItemsRequestLastPublished.Raw, diff --git a/src/serialization/types/ListCustomCodeBlocks.ts b/src/serialization/types/ListCustomCodeBlocks.ts index 7ecdbde4..a08eeb41 100644 --- a/src/serialization/types/ListCustomCodeBlocks.ts +++ b/src/serialization/types/ListCustomCodeBlocks.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomCodeBlock } from "./CustomCodeBlock"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Locale.ts b/src/serialization/types/Locale.ts index 8c3b4f99..4c65e9f9 100644 --- a/src/serialization/types/Locale.ts +++ b/src/serialization/types/Locale.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Locale: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Locales.ts b/src/serialization/types/Locales.ts index b12738b7..331b2369 100644 --- a/src/serialization/types/Locales.ts +++ b/src/serialization/types/Locales.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Locale } from "./Locale"; export const Locales: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Metadata.ts b/src/serialization/types/Metadata.ts index 59a82bd7..b5718a3d 100644 --- a/src/serialization/types/Metadata.ts +++ b/src/serialization/types/Metadata.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { MetadataOptionsItem } from "./MetadataOptionsItem"; export const Metadata: core.serialization.ObjectSchema = diff --git a/src/serialization/types/MetadataOptionsItem.ts b/src/serialization/types/MetadataOptionsItem.ts index 76b6ce9a..062ee622 100644 --- a/src/serialization/types/MetadataOptionsItem.ts +++ b/src/serialization/types/MetadataOptionsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const MetadataOptionsItem: core.serialization.ObjectSchema< serializers.MetadataOptionsItem.Raw, diff --git a/src/serialization/types/NewOrder.ts b/src/serialization/types/NewOrder.ts index 828eefc3..336ff8da 100644 --- a/src/serialization/types/NewOrder.ts +++ b/src/serialization/types/NewOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Order } from "./Order"; export const NewOrder: core.serialization.ObjectSchema = diff --git a/src/serialization/types/NoDomains.ts b/src/serialization/types/NoDomains.ts index a8fd4d23..fd176b87 100644 --- a/src/serialization/types/NoDomains.ts +++ b/src/serialization/types/NoDomains.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const NoDomains: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/Node.ts b/src/serialization/types/Node.ts index 50c5efbc..dc6acf73 100644 --- a/src/serialization/types/Node.ts +++ b/src/serialization/types/Node.ts @@ -1,15 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { ComponentNode } from "./ComponentNode"; +import { TextNode } from "./TextNode"; import { ImageNode } from "./ImageNode"; -import { SearchButtonNode } from "./SearchButtonNode"; +import { ComponentNode } from "./ComponentNode"; +import { TextInputNode } from "./TextInputNode"; import { SelectNode } from "./SelectNode"; import { SubmitButtonNode } from "./SubmitButtonNode"; -import { TextInputNode } from "./TextInputNode"; -import { TextNode } from "./TextNode"; +import { SearchButtonNode } from "./SearchButtonNode"; export const Node: core.serialization.Schema = core.serialization .union("type", { diff --git a/src/serialization/types/NotEnterprisePlanSite.ts b/src/serialization/types/NotEnterprisePlanSite.ts index 2f1be62f..6e0fcb72 100644 --- a/src/serialization/types/NotEnterprisePlanSite.ts +++ b/src/serialization/types/NotEnterprisePlanSite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const NotEnterprisePlanSite: core.serialization.Schema< serializers.NotEnterprisePlanSite.Raw, diff --git a/src/serialization/types/NotEnterprisePlanWorkspace.ts b/src/serialization/types/NotEnterprisePlanWorkspace.ts index 537cb9e1..566e4a60 100644 --- a/src/serialization/types/NotEnterprisePlanWorkspace.ts +++ b/src/serialization/types/NotEnterprisePlanWorkspace.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const NotEnterprisePlanWorkspace: core.serialization.Schema< serializers.NotEnterprisePlanWorkspace.Raw, diff --git a/src/serialization/types/OptionField.ts b/src/serialization/types/OptionField.ts index beb1b9a7..711e63d2 100644 --- a/src/serialization/types/OptionField.ts +++ b/src/serialization/types/OptionField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Metadata } from "./Metadata"; export const OptionField: core.serialization.ObjectSchema = diff --git a/src/serialization/types/Order.ts b/src/serialization/types/Order.ts index f8ea7ff8..2bfe0cb3 100644 --- a/src/serialization/types/Order.ts +++ b/src/serialization/types/Order.ts @@ -1,22 +1,24 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { OrderStatus } from "./OrderStatus"; +import { OrderDisputeLastStatus } from "./OrderDisputeLastStatus"; +import { OrderPrice } from "./OrderPrice"; import { OrderAddress } from "./OrderAddress"; +import { OrderShippingAddress } from "./OrderShippingAddress"; import { OrderBillingAddress } from "./OrderBillingAddress"; import { OrderCustomerInfo } from "./OrderCustomerInfo"; -import { OrderDisputeLastStatus } from "./OrderDisputeLastStatus"; -import { OrderDownloadFilesItem } from "./OrderDownloadFilesItem"; -import { OrderMetadata } from "./OrderMetadata"; -import { OrderPrice } from "./OrderPrice"; import { OrderPurchasedItem } from "./OrderPurchasedItem"; -import { OrderShippingAddress } from "./OrderShippingAddress"; -import { OrderStatus } from "./OrderStatus"; -import { OrderTotals } from "./OrderTotals"; -import { PaypalDetails } from "./PaypalDetails"; -import { StripeCard } from "./StripeCard"; import { StripeDetails } from "./StripeDetails"; +import { StripeCard } from "./StripeCard"; +import { PaypalDetails } from "./PaypalDetails"; +import { OrderMetadata } from "./OrderMetadata"; +import { OrderTotals } from "./OrderTotals"; +import { OrderDownloadFilesItem } from "./OrderDownloadFilesItem"; export const Order: core.serialization.ObjectSchema = core.serialization.object({ orderId: core.serialization.string().optional(), diff --git a/src/serialization/types/OrderAddress.ts b/src/serialization/types/OrderAddress.ts index a3e26d63..3618faa7 100644 --- a/src/serialization/types/OrderAddress.ts +++ b/src/serialization/types/OrderAddress.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { OrderAddressJapanType } from "./OrderAddressJapanType"; import { OrderAddressType } from "./OrderAddressType"; +import { OrderAddressJapanType } from "./OrderAddressJapanType"; export const OrderAddress: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderAddressJapanType.ts b/src/serialization/types/OrderAddressJapanType.ts index 801cd48f..4dd4dfd1 100644 --- a/src/serialization/types/OrderAddressJapanType.ts +++ b/src/serialization/types/OrderAddressJapanType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderAddressJapanType: core.serialization.Schema< serializers.OrderAddressJapanType.Raw, diff --git a/src/serialization/types/OrderAddressType.ts b/src/serialization/types/OrderAddressType.ts index 090ba6dc..6acce07d 100644 --- a/src/serialization/types/OrderAddressType.ts +++ b/src/serialization/types/OrderAddressType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderAddressType: core.serialization.Schema = core.serialization.enum_(["shipping", "billing"]); diff --git a/src/serialization/types/OrderBillingAddress.ts b/src/serialization/types/OrderBillingAddress.ts index d708ba2b..c31476e4 100644 --- a/src/serialization/types/OrderBillingAddress.ts +++ b/src/serialization/types/OrderBillingAddress.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { OrderBillingAddressJapanType } from "./OrderBillingAddressJapanType"; import { OrderBillingAddressType } from "./OrderBillingAddressType"; +import { OrderBillingAddressJapanType } from "./OrderBillingAddressJapanType"; export const OrderBillingAddress: core.serialization.ObjectSchema< serializers.OrderBillingAddress.Raw, diff --git a/src/serialization/types/OrderBillingAddressJapanType.ts b/src/serialization/types/OrderBillingAddressJapanType.ts index 0ab6cace..5edc32c9 100644 --- a/src/serialization/types/OrderBillingAddressJapanType.ts +++ b/src/serialization/types/OrderBillingAddressJapanType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderBillingAddressJapanType: core.serialization.Schema< serializers.OrderBillingAddressJapanType.Raw, diff --git a/src/serialization/types/OrderBillingAddressType.ts b/src/serialization/types/OrderBillingAddressType.ts index 42db9262..f70d77b0 100644 --- a/src/serialization/types/OrderBillingAddressType.ts +++ b/src/serialization/types/OrderBillingAddressType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderBillingAddressType: core.serialization.Schema< serializers.OrderBillingAddressType.Raw, diff --git a/src/serialization/types/OrderCustomerInfo.ts b/src/serialization/types/OrderCustomerInfo.ts index 4c39dadc..daa399a8 100644 --- a/src/serialization/types/OrderCustomerInfo.ts +++ b/src/serialization/types/OrderCustomerInfo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderCustomerInfo: core.serialization.ObjectSchema< serializers.OrderCustomerInfo.Raw, diff --git a/src/serialization/types/OrderDisputeLastStatus.ts b/src/serialization/types/OrderDisputeLastStatus.ts index 97cd3273..7c561d38 100644 --- a/src/serialization/types/OrderDisputeLastStatus.ts +++ b/src/serialization/types/OrderDisputeLastStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderDisputeLastStatus: core.serialization.Schema< serializers.OrderDisputeLastStatus.Raw, diff --git a/src/serialization/types/OrderDownloadFilesItem.ts b/src/serialization/types/OrderDownloadFilesItem.ts index df58bf76..94005846 100644 --- a/src/serialization/types/OrderDownloadFilesItem.ts +++ b/src/serialization/types/OrderDownloadFilesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderDownloadFilesItem: core.serialization.ObjectSchema< serializers.OrderDownloadFilesItem.Raw, diff --git a/src/serialization/types/OrderList.ts b/src/serialization/types/OrderList.ts index 3f8f26df..d7d13853 100644 --- a/src/serialization/types/OrderList.ts +++ b/src/serialization/types/OrderList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Order } from "./Order"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/OrderMetadata.ts b/src/serialization/types/OrderMetadata.ts index 043f0e2c..c7bbbd22 100644 --- a/src/serialization/types/OrderMetadata.ts +++ b/src/serialization/types/OrderMetadata.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderMetadata: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderPrice.ts b/src/serialization/types/OrderPrice.ts index 1e483e90..07cf76c9 100644 --- a/src/serialization/types/OrderPrice.ts +++ b/src/serialization/types/OrderPrice.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderPrice: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/OrderPurchasedItem.ts b/src/serialization/types/OrderPurchasedItem.ts index 56585fd6..028d8647 100644 --- a/src/serialization/types/OrderPurchasedItem.ts +++ b/src/serialization/types/OrderPurchasedItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderPrice } from "./OrderPrice"; import { OrderPurchasedItemVariantImage } from "./OrderPurchasedItemVariantImage"; diff --git a/src/serialization/types/OrderPurchasedItemVariantImage.ts b/src/serialization/types/OrderPurchasedItemVariantImage.ts index 3082bb2e..6aae08ab 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImage.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImage.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderPurchasedItemVariantImageFile } from "./OrderPurchasedItemVariantImageFile"; export const OrderPurchasedItemVariantImage: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPurchasedItemVariantImageFile.ts b/src/serialization/types/OrderPurchasedItemVariantImageFile.ts index 4a810c85..d412f892 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImageFile.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImageFile.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderPurchasedItemVariantImageFileVariantsItem } from "./OrderPurchasedItemVariantImageFileVariantsItem"; export const OrderPurchasedItemVariantImageFile: core.serialization.ObjectSchema< diff --git a/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts b/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts index 8a29ce20..27d4bae8 100644 --- a/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts +++ b/src/serialization/types/OrderPurchasedItemVariantImageFileVariantsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderPurchasedItemVariantImageFileVariantsItem: core.serialization.ObjectSchema< serializers.OrderPurchasedItemVariantImageFileVariantsItem.Raw, diff --git a/src/serialization/types/OrderShippingAddress.ts b/src/serialization/types/OrderShippingAddress.ts index 7100f7ff..0e0b6f6d 100644 --- a/src/serialization/types/OrderShippingAddress.ts +++ b/src/serialization/types/OrderShippingAddress.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { OrderShippingAddressJapanType } from "./OrderShippingAddressJapanType"; import { OrderShippingAddressType } from "./OrderShippingAddressType"; +import { OrderShippingAddressJapanType } from "./OrderShippingAddressJapanType"; export const OrderShippingAddress: core.serialization.ObjectSchema< serializers.OrderShippingAddress.Raw, diff --git a/src/serialization/types/OrderShippingAddressJapanType.ts b/src/serialization/types/OrderShippingAddressJapanType.ts index 0c6d413f..e1db409e 100644 --- a/src/serialization/types/OrderShippingAddressJapanType.ts +++ b/src/serialization/types/OrderShippingAddressJapanType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderShippingAddressJapanType: core.serialization.Schema< serializers.OrderShippingAddressJapanType.Raw, diff --git a/src/serialization/types/OrderShippingAddressType.ts b/src/serialization/types/OrderShippingAddressType.ts index 2bb5fa07..50b24c85 100644 --- a/src/serialization/types/OrderShippingAddressType.ts +++ b/src/serialization/types/OrderShippingAddressType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderShippingAddressType: core.serialization.Schema< serializers.OrderShippingAddressType.Raw, diff --git a/src/serialization/types/OrderStatus.ts b/src/serialization/types/OrderStatus.ts index 122f091c..c648fb9b 100644 --- a/src/serialization/types/OrderStatus.ts +++ b/src/serialization/types/OrderStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderStatus: core.serialization.Schema = core.serialization.enum_(["pending", "unfulfilled", "fulfilled", "disputed", "dispute-lost", "refunded"]); diff --git a/src/serialization/types/OrderTotals.ts b/src/serialization/types/OrderTotals.ts index 0e9fed36..3aa91c03 100644 --- a/src/serialization/types/OrderTotals.ts +++ b/src/serialization/types/OrderTotals.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { OrderPrice } from "./OrderPrice"; import { OrderTotalsExtrasItem } from "./OrderTotalsExtrasItem"; diff --git a/src/serialization/types/OrderTotalsExtrasItem.ts b/src/serialization/types/OrderTotalsExtrasItem.ts index c899ea35..95f76dc2 100644 --- a/src/serialization/types/OrderTotalsExtrasItem.ts +++ b/src/serialization/types/OrderTotalsExtrasItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { OrderPrice } from "./OrderPrice"; import { OrderTotalsExtrasItemType } from "./OrderTotalsExtrasItemType"; +import { OrderPrice } from "./OrderPrice"; export const OrderTotalsExtrasItem: core.serialization.ObjectSchema< serializers.OrderTotalsExtrasItem.Raw, diff --git a/src/serialization/types/OrderTotalsExtrasItemType.ts b/src/serialization/types/OrderTotalsExtrasItemType.ts index 4d19441c..4e16c0ee 100644 --- a/src/serialization/types/OrderTotalsExtrasItemType.ts +++ b/src/serialization/types/OrderTotalsExtrasItemType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const OrderTotalsExtrasItemType: core.serialization.Schema< serializers.OrderTotalsExtrasItemType.Raw, diff --git a/src/serialization/types/Page.ts b/src/serialization/types/Page.ts index 9b9e2a1f..450e4638 100644 --- a/src/serialization/types/Page.ts +++ b/src/serialization/types/Page.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { PageOpenGraph } from "./PageOpenGraph"; import { PageSeo } from "./PageSeo"; +import { PageOpenGraph } from "./PageOpenGraph"; export const Page: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string(), diff --git a/src/serialization/types/PageCreatedWebhook.ts b/src/serialization/types/PageCreatedWebhook.ts index c60e01d9..478a14c3 100644 --- a/src/serialization/types/PageCreatedWebhook.ts +++ b/src/serialization/types/PageCreatedWebhook.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PageCreatedWebhookPayload } from "./PageCreatedWebhookPayload"; export const PageCreatedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageCreatedWebhookPayload.ts b/src/serialization/types/PageCreatedWebhookPayload.ts index b61870d0..9a8ab194 100644 --- a/src/serialization/types/PageCreatedWebhookPayload.ts +++ b/src/serialization/types/PageCreatedWebhookPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PageCreatedWebhookPayload: core.serialization.ObjectSchema< serializers.PageCreatedWebhookPayload.Raw, diff --git a/src/serialization/types/PageDeletedWebhook.ts b/src/serialization/types/PageDeletedWebhook.ts index cede0799..0044c3d6 100644 --- a/src/serialization/types/PageDeletedWebhook.ts +++ b/src/serialization/types/PageDeletedWebhook.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PageDeletedWebhookPayload } from "./PageDeletedWebhookPayload"; export const PageDeletedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageDeletedWebhookPayload.ts b/src/serialization/types/PageDeletedWebhookPayload.ts index 45ce0c48..97979d06 100644 --- a/src/serialization/types/PageDeletedWebhookPayload.ts +++ b/src/serialization/types/PageDeletedWebhookPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PageDeletedWebhookPayload: core.serialization.ObjectSchema< serializers.PageDeletedWebhookPayload.Raw, diff --git a/src/serialization/types/PageList.ts b/src/serialization/types/PageList.ts index d9f21b80..9ef9e51c 100644 --- a/src/serialization/types/PageList.ts +++ b/src/serialization/types/PageList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Page } from "./Page"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/PageMetadataUpdatedWebhook.ts b/src/serialization/types/PageMetadataUpdatedWebhook.ts index 75a47eb3..27628074 100644 --- a/src/serialization/types/PageMetadataUpdatedWebhook.ts +++ b/src/serialization/types/PageMetadataUpdatedWebhook.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PageMetadataUpdatedWebhookPayload } from "./PageMetadataUpdatedWebhookPayload"; export const PageMetadataUpdatedWebhook: core.serialization.ObjectSchema< diff --git a/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts b/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts index 01d872cf..8400b888 100644 --- a/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts +++ b/src/serialization/types/PageMetadataUpdatedWebhookPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PageMetadataUpdatedWebhookPayload: core.serialization.ObjectSchema< serializers.PageMetadataUpdatedWebhookPayload.Raw, diff --git a/src/serialization/types/PageOpenGraph.ts b/src/serialization/types/PageOpenGraph.ts index a3b3dfc2..0a104b5f 100644 --- a/src/serialization/types/PageOpenGraph.ts +++ b/src/serialization/types/PageOpenGraph.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PageOpenGraph: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/PageSeo.ts b/src/serialization/types/PageSeo.ts index cc66a6bd..9fe4aa20 100644 --- a/src/serialization/types/PageSeo.ts +++ b/src/serialization/types/PageSeo.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PageSeo: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Pagination.ts b/src/serialization/types/Pagination.ts index bd79fdda..7d78b97e 100644 --- a/src/serialization/types/Pagination.ts +++ b/src/serialization/types/Pagination.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Pagination: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Payload.ts b/src/serialization/types/Payload.ts index d4a1c0bc..ffaf5cb9 100644 --- a/src/serialization/types/Payload.ts +++ b/src/serialization/types/Payload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { PayloadFieldData } from "./PayloadFieldData"; export const Payload: core.serialization.ObjectSchema = diff --git a/src/serialization/types/PayloadFieldData.ts b/src/serialization/types/PayloadFieldData.ts index a5499c97..1076c24c 100644 --- a/src/serialization/types/PayloadFieldData.ts +++ b/src/serialization/types/PayloadFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PayloadFieldData: core.serialization.ObjectSchema< serializers.PayloadFieldData.Raw, diff --git a/src/serialization/types/PaypalDetails.ts b/src/serialization/types/PaypalDetails.ts index 37bed9d7..b4b38c02 100644 --- a/src/serialization/types/PaypalDetails.ts +++ b/src/serialization/types/PaypalDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PaypalDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Product.ts b/src/serialization/types/Product.ts index 41f09e47..6c7da3a8 100644 --- a/src/serialization/types/Product.ts +++ b/src/serialization/types/Product.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ProductFieldData } from "./ProductFieldData"; export const Product: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ProductAndSkUs.ts b/src/serialization/types/ProductAndSkUs.ts index 0e40c85d..eb8f9a8c 100644 --- a/src/serialization/types/ProductAndSkUs.ts +++ b/src/serialization/types/ProductAndSkUs.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Product } from "./Product"; import { Sku } from "./Sku"; diff --git a/src/serialization/types/ProductAndSkUsList.ts b/src/serialization/types/ProductAndSkUsList.ts index bfc8af72..bc08eb2c 100644 --- a/src/serialization/types/ProductAndSkUsList.ts +++ b/src/serialization/types/ProductAndSkUsList.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Pagination } from "./Pagination"; import { ProductAndSkUs } from "./ProductAndSkUs"; +import { Pagination } from "./Pagination"; export const ProductAndSkUsList: core.serialization.ObjectSchema< serializers.ProductAndSkUsList.Raw, diff --git a/src/serialization/types/ProductFieldData.ts b/src/serialization/types/ProductFieldData.ts index 045e745f..8f109dd6 100644 --- a/src/serialization/types/ProductFieldData.ts +++ b/src/serialization/types/ProductFieldData.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { ProductFieldDataEcProductType } from "./ProductFieldDataEcProductType"; -import { ProductFieldDataTaxCategory } from "./ProductFieldDataTaxCategory"; import { SkuPropertyList } from "./SkuPropertyList"; +import { ProductFieldDataTaxCategory } from "./ProductFieldDataTaxCategory"; +import { ProductFieldDataEcProductType } from "./ProductFieldDataEcProductType"; export const ProductFieldData: core.serialization.ObjectSchema< serializers.ProductFieldData.Raw, diff --git a/src/serialization/types/ProductFieldDataEcProductType.ts b/src/serialization/types/ProductFieldDataEcProductType.ts index 123c71d5..9a0a026f 100644 --- a/src/serialization/types/ProductFieldDataEcProductType.ts +++ b/src/serialization/types/ProductFieldDataEcProductType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ProductFieldDataEcProductType: core.serialization.Schema< serializers.ProductFieldDataEcProductType.Raw, diff --git a/src/serialization/types/ProductFieldDataTaxCategory.ts b/src/serialization/types/ProductFieldDataTaxCategory.ts index f8633b32..4603b97d 100644 --- a/src/serialization/types/ProductFieldDataTaxCategory.ts +++ b/src/serialization/types/ProductFieldDataTaxCategory.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ProductFieldDataTaxCategory: core.serialization.Schema< serializers.ProductFieldDataTaxCategory.Raw, diff --git a/src/serialization/types/PublishStatus.ts b/src/serialization/types/PublishStatus.ts index ebc801a5..b59744f2 100644 --- a/src/serialization/types/PublishStatus.ts +++ b/src/serialization/types/PublishStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const PublishStatus: core.serialization.Schema = core.serialization.enum_(["staging", "live"]); diff --git a/src/serialization/types/Redirect.ts b/src/serialization/types/Redirect.ts index d310f519..7de21d00 100644 --- a/src/serialization/types/Redirect.ts +++ b/src/serialization/types/Redirect.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Redirect: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Redirects.ts b/src/serialization/types/Redirects.ts index 5e5baa85..a8e2df7e 100644 --- a/src/serialization/types/Redirects.ts +++ b/src/serialization/types/Redirects.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Pagination } from "./Pagination"; import { Redirect } from "./Redirect"; +import { Pagination } from "./Pagination"; export const Redirects: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ReferenceField.ts b/src/serialization/types/ReferenceField.ts index 39067e3c..d1750771 100644 --- a/src/serialization/types/ReferenceField.ts +++ b/src/serialization/types/ReferenceField.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { ReferenceFieldMetadata } from "./ReferenceFieldMetadata"; import { ReferenceFieldType } from "./ReferenceFieldType"; +import { ReferenceFieldMetadata } from "./ReferenceFieldMetadata"; export const ReferenceField: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/ReferenceFieldMetadata.ts b/src/serialization/types/ReferenceFieldMetadata.ts index 39d8f9b5..0f2848ef 100644 --- a/src/serialization/types/ReferenceFieldMetadata.ts +++ b/src/serialization/types/ReferenceFieldMetadata.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ReferenceFieldMetadata: core.serialization.ObjectSchema< serializers.ReferenceFieldMetadata.Raw, diff --git a/src/serialization/types/ReferenceFieldType.ts b/src/serialization/types/ReferenceFieldType.ts index f2d1c200..1e8cebe9 100644 --- a/src/serialization/types/ReferenceFieldType.ts +++ b/src/serialization/types/ReferenceFieldType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ReferenceFieldType: core.serialization.Schema< serializers.ReferenceFieldType.Raw, diff --git a/src/serialization/types/RegisteredScriptList.ts b/src/serialization/types/RegisteredScriptList.ts index e7948791..a690b80e 100644 --- a/src/serialization/types/RegisteredScriptList.ts +++ b/src/serialization/types/RegisteredScriptList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { CustomCodeHostedResponse } from "./CustomCodeHostedResponse"; import { Pagination } from "./Pagination"; diff --git a/src/serialization/types/Robots.ts b/src/serialization/types/Robots.ts index 324517e2..c2757178 100644 --- a/src/serialization/types/Robots.ts +++ b/src/serialization/types/Robots.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { RobotsRulesItem } from "./RobotsRulesItem"; export const Robots: core.serialization.ObjectSchema = diff --git a/src/serialization/types/RobotsRulesItem.ts b/src/serialization/types/RobotsRulesItem.ts index ccd9d899..a261e7a1 100644 --- a/src/serialization/types/RobotsRulesItem.ts +++ b/src/serialization/types/RobotsRulesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const RobotsRulesItem: core.serialization.ObjectSchema< serializers.RobotsRulesItem.Raw, diff --git a/src/serialization/types/ScriptApply.ts b/src/serialization/types/ScriptApply.ts index c78860d7..179a946e 100644 --- a/src/serialization/types/ScriptApply.ts +++ b/src/serialization/types/ScriptApply.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScriptApplyLocation } from "./ScriptApplyLocation"; export const ScriptApply: core.serialization.ObjectSchema = diff --git a/src/serialization/types/ScriptApplyList.ts b/src/serialization/types/ScriptApplyList.ts index df42c718..4bccf7ba 100644 --- a/src/serialization/types/ScriptApplyList.ts +++ b/src/serialization/types/ScriptApplyList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScriptApply } from "./ScriptApply"; export const ScriptApplyList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/ScriptApplyLocation.ts b/src/serialization/types/ScriptApplyLocation.ts index 4e025937..19941529 100644 --- a/src/serialization/types/ScriptApplyLocation.ts +++ b/src/serialization/types/ScriptApplyLocation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const ScriptApplyLocation: core.serialization.Schema< serializers.ScriptApplyLocation.Raw, diff --git a/src/serialization/types/Scripts.ts b/src/serialization/types/Scripts.ts index fe315433..a2287894 100644 --- a/src/serialization/types/Scripts.ts +++ b/src/serialization/types/Scripts.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { ScriptApply } from "./ScriptApply"; export const Scripts: core.serialization.Schema = diff --git a/src/serialization/types/SearchButtonNode.ts b/src/serialization/types/SearchButtonNode.ts index 87e19e5c..9cb3904d 100644 --- a/src/serialization/types/SearchButtonNode.ts +++ b/src/serialization/types/SearchButtonNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchButtonNode: core.serialization.ObjectSchema< serializers.SearchButtonNode.Raw, diff --git a/src/serialization/types/SearchButtonNodeWrite.ts b/src/serialization/types/SearchButtonNodeWrite.ts index 722cbe7e..b0fbc7e8 100644 --- a/src/serialization/types/SearchButtonNodeWrite.ts +++ b/src/serialization/types/SearchButtonNodeWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SearchButtonNodeWrite: core.serialization.ObjectSchema< serializers.SearchButtonNodeWrite.Raw, diff --git a/src/serialization/types/Select.ts b/src/serialization/types/Select.ts index 77df4488..93034408 100644 --- a/src/serialization/types/Select.ts +++ b/src/serialization/types/Select.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SelectNodeWriteChoicesItem } from "./SelectNodeWriteChoicesItem"; export const Select: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectNode.ts b/src/serialization/types/SelectNode.ts index 18ee4bb8..78828b27 100644 --- a/src/serialization/types/SelectNode.ts +++ b/src/serialization/types/SelectNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SelectNodeChoicesItem } from "./SelectNodeChoicesItem"; export const SelectNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SelectNodeChoicesItem.ts b/src/serialization/types/SelectNodeChoicesItem.ts index b48faf40..cd6c5339 100644 --- a/src/serialization/types/SelectNodeChoicesItem.ts +++ b/src/serialization/types/SelectNodeChoicesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SelectNodeChoicesItem: core.serialization.ObjectSchema< serializers.SelectNodeChoicesItem.Raw, diff --git a/src/serialization/types/SelectNodeWriteChoicesItem.ts b/src/serialization/types/SelectNodeWriteChoicesItem.ts index ce69a0c0..dca7664b 100644 --- a/src/serialization/types/SelectNodeWriteChoicesItem.ts +++ b/src/serialization/types/SelectNodeWriteChoicesItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SelectNodeWriteChoicesItem: core.serialization.ObjectSchema< serializers.SelectNodeWriteChoicesItem.Raw, diff --git a/src/serialization/types/SingleLocaleCreatedPayload.ts b/src/serialization/types/SingleLocaleCreatedPayload.ts index c49293f1..c71b8ca3 100644 --- a/src/serialization/types/SingleLocaleCreatedPayload.ts +++ b/src/serialization/types/SingleLocaleCreatedPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SingleLocaleCreatedPayloadFieldData } from "./SingleLocaleCreatedPayloadFieldData"; export const SingleLocaleCreatedPayload: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts b/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts index a8803259..fd1491fa 100644 --- a/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts +++ b/src/serialization/types/SingleLocaleCreatedPayloadFieldData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SingleLocaleCreatedPayloadFieldData: core.serialization.ObjectSchema< serializers.SingleLocaleCreatedPayloadFieldData.Raw, diff --git a/src/serialization/types/Site.ts b/src/serialization/types/Site.ts index ed7eacab..eddd4dde 100644 --- a/src/serialization/types/Site.ts +++ b/src/serialization/types/Site.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Domain } from "./Domain"; import { Locales } from "./Locales"; import { SiteDataCollectionType } from "./SiteDataCollectionType"; diff --git a/src/serialization/types/SiteActivityLogItem.ts b/src/serialization/types/SiteActivityLogItem.ts index d923b15a..363dde52 100644 --- a/src/serialization/types/SiteActivityLogItem.ts +++ b/src/serialization/types/SiteActivityLogItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SiteActivityLogItemEvent } from "./SiteActivityLogItemEvent"; import { SiteActivityLogItemResourceOperation } from "./SiteActivityLogItemResourceOperation"; import { SiteActivityLogItemUser } from "./SiteActivityLogItemUser"; diff --git a/src/serialization/types/SiteActivityLogItemEvent.ts b/src/serialization/types/SiteActivityLogItemEvent.ts index 90151d6b..73263953 100644 --- a/src/serialization/types/SiteActivityLogItemEvent.ts +++ b/src/serialization/types/SiteActivityLogItemEvent.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SiteActivityLogItemEvent: core.serialization.Schema< serializers.SiteActivityLogItemEvent.Raw, diff --git a/src/serialization/types/SiteActivityLogItemResourceOperation.ts b/src/serialization/types/SiteActivityLogItemResourceOperation.ts index 8f43bff5..ea3b3473 100644 --- a/src/serialization/types/SiteActivityLogItemResourceOperation.ts +++ b/src/serialization/types/SiteActivityLogItemResourceOperation.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SiteActivityLogItemResourceOperation: core.serialization.Schema< serializers.SiteActivityLogItemResourceOperation.Raw, diff --git a/src/serialization/types/SiteActivityLogItemUser.ts b/src/serialization/types/SiteActivityLogItemUser.ts index 3e444dd6..7ac8792b 100644 --- a/src/serialization/types/SiteActivityLogItemUser.ts +++ b/src/serialization/types/SiteActivityLogItemUser.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SiteActivityLogItemUser: core.serialization.ObjectSchema< serializers.SiteActivityLogItemUser.Raw, diff --git a/src/serialization/types/SiteActivityLogResponse.ts b/src/serialization/types/SiteActivityLogResponse.ts index dfcee20d..1d5209ee 100644 --- a/src/serialization/types/SiteActivityLogResponse.ts +++ b/src/serialization/types/SiteActivityLogResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Pagination } from "./Pagination"; import { SiteActivityLogItem } from "./SiteActivityLogItem"; +import { Pagination } from "./Pagination"; export const SiteActivityLogResponse: core.serialization.ObjectSchema< serializers.SiteActivityLogResponse.Raw, diff --git a/src/serialization/types/SiteDataCollectionType.ts b/src/serialization/types/SiteDataCollectionType.ts index e8764024..2cf597c2 100644 --- a/src/serialization/types/SiteDataCollectionType.ts +++ b/src/serialization/types/SiteDataCollectionType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SiteDataCollectionType: core.serialization.Schema< serializers.SiteDataCollectionType.Raw, diff --git a/src/serialization/types/SiteMembership.ts b/src/serialization/types/SiteMembership.ts index becdb00d..8208542c 100644 --- a/src/serialization/types/SiteMembership.ts +++ b/src/serialization/types/SiteMembership.ts @@ -1,13 +1,15 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess } from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; -import { WorkspaceAuditLogItemPayloadSiteMembershipMethod } from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; import { WorkspaceAuditLogItemPayloadSiteMembershipSite } from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; import { WorkspaceAuditLogItemPayloadSiteMembershipTargetUser } from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; +import { WorkspaceAuditLogItemPayloadSiteMembershipMethod } from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; import { WorkspaceAuditLogItemPayloadSiteMembershipUserType } from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; +import { WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess } from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; export const SiteMembership: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SiteMembershipAuditLogItem.ts b/src/serialization/types/SiteMembershipAuditLogItem.ts index 4d7f9a13..19bf2594 100644 --- a/src/serialization/types/SiteMembershipAuditLogItem.ts +++ b/src/serialization/types/SiteMembershipAuditLogItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { SiteMembership } from "./SiteMembership"; import { SiteMembershipAuditLogItemEventSubType } from "./SiteMembershipAuditLogItemEventSubType"; +import { SiteMembership } from "./SiteMembership"; export const SiteMembershipAuditLogItem: core.serialization.ObjectSchema< serializers.SiteMembershipAuditLogItem.Raw, diff --git a/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts b/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts index 8ff121a3..05688493 100644 --- a/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts +++ b/src/serialization/types/SiteMembershipAuditLogItemEventSubType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SiteMembershipAuditLogItemEventSubType: core.serialization.Schema< serializers.SiteMembershipAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/SitePlan.ts b/src/serialization/types/SitePlan.ts index 9ed6a08e..7da15cf8 100644 --- a/src/serialization/types/SitePlan.ts +++ b/src/serialization/types/SitePlan.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SitePlanId } from "./SitePlanId"; import { SitePlanName } from "./SitePlanName"; diff --git a/src/serialization/types/SitePlanId.ts b/src/serialization/types/SitePlanId.ts index fe03d23c..d19ecc2e 100644 --- a/src/serialization/types/SitePlanId.ts +++ b/src/serialization/types/SitePlanId.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SitePlanId: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/SitePlanName.ts b/src/serialization/types/SitePlanName.ts index 81c2a953..ef8881f1 100644 --- a/src/serialization/types/SitePlanName.ts +++ b/src/serialization/types/SitePlanName.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SitePlanName: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/SitePublish.ts b/src/serialization/types/SitePublish.ts index 07b0ac99..1e476a6c 100644 --- a/src/serialization/types/SitePublish.ts +++ b/src/serialization/types/SitePublish.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SitePublishPayload } from "./SitePublishPayload"; export const SitePublish: core.serialization.ObjectSchema = diff --git a/src/serialization/types/SitePublishPayload.ts b/src/serialization/types/SitePublishPayload.ts index 8d8280ec..e94eab59 100644 --- a/src/serialization/types/SitePublishPayload.ts +++ b/src/serialization/types/SitePublishPayload.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SitePublishPayload: core.serialization.ObjectSchema< serializers.SitePublishPayload.Raw, diff --git a/src/serialization/types/Sites.ts b/src/serialization/types/Sites.ts index 7e6465ab..ab5b6d23 100644 --- a/src/serialization/types/Sites.ts +++ b/src/serialization/types/Sites.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Site } from "./Site"; export const Sites: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/Sku.ts b/src/serialization/types/Sku.ts index a623ef62..4e9ad250 100644 --- a/src/serialization/types/Sku.ts +++ b/src/serialization/types/Sku.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SkuFieldData } from "./SkuFieldData"; export const Sku: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SkuFieldData.ts b/src/serialization/types/SkuFieldData.ts index 896bb3ef..6e73061c 100644 --- a/src/serialization/types/SkuFieldData.ts +++ b/src/serialization/types/SkuFieldData.ts @@ -1,14 +1,16 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { SkuValueList } from "./SkuValueList"; +import { SkuFieldDataPrice } from "./SkuFieldDataPrice"; import { SkuFieldDataCompareAtPrice } from "./SkuFieldDataCompareAtPrice"; import { SkuFieldDataEcSkuBillingMethod } from "./SkuFieldDataEcSkuBillingMethod"; import { SkuFieldDataEcSkuSubscriptionPlan } from "./SkuFieldDataEcSkuSubscriptionPlan"; -import { SkuFieldDataPrice } from "./SkuFieldDataPrice"; import { SkuPropertyList } from "./SkuPropertyList"; -import { SkuValueList } from "./SkuValueList"; export const SkuFieldData: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SkuFieldDataCompareAtPrice.ts b/src/serialization/types/SkuFieldDataCompareAtPrice.ts index b574baf9..f7e9ad41 100644 --- a/src/serialization/types/SkuFieldDataCompareAtPrice.ts +++ b/src/serialization/types/SkuFieldDataCompareAtPrice.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuFieldDataCompareAtPrice: core.serialization.ObjectSchema< serializers.SkuFieldDataCompareAtPrice.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts b/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts index cc77d092..69ee4d8f 100644 --- a/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts +++ b/src/serialization/types/SkuFieldDataEcSkuBillingMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuFieldDataEcSkuBillingMethod: core.serialization.Schema< serializers.SkuFieldDataEcSkuBillingMethod.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts index f5fe7f49..5f356b3c 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlan.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SkuFieldDataEcSkuSubscriptionPlanInterval } from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; import { SkuFieldDataEcSkuSubscriptionPlanPlansItem } from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts index 753ed927..eff02383 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanInterval.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuFieldDataEcSkuSubscriptionPlanInterval: core.serialization.Schema< serializers.SkuFieldDataEcSkuSubscriptionPlanInterval.Raw, diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts index a5f08ea1..16e1ebe9 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus } from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; export const SkuFieldDataEcSkuSubscriptionPlanPlansItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts index fbe0ed8b..4300607d 100644 --- a/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts +++ b/src/serialization/types/SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus: core.serialization.Schema< serializers.SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus.Raw, diff --git a/src/serialization/types/SkuFieldDataPrice.ts b/src/serialization/types/SkuFieldDataPrice.ts index 012dc3c7..e6ed7eb7 100644 --- a/src/serialization/types/SkuFieldDataPrice.ts +++ b/src/serialization/types/SkuFieldDataPrice.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuFieldDataPrice: core.serialization.ObjectSchema< serializers.SkuFieldDataPrice.Raw, diff --git a/src/serialization/types/SkuPropertyList.ts b/src/serialization/types/SkuPropertyList.ts index 11b9fad6..8c85ab16 100644 --- a/src/serialization/types/SkuPropertyList.ts +++ b/src/serialization/types/SkuPropertyList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { SkuPropertyListEnumItem } from "./SkuPropertyListEnumItem"; export const SkuPropertyList: core.serialization.ObjectSchema< diff --git a/src/serialization/types/SkuPropertyListEnumItem.ts b/src/serialization/types/SkuPropertyListEnumItem.ts index 65f230b7..dce561f8 100644 --- a/src/serialization/types/SkuPropertyListEnumItem.ts +++ b/src/serialization/types/SkuPropertyListEnumItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuPropertyListEnumItem: core.serialization.ObjectSchema< serializers.SkuPropertyListEnumItem.Raw, diff --git a/src/serialization/types/SkuValueList.ts b/src/serialization/types/SkuValueList.ts index c49f588a..52a04607 100644 --- a/src/serialization/types/SkuValueList.ts +++ b/src/serialization/types/SkuValueList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SkuValueList: core.serialization.Schema = core.serialization.record(core.serialization.string(), core.serialization.string()); diff --git a/src/serialization/types/StaticField.ts b/src/serialization/types/StaticField.ts index e32f9085..397db2ec 100644 --- a/src/serialization/types/StaticField.ts +++ b/src/serialization/types/StaticField.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { StaticFieldType } from "./StaticFieldType"; export const StaticField: core.serialization.ObjectSchema = diff --git a/src/serialization/types/StaticFieldType.ts b/src/serialization/types/StaticFieldType.ts index 1a221d1c..cb704184 100644 --- a/src/serialization/types/StaticFieldType.ts +++ b/src/serialization/types/StaticFieldType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const StaticFieldType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/StripeCard.ts b/src/serialization/types/StripeCard.ts index cabcc6ba..1372e95f 100644 --- a/src/serialization/types/StripeCard.ts +++ b/src/serialization/types/StripeCard.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { StripeCardBrand } from "./StripeCardBrand"; import { StripeCardExpires } from "./StripeCardExpires"; diff --git a/src/serialization/types/StripeCardBrand.ts b/src/serialization/types/StripeCardBrand.ts index d41b3066..a08d9ac5 100644 --- a/src/serialization/types/StripeCardBrand.ts +++ b/src/serialization/types/StripeCardBrand.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const StripeCardBrand: core.serialization.Schema = core.serialization.enum_(["Visa", "American Express", "MasterCard", "Discover", "JCB", "Diners Club", "Unknown"]); diff --git a/src/serialization/types/StripeCardExpires.ts b/src/serialization/types/StripeCardExpires.ts index ade57d89..8ec82664 100644 --- a/src/serialization/types/StripeCardExpires.ts +++ b/src/serialization/types/StripeCardExpires.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const StripeCardExpires: core.serialization.ObjectSchema< serializers.StripeCardExpires.Raw, diff --git a/src/serialization/types/StripeDetails.ts b/src/serialization/types/StripeDetails.ts index 5ab2c3de..f1b8470a 100644 --- a/src/serialization/types/StripeDetails.ts +++ b/src/serialization/types/StripeDetails.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const StripeDetails: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/SubmitButtonNode.ts b/src/serialization/types/SubmitButtonNode.ts index 4a5bc190..794a1d5a 100644 --- a/src/serialization/types/SubmitButtonNode.ts +++ b/src/serialization/types/SubmitButtonNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubmitButtonNode: core.serialization.ObjectSchema< serializers.SubmitButtonNode.Raw, diff --git a/src/serialization/types/SubmitButtonNodeWrite.ts b/src/serialization/types/SubmitButtonNodeWrite.ts index 1c41a3b8..8cf1a7f8 100644 --- a/src/serialization/types/SubmitButtonNodeWrite.ts +++ b/src/serialization/types/SubmitButtonNodeWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const SubmitButtonNodeWrite: core.serialization.ObjectSchema< serializers.SubmitButtonNodeWrite.Raw, diff --git a/src/serialization/types/Text.ts b/src/serialization/types/Text.ts index d6e76aab..e5f55d60 100644 --- a/src/serialization/types/Text.ts +++ b/src/serialization/types/Text.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const Text: core.serialization.ObjectSchema = core.serialization.object({ html: core.serialization.string().optional(), diff --git a/src/serialization/types/TextInputNode.ts b/src/serialization/types/TextInputNode.ts index a38fb6da..71726816 100644 --- a/src/serialization/types/TextInputNode.ts +++ b/src/serialization/types/TextInputNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TextInputNode: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TextInputNodeWrite.ts b/src/serialization/types/TextInputNodeWrite.ts index e52a7f3e..737b37a0 100644 --- a/src/serialization/types/TextInputNodeWrite.ts +++ b/src/serialization/types/TextInputNodeWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TextInputNodeWrite: core.serialization.ObjectSchema< serializers.TextInputNodeWrite.Raw, diff --git a/src/serialization/types/TextNode.ts b/src/serialization/types/TextNode.ts index e74d0ee9..b0cca75c 100644 --- a/src/serialization/types/TextNode.ts +++ b/src/serialization/types/TextNode.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TextNodeText } from "./TextNodeText"; export const TextNode: core.serialization.ObjectSchema = diff --git a/src/serialization/types/TextNodeText.ts b/src/serialization/types/TextNodeText.ts index 7a500a02..77a3fe19 100644 --- a/src/serialization/types/TextNodeText.ts +++ b/src/serialization/types/TextNodeText.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TextNodeText: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TextNodeWrite.ts b/src/serialization/types/TextNodeWrite.ts index 9efc3f26..ab1d060e 100644 --- a/src/serialization/types/TextNodeWrite.ts +++ b/src/serialization/types/TextNodeWrite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TextNodeWrite: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/TriggerType.ts b/src/serialization/types/TriggerType.ts index 7443fca0..b3c9eb26 100644 --- a/src/serialization/types/TriggerType.ts +++ b/src/serialization/types/TriggerType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const TriggerType: core.serialization.Schema = core.serialization.enum_([ diff --git a/src/serialization/types/UpdatedOrder.ts b/src/serialization/types/UpdatedOrder.ts index c26b9554..4c27a99b 100644 --- a/src/serialization/types/UpdatedOrder.ts +++ b/src/serialization/types/UpdatedOrder.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { Order } from "./Order"; export const UpdatedOrder: core.serialization.ObjectSchema = diff --git a/src/serialization/types/User.ts b/src/serialization/types/User.ts index 4e724453..67dba20e 100644 --- a/src/serialization/types/User.ts +++ b/src/serialization/types/User.ts @@ -1,11 +1,13 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; +import { UserStatus } from "./UserStatus"; import { UserAccessGroupsItem } from "./UserAccessGroupsItem"; import { UserData } from "./UserData"; -import { UserStatus } from "./UserStatus"; export const User: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), diff --git a/src/serialization/types/UserAccess.ts b/src/serialization/types/UserAccess.ts index b2c7f0e8..32f8344f 100644 --- a/src/serialization/types/UserAccess.ts +++ b/src/serialization/types/UserAccess.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { WorkspaceAuditLogItemPayloadUserAccessMethod } from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; export const UserAccess: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserAccessAuditLogItem.ts b/src/serialization/types/UserAccessAuditLogItem.ts index e2e7b947..7b344f7d 100644 --- a/src/serialization/types/UserAccessAuditLogItem.ts +++ b/src/serialization/types/UserAccessAuditLogItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { UserAccess } from "./UserAccess"; import { UserAccessAuditLogItemEventSubType } from "./UserAccessAuditLogItemEventSubType"; +import { UserAccess } from "./UserAccess"; export const UserAccessAuditLogItem: core.serialization.ObjectSchema< serializers.UserAccessAuditLogItem.Raw, diff --git a/src/serialization/types/UserAccessAuditLogItemEventSubType.ts b/src/serialization/types/UserAccessAuditLogItemEventSubType.ts index bc7154e3..1664e09e 100644 --- a/src/serialization/types/UserAccessAuditLogItemEventSubType.ts +++ b/src/serialization/types/UserAccessAuditLogItemEventSubType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UserAccessAuditLogItemEventSubType: core.serialization.Schema< serializers.UserAccessAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/UserAccessGroupsItem.ts b/src/serialization/types/UserAccessGroupsItem.ts index 9637a167..92c0b5c2 100644 --- a/src/serialization/types/UserAccessGroupsItem.ts +++ b/src/serialization/types/UserAccessGroupsItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { UserAccessGroupsItemType } from "./UserAccessGroupsItemType"; export const UserAccessGroupsItem: core.serialization.ObjectSchema< diff --git a/src/serialization/types/UserAccessGroupsItemType.ts b/src/serialization/types/UserAccessGroupsItemType.ts index 6fb260b1..72c0d996 100644 --- a/src/serialization/types/UserAccessGroupsItemType.ts +++ b/src/serialization/types/UserAccessGroupsItemType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UserAccessGroupsItemType: core.serialization.Schema< serializers.UserAccessGroupsItemType.Raw, diff --git a/src/serialization/types/UserData.ts b/src/serialization/types/UserData.ts index 7abc1416..9fe16c9b 100644 --- a/src/serialization/types/UserData.ts +++ b/src/serialization/types/UserData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { UserDataData } from "./UserDataData"; export const UserData: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserDataData.ts b/src/serialization/types/UserDataData.ts index 4d3646f6..9c8fe706 100644 --- a/src/serialization/types/UserDataData.ts +++ b/src/serialization/types/UserDataData.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UserDataData: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/UserLimitReached.ts b/src/serialization/types/UserLimitReached.ts index 912e9f0d..dd99b693 100644 --- a/src/serialization/types/UserLimitReached.ts +++ b/src/serialization/types/UserLimitReached.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UserLimitReached: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/UserList.ts b/src/serialization/types/UserList.ts index 42a18c4b..5b51c82b 100644 --- a/src/serialization/types/UserList.ts +++ b/src/serialization/types/UserList.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { User } from "./User"; export const UserList: core.serialization.ObjectSchema = diff --git a/src/serialization/types/UserStatus.ts b/src/serialization/types/UserStatus.ts index 84d5d4cc..24109027 100644 --- a/src/serialization/types/UserStatus.ts +++ b/src/serialization/types/UserStatus.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UserStatus: core.serialization.Schema = core.serialization.enum_(["invited", "verified", "unverified"]); diff --git a/src/serialization/types/UsersNotEnabled.ts b/src/serialization/types/UsersNotEnabled.ts index 2eb16fdf..fc9a6e7b 100644 --- a/src/serialization/types/UsersNotEnabled.ts +++ b/src/serialization/types/UsersNotEnabled.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const UsersNotEnabled: core.serialization.Schema = core.serialization.unknown(); diff --git a/src/serialization/types/Webhook.ts b/src/serialization/types/Webhook.ts index cdb03bbe..07f0eaa6 100644 --- a/src/serialization/types/Webhook.ts +++ b/src/serialization/types/Webhook.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; import { TriggerType } from "./TriggerType"; import { WebhookFilter } from "./WebhookFilter"; diff --git a/src/serialization/types/WebhookFilter.ts b/src/serialization/types/WebhookFilter.ts index 0821bcf0..8c3bf81b 100644 --- a/src/serialization/types/WebhookFilter.ts +++ b/src/serialization/types/WebhookFilter.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WebhookFilter: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/WebhookList.ts b/src/serialization/types/WebhookList.ts index 8f48ab27..b3900024 100644 --- a/src/serialization/types/WebhookList.ts +++ b/src/serialization/types/WebhookList.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Pagination } from "./Pagination"; import { Webhook } from "./Webhook"; +import { Pagination } from "./Pagination"; export const WebhookList: core.serialization.ObjectSchema = core.serialization.object({ diff --git a/src/serialization/types/WorkspaceAuditLogItem.ts b/src/serialization/types/WorkspaceAuditLogItem.ts index c321a594..3baef5de 100644 --- a/src/serialization/types/WorkspaceAuditLogItem.ts +++ b/src/serialization/types/WorkspaceAuditLogItem.ts @@ -1,15 +1,17 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import { WorkspaceAuditLogItemActor } from "./WorkspaceAuditLogItemActor"; +import { WorkspaceAuditLogItemWorkspace } from "./WorkspaceAuditLogItemWorkspace"; import * as core from "../../core"; -import type * as serializers from "../index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; +import { UserAccessAuditLogItem } from "./UserAccessAuditLogItem"; import { CustomRoleAuditLogItem } from "./CustomRoleAuditLogItem"; +import { WorkspaceMembershipAuditLogItem } from "./WorkspaceMembershipAuditLogItem"; import { SiteMembershipAuditLogItem } from "./SiteMembershipAuditLogItem"; -import { UserAccessAuditLogItem } from "./UserAccessAuditLogItem"; -import { WorkspaceAuditLogItemActor } from "./WorkspaceAuditLogItemActor"; -import { WorkspaceAuditLogItemWorkspace } from "./WorkspaceAuditLogItemWorkspace"; import { WorkspaceInvitationAuditLogItem } from "./WorkspaceInvitationAuditLogItem"; -import { WorkspaceMembershipAuditLogItem } from "./WorkspaceMembershipAuditLogItem"; const _Base = core.serialization.object({ timestamp: core.serialization.date().optional(), diff --git a/src/serialization/types/WorkspaceAuditLogItemActor.ts b/src/serialization/types/WorkspaceAuditLogItemActor.ts index ffb97d60..5e501453 100644 --- a/src/serialization/types/WorkspaceAuditLogItemActor.ts +++ b/src/serialization/types/WorkspaceAuditLogItemActor.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemActor: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemActor.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts index a919f78d..841da5cb 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts index 3e332e33..aec1001e 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts index 73139916..ed122f31 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipSite.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipSite: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipSite.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts index a9699cd7..5bda00ce 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts index 153aa32b..56ee7806 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadSiteMembershipUserType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadSiteMembershipUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadSiteMembershipUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts index 81e4ca79..5a8ceacb 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadUserAccessMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadUserAccessMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadUserAccessMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts index 387d613f..488ab8fa 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts index b9dd991e..87b2dd6a 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts index 6a6e114d..eae9726b 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts index 3358ea54..35c2081a 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts index 532face8..6b07d19c 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts index faf9db85..446a7b41 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts index c3c4182b..6358f927 100644 --- a/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts +++ b/src/serialization/types/WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType: core.serialization.Schema< serializers.WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts b/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts index f77e2f0a..92b43c94 100644 --- a/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts +++ b/src/serialization/types/WorkspaceAuditLogItemWorkspace.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceAuditLogItemWorkspace: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogItemWorkspace.Raw, diff --git a/src/serialization/types/WorkspaceAuditLogResponse.ts b/src/serialization/types/WorkspaceAuditLogResponse.ts index 291cba49..a6d047b4 100644 --- a/src/serialization/types/WorkspaceAuditLogResponse.ts +++ b/src/serialization/types/WorkspaceAuditLogResponse.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { Pagination } from "./Pagination"; import { WorkspaceAuditLogItem } from "./WorkspaceAuditLogItem"; +import { Pagination } from "./Pagination"; export const WorkspaceAuditLogResponse: core.serialization.ObjectSchema< serializers.WorkspaceAuditLogResponse.Raw, diff --git a/src/serialization/types/WorkspaceInvitation.ts b/src/serialization/types/WorkspaceInvitation.ts index 9f9f1165..14fc0ed4 100644 --- a/src/serialization/types/WorkspaceInvitation.ts +++ b/src/serialization/types/WorkspaceInvitation.ts @@ -1,12 +1,14 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; -import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +import { WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; import { WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +import { WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem } from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; export const WorkspaceInvitation: core.serialization.ObjectSchema< serializers.WorkspaceInvitation.Raw, diff --git a/src/serialization/types/WorkspaceInvitationAuditLogItem.ts b/src/serialization/types/WorkspaceInvitationAuditLogItem.ts index 63cc56b5..24ff3df9 100644 --- a/src/serialization/types/WorkspaceInvitationAuditLogItem.ts +++ b/src/serialization/types/WorkspaceInvitationAuditLogItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { WorkspaceInvitation } from "./WorkspaceInvitation"; import { WorkspaceInvitationAuditLogItemEventSubType } from "./WorkspaceInvitationAuditLogItemEventSubType"; +import { WorkspaceInvitation } from "./WorkspaceInvitation"; export const WorkspaceInvitationAuditLogItem: core.serialization.ObjectSchema< serializers.WorkspaceInvitationAuditLogItem.Raw, diff --git a/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts b/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts index 3e7ac3b0..3e1feda3 100644 --- a/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts +++ b/src/serialization/types/WorkspaceInvitationAuditLogItemEventSubType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceInvitationAuditLogItemEventSubType: core.serialization.Schema< serializers.WorkspaceInvitationAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/WorkspaceMembership.ts b/src/serialization/types/WorkspaceMembership.ts index e492e179..352f0412 100644 --- a/src/serialization/types/WorkspaceMembership.ts +++ b/src/serialization/types/WorkspaceMembership.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; import { WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +import { WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; import { WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType } from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; export const WorkspaceMembership: core.serialization.ObjectSchema< diff --git a/src/serialization/types/WorkspaceMembershipAuditLogItem.ts b/src/serialization/types/WorkspaceMembershipAuditLogItem.ts index 44386f4d..57640bf3 100644 --- a/src/serialization/types/WorkspaceMembershipAuditLogItem.ts +++ b/src/serialization/types/WorkspaceMembershipAuditLogItem.ts @@ -1,10 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; -import { WorkspaceMembership } from "./WorkspaceMembership"; import { WorkspaceMembershipAuditLogItemEventSubType } from "./WorkspaceMembershipAuditLogItemEventSubType"; +import { WorkspaceMembership } from "./WorkspaceMembership"; export const WorkspaceMembershipAuditLogItem: core.serialization.ObjectSchema< serializers.WorkspaceMembershipAuditLogItem.Raw, diff --git a/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts b/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts index 5886cd87..72478926 100644 --- a/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts +++ b/src/serialization/types/WorkspaceMembershipAuditLogItemEventSubType.ts @@ -1,8 +1,10 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import type * as Webflow from "../../api/index"; +import * as serializers from "../index"; +import * as Webflow from "../../api/index"; import * as core from "../../core"; -import type * as serializers from "../index"; export const WorkspaceMembershipAuditLogItemEventSubType: core.serialization.Schema< serializers.WorkspaceMembershipAuditLogItemEventSubType.Raw, diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 05e2bc8a..226d0e81 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -1,264 +1,264 @@ -export * from "./AccessGroup"; -export * from "./AccessGroupList"; +export * from "./ForbiddenErrorBody"; +export * from "./BadRequestErrorBody"; +export * from "./ItemsListItemsRequestLastPublished"; +export * from "./ItemsListItemsLiveRequestLastPublished"; +export * from "./ConflictErrorBody"; +export * from "./AuthorizedUser"; +export * from "./ErrorCode"; +export * from "./Error_"; export * from "./Application"; -export * from "./Asset"; -export * from "./AssetFolder"; -export * from "./AssetFolderList"; -export * from "./Assets"; -export * from "./AssetUpload"; -export * from "./AssetUploadUploadDetails"; -export * from "./AssetVariant"; -export * from "./Authorization"; -export * from "./AuthorizationAuthorization"; export * from "./AuthorizationAuthorizationAuthorizedTo"; -export * from "./AuthorizedUser"; -export * from "./BadRequestErrorBody"; -export * from "./BulkCollectionItem"; -export * from "./BulkCollectionItemFieldData"; +export * from "./AuthorizationAuthorization"; +export * from "./Authorization"; +export * from "./Domain"; +export * from "./Locale"; +export * from "./Locales"; +export * from "./SiteDataCollectionType"; +export * from "./Site"; +export * from "./InvalidScopes"; +export * from "./NotEnterprisePlanWorkspace"; +export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; +export * from "./UserAccess"; +export * from "./UserAccessAuditLogItemEventSubType"; +export * from "./UserAccessAuditLogItem"; +export * from "./CustomRole"; +export * from "./CustomRoleAuditLogItemEventSubType"; +export * from "./CustomRoleAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; +export * from "./WorkspaceMembership"; +export * from "./WorkspaceMembershipAuditLogItemEventSubType"; +export * from "./WorkspaceMembershipAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; +export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; +export * from "./SiteMembership"; +export * from "./SiteMembershipAuditLogItemEventSubType"; +export * from "./SiteMembershipAuditLogItem"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; +export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; +export * from "./WorkspaceInvitation"; +export * from "./WorkspaceInvitationAuditLogItemEventSubType"; +export * from "./WorkspaceInvitationAuditLogItem"; +export * from "./WorkspaceAuditLogItemActor"; +export * from "./WorkspaceAuditLogItemWorkspace"; +export * from "./WorkspaceAuditLogItem"; +export * from "./Pagination"; +export * from "./WorkspaceAuditLogResponse"; +export * from "./Sites"; +export * from "./NotEnterprisePlanSite"; +export * from "./Domains"; +export * from "./InvalidDomain"; +export * from "./NoDomains"; +export * from "./Redirect"; +export * from "./Redirects"; +export * from "./SitePlanId"; +export * from "./SitePlanName"; +export * from "./SitePlan"; +export * from "./RobotsRulesItem"; +export * from "./Robots"; +export * from "./SiteActivityLogItemEvent"; +export * from "./SiteActivityLogItemResourceOperation"; +export * from "./SiteActivityLogItemUser"; +export * from "./SiteActivityLogItem"; +export * from "./SiteActivityLogResponse"; +export * from "./CollectionListArrayItem"; +export * from "./CollectionList"; +export * from "./StaticFieldType"; +export * from "./StaticField"; +export * from "./MetadataOptionsItem"; +export * from "./Metadata"; +export * from "./OptionField"; +export * from "./ReferenceFieldType"; +export * from "./ReferenceFieldMetadata"; +export * from "./ReferenceField"; +export * from "./FieldCreate"; +export * from "./FieldType"; +export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; +export * from "./FieldValidationsAdditionalProperties"; +export * from "./FieldValidations"; +export * from "./Field"; export * from "./Collection"; -export * from "./CollectionItem"; -export * from "./CollectionItemChanged"; -export * from "./CollectionItemCreated"; export * from "./CollectionItemFieldData"; -export * from "./CollectionItemList"; -export * from "./CollectionItemListNoPagination"; +export * from "./CollectionItem"; export * from "./CollectionItemListPagination"; -export * from "./CollectionItemPatchSingle"; -export * from "./CollectionItemPatchSingleFieldData"; -export * from "./CollectionItemPostSingle"; +export * from "./CollectionItemList"; export * from "./CollectionItemPostSingleFieldData"; -export * from "./CollectionItemPublished"; -export * from "./CollectionItemRemoved"; -export * from "./CollectionItemRemovedPayload"; -export * from "./CollectionItemRemovedPayloadFieldData"; -export * from "./CollectionItemUnpublished"; -export * from "./CollectionItemUnpublishedPayload"; -export * from "./CollectionItemUnpublishedPayloadFieldData"; -export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemPostSingle"; export * from "./CollectionItemWithIdInputFieldData"; -export * from "./CollectionList"; -export * from "./CollectionListArrayItem"; -export * from "./Comment"; -export * from "./CommentPayload"; -export * from "./CommentPayloadAuthor"; -export * from "./CommentPayloadMentionedUsersItem"; -export * from "./CommentReply"; -export * from "./CommentReplyAuthor"; -export * from "./CommentReplyList"; -export * from "./CommentReplyListPagination"; -export * from "./CommentReplyMentionedUsersItem"; -export * from "./CommentThread"; +export * from "./CollectionItemWithIdInput"; +export * from "./CollectionItemListNoPagination"; +export * from "./Conflict"; +export * from "./BulkCollectionItemFieldData"; +export * from "./BulkCollectionItem"; +export * from "./CollectionItemPatchSingleFieldData"; +export * from "./CollectionItemPatchSingle"; export * from "./CommentThreadAuthor"; -export * from "./CommentThreadList"; -export * from "./CommentThreadListPagination"; export * from "./CommentThreadMentionedUsersItem"; -export * from "./Component"; -export * from "./ComponentDom"; -export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./CommentThread"; +export * from "./CommentThreadListPagination"; +export * from "./CommentThreadList"; +export * from "./CommentReplyAuthor"; +export * from "./CommentReplyMentionedUsersItem"; +export * from "./CommentReply"; +export * from "./CommentReplyListPagination"; +export * from "./CommentReplyList"; +export * from "./PageSeo"; +export * from "./PageOpenGraph"; +export * from "./Page"; +export * from "./PageList"; +export * from "./TextNodeText"; +export * from "./TextNode"; +export * from "./ImageNodeImage"; +export * from "./ImageNode"; +export * from "./Text"; +export * from "./ComponentPropertyType"; +export * from "./ComponentProperty"; +export * from "./ComponentNode"; +export * from "./TextInputNode"; +export * from "./SelectNodeChoicesItem"; +export * from "./SelectNode"; +export * from "./SubmitButtonNode"; +export * from "./SearchButtonNode"; +export * from "./Node"; +export * from "./Dom"; +export * from "./TextNodeWrite"; export * from "./ComponentInstanceNodePropertyOverridesWritePropertyOverridesItem"; +export * from "./ComponentInstanceNodePropertyOverridesWrite"; +export * from "./SelectNodeWriteChoicesItem"; +export * from "./Select"; +export * from "./TextInputNodeWrite"; +export * from "./SubmitButtonNodeWrite"; +export * from "./SearchButtonNodeWrite"; +export * from "./Component"; export * from "./ComponentList"; -export * from "./ComponentNode"; +export * from "./ComponentDom"; export * from "./ComponentProperties"; -export * from "./ComponentProperty"; -export * from "./ComponentPropertyType"; -export * from "./Conflict"; -export * from "./ConflictErrorBody"; -export * from "./CustomCodeBlock"; -export * from "./CustomCodeBlockType"; +export * from "./ScriptApplyLocation"; +export * from "./ScriptApply"; +export * from "./ScriptApplyList"; export * from "./CustomCodeHostedResponse"; +export * from "./RegisteredScriptList"; export * from "./CustomCodeInlineResponse"; -export * from "./CustomRole"; -export * from "./CustomRoleAuditLogItem"; -export * from "./CustomRoleAuditLogItemEventSubType"; -export * from "./Dom"; -export * from "./Domain"; -export * from "./Domains"; -export * from "./DuplicateUserEmail"; -export * from "./EcommerceSettings"; -export * from "./Error_"; -export * from "./ErrorCode"; -export * from "./Field"; -export * from "./FieldCreate"; -export * from "./FieldType"; -export * from "./FieldValidations"; -export * from "./FieldValidationsAdditionalProperties"; -export * from "./FieldValidationsAdditionalPropertiesAdditionalProperties"; -export * from "./ForbiddenErrorBody"; -export * from "./Form"; -export * from "./FormField"; -export * from "./FormFieldValue"; +export * from "./Scripts"; +export * from "./CustomCodeBlockType"; +export * from "./CustomCodeBlock"; +export * from "./ListCustomCodeBlocks"; +export * from "./AssetVariant"; +export * from "./Asset"; +export * from "./Assets"; +export * from "./AssetUploadUploadDetails"; +export * from "./AssetUpload"; +export * from "./AssetFolder"; +export * from "./AssetFolderList"; +export * from "./TriggerType"; +export * from "./WebhookFilter"; +export * from "./Webhook"; +export * from "./WebhookList"; export * from "./FormFieldValueType"; -export * from "./FormList"; +export * from "./FormFieldValue"; +export * from "./FormField"; export * from "./FormResponseSettings"; +export * from "./Form"; +export * from "./FormList"; export * from "./FormSubmission"; export * from "./FormSubmissionList"; -export * from "./FormSubmissionTrigger"; -export * from "./FormSubmissionTriggerPayload"; -export * from "./FormSubmissionTriggerPayloadSchemaItem"; -export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; -export * from "./ImageNode"; -export * from "./ImageNodeImage"; -export * from "./InvalidDomain"; -export * from "./InvalidScopes"; -export * from "./InventoryItem"; -export * from "./InventoryItemInventoryType"; -export * from "./ItemsListItemsLiveRequestLastPublished"; -export * from "./ItemsListItemsRequestLastPublished"; -export * from "./ListCustomCodeBlocks"; -export * from "./Locale"; -export * from "./Locales"; -export * from "./Metadata"; -export * from "./MetadataOptionsItem"; -export * from "./NewOrder"; -export * from "./NoDomains"; -export * from "./Node"; -export * from "./NotEnterprisePlanSite"; -export * from "./NotEnterprisePlanWorkspace"; -export * from "./OptionField"; -export * from "./Order"; -export * from "./OrderAddress"; -export * from "./OrderAddressJapanType"; -export * from "./OrderAddressType"; -export * from "./OrderBillingAddress"; -export * from "./OrderBillingAddressJapanType"; -export * from "./OrderBillingAddressType"; -export * from "./OrderCustomerInfo"; -export * from "./OrderDisputeLastStatus"; -export * from "./OrderDownloadFilesItem"; -export * from "./OrderList"; -export * from "./OrderMetadata"; -export * from "./OrderPrice"; -export * from "./OrderPurchasedItem"; -export * from "./OrderPurchasedItemVariantImage"; -export * from "./OrderPurchasedItemVariantImageFile"; -export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; -export * from "./OrderShippingAddress"; -export * from "./OrderShippingAddressJapanType"; -export * from "./OrderShippingAddressType"; -export * from "./OrderStatus"; -export * from "./OrderTotals"; -export * from "./OrderTotalsExtrasItem"; -export * from "./OrderTotalsExtrasItemType"; -export * from "./Page"; -export * from "./PageCreatedWebhook"; -export * from "./PageCreatedWebhookPayload"; -export * from "./PageDeletedWebhook"; -export * from "./PageDeletedWebhookPayload"; -export * from "./PageList"; -export * from "./PageMetadataUpdatedWebhook"; -export * from "./PageMetadataUpdatedWebhookPayload"; -export * from "./PageOpenGraph"; -export * from "./PageSeo"; -export * from "./Pagination"; -export * from "./Payload"; -export * from "./PayloadFieldData"; -export * from "./PaypalDetails"; -export * from "./Product"; -export * from "./ProductAndSkUs"; -export * from "./ProductAndSkUsList"; -export * from "./ProductFieldData"; -export * from "./ProductFieldDataEcProductType"; +export * from "./UserStatus"; +export * from "./UserAccessGroupsItemType"; +export * from "./UserAccessGroupsItem"; +export * from "./UserDataData"; +export * from "./UserData"; +export * from "./User"; +export * from "./UserList"; +export * from "./UsersNotEnabled"; +export * from "./DuplicateUserEmail"; +export * from "./UserLimitReached"; +export * from "./AccessGroup"; +export * from "./AccessGroupList"; +export * from "./SkuPropertyListEnumItem"; +export * from "./SkuPropertyList"; export * from "./ProductFieldDataTaxCategory"; -export * from "./PublishStatus"; -export * from "./Redirect"; -export * from "./Redirects"; -export * from "./ReferenceField"; -export * from "./ReferenceFieldMetadata"; -export * from "./ReferenceFieldType"; -export * from "./RegisteredScriptList"; -export * from "./Robots"; -export * from "./RobotsRulesItem"; -export * from "./ScriptApply"; -export * from "./ScriptApplyList"; -export * from "./ScriptApplyLocation"; -export * from "./Scripts"; -export * from "./SearchButtonNode"; -export * from "./SearchButtonNodeWrite"; -export * from "./Select"; -export * from "./SelectNode"; -export * from "./SelectNodeChoicesItem"; -export * from "./SelectNodeWriteChoicesItem"; -export * from "./SingleLocaleCreatedPayload"; -export * from "./SingleLocaleCreatedPayloadFieldData"; -export * from "./Site"; -export * from "./SiteActivityLogItem"; -export * from "./SiteActivityLogItemEvent"; -export * from "./SiteActivityLogItemResourceOperation"; -export * from "./SiteActivityLogItemUser"; -export * from "./SiteActivityLogResponse"; -export * from "./SiteDataCollectionType"; -export * from "./SiteMembership"; -export * from "./SiteMembershipAuditLogItem"; -export * from "./SiteMembershipAuditLogItemEventSubType"; -export * from "./SitePlan"; -export * from "./SitePlanId"; -export * from "./SitePlanName"; -export * from "./SitePublish"; -export * from "./SitePublishPayload"; -export * from "./Sites"; -export * from "./Sku"; -export * from "./SkuFieldData"; +export * from "./ProductFieldDataEcProductType"; +export * from "./ProductFieldData"; +export * from "./Product"; +export * from "./SkuValueList"; +export * from "./SkuFieldDataPrice"; export * from "./SkuFieldDataCompareAtPrice"; export * from "./SkuFieldDataEcSkuBillingMethod"; -export * from "./SkuFieldDataEcSkuSubscriptionPlan"; export * from "./SkuFieldDataEcSkuSubscriptionPlanInterval"; -export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItemStatus"; -export * from "./SkuFieldDataPrice"; -export * from "./SkuPropertyList"; -export * from "./SkuPropertyListEnumItem"; -export * from "./SkuValueList"; -export * from "./StaticField"; -export * from "./StaticFieldType"; -export * from "./StripeCard"; +export * from "./SkuFieldDataEcSkuSubscriptionPlanPlansItem"; +export * from "./SkuFieldDataEcSkuSubscriptionPlan"; +export * from "./SkuFieldData"; +export * from "./Sku"; +export * from "./ProductAndSkUs"; +export * from "./ProductAndSkUsList"; +export * from "./PublishStatus"; +export * from "./OrderPrice"; +export * from "./OrderAddressType"; +export * from "./OrderAddressJapanType"; +export * from "./OrderAddress"; +export * from "./OrderPurchasedItemVariantImageFileVariantsItem"; +export * from "./OrderPurchasedItemVariantImageFile"; +export * from "./OrderPurchasedItemVariantImage"; +export * from "./OrderPurchasedItem"; +export * from "./StripeDetails"; export * from "./StripeCardBrand"; export * from "./StripeCardExpires"; -export * from "./StripeDetails"; -export * from "./SubmitButtonNode"; -export * from "./SubmitButtonNodeWrite"; -export * from "./Text"; -export * from "./TextInputNode"; -export * from "./TextInputNodeWrite"; -export * from "./TextNode"; -export * from "./TextNodeText"; -export * from "./TextNodeWrite"; -export * from "./TriggerType"; +export * from "./StripeCard"; +export * from "./PaypalDetails"; +export * from "./OrderStatus"; +export * from "./OrderDisputeLastStatus"; +export * from "./OrderShippingAddressType"; +export * from "./OrderShippingAddressJapanType"; +export * from "./OrderShippingAddress"; +export * from "./OrderBillingAddressType"; +export * from "./OrderBillingAddressJapanType"; +export * from "./OrderBillingAddress"; +export * from "./OrderCustomerInfo"; +export * from "./OrderMetadata"; +export * from "./OrderTotalsExtrasItemType"; +export * from "./OrderTotalsExtrasItem"; +export * from "./OrderTotals"; +export * from "./OrderDownloadFilesItem"; +export * from "./Order"; +export * from "./OrderList"; +export * from "./InventoryItemInventoryType"; +export * from "./InventoryItem"; +export * from "./EcommerceSettings"; +export * from "./FormSubmissionTriggerPayloadSchemaItemFieldType"; +export * from "./FormSubmissionTriggerPayloadSchemaItem"; +export * from "./FormSubmissionTriggerPayload"; +export * from "./FormSubmissionTrigger"; +export * from "./SitePublishPayload"; +export * from "./SitePublish"; +export * from "./NewOrder"; export * from "./UpdatedOrder"; -export * from "./User"; -export * from "./UserAccess"; -export * from "./UserAccessAuditLogItem"; -export * from "./UserAccessAuditLogItemEventSubType"; -export * from "./UserAccessGroupsItem"; -export * from "./UserAccessGroupsItemType"; -export * from "./UserData"; -export * from "./UserDataData"; -export * from "./UserLimitReached"; -export * from "./UserList"; -export * from "./UserStatus"; -export * from "./UsersNotEnabled"; -export * from "./Webhook"; -export * from "./WebhookFilter"; -export * from "./WebhookList"; -export * from "./WorkspaceAuditLogItem"; -export * from "./WorkspaceAuditLogItemActor"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipGranularAccess"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipSite"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadSiteMembershipUserType"; -export * from "./WorkspaceAuditLogItemPayloadUserAccessMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationTargetUsersItem"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceInvitationUserType"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipMethod"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipTargetUser"; -export * from "./WorkspaceAuditLogItemPayloadWorkspaceMembershipUserType"; -export * from "./WorkspaceAuditLogItemWorkspace"; -export * from "./WorkspaceAuditLogResponse"; -export * from "./WorkspaceInvitation"; -export * from "./WorkspaceInvitationAuditLogItem"; -export * from "./WorkspaceInvitationAuditLogItemEventSubType"; -export * from "./WorkspaceMembership"; -export * from "./WorkspaceMembershipAuditLogItem"; -export * from "./WorkspaceMembershipAuditLogItemEventSubType"; +export * from "./SingleLocaleCreatedPayloadFieldData"; +export * from "./SingleLocaleCreatedPayload"; +export * from "./CollectionItemCreated"; +export * from "./CollectionItemChanged"; +export * from "./CollectionItemRemovedPayloadFieldData"; +export * from "./CollectionItemRemovedPayload"; +export * from "./CollectionItemRemoved"; +export * from "./PayloadFieldData"; +export * from "./Payload"; +export * from "./CollectionItemPublished"; +export * from "./CollectionItemUnpublishedPayloadFieldData"; +export * from "./CollectionItemUnpublishedPayload"; +export * from "./CollectionItemUnpublished"; +export * from "./PageCreatedWebhookPayload"; +export * from "./PageCreatedWebhook"; +export * from "./PageMetadataUpdatedWebhookPayload"; +export * from "./PageMetadataUpdatedWebhook"; +export * from "./PageDeletedWebhookPayload"; +export * from "./PageDeletedWebhook"; +export * from "./CommentPayloadAuthor"; +export * from "./CommentPayloadMentionedUsersItem"; +export * from "./CommentPayload"; +export * from "./Comment"; diff --git a/src/version.ts b/src/version.ts index de6a59ab..7d5c832f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "3.3.0-beta"; +export const SDK_VERSION = "3.2.2"; diff --git a/tests/mock-server/MockServer.ts b/tests/mock-server/MockServer.ts index 5b30fe7c..6e258f17 100644 --- a/tests/mock-server/MockServer.ts +++ b/tests/mock-server/MockServer.ts @@ -1,4 +1,4 @@ -import type { RequestHandlerOptions } from "msw"; +import { RequestHandlerOptions } from "msw"; import type { SetupServer } from "msw/node"; import { mockEndpointBuilder } from "./mockEndpointBuilder"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index e1a90f7f..81608069 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -22,7 +22,7 @@ async function formatHttpRequest(request: Request, id?: string): Promise } else if (clone.body) { body = await clone.text(); } - } catch (_e) { + } catch (e) { body = "(unable to parse body)"; } @@ -48,7 +48,7 @@ async function formatHttpResponse(response: Response, id?: string): Promise { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug(`request:start\n${formattedRequest}`); + console.debug("request:start\n" + formattedRequest); }); mswServer.events.on("request:unhandled", async ({ request, requestId }) => { const formattedRequest = await formatHttpRequest(request, requestId); - console.debug(`request:unhandled\n${formattedRequest}`); + console.debug("request:unhandled\n" + formattedRequest); }); mswServer.events.on("response:mocked", async ({ request, response, requestId }) => { const formattedResponse = await formatHttpResponse(response, requestId); - console.debug(`response:mocked\n${formattedResponse}`); + console.debug("response:mocked\n" + formattedResponse); }); } } diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 18557ec1..390b2256 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -1,6 +1,5 @@ -import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponseResolver, http } from "msw"; +import { DefaultBodyType, HttpHandler, HttpResponse, HttpResponseResolver, http } from "msw"; -import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; import { withHeaders } from "./withHeaders"; import { withJson } from "./withJson"; @@ -128,25 +127,28 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta } jsonBody(body: unknown): ResponseStage { - if (body === undefined) { - throw new Error("Undefined is not valid JSON. Do not call jsonBody if you want an empty body."); - } this.predicates.push((resolver) => withJson(body, resolver)); return this; } respondWith(): ResponseStatusStage { - return new ResponseBuilder(this.method, this.buildUrl(), this.predicates, this.handlerOptions); + return new ResponseBuilder(this.method, this.buildPath(), this.predicates, this.handlerOptions); } - private buildUrl(): string { - return url.join(this._baseUrl, this.path); + private buildPath(): string { + if (this._baseUrl.endsWith("/") && this.path.startsWith("/")) { + return this._baseUrl + this.path.slice(1); + } + if (!this._baseUrl.endsWith("/") && !this.path.startsWith("/")) { + return this._baseUrl + "/" + this.path; + } + return this._baseUrl + this.path; } } class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, ResponseBodyStage, BuildStage { private readonly method: HttpMethod; - private readonly url: string; + private readonly path: string; private readonly requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[]; private readonly handlerOptions?: HttpHandlerBuilderOptions; @@ -156,12 +158,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo constructor( method: HttpMethod, - url: string, + path: string, requestPredicates: ((resolver: HttpResponseResolver) => HttpResponseResolver)[], options?: HttpHandlerBuilderOptions, ) { this.method = method; - this.url = url; + this.path = path; this.requestPredicates = requestPredicates; this.handlerOptions = options; } @@ -182,29 +184,21 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo } public jsonBody(body: unknown): BuildStage { - if (body === undefined) { - throw new Error("Undefined is not valid JSON. Do not call jsonBody if you expect an empty body."); - } this.responseBody = toJson(body); return this; } public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { - const response = new HttpResponse(this.responseBody, { + return new HttpResponse(this.responseBody, { status: this.responseStatusCode, headers: this.responseHeaders, }); - // if no Content-Type header is set, delete the default text content type that is set - if (Object.keys(this.responseHeaders).some((key) => key.toLowerCase() === "content-type") === false) { - response.headers.delete("Content-Type"); - } - return response; }; const finalResolver = this.requestPredicates.reduceRight((acc, predicate) => predicate(acc), responseResolver); - const handler = http[this.method](this.url, finalResolver, this.handlerOptions); + const handler = http[this.method](this.path, finalResolver, this.handlerOptions); this.handlerOptions?.onBuild?.(handler); return handler; } diff --git a/tests/mock-server/withHeaders.ts b/tests/mock-server/withHeaders.ts index 6599d2b4..e77c837d 100644 --- a/tests/mock-server/withHeaders.ts +++ b/tests/mock-server/withHeaders.ts @@ -1,4 +1,4 @@ -import { type HttpResponseResolver, passthrough } from "msw"; +import { HttpResponseResolver, passthrough } from "msw"; /** * Creates a request matcher that validates if request headers match specified criteria diff --git a/tests/mock-server/withJson.ts b/tests/mock-server/withJson.ts index b627638b..4b4820c9 100644 --- a/tests/mock-server/withJson.ts +++ b/tests/mock-server/withJson.ts @@ -1,4 +1,4 @@ -import { type HttpResponseResolver, passthrough } from "msw"; +import { HttpResponseResolver, passthrough } from "msw"; import { fromJson, toJson } from "../../src/core/json"; @@ -12,23 +12,17 @@ export function withJson(expectedBody: unknown, resolver: HttpResponseResolver): const { request } = args; let clonedRequest: Request; - let bodyText: string | undefined; let actualBody: unknown; try { clonedRequest = request.clone(); - bodyText = await clonedRequest.text(); - if (bodyText === "") { - console.error("Request body is empty, expected a JSON object."); - return passthrough(); - } - actualBody = fromJson(bodyText); + actualBody = fromJson(await clonedRequest.text()); } catch (error) { - console.error(`Error processing request body:\n\tError: ${error}\n\tBody: ${bodyText}`); + console.error("Error processing request body:", error); return passthrough(); } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).filter((key) => !key.startsWith("pagination.")).length > 0) { + if (Object.keys(mismatches).length > 0) { console.error("JSON body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } @@ -67,7 +61,7 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [mismatchKey, mismatchValue] of Object.entries(itemMismatches)) { - arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : `.${mismatchKey}`}`] = mismatchValue; + arrayMismatches[`[${i}]${mismatchKey === "value" ? "" : "." + mismatchKey}`] = mismatchValue; } } } @@ -81,14 +75,8 @@ function findMismatches(actual: any, expected: any): Record 0) { for (const [nestedKey, nestedValue] of Object.entries(nestedMismatches)) { - mismatches[`${key}${nestedKey === "value" ? "" : `.${nestedKey}`}`] = nestedValue; + mismatches[`${key}${nestedKey === "value" ? "" : "." + nestedKey}`] = nestedValue; } } } else if (actual[key] !== expected[key]) { diff --git a/tests/tsconfig.json b/tests/tsconfig.json index fe83070d..10185ed2 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": null, "rootDir": "..", diff --git a/tests/unit/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 90bbc7ee..79ef9799 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -18,41 +18,5 @@ describe("BasicAuth", () => { password: "password", }); }); - - it("handles password with colons", () => { - expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcjpwYXNzOndvcmQ=")).toEqual({ - username: "user", - password: "pass:word", - }); - }); - - it("handles empty username and password (just colon)", () => { - expect(BasicAuth.fromAuthorizationHeader("Basic Og==")).toEqual({ - username: "", - password: "", - }); - }); - - it("handles empty username", () => { - expect(BasicAuth.fromAuthorizationHeader("Basic OnBhc3N3b3Jk")).toEqual({ - username: "", - password: "password", - }); - }); - - it("handles empty password", () => { - expect(BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU6")).toEqual({ - username: "username", - password: "", - }); - }); - - it("throws error for completely empty credentials", () => { - expect(() => BasicAuth.fromAuthorizationHeader("Basic ")).toThrow("Invalid basic auth"); - }); - - it("throws error for credentials without colon", () => { - expect(() => BasicAuth.fromAuthorizationHeader("Basic dXNlcm5hbWU=")).toThrow("Invalid basic auth"); - }); }); }); diff --git a/tests/unit/base64.test.ts b/tests/unit/base64.test.ts deleted file mode 100644 index 939594ca..00000000 --- a/tests/unit/base64.test.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { base64Decode, base64Encode } from "../../src/core/base64"; - -describe("base64", () => { - describe("base64Encode", () => { - it("should encode ASCII strings", () => { - expect(base64Encode("hello")).toBe("aGVsbG8="); - expect(base64Encode("")).toBe(""); - }); - - it("should encode UTF-8 strings", () => { - expect(base64Encode("café")).toBe("Y2Fmw6k="); - expect(base64Encode("🎉")).toBe("8J+OiQ=="); - }); - - it("should handle basic auth credentials", () => { - expect(base64Encode("username:password")).toBe("dXNlcm5hbWU6cGFzc3dvcmQ="); - }); - }); - - describe("base64Decode", () => { - it("should decode ASCII strings", () => { - expect(base64Decode("aGVsbG8=")).toBe("hello"); - expect(base64Decode("")).toBe(""); - }); - - it("should decode UTF-8 strings", () => { - expect(base64Decode("Y2Fmw6k=")).toBe("café"); - expect(base64Decode("8J+OiQ==")).toBe("🎉"); - }); - - it("should handle basic auth credentials", () => { - expect(base64Decode("dXNlcm5hbWU6cGFzc3dvcmQ=")).toBe("username:password"); - }); - }); - - describe("round-trip encoding", () => { - const testStrings = [ - "hello world", - "test@example.com", - "café", - "username:password", - "user@domain.com:super$ecret123!", - ]; - - testStrings.forEach((testString) => { - it(`should round-trip encode/decode: "${testString}"`, () => { - const encoded = base64Encode(testString); - const decoded = base64Decode(encoded); - expect(decoded).toBe(testString); - }); - }); - }); -}); diff --git a/tests/unit/fetcher/Fetcher.test.ts b/tests/unit/fetcher/Fetcher.test.ts index ae608ac1..a32945e9 100644 --- a/tests/unit/fetcher/Fetcher.test.ts +++ b/tests/unit/fetcher/Fetcher.test.ts @@ -1,6 +1,7 @@ import fs from "fs"; import { join } from "path"; -import { type Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; + +import { Fetcher, fetcherImpl } from "../../../src/core/fetcher/Fetcher"; describe("Test fetcherImpl", () => { it("should handle successful request", async () => { @@ -11,15 +12,14 @@ describe("Test fetcherImpl", () => { body: { data: "test" }, contentType: "application/json", requestType: "json", - responseType: "json", }; - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify({ data: "test" }), { - status: 200, - statusText: "OK", - }), - ); + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + status: 200, + text: () => Promise.resolve(JSON.stringify({ data: "test" })), + json: () => ({ data: "test" }), + }); const result = await fetcherImpl(mockArgs); expect(result.ok).toBe(true); @@ -45,16 +45,16 @@ describe("Test fetcherImpl", () => { headers: { "X-Test": "x-test-header" }, contentType: "application/octet-stream", requestType: "bytes", - responseType: "json", + duplex: "half", body: fs.createReadStream(join(__dirname, "test-file.txt")), }; - global.fetch = jest.fn().mockResolvedValue( - new Response(JSON.stringify({ data: "test" }), { - status: 200, - statusText: "OK", - }), - ); + global.fetch = jest.fn().mockResolvedValue({ + ok: true, + status: 200, + text: () => Promise.resolve(JSON.stringify({ data: "test" })), + json: () => Promise.resolve({ data: "test" }), + }); const result = await fetcherImpl(mockArgs); diff --git a/tests/unit/fetcher/HttpResponsePromise.test.ts b/tests/unit/fetcher/HttpResponsePromise.test.ts index c063b079..2216a33e 100644 --- a/tests/unit/fetcher/HttpResponsePromise.test.ts +++ b/tests/unit/fetcher/HttpResponsePromise.test.ts @@ -1,7 +1,7 @@ import { beforeEach, describe, expect, it, jest } from "@jest/globals"; import { HttpResponsePromise } from "../../../src/core/fetcher/HttpResponsePromise"; -import type { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; +import { RawResponse, WithRawResponse } from "../../../src/core/fetcher/RawResponse"; describe("HttpResponsePromise", () => { const mockRawResponse: RawResponse = { diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index 06e03b2c..486e1e61 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -48,113 +48,4 @@ describe("Test createRequestUrl", () => { const queryParams = { special: "a&b=c d" }; expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?special=a%26b%3Dc%20d"); }); - - // Additional tests for edge cases and different value types - it("should handle numeric values", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { count: 42, price: 19.99, active: 1, inactive: 0 }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?count=42&price=19.99&active=1&inactive=0", - ); - }); - - it("should handle boolean values", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { enabled: true, disabled: false }; - expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?enabled=true&disabled=false"); - }); - - it("should handle null and undefined values", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - valid: "value", - nullValue: null, - undefinedValue: undefined, - emptyString: "", - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?valid=value&nullValue=&emptyString=", - ); - }); - - it("should handle deeply nested objects", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - user: { - profile: { - name: "John", - settings: { theme: "dark" }, - }, - }, - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", - ); - }); - - it("should handle arrays of objects", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - users: [ - { name: "John", age: 30 }, - { name: "Jane", age: 25 }, - ], - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?users%5Bname%5D=John&users%5Bage%5D=30&users%5Bname%5D=Jane&users%5Bage%5D=25", - ); - }); - - it("should handle mixed arrays", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - mixed: ["string", 42, true, { key: "value" }], - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?mixed=string&mixed=42&mixed=true&mixed%5Bkey%5D=value", - ); - }); - - it("should handle empty arrays", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { emptyArray: [] }; - expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); - }); - - it("should handle empty objects", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { emptyObject: {} }; - expect(createRequestUrl(baseUrl, queryParams)).toBe(baseUrl); - }); - - it("should handle special characters in keys", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { "key with spaces": "value", "key[with]brackets": "value" }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?key%20with%20spaces=value&key%5Bwith%5Dbrackets=value", - ); - }); - - it("should handle URL with existing query parameters", () => { - const baseUrl = "https://api.example.com?existing=param"; - const queryParams = { new: "value" }; - expect(createRequestUrl(baseUrl, queryParams)).toBe("https://api.example.com?existing=param?new=value"); - }); - - it("should handle complex nested structures", () => { - const baseUrl = "https://api.example.com"; - const queryParams = { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, - }, - sort: { field: "name", direction: "asc" }, - }; - expect(createRequestUrl(baseUrl, queryParams)).toBe( - "https://api.example.com?filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - ); - }); }); diff --git a/tests/unit/fetcher/getFetchFn.test.ts b/tests/unit/fetcher/getFetchFn.test.ts index ac05ab2f..b55dbbc3 100644 --- a/tests/unit/fetcher/getFetchFn.test.ts +++ b/tests/unit/fetcher/getFetchFn.test.ts @@ -3,7 +3,7 @@ import { RUNTIME } from "../../../src/core/runtime"; describe("Test for getFetchFn", () => { it("should get node-fetch function", async () => { - if (RUNTIME.type === "node") { + if (RUNTIME.type == "node") { if (RUNTIME.parsedVersion != null && RUNTIME.parsedVersion >= 18) { expect(await getFetchFn()).toBe(fetch); } else { @@ -13,7 +13,7 @@ describe("Test for getFetchFn", () => { }); it("should get fetch function", async () => { - if (RUNTIME.type === "browser") { + if (RUNTIME.type == "browser") { const fetchFn = await getFetchFn(); expect(typeof fetchFn).toBe("function"); expect(fetchFn.name).toBe("fetch"); diff --git a/tests/unit/fetcher/getRequestBody.test.ts b/tests/unit/fetcher/getRequestBody.test.ts index e864c8b5..1e4a3d69 100644 --- a/tests/unit/fetcher/getRequestBody.test.ts +++ b/tests/unit/fetcher/getRequestBody.test.ts @@ -2,6 +2,18 @@ import { getRequestBody } from "../../../src/core/fetcher/getRequestBody"; import { RUNTIME } from "../../../src/core/runtime"; describe("Test getRequestBody", () => { + it("should return FormData as is in Node environment", async () => { + if (RUNTIME.type === "node") { + const formData = new (await import("formdata-node")).FormData(); + formData.append("key", "value"); + const result = await getRequestBody({ + body: formData, + type: "file", + }); + expect(result).toBe(formData); + } + }); + it("should stringify body if not FormData in Node environment", async () => { if (RUNTIME.type === "node") { const body = { key: "value" }; @@ -15,7 +27,7 @@ describe("Test getRequestBody", () => { it("should return FormData in browser environment", async () => { if (RUNTIME.type === "browser") { - const formData = new FormData(); + const formData = new (await import("form-data")).default(); formData.append("key", "value"); const result = await getRequestBody({ body: formData, diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index ad6bc5be..17ef223c 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -1,6 +1,7 @@ +import { RUNTIME } from "../../../src/core/runtime"; import { getResponseBody } from "../../../src/core/fetcher/getResponseBody"; + import { chooseStreamWrapper } from "../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; -import { RUNTIME } from "../../../src/core/runtime"; describe("Test getResponseBody", () => { it("should handle blob response type", async () => { diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 6f9426fc..3cdaa40a 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -129,107 +129,4 @@ describe("requestWithRetries", () => { expect(response1.status).toBe(200); expect(response2.status).toBe(200); }); - - it("should respect retry-after header with seconds value", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ "retry-after": "5" }), - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 5000); // 5 seconds = 5000ms - expect(response.status).toBe(200); - }); - - it("should respect retry-after header with HTTP date value", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - const futureDate = new Date(Date.now() + 3000); // 3 seconds from now - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ "retry-after": futureDate.toUTCString() }), - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - // Should use the date-based delay (approximately 3000ms, but with jitter) - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); - const actualDelay = setTimeoutSpy.mock.calls[0][1]; - expect(actualDelay).toBeGreaterThan(2000); - expect(actualDelay).toBeLessThan(4000); - expect(response.status).toBe(200); - }); - - it("should respect x-ratelimit-reset header", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - const resetTime = Math.floor((Date.now() + 4000) / 1000); // 4 seconds from now in Unix timestamp - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ "x-ratelimit-reset": resetTime.toString() }), - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - // Should use the x-ratelimit-reset delay (approximately 4000ms, but with positive jitter) - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); - const actualDelay = setTimeoutSpy.mock.calls[0][1]; - expect(actualDelay).toBeGreaterThan(3000); - expect(actualDelay).toBeLessThan(6000); - expect(response.status).toBe(200); - }); - - it("should cap delay at MAX_RETRY_DELAY for large header values", async () => { - setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { - process.nextTick(callback); - return null as any; - }); - - mockFetch - .mockResolvedValueOnce( - new Response("", { - status: 429, - headers: new Headers({ "retry-after": "120" }), // 120 seconds = 120000ms > MAX_RETRY_DELAY (60000ms) - }), - ) - .mockResolvedValueOnce(new Response("", { status: 200 })); - - const responsePromise = requestWithRetries(() => mockFetch(), 1); - await jest.runAllTimersAsync(); - const response = await responsePromise; - - // Should be capped at MAX_RETRY_DELAY (60000ms) with jitter applied - expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), 60000); // Exactly MAX_RETRY_DELAY since jitter with 0.5 random keeps it at 60000 - expect(response.status).toBe(200); - }); }); diff --git a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts index 57892e4d..172c1c26 100644 --- a/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/Node18UniversalStreamWrapper.test.ts @@ -61,7 +61,7 @@ describe("Node18UniversalStreamWrapper", () => { }); const stream = new Node18UniversalStreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts index f47b166c..19c26668 100644 --- a/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/NodePre18StreamWrapper.test.ts @@ -37,7 +37,7 @@ describe("NodePre18StreamWrapper", () => { const rawStream = (await import("readable-stream")).Readable.from(["test", "test"]); const stream = new NodePre18StreamWrapper(rawStream); const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { expect(chunk.toString()).toEqual("test"); callback(); }, @@ -51,7 +51,7 @@ describe("NodePre18StreamWrapper", () => { const stream = new NodePre18StreamWrapper(rawStream); const buffer: Uint8Array[] = []; const dest = new (await import("readable-stream")).Writable({ - write(chunk, _encoding, callback) { + write(chunk, encoding, callback) { buffer.push(chunk); callback(); }, diff --git a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts index 56cba346..5752c8af 100644 --- a/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts +++ b/tests/unit/fetcher/stream-wrappers/chooseStreamWrapper.test.ts @@ -1,7 +1,7 @@ -import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { Node18UniversalStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper"; import { NodePre18StreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/NodePre18StreamWrapper"; import { UndiciStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/UndiciStreamWrapper"; +import { chooseStreamWrapper } from "../../../../src/core/fetcher/stream-wrappers/chooseStreamWrapper"; import { RUNTIME } from "../../../../src/core/runtime"; describe("chooseStreamWrapper", () => { diff --git a/tests/unit/schemas/lazy/lazy.test.ts b/tests/unit/schemas/lazy/lazy.test.ts index 57a76df2..3a5a338d 100644 --- a/tests/unit/schemas/lazy/lazy.test.ts +++ b/tests/unit/schemas/lazy/lazy.test.ts @@ -1,5 +1,5 @@ +import { Schema } from "../../../../src/core/schemas/Schema"; import { lazy, list, object, string } from "../../../../src/core/schemas/builders"; -import type { Schema } from "../../../../src/core/schemas/Schema"; import { itSchemaIdentity } from "../utils/itSchema"; describe("lazy", () => { diff --git a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts index 822c3ca4..09d594d0 100644 --- a/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts +++ b/tests/unit/schemas/schema-utils/getSchemaUtils.test.ts @@ -18,7 +18,7 @@ describe("getSchemaUtils", () => { itSchema( "transform and untransform run correctly", string().transform({ - transform: (x) => `${x}X`, + transform: (x) => x + "X", untransform: (x) => (x as string).slice(0, -1), }), { @@ -36,7 +36,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).parseOrThrow({ a: 24 }); - expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); + expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); }); }); @@ -48,7 +48,7 @@ describe("getSchemaUtils", () => { it("throws on invalid value", async () => { const value = () => object({ a: string(), b: string() }).jsonOrThrow({ a: 24 }); - expect(value).toThrowError('a: Expected string. Received 24.; Missing required key "b"'); + expect(value).toThrowError(new Error('a: Expected string. Received 24.; Missing required key "b"')); }); }); diff --git a/tests/unit/schemas/utils/itSchema.ts b/tests/unit/schemas/utils/itSchema.ts index a1e1cae9..82a53887 100644 --- a/tests/unit/schemas/utils/itSchema.ts +++ b/tests/unit/schemas/utils/itSchema.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import type { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; +import { Schema, SchemaOptions } from "../../../../src/core/schemas/Schema"; export function itSchemaIdentity( schema: Schema, @@ -48,7 +48,7 @@ export function itParse( it(title, () => { const maybeValid = schema.parse(raw, opts); if (!maybeValid.ok) { - throw new Error(`Failed to parse() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); + throw new Error("Failed to parse() " + JSON.stringify(maybeValid.errors, undefined, 4)); } expect(maybeValid.value).toStrictEqual(parsed); }); @@ -71,7 +71,7 @@ export function itJson( it(title, () => { const maybeValid = schema.json(parsed, opts); if (!maybeValid.ok) { - throw new Error(`Failed to json() ${JSON.stringify(maybeValid.errors, undefined, 4)}`); + throw new Error("Failed to json() " + JSON.stringify(maybeValid.errors, undefined, 4)); } expect(maybeValid.value).toStrictEqual(raw); }); diff --git a/tests/unit/schemas/utils/itValidate.ts b/tests/unit/schemas/utils/itValidate.ts index ffe40cef..ead1ca70 100644 --- a/tests/unit/schemas/utils/itValidate.ts +++ b/tests/unit/schemas/utils/itValidate.ts @@ -1,5 +1,5 @@ /* eslint-disable jest/no-export */ -import type { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; +import { Schema, SchemaOptions, ValidationError } from "../../../../src/core/schemas/Schema"; export function itValidate( title: string, diff --git a/tests/unit/url/join.test.ts b/tests/unit/url/join.test.ts deleted file mode 100644 index 1956a8c0..00000000 --- a/tests/unit/url/join.test.ts +++ /dev/null @@ -1,120 +0,0 @@ -import { join } from "../../../src/core/url/index"; - -describe("join", () => { - describe("basic functionality", () => { - it("should return empty string for empty base", () => { - expect(join("")).toBe(""); - expect(join("", "path")).toBe(""); - }); - - it("should handle single segment", () => { - expect(join("base", "segment")).toBe("base/segment"); - expect(join("base/", "segment")).toBe("base/segment"); - expect(join("base", "/segment")).toBe("base/segment"); - expect(join("base/", "/segment")).toBe("base/segment"); - }); - - it("should handle multiple segments", () => { - expect(join("base", "path1", "path2", "path3")).toBe("base/path1/path2/path3"); - expect(join("base/", "/path1/", "/path2/", "/path3/")).toBe("base/path1/path2/path3/"); - }); - }); - - describe("URL handling", () => { - it("should handle absolute URLs", () => { - expect(join("https://example.com", "api", "v1")).toBe("https://example.com/api/v1"); - expect(join("https://example.com/", "/api/", "/v1/")).toBe("https://example.com/api/v1/"); - expect(join("https://example.com/base", "api", "v1")).toBe("https://example.com/base/api/v1"); - }); - - it("should preserve URL query parameters and fragments", () => { - expect(join("https://example.com?query=1", "api")).toBe("https://example.com/api?query=1"); - expect(join("https://example.com#fragment", "api")).toBe("https://example.com/api#fragment"); - expect(join("https://example.com?query=1#fragment", "api")).toBe( - "https://example.com/api?query=1#fragment", - ); - }); - - it("should handle different protocols", () => { - expect(join("http://example.com", "api")).toBe("http://example.com/api"); - expect(join("ftp://example.com", "files")).toBe("ftp://example.com/files"); - expect(join("ws://example.com", "socket")).toBe("ws://example.com/socket"); - }); - - it("should fallback to path joining for malformed URLs", () => { - expect(join("not-a-url://", "path")).toBe("not-a-url:///path"); - }); - }); - - describe("edge cases", () => { - it("should handle empty segments", () => { - expect(join("base", "", "path")).toBe("base/path"); - expect(join("base", null as any, "path")).toBe("base/path"); - expect(join("base", undefined as any, "path")).toBe("base/path"); - }); - - it("should handle segments with only slashes", () => { - expect(join("base", "/", "path")).toBe("base/path"); - expect(join("base", "//", "path")).toBe("base/path"); - }); - - it("should handle base paths with trailing slashes", () => { - expect(join("base/", "path")).toBe("base/path"); - }); - - it("should handle complex nested paths", () => { - expect(join("api/v1/", "/users/", "/123/", "/profile")).toBe("api/v1/users/123/profile"); - }); - }); - - describe("real-world scenarios", () => { - it("should handle API endpoint construction", () => { - const baseUrl = "https://api.example.com/v1"; - expect(join(baseUrl, "users", "123", "posts")).toBe("https://api.example.com/v1/users/123/posts"); - }); - - it("should handle file path construction", () => { - expect(join("/var/www", "html", "assets", "images")).toBe("/var/www/html/assets/images"); - }); - - it("should handle relative path construction", () => { - expect(join("../parent", "child", "grandchild")).toBe("../parent/child/grandchild"); - }); - - it("should handle Windows-style paths", () => { - expect(join("C:\\Users", "Documents", "file.txt")).toBe("C:\\Users/Documents/file.txt"); - }); - }); - - describe("performance scenarios", () => { - it("should handle many segments efficiently", () => { - const segments = Array(100).fill("segment"); - const result = join("base", ...segments); - expect(result).toBe(`base/${segments.join("/")}`); - }); - - it("should handle long URLs", () => { - const longPath = "a".repeat(1000); - expect(join("https://example.com", longPath)).toBe(`https://example.com/${longPath}`); - }); - }); - - describe("trailing slash preservation", () => { - it("should preserve trailing slash on final result when base has trailing slash and no segments", () => { - expect(join("https://api.example.com/")).toBe("https://api.example.com/"); - expect(join("https://api.example.com/v1/")).toBe("https://api.example.com/v1/"); - }); - - it("should preserve trailing slash when last segment has trailing slash", () => { - expect(join("https://api.example.com", "users/")).toBe("https://api.example.com/users/"); - expect(join("api/v1", "users/")).toBe("api/v1/users/"); - }); - - it("should preserve trailing slash with multiple segments where last has trailing slash", () => { - expect(join("https://api.example.com", "v1", "collections/")).toBe( - "https://api.example.com/v1/collections/", - ); - expect(join("base", "path1", "path2/")).toBe("base/path1/path2/"); - }); - }); -}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts deleted file mode 100644 index 80e7e044..00000000 --- a/tests/unit/url/qs.test.ts +++ /dev/null @@ -1,187 +0,0 @@ -import { toQueryString } from "../../../src/core/url/index"; - -describe("Test qs toQueryString", () => { - describe("Basic functionality", () => { - it("should return empty string for null/undefined", () => { - expect(toQueryString(null)).toBe(""); - expect(toQueryString(undefined)).toBe(""); - }); - - it("should return empty string for primitive values", () => { - expect(toQueryString("hello")).toBe(""); - expect(toQueryString(42)).toBe(""); - expect(toQueryString(true)).toBe(""); - expect(toQueryString(false)).toBe(""); - }); - - it("should handle empty objects", () => { - expect(toQueryString({})).toBe(""); - }); - - it("should handle simple key-value pairs", () => { - const obj = { name: "John", age: 30 }; - expect(toQueryString(obj)).toBe("name=John&age=30"); - }); - }); - - describe("Array handling", () => { - it("should handle arrays with indices format (default)", () => { - const obj = { items: ["a", "b", "c"] }; - expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b&items%5B2%5D=c"); - }); - - it("should handle arrays with repeat format", () => { - const obj = { items: ["a", "b", "c"] }; - expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("items=a&items=b&items=c"); - }); - - it("should handle empty arrays", () => { - const obj = { items: [] }; - expect(toQueryString(obj)).toBe(""); - }); - - it("should handle arrays with mixed types", () => { - const obj = { mixed: ["string", 42, true, false] }; - expect(toQueryString(obj)).toBe("mixed%5B0%5D=string&mixed%5B1%5D=42&mixed%5B2%5D=true&mixed%5B3%5D=false"); - }); - - it("should handle arrays with objects", () => { - const obj = { users: [{ name: "John" }, { name: "Jane" }] }; - expect(toQueryString(obj)).toBe("users%5B0%5D%5Bname%5D=John&users%5B1%5D%5Bname%5D=Jane"); - }); - - it("should handle arrays with objects in repeat format", () => { - const obj = { users: [{ name: "John" }, { name: "Jane" }] }; - expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe("users%5Bname%5D=John&users%5Bname%5D=Jane"); - }); - }); - - describe("Nested objects", () => { - it("should handle nested objects", () => { - const obj = { user: { name: "John", age: 30 } }; - expect(toQueryString(obj)).toBe("user%5Bname%5D=John&user%5Bage%5D=30"); - }); - - it("should handle deeply nested objects", () => { - const obj = { user: { profile: { name: "John", settings: { theme: "dark" } } } }; - expect(toQueryString(obj)).toBe( - "user%5Bprofile%5D%5Bname%5D=John&user%5Bprofile%5D%5Bsettings%5D%5Btheme%5D=dark", - ); - }); - - it("should handle empty nested objects", () => { - const obj = { user: {} }; - expect(toQueryString(obj)).toBe(""); - }); - }); - - describe("Encoding", () => { - it("should encode by default", () => { - const obj = { name: "John Doe", email: "john@example.com" }; - expect(toQueryString(obj)).toBe("name=John%20Doe&email=john%40example.com"); - }); - - it("should not encode when encode is false", () => { - const obj = { name: "John Doe", email: "john@example.com" }; - expect(toQueryString(obj, { encode: false })).toBe("name=John Doe&email=john@example.com"); - }); - - it("should encode special characters in keys", () => { - const obj = { "user name": "John", "email[primary]": "john@example.com" }; - expect(toQueryString(obj)).toBe("user%20name=John&email%5Bprimary%5D=john%40example.com"); - }); - - it("should not encode special characters in keys when encode is false", () => { - const obj = { "user name": "John", "email[primary]": "john@example.com" }; - expect(toQueryString(obj, { encode: false })).toBe("user name=John&email[primary]=john@example.com"); - }); - }); - - describe("Mixed scenarios", () => { - it("should handle complex nested structures", () => { - const obj = { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, - }, - sort: { field: "name", direction: "asc" }, - }; - expect(toQueryString(obj)).toBe( - "filters%5Bstatus%5D%5B0%5D=active&filters%5Bstatus%5D%5B1%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D%5B0%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D%5B1%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - ); - }); - - it("should handle complex nested structures with repeat format", () => { - const obj = { - filters: { - status: ["active", "pending"], - category: { - type: "electronics", - subcategories: ["phones", "laptops"], - }, - }, - sort: { field: "name", direction: "asc" }, - }; - expect(toQueryString(obj, { arrayFormat: "repeat" })).toBe( - "filters%5Bstatus%5D=active&filters%5Bstatus%5D=pending&filters%5Bcategory%5D%5Btype%5D=electronics&filters%5Bcategory%5D%5Bsubcategories%5D=phones&filters%5Bcategory%5D%5Bsubcategories%5D=laptops&sort%5Bfield%5D=name&sort%5Bdirection%5D=asc", - ); - }); - - it("should handle arrays with null/undefined values", () => { - const obj = { items: ["a", null, "c", undefined, "e"] }; - expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e"); - }); - - it("should handle objects with null/undefined values", () => { - const obj = { name: "John", age: null, email: undefined, active: true }; - expect(toQueryString(obj)).toBe("name=John&age=&active=true"); - }); - }); - - describe("Edge cases", () => { - it("should handle numeric keys", () => { - const obj = { "0": "zero", "1": "one" }; - expect(toQueryString(obj)).toBe("0=zero&1=one"); - }); - - it("should handle boolean values in objects", () => { - const obj = { enabled: true, disabled: false }; - expect(toQueryString(obj)).toBe("enabled=true&disabled=false"); - }); - - it("should handle empty strings", () => { - const obj = { name: "", description: "test" }; - expect(toQueryString(obj)).toBe("name=&description=test"); - }); - - it("should handle zero values", () => { - const obj = { count: 0, price: 0.0 }; - expect(toQueryString(obj)).toBe("count=0&price=0"); - }); - - it("should handle arrays with empty strings", () => { - const obj = { items: ["a", "", "c"] }; - expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c"); - }); - }); - - describe("Options combinations", () => { - it("should respect both arrayFormat and encode options", () => { - const obj = { items: ["a & b", "c & d"] }; - expect(toQueryString(obj, { arrayFormat: "repeat", encode: false })).toBe("items=a & b&items=c & d"); - }); - - it("should use default options when none provided", () => { - const obj = { items: ["a", "b"] }; - expect(toQueryString(obj)).toBe("items%5B0%5D=a&items%5B1%5D=b"); - }); - - it("should merge provided options with defaults", () => { - const obj = { items: ["a", "b"], name: "John Doe" }; - expect(toQueryString(obj, { encode: false })).toBe("items[0]=a&items[1]=b&name=John Doe"); - }); - }); -}); diff --git a/tests/wire/.gitkeep b/tests/wire/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/tests/wire/accessGroups.test.ts b/tests/wire/accessGroups.test.ts index a5848636..52857a46 100644 --- a/tests/wire/accessGroups.test.ts +++ b/tests/wire/accessGroups.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("AccessGroups", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -43,8 +44,8 @@ describe("AccessGroups", () => { .build(); const response = await client.accessGroups.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sort: "CreatedOn", }); expect(response).toEqual({ @@ -70,130 +71,4 @@ describe("AccessGroups", () => { ], }); }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/accessgroups") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.accessGroups.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/assets.test.ts b/tests/wire/assets.test.ts index e49a5113..0fe783e9 100644 --- a/tests/wire/assets.test.ts +++ b/tests/wire/assets.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Assets", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -78,8 +79,8 @@ describe("Assets", () => { .build(); const response = await client.assets.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ assets: [ @@ -144,112 +145,7 @@ describe("Assets", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/assets") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/assets") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/assets") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/assets") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/assets") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -325,132 +221,7 @@ describe("Assets", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/assets") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.create("site_id", { - fileName: "fileName", - fileHash: "fileHash", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/assets") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.create("site_id", { - fileName: "fileName", - fileHash: "fileHash", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/assets") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.create("site_id", { - fileName: "fileName", - fileHash: "fileHash", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/assets") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.create("site_id", { - fileName: "fileName", - fileHash: "fileHash", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileHash: "fileHash" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/assets") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.create("site_id", { - fileName: "fileName", - fileHash: "fileHash", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -520,82 +291,7 @@ describe("Assets", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.assets.get("asset_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.assets.get("asset_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.assets.get("asset_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.assets.get("asset_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/assets/asset_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.assets.get("asset_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -608,112 +304,7 @@ describe("Assets", () => { expect(response).toEqual(undefined); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/assets/asset_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.delete("asset_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/assets/asset_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.delete("asset_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/assets/asset_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.delete("asset_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/assets/asset_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.delete("asset_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/assets/asset_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.delete("asset_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -784,117 +375,7 @@ describe("Assets", () => { }); }); - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/assets/asset_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.update("asset_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/assets/asset_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.update("asset_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/assets/asset_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.update("asset_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/assets/asset_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.update("asset_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/assets/asset_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.update("asset_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-folders (1)", async () => { + test("list-folders", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -944,112 +425,7 @@ describe("Assets", () => { }); }); - test("list-folders (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/asset_folders") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.listFolders("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-folders (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/asset_folders") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.listFolders("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-folders (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/asset_folders") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.listFolders("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-folders (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/asset_folders") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.listFolders("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-folders (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/asset_folders") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.listFolders("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create-folder (1)", async () => { + test("create-folder", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1088,127 +464,7 @@ describe("Assets", () => { }); }); - test("create-folder (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/asset_folders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.createFolder("site_id", { - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create-folder (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/asset_folders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.createFolder("site_id", { - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create-folder (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/asset_folders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.createFolder("site_id", { - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create-folder (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/asset_folders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.createFolder("site_id", { - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create-folder (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/asset_folders") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.createFolder("site_id", { - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-folder (1)", async () => { + test("get-folder", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1243,109 +499,4 @@ describe("Assets", () => { lastUpdated: new Date("2022-12-07T16:51:37.000Z"), }); }); - - test("get-folder (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/asset_folders/asset_folder_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.getFolder("asset_folder_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-folder (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/asset_folders/asset_folder_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.getFolder("asset_folder_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-folder (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/asset_folders/asset_folder_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.getFolder("asset_folder_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-folder (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/asset_folders/asset_folder_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.getFolder("asset_folder_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-folder (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/asset_folders/asset_folder_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.assets.getFolder("asset_folder_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/collections.test.ts b/tests/wire/collections.test.ts index b60b6411..20c4f5ab 100644 --- a/tests/wire/collections.test.ts +++ b/tests/wire/collections.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Collections", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -79,112 +80,7 @@ describe("Collections", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/collections") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/collections") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/collections") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/collections") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/collections") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -324,157 +220,7 @@ describe("Collections", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { displayName: "displayName", singularName: "singularName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/collections") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.create("site_id", { - displayName: "displayName", - singularName: "singularName", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -818,112 +564,7 @@ describe("Collections", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/collection_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.get("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.get("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.get("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.get("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.get("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -935,109 +576,4 @@ describe("Collections", () => { const response = await client.collections.delete("580e63fc8c9a982ac9b8b745"); expect(response).toEqual(undefined); }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.delete("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.delete("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.delete("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.delete("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.delete("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/collections/fields.test.ts b/tests/wire/collections/fields.test.ts index c5480717..6e27aaf6 100644 --- a/tests/wire/collections/fields.test.ts +++ b/tests/wire/collections/fields.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Fields", () => { - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -54,291 +55,7 @@ describe("Fields", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - id: "562ac0395358780a1f5e6fbc", - isEditable: true, - isRequired: false, - type: "Option", - displayName: "Post Type", - helpText: "Add the body of your post here", - metadata: { options: [{ name: "Feature" }, { name: "News" }, { name: "Product Highlight" }] }, - }; - const rawResponseBody = { - id: "562ac0395358780a1f5e6fbc", - isEditable: true, - isRequired: false, - type: "Option", - displayName: "Post Type", - helpText: "Add the body of your post here", - metadata: { options: [{ name: "Feature" }, { name: "News" }, { name: "Product Highlight" }] }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { - id: "562ac0395358780a1f5e6fbc", - isEditable: true, - isRequired: false, - type: "Option", - displayName: "Post Type", - helpText: "Add the body of your post here", - metadata: { - options: [ - { - name: "Feature", - }, - { - name: "News", - }, - { - name: "Product Highlight", - }, - ], - }, - }); - expect(response).toEqual({ - id: "562ac0395358780a1f5e6fbc", - isEditable: true, - isRequired: false, - type: "Option", - displayName: "Post Type", - helpText: "Add the body of your post here", - metadata: { - options: [ - { - name: "Feature", - }, - { - name: "News", - }, - { - name: "Product Highlight", - }, - ], - }, - }); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - id: "562ac0395358780a1f5e6fbd", - isEditable: true, - isRequired: false, - type: "Reference", - displayName: "Author", - helpText: "Add the post author here", - metadata: { collectionId: "63692ab61fb2852f582ba8f5" }, - }; - const rawResponseBody = { - id: "562ac0395358780a1f5e6fbd", - isEditable: true, - isRequired: false, - type: "Reference", - displayName: "Author", - helpText: "Add the post author here", - metadata: { collectionId: "63692ab61fb2852f582ba8f5" }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.fields.create("580e63fc8c9a982ac9b8b745", { - id: "562ac0395358780a1f5e6fbd", - isEditable: true, - isRequired: false, - type: "Reference", - displayName: "Author", - helpText: "Add the post author here", - metadata: { - collectionId: "63692ab61fb2852f582ba8f5", - }, - }); - expect(response).toEqual({ - id: "562ac0395358780a1f5e6fbd", - isEditable: true, - isRequired: false, - type: "Reference", - displayName: "Author", - helpText: "Add the post author here", - metadata: { - collectionId: "63692ab61fb2852f582ba8f5", - }, - }); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("create (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (9)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { type: "Color", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/fields") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.create("collection_id", { - type: "Color", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -356,112 +73,7 @@ describe("Fields", () => { expect(response).toEqual(undefined); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/fields/field_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.delete("collection_id", "field_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/fields/field_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.delete("collection_id", "field_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/fields/field_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.delete("collection_id", "field_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/fields/field_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.delete("collection_id", "field_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/fields/field_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.delete("collection_id", "field_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -513,114 +125,4 @@ describe("Fields", () => { }, }); }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/fields/field_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.update("collection_id", "field_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/fields/field_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.update("collection_id", "field_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/fields/field_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.update("collection_id", "field_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/fields/field_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.update("collection_id", "field_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/fields/field_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.fields.update("collection_id", "field_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/collections/items.test.ts b/tests/wire/collections/items.test.ts index 063dc6b8..42c14762 100644 --- a/tests/wire/collections/items.test.ts +++ b/tests/wire/collections/items.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Items", () => { - test("list-items (1)", async () => { + test("list-items", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -22,12 +23,7 @@ describe("Items", () => { createdOn: "2022-06-25T14:51:27.809Z", isArchived: false, isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, + fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst" }, }, { id: "62c880ef281c7b7b4cf9dabc", @@ -37,12 +33,7 @@ describe("Items", () => { createdOn: "2023-04-10T11:45:30.567Z", isArchived: false, isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, + fieldData: { name: "Product Manager", slug: "product-manager" }, }, ], pagination: { limit: 25, offset: 0, total: 2 }, @@ -57,8 +48,8 @@ describe("Items", () => { const response = await client.collections.items.listItems("580e63fc8c9a982ac9b8b745", { cmsLocaleId: "cmsLocaleId", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, name: "name", slug: "slug", sortBy: "lastPublished", @@ -77,8 +68,6 @@ describe("Items", () => { fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", }, }, { @@ -92,8 +81,6 @@ describe("Items", () => { fieldData: { name: "Product Manager", slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", }, }, ], @@ -105,112 +92,7 @@ describe("Items", () => { }); }); - test("list-items (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/collection_id/items") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItems("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-items (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItems("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-items (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItems("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-items (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItems("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-items (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItems("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create-item (1)", async () => { + test("create-item", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -219,33 +101,7 @@ describe("Items", () => { const rawRequestBody = { isArchived: false, isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, }; const rawResponseBody = { id: "42b720ef280c7a7a3be8cabe", @@ -255,33 +111,7 @@ describe("Items", () => { createdOn: "2022-11-17T17:11:57.148Z", isArchived: false, isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, }; server .mockEndpoint() @@ -300,38 +130,6 @@ describe("Items", () => { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, }, }, }); @@ -346,522 +144,143 @@ describe("Items", () => { fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, }, }); }); - test("create-item (2)", async () => { + test("delete-items", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - items: [ - { - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, - }, - ], - }; - const rawResponseBody = { - id: "id", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - name: "My new item", - slug: "my-new-item", - }, - }; + const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; + server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items") + .delete("/collections/580e63fc8c9a982ac9b8b745/items") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) - .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.createItem("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - body: { - items: [ - { - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - }, - }, - { - isArchived: false, - isDraft: false, - fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - }, - }, - ], - }, - }); - expect(response).toEqual({ - id: "id", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - }, + const response = await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], }); + expect(response).toEqual(undefined); }); - test("create-item (3)", async () => { + test("update-items", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = { key: "value" }; + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, + }, + ], + }; + const rawResponseBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, + }, + { + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", + isArchived: false, + isDraft: false, + fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, + }, + ], + pagination: { limit: 25, offset: 0, total: 4 }, + }; server .mockEndpoint() - .post("/collections/collection_id/items") + .patch("/collections/580e63fc8c9a982ac9b8b745/items") .jsonBody(rawRequestBody) .respondWith() - .statusCode(400) + .statusCode(200) .jsonBody(rawResponseBody) .build(); - await expect(async () => { - return await client.collections.items.createItem("collection_id", { - body: { + const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { - name: "name", - slug: "slug", + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", }, }, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create-item (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItem("collection_id", { - body: { + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { - name: "name", - slug: "slug", + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", }, }, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create-item (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItem("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create-item (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItem("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create-item (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItem("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-items (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; - - server - .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.collections.items.deleteItems("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "580e64008c9a982ac9b8b754", - }, - ], - }); - expect(response).toEqual(undefined); - }); - - test("delete-items (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-items (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-items (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-items (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("delete-items (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-items (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItems("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-items (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { - featured: false, name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", }, @@ -870,14 +289,13 @@ describe("Items", () => { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { - featured: false, name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", }, }, ], - }; - const rawResponseBody = { + }); + expect(response).toEqual({ items: [ { id: "66f6ed9576ddacf3149d5ea6", @@ -887,7 +305,10 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + fieldData: { + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", + }, }, { id: "66f6ed9576ddacf3149d5ea6", @@ -897,7 +318,10 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + fieldData: { + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", + }, }, { id: "66f6ed9576ddacf3149d5eaa", @@ -908,7 +332,6 @@ describe("Items", () => { isArchived: false, isDraft: false, fieldData: { - featured: false, name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci", }, @@ -922,65 +345,218 @@ describe("Items", () => { isArchived: false, isDraft: false, fieldData: { - featured: false, name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias", }, }, ], - pagination: { limit: 25, offset: 0, total: 4 }, + pagination: { + limit: 25, + offset: 0, + total: 4, + }, + }); + }); + + test("list-items-live", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + + const rawResponseBody = { + items: [ + { + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, + fieldData: { name: "Senior Data Analyst", slug: "senior-data-analyst" }, + }, + { + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, + fieldData: { name: "Product Manager", slug: "product-manager" }, + }, + ], + pagination: { limit: 25, offset: 0, total: 2 }, }; server .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items") - .jsonBody(rawRequestBody) + .get("/collections/580e63fc8c9a982ac9b8b745/items/live") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, + const response = await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { + cmsLocaleId: "cmsLocaleId", + offset: 1, + limit: 1, + name: "name", + slug: "slug", + sortBy: "lastPublished", + sortOrder: "asc", + }); + expect(response).toEqual({ items: [ { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", + id: "62b720ef280c7a7a3be8cabe", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2022-06-30T13:35:20.878Z", + lastUpdated: "2022-06-25T14:51:27.809Z", + createdOn: "2022-06-25T14:51:27.809Z", + isArchived: false, + isDraft: false, fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - featured: false, + name: "Senior Data Analyst", + slug: "senior-data-analyst", }, }, { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", + id: "62c880ef281c7b7b4cf9dabc", + cmsLocaleId: "66f6e966c9e1dc700a857ca3", + lastPublished: "2023-04-15T10:25:18.123Z", + lastUpdated: "2023-04-10T11:45:30.567Z", + createdOn: "2023-04-10T11:45:30.567Z", + isArchived: false, + isDraft: false, fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - featured: false, + name: "Product Manager", + slug: "product-manager", }, }, + ], + pagination: { + limit: 25, + offset: 0, + total: 2, + }, + }); + }); + + test("create-item-live", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; + server + .mockEndpoint() + .post("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }, + }); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }); + }); + + test("delete-items-live", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; + + server + .mockEndpoint() + .delete("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .build(); + + const response = await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { + items: [ + { + id: "580e64008c9a982ac9b8b754", + }, + ], + }); + expect(response).toEqual(undefined); + }); + + test("update-items-live", async () => { + const server = mockServerPool.createServer(); + const client = new WebflowClient({ + accessToken: "test", + environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + }); + const rawRequestBody = { + items: [ + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, + }, + { + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, + }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - featured: false, - }, + fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, }, { id: "66f6ed9576ddacf3149d5eaa", cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - featured: false, - }, + fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, }, ], - }); - expect(response).toEqual({ + }; + const rawResponseBody = { items: [ { id: "66f6ed9576ddacf3149d5ea6", @@ -990,11 +566,7 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - featured: false, - }, + fieldData: { name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, }, { id: "66f6ed9576ddacf3149d5ea6", @@ -1004,11 +576,7 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - featured: false, - }, + fieldData: { name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, }, { id: "66f6ed9576ddacf3149d5eaa", @@ -1018,11 +586,7 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - featured: false, - }, + fieldData: { name: "Au Revoir et Merci pour Tous les Poissons", slug: "au-revoir-et-merci" }, }, { id: "66f6ed9576ddacf3149d5eaa", @@ -1032,3950 +596,460 @@ describe("Items", () => { createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - featured: false, - }, + fieldData: { name: "Hasta Luego y Gracias por Todo el Pescado", slug: "hasta-luego-y-gracias" }, }, ], - pagination: { - limit: 25, - offset: 0, - total: 4, - }, - }); - }); + }; + server + .mockEndpoint() + .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); - test("update-items (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { + const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, items: [ { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", }, }, { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", }, }, - ], - }; - const rawResponseBody = { - items: [ { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", }, }, { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", }, }, ], - pagination: { limit: 25, offset: 0, total: 2 }, - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, + }); + expect(response).toEqual({ items: [ { - id: "580e64008c9a982ac9b8b754", + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", + name: "Ne Paniquez Pas", + slug: "ne-paniquez-pas", }, }, { - id: "580e64008c9a982ac9b8b754", + id: "66f6ed9576ddacf3149d5ea6", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", + name: "No Entrar en P\u00E1nico", + slug: "no-entrar-en-panico", }, }, - ], - }); - expect(response).toEqual({ - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - }, - }, - ], - pagination: { - limit: 25, - offset: 0, - total: 2, - }, - }); - }); - - test("update-items (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItems("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-items (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItems("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-items (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItems("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-items (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItems("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-items (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItems("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-items-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, - }, - ], - pagination: { limit: 25, offset: 0, total: 2 }, - }; - server - .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/live") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.listItemsLive("580e63fc8c9a982ac9b8b745", { - cmsLocaleId: "cmsLocaleId", - offset: 1.1, - limit: 1.1, - name: "name", - slug: "slug", - sortBy: "lastPublished", - sortOrder: "asc", - }); - expect(response).toEqual({ - items: [ { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca5", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", + name: "Au Revoir et Merci pour Tous les Poissons", + slug: "au-revoir-et-merci", }, }, { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", + id: "66f6ed9576ddacf3149d5eaa", + cmsLocaleId: "66f6e966c9e1dc700a857ca4", + lastPublished: "2024-09-27T17:38:29.066Z", + lastUpdated: "2024-09-27T17:38:29.066Z", + createdOn: "2024-09-27T17:38:29.066Z", isArchived: false, isDraft: false, fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", + name: "Hasta Luego y Gracias por Todo el Pescado", + slug: "hasta-luego-y-gracias", }, - }, - ], - pagination: { - limit: 25, - offset: 0, - total: 2, - }, - }); - }); - - test("list-items-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/collection_id/items/live") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItemsLive("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-items-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/live") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItemsLive("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-items-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/live") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItemsLive("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-items-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/live") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItemsLive("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-items-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/live") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.listItemsLive("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create-item-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }, - }); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("create-item-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, - }, - ], - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - body: { - items: [ - { - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - }, - }, - { - isArchived: false, - isDraft: false, - fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - }, - }, - ], - }, - }); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("create-item-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItemLive("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create-item-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItemLive("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create-item-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItemLive("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create-item-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItemLive("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create-item-live (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItemLive("collection_id", { - body: { - fieldData: { - name: "name", - slug: "slug", - }, - }, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-items-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "580e64008c9a982ac9b8b754" }] }; - - server - .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .build(); - - const response = await client.collections.items.deleteItemsLive("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "580e64008c9a982ac9b8b754", - }, - ], - }); - expect(response).toEqual(undefined); - }); - - test("delete-items-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemsLive("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-items-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemsLive("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-items-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemsLive("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-items-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemsLive("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-items-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { items: [{ id: "id" }, { id: "id" }] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemsLive("collection_id", { - items: [ - { - id: "id", - }, - { - id: "id", - }, - ], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-items-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { - 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, - }, - }, - ], - }); - expect(response).toEqual({ - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - featured: false, - }, - }, - ], - }); - }); - - test("update-items-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - items: [ - { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - }, - }, - { - id: "580e64008c9a982ac9b8b754", - isArchived: false, - isDraft: false, - fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - }, - }, - ], - }); - expect(response).toEqual({ - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - featured: false, - }, - }, - ], - }); - }); - - test("update-items-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { - 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, - }, - }, - ], - }); - expect(response).toEqual({ - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Ne Paniquez Pas", - slug: "ne-paniquez-pas", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "No Entrar en P\u00E1nico", - slug: "no-entrar-en-panico", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - featured: false, - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - lastPublished: "2024-09-27T17:38:29.066Z", - lastUpdated: "2024-09-27T17:38:29.066Z", - createdOn: "2024-09-27T17:38:29.066Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - featured: false, - }, - }, - ], - }); - }); - - test("update-items-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - items: [ - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { featured: false, name: "Ne Paniquez Pas", slug: "ne-paniquez-pas" }, - }, - { - id: "66f6ed9576ddacf3149d5ea6", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { featured: false, name: "No Entrar en Pánico", slug: "no-entrar-en-panico" }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca5", - fieldData: { - featured: false, - name: "Au Revoir et Merci pour Tous les Poissons", - slug: "au-revoir-et-merci", - }, - }, - { - id: "66f6ed9576ddacf3149d5eaa", - cmsLocaleId: "66f6e966c9e1dc700a857ca4", - fieldData: { - featured: false, - name: "Hasta Luego y Gracias por Todo el Pescado", - slug: "hasta-luego-y-gracias", - }, - }, - ], - }; - const rawResponseBody = { - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - name: "Senior Data Analyst", - slug: "senior-data-analyst", - }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, - fieldData: { - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - name: "Product Manager", - slug: "product-manager", - }, - }, - ], - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItemsLive("580e63fc8c9a982ac9b8b745", { - 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, - }, - }, - ], - }); - expect(response).toEqual({ - items: [ - { - id: "62b720ef280c7a7a3be8cabe", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2022-06-30T13:35:20.878Z", - lastUpdated: "2022-06-25T14:51:27.809Z", - createdOn: "2022-06-25T14:51:27.809Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Senior Data Analyst", - slug: "senior-data-analyst", - url: "https://boards.greenhouse.io/webflow/jobs/26567701", - department: "Data", - }, - }, - { - id: "62c880ef281c7b7b4cf9dabc", - cmsLocaleId: "66f6e966c9e1dc700a857ca3", - lastPublished: "2023-04-15T10:25:18.123Z", - lastUpdated: "2023-04-10T11:45:30.567Z", - createdOn: "2023-04-10T11:45:30.567Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "Product Manager", - slug: "product-manager", - url: "https://boards.greenhouse.io/webflow/jobs/31234567", - department: "Product", - }, - }, - ], - }); - }); - - test("update-items-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-items-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-items-live (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-items-live (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-items-live (9)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-items-live (10)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemsLive("collection_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create-items (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { name: "Don’t Panic", slug: "dont-panic" }, - }; - const rawResponseBody = { - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - name: "My new item", - slug: "my-new-item", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { - name: "Don\u2019t Panic", - slug: "dont-panic", - }, - }); - expect(response).toEqual({ - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - }, - }); - }); - - test("create-items (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], - isArchived: false, - isDraft: false, - fieldData: [ - { name: "Don’t Panic", slug: "dont-panic" }, - { name: "So Long and Thanks for All the Fish", slug: "so-long-and-thanks" }, - ], - }; - const rawResponseBody = { - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - name: "My new item", - slug: "my-new-item", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"], - isArchived: false, - isDraft: false, - fieldData: [ - { - name: "Don\u2019t Panic", - slug: "dont-panic", - }, - { - name: "So Long and Thanks for All the Fish", - slug: "so-long-and-thanks", - }, - ], - }); - expect(response).toEqual({ - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - }, - }); - }); - - test("create-items (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { name: "Don’t Panic", slug: "dont-panic" }, - }; - const rawResponseBody = { - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - name: "My new item", - slug: "my-new-item", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { - name: "Don\u2019t Panic", - slug: "dont-panic", - }, - }); - expect(response).toEqual({ - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - }, - }); - }); - - test("create-items (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { name: "Don’t Panic", slug: "dont-panic" }, - }; - const rawResponseBody = { - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - name: "My new item", - slug: "my-new-item", - }, - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { - skipInvalidFiles: true, - cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], - isArchived: false, - isDraft: false, - fieldData: { - name: "Don\u2019t Panic", - slug: "dont-panic", - }, - }); - expect(response).toEqual({ - id: "580e64008c9a982ac9b8b754", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - lastPublished: "2023-03-17T18:47:35.560Z", - lastUpdated: "2023-03-17T18:47:35.560Z", - createdOn: "2023-03-17T18:47:35.560Z", - isArchived: true, - isDraft: true, - fieldData: { - name: "My new item", - slug: "my-new-item", - date: "2022-11-18T00:00:00.000Z", - featured: false, - color: "#db4b68", - }, - }); - }); - - test("create-items (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/collections/collection_id/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItems("collection_id", { - fieldData: { - name: "name", - slug: "slug", - }, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create-items (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItems("collection_id", { - fieldData: { - name: "name", - slug: "slug", - }, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create-items (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItems("collection_id", { - fieldData: { - name: "name", - slug: "slug", - }, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create-items (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItems("collection_id", { - fieldData: { - name: "name", - slug: "slug", - }, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create-items (9)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fieldData: { name: "name", slug: "slug" } }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/collections/collection_id/items/bulk") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.createItems("collection_id", { - fieldData: { - name: "name", - slug: "slug", - }, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-item (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.getItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("get-item (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-item (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-item (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-item (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-item (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-item (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.collections.items.deleteItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual(undefined); - }); - - test("delete-item (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-item (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-item (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-item (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-item (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItem("collection_id", "item_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-item (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItem( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }, - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("update-item (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItem("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-item (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItem("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-item (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItem("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-item (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItem("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-item (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItem("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-item-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.getItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("get-item-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-item-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-item-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-item-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-item-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.getItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-item-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.collections.items.deleteItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - cmsLocaleId: "cmsLocaleId", - }, - ); - expect(response).toEqual(undefined); - }); - - test("delete-item-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-item-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-item-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-item-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-item-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/collections/collection_id/items/item_id/live") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.deleteItemLive("collection_id", "item_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-item-live (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - const rawResponseBody = { - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - "image-gallery": [ - { fileId: "62b720ef280c7a7a3be8cabd", url: "/files/62b720ef280c7a7a3be8cabd_image.png" }, - { fileId: "62b720ef280c7a7a3be8cabe", url: "/files/62b720ef280c7a7a3be8cabe_image.png" }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - }, - }; - server - .mockEndpoint() - .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.updateItemLive( - "580e63fc8c9a982ac9b8b745", - "580e64008c9a982ac9b8b754", - { - skipInvalidFiles: true, - body: { - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }, - }, - ); - expect(response).toEqual({ - id: "42b720ef280c7a7a3be8cabe", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2022-11-29T16:22:43.159Z", - lastUpdated: "2022-11-17T17:19:43.282Z", - createdOn: "2022-11-17T17:11:57.148Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "The Hitchhiker's Guide to the Galaxy", - slug: "hitchhikers-guide-to-the-galaxy", - "plain-text": "Don't Panic.", - "rich-text": - "

A Guide to Interstellar Travel

A towel is about the most massively useful thing an interstellar hitchhiker can have. Don't forget yours!

", - "main-image": { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - "image-gallery": [ - { - fileId: "62b720ef280c7a7a3be8cabd", - url: "/files/62b720ef280c7a7a3be8cabd_image.png", - }, - { - fileId: "62b720ef280c7a7a3be8cabe", - url: "/files/62b720ef280c7a7a3be8cabe_image.png", - }, - ], - "intro-video": "https://www.youtube.com/watch?v=aJ83KAggd-4", - "official-site": "https://hitchhikers.fandom.com/wiki/The_Hitchhiker%27s_Guide_to_the_Galaxy", - "contact-email": "zaphod.beeblebrox@heartofgold.gov", - "support-phone": "424-242-4242", - "answer-to-everything": 42, - "release-date": "1979-10-12T00:00:00.000Z", - "is-featured": true, - "brand-color": "#000000", - category: "62b720ef280c7a7a3be8cabf", - author: "62b720ef280c7a7a3be8cab0", - tags: ["62b720ef280c7a7a3be8cab1", "62b720ef280c7a7a3be8cab2"], - "downloadable-asset": { - fileId: "62b720ef280c7a7a3be8cab3", - url: "/files/62b720ef280c7a7a3be8cab3_document.pdf", - }, - }, - }); - }); - - test("update-item-live (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-item-live (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-item-live (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-item-live (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-item-live (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-item-live (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/collection_id/items/item_id/live") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.collections.items.updateItemLive("collection_id", "item_id", { - body: {}, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("publish-item (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], - }; - const rawResponseBody = { - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], - }; - server - .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], - }); - expect(response).toEqual({ - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + }, + ], }); }); - test("publish-item (2)", async () => { + test("create-items", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); const rawRequestBody = { - items: [ - { id: "643fd856d66b6528195ee2ca", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, - { id: "643fd856d66b6528195ee2cb", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, - { id: "643fd856d66b6528195ee2cc", cmsLocaleIds: ["653ad57de882f528b32e810e"] }, - ], + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { name: "Don’t Panic", slug: "dont-panic" }, }; const rawResponseBody = { - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { name: "My new item", slug: "my-new-item" }, }; server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") + .post("/collections/580e63fc8c9a982ac9b8b745/items/bulk") .jsonBody(rawRequestBody) .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "643fd856d66b6528195ee2ca", - cmsLocaleIds: ["653ad57de882f528b32e810e"], - }, - { - id: "643fd856d66b6528195ee2cb", - cmsLocaleIds: ["653ad57de882f528b32e810e"], - }, - { - id: "643fd856d66b6528195ee2cc", - cmsLocaleIds: ["653ad57de882f528b32e810e"], - }, - ], + const response = await client.collections.items.createItems("580e63fc8c9a982ac9b8b745", { + skipInvalidFiles: true, + cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"], + isArchived: false, + isDraft: false, + fieldData: { + name: "Don\u2019t Panic", + slug: "dont-panic", + }, }); expect(response).toEqual({ - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + id: "580e64008c9a982ac9b8b754", + cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], + lastPublished: "2023-03-17T18:47:35.560Z", + lastUpdated: "2023-03-17T18:47:35.560Z", + createdOn: "2023-03-17T18:47:35.560Z", + isArchived: true, + isDraft: true, + fieldData: { + name: "My new item", + slug: "my-new-item", + }, }); }); - test("publish-item (3)", async () => { + test("get-item", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = { - items: [ - { - id: "643fd856d66b6528195ee2ca", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - }, - ], - }; + const rawResponseBody = { - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, }; server .mockEndpoint() - .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") - .jsonBody(rawRequestBody) + .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") .respondWith() .statusCode(200) .jsonBody(rawResponseBody) .build(); - const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { - items: [ - { - id: "643fd856d66b6528195ee2ca", - cmsLocaleIds: ["653ad57de882f528b32e810e", "6514390aea353fc691d69827", "65143930ea353fc691d69cd8"], - }, - ], - }); + const response = await client.collections.items.getItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); expect(response).toEqual({ - publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], - errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, }); }); - test("publish-item (4)", async () => { + test("delete-item", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/collections/collection_id/items/publish") - .jsonBody(rawRequestBody) + .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) + .statusCode(200) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); + const response = await client.collections.items.deleteItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual(undefined); }); - test("publish-item (5)", async () => { + test("update-item", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = {}; + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; server .mockEndpoint() - .post("/collections/collection_id/items/publish") + .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754") .jsonBody(rawRequestBody) .respondWith() - .statusCode(401) + .statusCode(200) .jsonBody(rawResponseBody) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); + const response = await client.collections.items.updateItem( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }, + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }); }); - test("publish-item (6)", async () => { + test("get-item-live", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = {}; + + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; server .mockEndpoint() - .post("/collections/collection_id/items/publish") - .jsonBody(rawRequestBody) + .get("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") .respondWith() - .statusCode(404) + .statusCode(200) .jsonBody(rawResponseBody) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); + const response = await client.collections.items.getItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }); }); - test("publish-item (7)", async () => { + test("delete-item-live", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; + server .mockEndpoint() - .post("/collections/collection_id/items/publish") - .jsonBody(rawRequestBody) + .delete("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) + .statusCode(200) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.ConflictError); + const response = await client.collections.items.deleteItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + cmsLocaleId: "cmsLocaleId", + }, + ); + expect(response).toEqual(undefined); }); - test("publish-item (8)", async () => { + test("update-item-live", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = {}; + const rawRequestBody = { + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; + const rawResponseBody = { + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { name: "The Hitchhiker's Guide to the Galaxy", slug: "hitchhikers-guide-to-the-galaxy" }, + }; server .mockEndpoint() - .post("/collections/collection_id/items/publish") + .patch("/collections/580e63fc8c9a982ac9b8b745/items/580e64008c9a982ac9b8b754/live") .jsonBody(rawRequestBody) .respondWith() - .statusCode(429) + .statusCode(200) .jsonBody(rawResponseBody) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); + const response = await client.collections.items.updateItemLive( + "580e63fc8c9a982ac9b8b745", + "580e64008c9a982ac9b8b754", + { + skipInvalidFiles: true, + body: { + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }, + }, + ); + expect(response).toEqual({ + id: "42b720ef280c7a7a3be8cabe", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2022-11-29T16:22:43.159Z", + lastUpdated: "2022-11-17T17:19:43.282Z", + createdOn: "2022-11-17T17:11:57.148Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "The Hitchhiker's Guide to the Galaxy", + slug: "hitchhikers-guide-to-the-galaxy", + }, + }); }); - test("publish-item (9)", async () => { + test("publish-item", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawRequestBody = {}; - const rawResponseBody = {}; + const rawRequestBody = { + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], + }; + const rawResponseBody = { + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + }; server .mockEndpoint() - .post("/collections/collection_id/items/publish") + .post("/collections/580e63fc8c9a982ac9b8b745/items/publish") .jsonBody(rawRequestBody) .respondWith() - .statusCode(500) + .statusCode(200) .jsonBody(rawResponseBody) .build(); - await expect(async () => { - return await client.collections.items.publishItem("collection_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); + const response = await client.collections.items.publishItem("580e63fc8c9a982ac9b8b745", { + itemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb", "643fd856d66b6528195ee2cc"], + }); + expect(response).toEqual({ + publishedItemIds: ["643fd856d66b6528195ee2ca", "643fd856d66b6528195ee2cb"], + errors: ["Staging item ID 643fd856d66b6528195ee2cf not found."], + }); }); }); diff --git a/tests/wire/components.test.ts b/tests/wire/components.test.ts index 6e17e838..d0657f07 100644 --- a/tests/wire/components.test.ts +++ b/tests/wire/components.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Components", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -55,8 +56,8 @@ describe("Components", () => { const response = await client.components.list("580e63e98c9a982ac9b8b741", { branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }); expect(response).toEqual({ components: [ @@ -97,112 +98,7 @@ describe("Components", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/components") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-content (1)", async () => { + test("get-content", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -212,23 +108,23 @@ describe("Components", () => { const rawResponseBody = { componentId: "69118560-d0bc-15fc-bbf8-b8fe5f6535b5", nodes: [ - { type: "text", id: "id", text: {}, attributes: { key: "value" } }, - { type: "text", id: "id", text: {}, attributes: { key: "value" } }, - { type: "image", id: "id", image: {}, attributes: { key: "value" } }, - { type: "text-input", id: "id", placeholder: "placeholder", attributes: { key: "value" } }, - { type: "select", id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" } }, + { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, + { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, + { id: "id", image: {}, attributes: { key: "value" }, type: "image" }, + { id: "id", placeholder: "placeholder", attributes: { key: "value" }, type: "text-input" }, + { id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" }, type: "select" }, { - type: "submit-button", id: "id", value: "value", waitingText: "waitingText", attributes: { key: "value" }, + type: "submit-button", }, { - type: "component-instance", id: "id", componentId: "componentId", propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0" }], + type: "component-instance", }, ], pagination: { limit: 7, offset: 0, total: 7 }, @@ -247,8 +143,8 @@ describe("Components", () => { { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }, ); expect(response).toEqual({ @@ -327,112 +223,7 @@ describe("Components", () => { }); }); - test("get-content (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/dom") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getContent("site_id", "component_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-content (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/dom") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getContent("site_id", "component_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-content (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/dom") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getContent("site_id", "component_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-content (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/dom") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getContent("site_id", "component_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-content (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/dom") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getContent("site_id", "component_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-content (1)", async () => { + test("update-content", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -540,235 +331,7 @@ describe("Components", () => { }); }); - test("update-content (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-content (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-content (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-content (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-content (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-content (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateContent("site_id", "component_id", { - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-properties (1)", async () => { + test("get-properties", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -807,8 +370,8 @@ describe("Components", () => { { localeId: "65427cf400e02b306eaa04a0", branchId: "68026fa68ef6dc744c75b833", - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }, ); expect(response).toEqual({ @@ -839,112 +402,7 @@ describe("Components", () => { }); }); - test("get-properties (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/properties") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getProperties("site_id", "component_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-properties (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/properties") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getProperties("site_id", "component_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-properties (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/properties") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getProperties("site_id", "component_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-properties (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/properties") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getProperties("site_id", "component_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-properties (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/components/component_id/properties") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.getProperties("site_id", "component_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-properties (1)", async () => { + test("update-properties", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -991,194 +449,4 @@ describe("Components", () => { errors: ["errors"], }); }); - - test("update-properties (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - properties: [ - { propertyId: "propertyId", text: "text" }, - { propertyId: "propertyId", text: "text" }, - ], - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/properties") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateProperties("site_id", "component_id", { - properties: [ - { - propertyId: "propertyId", - text: "text", - }, - { - propertyId: "propertyId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-properties (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - properties: [ - { propertyId: "propertyId", text: "text" }, - { propertyId: "propertyId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/properties") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateProperties("site_id", "component_id", { - properties: [ - { - propertyId: "propertyId", - text: "text", - }, - { - propertyId: "propertyId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-properties (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - properties: [ - { propertyId: "propertyId", text: "text" }, - { propertyId: "propertyId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/properties") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateProperties("site_id", "component_id", { - properties: [ - { - propertyId: "propertyId", - text: "text", - }, - { - propertyId: "propertyId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-properties (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - properties: [ - { propertyId: "propertyId", text: "text" }, - { propertyId: "propertyId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/properties") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateProperties("site_id", "component_id", { - properties: [ - { - propertyId: "propertyId", - text: "text", - }, - { - propertyId: "propertyId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-properties (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - properties: [ - { propertyId: "propertyId", text: "text" }, - { propertyId: "propertyId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/components/component_id/properties") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.components.updateProperties("site_id", "component_id", { - properties: [ - { - propertyId: "propertyId", - text: "text", - }, - { - propertyId: "propertyId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/ecommerce.test.ts b/tests/wire/ecommerce.test.ts index 1f7b69ee..0b004ea8 100644 --- a/tests/wire/ecommerce.test.ts +++ b/tests/wire/ecommerce.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Ecommerce", () => { - test("get-settings (1)", async () => { + test("get-settings", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -32,151 +33,4 @@ describe("Ecommerce", () => { defaultCurrency: "USD", }); }); - - test("get-settings (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-settings (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-settings (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-settings (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-settings (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("get-settings (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-settings (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/ecommerce/settings") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.ecommerce.getSettings("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/forms.test.ts b/tests/wire/forms.test.ts index 486413ec..24329687 100644 --- a/tests/wire/forms.test.ts +++ b/tests/wire/forms.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Forms", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -67,8 +68,8 @@ describe("Forms", () => { .build(); const response = await client.forms.list("580e63e98c9a982ac9b8b741", { - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }); expect(response).toEqual({ forms: [ @@ -136,154 +137,7 @@ describe("Forms", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -365,97 +219,7 @@ describe("Forms", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/forms/form_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.forms.get("form_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-submissions (1)", async () => { + test("list-submissions", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -492,8 +256,8 @@ describe("Forms", () => { .build(); const response = await client.forms.listSubmissions("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ formSubmissions: [ @@ -528,133 +292,7 @@ describe("Forms", () => { }); }); - test("list-submissions (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-submissions (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-submissions (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list-submissions (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-submissions (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-submissions (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/forms/form_id/submissions") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.listSubmissions("form_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-submission (1)", async () => { + test("get-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -691,318 +329,45 @@ describe("Forms", () => { }); }); - test("get-submission (2)", async () => { + test("delete-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - const rawResponseBody = { key: "value" }; server .mockEndpoint() - .get("/form_submissions/form_submission_id") + .delete("/form_submissions/580e63e98c9a982ac9b8b741") .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) + .statusCode(200) .build(); - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); + const response = await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); + expect(response).toEqual(undefined); }); - test("get-submission (3)", async () => { + test("update-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - - const rawResponseBody = {}; + const rawRequestBody = {}; + const rawResponseBody = { + id: "6321ca84df3949bfc6752327", + displayName: "Sample Form", + siteId: "62749158efef318abc8d5a0f", + workspaceId: "62749158efef318abc8d5a0f", + dateSubmitted: "2022-09-14T12:35:16Z", + formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, + }; server .mockEndpoint() - .get("/form_submissions/form_submission_id") + .patch("/form_submissions/580e63e98c9a982ac9b8b741") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/form_submissions/form_submission_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/form_submissions/form_submission_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/form_submissions/form_submission_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/form_submissions/form_submission_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.getSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-submission (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - server - .mockEndpoint() - .delete("/form_submissions/580e63e98c9a982ac9b8b741") - .respondWith() - .statusCode(200) - .build(); - - const response = await client.forms.deleteSubmission("580e63e98c9a982ac9b8b741"); - expect(response).toEqual(undefined); - }); - - test("delete-submission (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-submission (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("delete-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("delete-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-submission (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/form_submissions/form_submission_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.deleteSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-submission (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { - id: "6321ca84df3949bfc6752327", - displayName: "Sample Form", - siteId: "62749158efef318abc8d5a0f", - workspaceId: "62749158efef318abc8d5a0f", - dateSubmitted: "2022-09-14T12:35:16Z", - formResponse: { "First Name": "Arthur", "Last Name": "Dent" }, - }; - server - .mockEndpoint() - .patch("/form_submissions/580e63e98c9a982ac9b8b741") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) + .statusCode(200) .jsonBody(rawResponseBody) .build(); @@ -1019,158 +384,4 @@ describe("Forms", () => { }, }); }); - - test("update-submission (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-submission (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-submission (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.forms.updateSubmission("form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/inventory.test.ts b/tests/wire/inventory.test.ts index e7ad002f..c64b448f 100644 --- a/tests/wire/inventory.test.ts +++ b/tests/wire/inventory.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Inventory", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -29,154 +30,7 @@ describe("Inventory", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/collections/sku_collection_id/items/sku_id/inventory") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.list("sku_collection_id", "sku_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -202,172 +56,4 @@ describe("Inventory", () => { inventoryType: "finite", }); }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { inventoryType: "infinite" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/collections/sku_collection_id/items/sku_id/inventory") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.inventory.update("sku_collection_id", "sku_id", { - inventoryType: "infinite", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index 7046b185..bad99bbb 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Orders", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -338,8 +339,8 @@ describe("Orders", () => { const response = await client.orders.list("580e63e98c9a982ac9b8b741", { status: "pending", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ orders: [ @@ -767,154 +768,7 @@ describe("Orders", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1323,154 +1177,7 @@ describe("Orders", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("get (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/orders/order_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.get("site_id", "order_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1880,161 +1587,7 @@ describe("Orders", () => { }); }); - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/orders/order_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.update("site_id", "order_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-fulfill (1)", async () => { + test("update-fulfill", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -2396,209 +1949,55 @@ describe("Orders", () => { value: "5892", string: "$ 109.05 USD", }, - extras: [ - { - type: "tax", - name: "State Taxes", - description: "NY Taxes (4.00%)", - price: { - unit: "USD", - value: "5892", - string: "$ 4.36 USD", - }, - }, - { - type: "tax", - name: "City Taxes", - description: "NEW YORK Taxes (4.88%)", - price: { - unit: "USD", - value: "5892", - string: "$ 5.32 USD", - }, - }, - { - type: "shipping", - name: "Flat", - description: "", - price: { - unit: "USD", - value: "5892", - string: "$ 0.00 USD", - }, - }, - ], - total: { - unit: "USD", - value: "5892", - string: "$ 118.73 USD", - }, - }, - downloadFiles: [ - { - id: "5e9a5eba75e0ac242e1b6f64", - name: "New product guide", - url: "https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa", - }, - ], - }); - }); - - test("update-fulfill (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-fulfill (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-fulfill (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-fulfill (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-fulfill (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-fulfill (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-fulfill (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, + extras: [ + { + type: "tax", + name: "State Taxes", + description: "NY Taxes (4.00%)", + price: { + unit: "USD", + value: "5892", + string: "$ 4.36 USD", + }, + }, + { + type: "tax", + name: "City Taxes", + description: "NEW YORK Taxes (4.88%)", + price: { + unit: "USD", + value: "5892", + string: "$ 5.32 USD", + }, + }, + { + type: "shipping", + name: "Flat", + description: "", + price: { + unit: "USD", + value: "5892", + string: "$ 0.00 USD", + }, + }, + ], + total: { + unit: "USD", + value: "5892", + string: "$ 118.73 USD", + }, + }, + downloadFiles: [ + { + id: "5e9a5eba75e0ac242e1b6f64", + name: "New product guide", + url: "https://webflow.com/dashboard/download-digital-product?payload=5d93ba5e38c6b0160ab711d3;e7634a;5eb1aac72912ec06f561278c;5e9a5eba75e0ac242e1b6f63:ka2nehxy:4a1ee0a632feaab94294350087215ed89533f2f530903e3b933b638940e921aa", + }, + ], }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/fulfill") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateFulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.InternalServerError); }); - test("update-unfulfill (1)", async () => { + test("update-unfulfill", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -3007,154 +2406,7 @@ describe("Orders", () => { }); }); - test("update-unfulfill (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-unfulfill (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-unfulfill (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-unfulfill (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-unfulfill (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-unfulfill (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-unfulfill (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/unfulfill") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.updateUnfulfill("site_id", "order_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("refund (1)", async () => { + test("refund", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -3563,158 +2815,4 @@ describe("Orders", () => { ], }); }); - - test("refund (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("refund (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("refund (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("refund (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("refund (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("refund (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("refund (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/orders/order_id/refund") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.orders.refund("site_id", "order_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/pages.test.ts b/tests/wire/pages.test.ts index 2476ae8a..9fcbbc7e 100644 --- a/tests/wire/pages.test.ts +++ b/tests/wire/pages.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Pages", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -85,8 +86,8 @@ describe("Pages", () => { const response = await client.pages.list("580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }); expect(response).toEqual({ pages: [ @@ -157,112 +158,7 @@ describe("Pages", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/pages") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/pages") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/pages") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/pages") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/pages") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-metadata (1)", async () => { + test("get-metadata", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -338,82 +234,7 @@ describe("Pages", () => { }); }); - test("get-metadata (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getMetadata("page_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-metadata (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getMetadata("page_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-metadata (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getMetadata("page_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-metadata (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getMetadata("page_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-metadata (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getMetadata("page_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-page-settings (1)", async () => { + test("update-page-settings", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -517,117 +338,7 @@ describe("Pages", () => { }); }); - test("update-page-settings (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/pages/page_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updatePageSettings("page_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-page-settings (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updatePageSettings("page_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-page-settings (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updatePageSettings("page_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-page-settings (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updatePageSettings("page_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-page-settings (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updatePageSettings("page_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-content (1)", async () => { + test("get-content", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -638,17 +349,17 @@ describe("Pages", () => { pageId: "658205daa3e8206a523b5ad4", branchId: "68026fa68ef6dc744c75b833", nodes: [ - { type: "text", id: "id", text: {}, attributes: { key: "value" } }, - { type: "text", id: "id", text: {}, attributes: { key: "value" } }, - { type: "image", id: "id", image: {}, attributes: { key: "value" } }, - { type: "select", id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" } }, - { type: "text-input", id: "id", placeholder: "placeholder", attributes: { key: "value" } }, - { type: "text", id: "id", text: {}, attributes: { key: "value" } }, + { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, + { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, + { id: "id", image: {}, attributes: { key: "value" }, type: "image" }, + { id: "id", choices: [{ value: "value", text: "text" }], attributes: { key: "value" }, type: "select" }, + { id: "id", placeholder: "placeholder", attributes: { key: "value" }, type: "text-input" }, + { id: "id", text: {}, attributes: { key: "value" }, type: "text" }, { - type: "component-instance", id: "id", componentId: "componentId", propertyOverrides: [{ propertyId: "7dd14c08-2e96-8d3d-2b19-b5c03642a0f0" }], + type: "component-instance", }, ], pagination: { limit: 4, offset: 0, total: 4 }, @@ -664,8 +375,8 @@ describe("Pages", () => { const response = await client.pages.getContent("63c720f9347c2139b248e552", { localeId: "65427cf400e02b306eaa04a0", - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }); expect(response).toEqual({ pageId: "658205daa3e8206a523b5ad4", @@ -744,97 +455,7 @@ describe("Pages", () => { }); }); - test("get-content (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-content (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-content (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-content (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-content (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-content (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/pages/page_id/dom").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.pages.getContent("page_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-static-content (1)", async () => { + test("update-static-content", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -936,238 +557,4 @@ describe("Pages", () => { errors: ["errors"], }); }); - - test("update-static-content (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-static-content (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-static-content (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-static-content (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-static-content (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-static-content (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - nodes: [ - { nodeId: "nodeId", text: "text" }, - { nodeId: "nodeId", text: "text" }, - ], - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/pages/page_id/dom") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.updateStaticContent("page_id", { - localeId: "localeId", - nodes: [ - { - nodeId: "nodeId", - text: "text", - }, - { - nodeId: "nodeId", - text: "text", - }, - ], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/pages/scripts.test.ts b/tests/wire/pages/scripts.test.ts index d0c00351..0ec29068 100644 --- a/tests/wire/pages/scripts.test.ts +++ b/tests/wire/pages/scripts.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Scripts", () => { - test("get-custom-code (1)", async () => { + test("get-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -42,112 +43,7 @@ describe("Scripts", () => { }); }); - test("get-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/pages/page_id/custom_code") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.getCustomCode("page_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/pages/page_id/custom_code") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.getCustomCode("page_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/pages/page_id/custom_code") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.getCustomCode("page_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/pages/page_id/custom_code") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.getCustomCode("page_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/pages/page_id/custom_code") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.getCustomCode("page_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("upsert-custom-code (1)", async () => { + test("upsert-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -227,139 +123,7 @@ describe("Scripts", () => { }); }); - test("upsert-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("upsert-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("upsert-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("upsert-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("upsert-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("upsert-custom-code (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/pages/page_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.upsertCustomCode("page_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-custom-code (1)", async () => { + test("delete-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -376,109 +140,4 @@ describe("Scripts", () => { const response = await client.pages.scripts.deleteCustomCode("63c720f9347c2139b248e552"); expect(response).toEqual(undefined); }); - - test("delete-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/pages/page_id/custom_code") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.deleteCustomCode("page_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/pages/page_id/custom_code") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.deleteCustomCode("page_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/pages/page_id/custom_code") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.deleteCustomCode("page_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/pages/page_id/custom_code") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.deleteCustomCode("page_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/pages/page_id/custom_code") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.pages.scripts.deleteCustomCode("page_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/products.test.ts b/tests/wire/products.test.ts index 67d2079f..6cc1190c 100644 --- a/tests/wire/products.test.ts +++ b/tests/wire/products.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Products", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -74,8 +75,8 @@ describe("Products", () => { .build(); const response = await client.products.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ items: [ @@ -155,154 +156,7 @@ describe("Products", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -548,182 +402,7 @@ describe("Products", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("create (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { product: {}, sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.create("site_id", { - product: {}, - sku: {}, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -864,192 +543,45 @@ describe("Products", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, }); - - const rawResponseBody = { key: "value" }; + const rawRequestBody = {}; + const rawResponseBody = { + id: "660eb7a486d1d6e0412292d7", + cmsLocaleId: "653ad57de882f528b32e810e", + lastPublished: "2024-04-04T14:24:19Z", + lastUpdated: "2024-04-04T14:30:19Z", + createdOn: "2024-04-04T14:22:28Z", + isArchived: false, + isDraft: false, + fieldData: { + name: "T-Shirt", + slug: "t-shirt", + description: "A plain cotton t-shirt.", + shippable: true, + "sku-properties": [ + { + id: "Color", + name: "Color", + enum: [{ id: "royal-blue", name: "Royal Blue", slug: "royal-blue" }], + }, + ], + category: ["category"], + "tax-category": "standard-taxable", + "default-sku": "default-sku", + "ec-product-type": "ff42fee0113744f693a764e3431a9cc2", + }, + }; server .mockEndpoint() - .get("/sites/site_id/products/product_id") + .patch("/sites/580e63e98c9a982ac9b8b741/products/580e63fc8c9a982ac9b8b745") + .jsonBody(rawRequestBody) .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("get (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/products/product_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.get("site_id", "product_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { - id: "660eb7a486d1d6e0412292d7", - cmsLocaleId: "653ad57de882f528b32e810e", - lastPublished: "2024-04-04T14:24:19Z", - lastUpdated: "2024-04-04T14:30:19Z", - createdOn: "2024-04-04T14:22:28Z", - isArchived: false, - isDraft: false, - fieldData: { - name: "T-Shirt", - slug: "t-shirt", - description: "A plain cotton t-shirt.", - shippable: true, - "sku-properties": [ - { - id: "Color", - name: "Color", - enum: [{ id: "royal-blue", name: "Royal Blue", slug: "royal-blue" }], - }, - ], - category: ["category"], - "tax-category": "standard-taxable", - "default-sku": "default-sku", - "ec-product-type": "ff42fee0113744f693a764e3431a9cc2", - }, - }; - server - .mockEndpoint() - .patch("/sites/580e63e98c9a982ac9b8b741/products/580e63fc8c9a982ac9b8b745") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) + .statusCode(200) .jsonBody(rawResponseBody) .build(); @@ -1088,161 +620,7 @@ describe("Products", () => { }); }); - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.update("site_id", "product_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create-sku (1)", async () => { + test("create-sku", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1360,175 +738,7 @@ describe("Products", () => { }); }); - test("create-sku (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create-sku (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create-sku (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("create-sku (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create-sku (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("create-sku (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create-sku (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { skus: [{}, {}] }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/products/product_id/skus") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.createSku("site_id", "product_id", { - skus: [{}, {}], - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-sku (1)", async () => { + test("update-sku", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1652,172 +862,4 @@ describe("Products", () => { }, }); }); - - test("update-sku (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-sku (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-sku (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-sku (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-sku (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-sku (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-sku (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sku: {} }; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/products/product_id/skus/sku_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.products.updateSku("site_id", "product_id", "sku_id", { - sku: {}, - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/scripts.test.ts b/tests/wire/scripts.test.ts index aafb7191..3404b169 100644 --- a/tests/wire/scripts.test.ts +++ b/tests/wire/scripts.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Scripts", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -97,112 +98,7 @@ describe("Scripts", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/registered_scripts") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/registered_scripts") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/registered_scripts") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/registered_scripts") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/registered_scripts") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("register-hosted (1)", async () => { + test("register-hosted", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -251,167 +147,7 @@ describe("Scripts", () => { }); }); - test("register-hosted (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/hosted") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerHosted("site_id", { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("register-hosted (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/hosted") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerHosted("site_id", { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("register-hosted (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/hosted") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerHosted("site_id", { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("register-hosted (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/hosted") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerHosted("site_id", { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("register-hosted (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/hosted") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerHosted("site_id", { - hostedLocation: "hostedLocation", - integrityHash: "integrityHash", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("register-inline (1)", async () => { + test("register-inline", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -455,134 +191,4 @@ describe("Scripts", () => { version: "0.0.1", }); }); - - test("register-inline (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/inline") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerInline("site_id", { - sourceCode: "sourceCode", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("register-inline (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/inline") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerInline("site_id", { - sourceCode: "sourceCode", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("register-inline (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/inline") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerInline("site_id", { - sourceCode: "sourceCode", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("register-inline (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/inline") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerInline("site_id", { - sourceCode: "sourceCode", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("register-inline (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { sourceCode: "sourceCode", version: "version", displayName: "displayName" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/registered_scripts/inline") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.scripts.registerInline("site_id", { - sourceCode: "sourceCode", - version: "version", - displayName: "displayName", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index a7939d6e..b1d3e6aa 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Sites", () => { - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -110,151 +111,7 @@ describe("Sites", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { name: "name" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/workspaces/workspace_id/sites") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.create("workspace_id", { - name: "name", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -546,52 +403,7 @@ describe("Sites", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.list(); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.list(); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.list(); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -705,82 +517,7 @@ describe("Sites", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.get("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.get("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.get("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.get("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/sites/site_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.get("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -793,97 +530,7 @@ describe("Sites", () => { expect(response).toEqual(undefined); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(400).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(403).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(404).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(429).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().delete("/sites/site_id").respondWith().statusCode(500).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.sites.delete("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -998,139 +645,7 @@ describe("Sites", () => { }); }); - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.update("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-custom-domain (1)", async () => { + test("get-custom-domain", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1172,112 +687,7 @@ describe("Sites", () => { }); }); - test("get-custom-domain (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_domains") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.getCustomDomain("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-custom-domain (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/custom_domains") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.getCustomDomain("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-custom-domain (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_domains") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.getCustomDomain("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-custom-domain (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_domains") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.getCustomDomain("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-custom-domain (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_domains") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.getCustomDomain("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("publish (1)", async () => { + test("publish", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -1317,114 +727,4 @@ describe("Sites", () => { publishToWebflowSubdomain: true, }); }); - - test("publish (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.publish("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("publish (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.publish("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("publish (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.publish("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("publish (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.publish("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("publish (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/publish") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.publish("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); }); diff --git a/tests/wire/sites/activityLogs.test.ts b/tests/wire/sites/activityLogs.test.ts index cb256afc..b94da7e2 100644 --- a/tests/wire/sites/activityLogs.test.ts +++ b/tests/wire/sites/activityLogs.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("ActivityLogs", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -39,8 +40,8 @@ describe("ActivityLogs", () => { .build(); const response = await client.sites.activityLogs.list("580e63e98c9a982ac9b8b741", { - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, }); expect(response).toEqual({ items: [ @@ -70,88 +71,4 @@ describe("ActivityLogs", () => { }, }); }); - - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/activity_logs") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.activityLogs.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/activity_logs") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.activityLogs.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/activity_logs") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.activityLogs.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/activity_logs") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.activityLogs.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/comments.test.ts b/tests/wire/sites/comments.test.ts index fbd965dc..552e2072 100644 --- a/tests/wire/sites/comments.test.ts +++ b/tests/wire/sites/comments.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Comments", () => { - test("list-comment-threads (1)", async () => { + test("list-comment-threads", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -77,8 +78,8 @@ describe("Comments", () => { const response = await client.sites.comments.listCommentThreads("580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", sortOrder: "asc", }); @@ -143,112 +144,7 @@ describe("Comments", () => { }); }); - test("list-comment-threads (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/comments") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentThreads("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-comment-threads (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentThreads("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-comment-threads (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentThreads("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-comment-threads (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentThreads("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-comment-threads (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentThreads("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-comment-thread (1)", async () => { + test("get-comment-thread", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -285,8 +181,8 @@ describe("Comments", () => { "580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", sortOrder: "asc", }, @@ -318,112 +214,7 @@ describe("Comments", () => { }); }); - test("get-comment-thread (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-comment-thread (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-comment-thread (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-comment-thread (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-comment-thread (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.getCommentThread("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-comment-replies (1)", async () => { + test("list-comment-replies", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -462,8 +253,8 @@ describe("Comments", () => { "580e63e98c9a982ac9b8b741", { localeId: "65427cf400e02b306eaa04a0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sortBy: "createdOn", sortOrder: "asc", }, @@ -502,109 +293,4 @@ describe("Comments", () => { }, }); }); - - test("list-comment-replies (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id/replies") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-comment-replies (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id/replies") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-comment-replies (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id/replies") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-comment-replies (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id/replies") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-comment-replies (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/comments/comment_thread_id/replies") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.comments.listCommentReplies("site_id", "comment_thread_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/forms.test.ts b/tests/wire/sites/forms.test.ts index f2b6692b..8c194ef3 100644 --- a/tests/wire/sites/forms.test.ts +++ b/tests/wire/sites/forms.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Forms", () => { - test("list-submissions-by-site (1)", async () => { + test("list-submissions-by-site", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -43,8 +44,8 @@ describe("Forms", () => { const response = await client.sites.forms.listSubmissionsBySite("580e63e98c9a982ac9b8b741", { elementId: "18259716-3e5a-646a-5f41-5dc4b9405aa0", - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ formSubmissions: [ @@ -79,133 +80,7 @@ describe("Forms", () => { }); }); - test("list-submissions-by-site (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-submissions-by-site (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-submissions-by-site (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list-submissions-by-site (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-submissions-by-site (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-submissions-by-site (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissionsBySite("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-submissions (1)", async () => { + test("list-submissions", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -245,8 +120,8 @@ describe("Forms", () => { "580e63e98c9a982ac9b8b741", "580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }, ); expect(response).toEqual({ @@ -282,133 +157,7 @@ describe("Forms", () => { }); }); - test("list-submissions (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-submissions (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-submissions (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list-submissions (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-submissions (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-submissions (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/forms/form_id/submissions") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.listSubmissions("site_id", "form_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get-submission (1)", async () => { + test("get-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -445,133 +194,7 @@ describe("Forms", () => { }); }); - test("get-submission (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-submission (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.getSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-submission (1)", async () => { + test("delete-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -592,154 +215,7 @@ describe("Forms", () => { expect(response).toEqual(undefined); }); - test("delete-submission (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-submission (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("delete-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("delete-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-submission (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/form_submissions/form_submission_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.deleteSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update-submission (1)", async () => { + test("update-submission", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -779,158 +255,4 @@ describe("Forms", () => { }, }); }); - - test("update-submission (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update-submission (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update-submission (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update-submission (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update-submission (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("update-submission (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update-submission (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/form_submissions/form_submission_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.forms.updateSubmission("site_id", "form_submission_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/plans.test.ts b/tests/wire/sites/plans.test.ts index 33070c61..79b1be3a 100644 --- a/tests/wire/sites/plans.test.ts +++ b/tests/wire/sites/plans.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Plans", () => { - test("get-site-plan (1)", async () => { + test("get-site-plan", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -32,109 +33,4 @@ describe("Plans", () => { pricingInfo: "https://webflow.com/pricing", }); }); - - test("get-site-plan (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/plan") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.plans.getSitePlan("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-site-plan (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/plan") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.plans.getSitePlan("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-site-plan (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/plan") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.plans.getSitePlan("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-site-plan (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/plan") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.plans.getSitePlan("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-site-plan (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/plan") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.plans.getSitePlan("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/redirects.test.ts b/tests/wire/sites/redirects.test.ts index 20c28be6..c4e19916 100644 --- a/tests/wire/sites/redirects.test.ts +++ b/tests/wire/sites/redirects.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Redirects", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -49,112 +50,7 @@ describe("Redirects", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/redirects") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/redirects") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/redirects") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/redirects") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/redirects") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -183,117 +79,7 @@ describe("Redirects", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/redirects") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.create("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/redirects") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.create("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/redirects") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.create("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/redirects") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.create("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/redirects") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.create("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -337,112 +123,7 @@ describe("Redirects", () => { }); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/redirects/redirect_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.delete("site_id", "redirect_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/redirects/redirect_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.delete("site_id", "redirect_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/redirects/redirect_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.delete("site_id", "redirect_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/redirects/redirect_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.delete("site_id", "redirect_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/redirects/redirect_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.delete("site_id", "redirect_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -470,114 +151,4 @@ describe("Redirects", () => { toUrl: "/earth", }); }); - - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/redirects/redirect_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.update("site_id", "redirect_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/redirects/redirect_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.update("site_id", "redirect_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/redirects/redirect_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.update("site_id", "redirect_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/redirects/redirect_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.update("site_id", "redirect_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/redirects/redirect_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.redirects.update("site_id", "redirect_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/robotsTxt.test.ts b/tests/wire/sites/robotsTxt.test.ts index ac33bb3c..2ad09ab6 100644 --- a/tests/wire/sites/robotsTxt.test.ts +++ b/tests/wire/sites/robotsTxt.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("RobotsTxt", () => { - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -43,112 +44,7 @@ describe("RobotsTxt", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/robots_txt") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.get("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/robots_txt") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.get("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/robots_txt") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.get("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/robots_txt") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.get("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/robots_txt") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.get("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("put (1)", async () => { + test("put", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -205,117 +101,7 @@ describe("RobotsTxt", () => { }); }); - test("put (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.put("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("put (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.put("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("put (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.put("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("put (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.put("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("put (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.put("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -362,117 +148,7 @@ describe("RobotsTxt", () => { }); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.delete("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.delete("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.delete("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.delete("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.delete("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("patch (1)", async () => { + test("patch", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -528,114 +204,4 @@ describe("RobotsTxt", () => { sitemap: "https://heartofgold.ship/sitemap.xml", }); }); - - test("patch (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.patch("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("patch (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.patch("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("patch (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.patch("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("patch (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.patch("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("patch (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/robots_txt") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.robotsTxt.patch("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/scripts.test.ts b/tests/wire/sites/scripts.test.ts index ea38b8a0..48798ee4 100644 --- a/tests/wire/sites/scripts.test.ts +++ b/tests/wire/sites/scripts.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("Scripts", () => { - test("get-custom-code (1)", async () => { + test("get-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -58,112 +59,7 @@ describe("Scripts", () => { }); }); - test("get-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/custom_code") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.getCustomCode("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.getCustomCode("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.getCustomCode("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.getCustomCode("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.getCustomCode("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("upsert-custom-code (1)", async () => { + test("upsert-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -243,117 +139,7 @@ describe("Scripts", () => { }); }); - test("upsert-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/sites/site_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.upsertCustomCode("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("upsert-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.upsertCustomCode("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("upsert-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.upsertCustomCode("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("upsert-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.upsertCustomCode("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("upsert-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/custom_code") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.upsertCustomCode("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete-custom-code (1)", async () => { + test("delete-custom-code", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -371,112 +157,7 @@ describe("Scripts", () => { expect(response).toEqual(undefined); }); - test("delete-custom-code (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/custom_code") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.deleteCustomCode("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete-custom-code (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/custom_code") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.deleteCustomCode("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete-custom-code (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/custom_code") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.deleteCustomCode("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete-custom-code (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/custom_code") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.deleteCustomCode("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete-custom-code (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/custom_code") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.deleteCustomCode("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("list-custom-code-blocks (1)", async () => { + test("list-custom-code-blocks", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -513,8 +194,8 @@ describe("Scripts", () => { .build(); const response = await client.sites.scripts.listCustomCodeBlocks("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, }); expect(response).toEqual({ blocks: [ @@ -557,109 +238,4 @@ describe("Scripts", () => { }, }); }); - - test("list-custom-code-blocks (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/custom_code/blocks") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.listCustomCodeBlocks("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list-custom-code-blocks (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code/blocks") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.listCustomCodeBlocks("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list-custom-code-blocks (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code/blocks") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.listCustomCodeBlocks("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list-custom-code-blocks (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code/blocks") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.listCustomCodeBlocks("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list-custom-code-blocks (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/custom_code/blocks") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.scripts.listCustomCodeBlocks("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/sites/wellKnown.test.ts b/tests/wire/sites/wellKnown.test.ts index a89303c2..2693fdb1 100644 --- a/tests/wire/sites/wellKnown.test.ts +++ b/tests/wire/sites/wellKnown.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("WellKnown", () => { - test("put (1)", async () => { + test("put", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -35,132 +36,7 @@ describe("WellKnown", () => { expect(response).toEqual(undefined); }); - test("put (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .put("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.put("site_id", { - fileName: "fileName", - fileData: "fileData", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("put (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.put("site_id", { - fileName: "fileName", - fileData: "fileData", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("put (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.put("site_id", { - fileName: "fileName", - fileData: "fileData", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("put (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.put("site_id", { - fileName: "fileName", - fileData: "fileData", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("put (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { fileName: "fileName", fileData: "fileData" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .put("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.put("site_id", { - fileName: "fileName", - fileData: "fileData", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -179,114 +55,4 @@ describe("WellKnown", () => { const response = await client.sites.wellKnown.delete("580e63e98c9a982ac9b8b741"); expect(response).toEqual(undefined); }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.delete("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.delete("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.delete("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.delete("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/well_known") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.sites.wellKnown.delete("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/token.test.ts b/tests/wire/token.test.ts index cd9db18e..6b339053 100644 --- a/tests/wire/token.test.ts +++ b/tests/wire/token.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Token", () => { - test("authorized-by (1)", async () => { + test("authorized-by", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -35,49 +36,7 @@ describe("Token", () => { }); }); - test("authorized-by (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/token/authorized_by") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.token.authorizedBy(); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("authorized-by (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/token/authorized_by") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.token.authorizedBy(); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("introspect (1)", async () => { + test("introspect", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -130,19 +89,4 @@ describe("Token", () => { }, }); }); - - test("introspect (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server.mockEndpoint().get("/token/introspect").respondWith().statusCode(401).jsonBody(rawResponseBody).build(); - - await expect(async () => { - return await client.token.introspect(); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); }); diff --git a/tests/wire/users.test.ts b/tests/wire/users.test.ts index e1f9c478..1d114052 100644 --- a/tests/wire/users.test.ts +++ b/tests/wire/users.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Users", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -79,8 +80,8 @@ describe("Users", () => { .build(); const response = await client.users.list("580e63e98c9a982ac9b8b741", { - offset: 1.1, - limit: 1.1, + offset: 1, + limit: 1, sort: "CreatedOn", }); expect(response).toEqual({ @@ -168,133 +169,7 @@ describe("Users", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -355,133 +230,7 @@ describe("Users", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/users/user_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.get("site_id", "user_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -499,133 +248,7 @@ describe("Users", () => { expect(response).toEqual(undefined); }); - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/sites/site_id/users/user_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.delete("site_id", "user_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("update (1)", async () => { + test("update", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -710,139 +333,7 @@ describe("Users", () => { }); }); - test("update (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("update (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("update (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("update (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("update (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("update (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .patch("/sites/site_id/users/user_id") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.update("site_id", "user_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("invite (1)", async () => { + test("invite", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -906,172 +397,4 @@ describe("Users", () => { }, }); }); - - test("invite (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("invite (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("invite (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("invite (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("invite (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(409) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.ConflictError); - }); - - test("invite (7)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("invite (8)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = { email: "email" }; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/users/invite") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.users.invite("site_id", { - email: "email", - }); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/webhooks.test.ts b/tests/wire/webhooks.test.ts index de28d4c1..a2bf9815 100644 --- a/tests/wire/webhooks.test.ts +++ b/tests/wire/webhooks.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../src/api/index"; +import { mockServerPool } from "../mock-server/MockServerPool.js"; import { WebflowClient } from "../../src/Client"; -import { mockServerPool } from "../mock-server/MockServerPool"; describe("Webhooks", () => { - test("list (1)", async () => { + test("list", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -103,112 +104,7 @@ describe("Webhooks", () => { }); }); - test("list (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/sites/site_id/webhooks") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.list("site_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("list (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/webhooks") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.list("site_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("list (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/webhooks") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.list("site_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("list (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/webhooks") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.list("site_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("list (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/sites/site_id/webhooks") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.list("site_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("create (1)", async () => { + test("create", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -265,117 +161,7 @@ describe("Webhooks", () => { }); }); - test("create (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .post("/sites/site_id/webhooks") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.create("site_id", {}); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("create (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/webhooks") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.create("site_id", {}); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("create (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/webhooks") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.create("site_id", {}); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("create (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/webhooks") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.create("site_id", {}); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("create (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - const rawRequestBody = {}; - const rawResponseBody = {}; - server - .mockEndpoint() - .post("/sites/site_id/webhooks") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.create("site_id", {}); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("get (1)", async () => { + test("get", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -415,112 +201,7 @@ describe("Webhooks", () => { }); }); - test("get (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/webhooks/webhook_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.get("webhook_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("get (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/webhooks/webhook_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.get("webhook_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/webhooks/webhook_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.get("webhook_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/webhooks/webhook_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.get("webhook_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/webhooks/webhook_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.get("webhook_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); - - test("delete (1)", async () => { + test("delete", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -532,109 +213,4 @@ describe("Webhooks", () => { const response = await client.webhooks.delete("580e64008c9a982ac9b8b754"); expect(response).toEqual(undefined); }); - - test("delete (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .delete("/webhooks/webhook_id") - .respondWith() - .statusCode(400) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.delete("webhook_id"); - }).rejects.toThrow(Webflow.BadRequestError); - }); - - test("delete (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/webhooks/webhook_id") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.delete("webhook_id"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("delete (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/webhooks/webhook_id") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.delete("webhook_id"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("delete (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/webhooks/webhook_id") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.delete("webhook_id"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("delete (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .delete("/webhooks/webhook_id") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.webhooks.delete("webhook_id"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tests/wire/workspaces/auditLogs.test.ts b/tests/wire/workspaces/auditLogs.test.ts index 02e93b4a..7725593d 100644 --- a/tests/wire/workspaces/auditLogs.test.ts +++ b/tests/wire/workspaces/auditLogs.test.ts @@ -1,11 +1,12 @@ -// This file was auto-generated by Fern from our API Definition. +/** + * This file was auto-generated by Fern from our API Definition. + */ -import * as Webflow from "../../../src/api/index"; +import { mockServerPool } from "../../mock-server/MockServerPool.js"; import { WebflowClient } from "../../../src/Client"; -import { mockServerPool } from "../../mock-server/MockServerPool"; describe("AuditLogs", () => { - test("get-workspace-audit_logs (1)", async () => { + test("get-workspace-audit_logs", async () => { const server = mockServerPool.createServer(); const client = new WebflowClient({ accessToken: "test", @@ -15,25 +16,25 @@ describe("AuditLogs", () => { const rawResponseBody = { items: [ { + eventSubType: "login", eventType: "user_access", - timestamp: "2025-04-29T20:30:06.000Z", + timestamp: "2025-04-29T20:30:06Z", actor: { id: "6661ccb359b561c69f29d554", email: "someone@email.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, - eventSubType: "login", }, { + eventSubType: "user_added", eventType: "workspace_membership", - timestamp: "2025-04-30T20:30:06.000Z", + timestamp: "2025-04-30T20:30:06Z", actor: { id: "60492e55bbddce079561cd7a", email: "someone@webflow.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, - eventSubType: "user_added", }, { + eventSubType: "user_added", eventType: "site_membership", - timestamp: "2025-04-30T00:33:31.000Z", + timestamp: "2025-04-30T00:33:31Z", actor: { id: "671fe00d185fc8c1ad409d37", email: "someone@webflow.com" }, workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, - eventSubType: "user_added", }, ], pagination: { limit: 10, offset: 0, total: 3 }, @@ -47,8 +48,8 @@ describe("AuditLogs", () => { .build(); const response = await client.workspaces.auditLogs.getWorkspaceAuditLogs("hitchhikers-workspace", { - limit: 1.1, - offset: 1.1, + limit: 1, + offset: 1, sortOrder: "asc", eventType: "user_access", from: new Date("2025-06-22T16:00:31.000Z"), @@ -59,22 +60,13 @@ describe("AuditLogs", () => { { eventType: "user_access", eventSubType: "login", - timestamp: new Date("2025-04-29T20:30:06.000Z"), - actor: { id: "6661ccb359b561c69f29d554", email: "someone@email.com" }, - workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, }, { eventType: "workspace_membership", eventSubType: "user_added", - timestamp: new Date("2025-04-30T20:30:06.000Z"), - actor: { id: "60492e55bbddce079561cd7a", email: "someone@webflow.com" }, - workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, }, { eventType: "site_membership", - timestamp: new Date("2025-04-30T00:33:31.000Z"), - actor: { id: "671fe00d185fc8c1ad409d37", email: "someone@webflow.com" }, - workspace: { id: "6621ccb459b561c69f29d57c", slug: "hitchhikers-workspace" }, eventSubType: "user_added", }, ], @@ -85,109 +77,4 @@ describe("AuditLogs", () => { }, }); }); - - test("get-workspace-audit_logs (2)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/workspaces/workspace_id_or_slug/audit_logs") - .respondWith() - .statusCode(401) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); - }).rejects.toThrow(Webflow.UnauthorizedError); - }); - - test("get-workspace-audit_logs (3)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = { key: "value" }; - server - .mockEndpoint() - .get("/workspaces/workspace_id_or_slug/audit_logs") - .respondWith() - .statusCode(403) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); - }).rejects.toThrow(Webflow.ForbiddenError); - }); - - test("get-workspace-audit_logs (4)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/workspaces/workspace_id_or_slug/audit_logs") - .respondWith() - .statusCode(404) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); - }).rejects.toThrow(Webflow.NotFoundError); - }); - - test("get-workspace-audit_logs (5)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/workspaces/workspace_id_or_slug/audit_logs") - .respondWith() - .statusCode(429) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); - }).rejects.toThrow(Webflow.TooManyRequestsError); - }); - - test("get-workspace-audit_logs (6)", async () => { - const server = mockServerPool.createServer(); - const client = new WebflowClient({ - accessToken: "test", - environment: { base: server.baseUrl, dataApi: server.baseUrl, contentDeliveryApi: server.baseUrl }, - }); - - const rawResponseBody = {}; - server - .mockEndpoint() - .get("/workspaces/workspace_id_or_slug/audit_logs") - .respondWith() - .statusCode(500) - .jsonBody(rawResponseBody) - .build(); - - await expect(async () => { - return await client.workspaces.auditLogs.getWorkspaceAuditLogs("workspace_id_or_slug"); - }).rejects.toThrow(Webflow.InternalServerError); - }); }); diff --git a/tsconfig.json b/tsconfig.json index 0140f411..1ec87dd7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,8 +10,6 @@ "outDir": "dist", "rootDir": "src", "baseUrl": "src", - "isolatedModules": true, - "isolatedDeclarations": true, "module": "CommonJS" }, "include": ["src"], diff --git a/yarn.lock b/yarn.lock index fd567d4b..309a77a2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -270,110 +270,42 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@biomejs/biome@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.3.1.tgz#d1a9284f52986324f288cdaf450331a0f3fb1da7" - integrity sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w== - optionalDependencies: - "@biomejs/cli-darwin-arm64" "2.3.1" - "@biomejs/cli-darwin-x64" "2.3.1" - "@biomejs/cli-linux-arm64" "2.3.1" - "@biomejs/cli-linux-arm64-musl" "2.3.1" - "@biomejs/cli-linux-x64" "2.3.1" - "@biomejs/cli-linux-x64-musl" "2.3.1" - "@biomejs/cli-win32-arm64" "2.3.1" - "@biomejs/cli-win32-x64" "2.3.1" - -"@biomejs/cli-darwin-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz#607835f8ef043e1a80f9ad2a232c9e860941ab60" - integrity sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA== - -"@biomejs/cli-darwin-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz#654fe4aaa8ea5d5bde5457db4961ad5d214713ac" - integrity sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ== - -"@biomejs/cli-linux-arm64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz#5fe502082a575c31ef808cf080cbcd4485964167" - integrity sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg== - -"@biomejs/cli-linux-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz#81c02547905d379dbb312e6ff24b04908c2e320f" - integrity sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ== - -"@biomejs/cli-linux-x64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz#c7c00beb5eda1ad25185544897e66eeec6be3b0b" - integrity sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ== - -"@biomejs/cli-linux-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz#7481d2e7be98d4de574df233766a5bdda037c897" - integrity sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q== - -"@biomejs/cli-win32-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz#dac8c7c7223e97f86cd0eed7aa95584984761481" - integrity sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A== - -"@biomejs/cli-win32-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz#f8818ab2c1e3a6e2ed8a656935173e5ce4c720be" - integrity sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA== - -"@bundled-es-modules/cookie@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/cookie/-/cookie-2.0.1.tgz#b41376af6a06b3e32a15241d927b840a9b4de507" - integrity sha512-8o+5fRPLNbjbdGRRmJj3h6Hh1AQJf2dk3qQ/5ZFb+PXkRNiSoMGGUKlsgLfrxneb72axVJyIYji64E2+nNfYyw== - dependencies: - cookie "^0.7.2" - -"@bundled-es-modules/statuses@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@bundled-es-modules/statuses/-/statuses-1.0.1.tgz#761d10f44e51a94902c4da48675b71a76cc98872" - integrity sha512-yn7BklA5acgcBr+7w064fGV+SGIFySjCKpqjcWgBAIfrAkY+4GQTJJHQMeT3V/sgz23VTEVV8TtOmkvJAhFVfg== - dependencies: - statuses "^2.0.1" - -"@inquirer/ansi@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.1.tgz#994f7dd16a00c547a7b110e04bf4f4eca1857929" - integrity sha512-yqq0aJW/5XPhi5xOAL1xRCpe1eh8UFVgYFpFsjEqmIR8rKLyP+HINvFXwUaxYICflJrVlxnp7lLN6As735kVpw== +"@inquirer/ansi@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@inquirer/ansi/-/ansi-1.0.2.tgz#674a4c4d81ad460695cb2a1fc69d78cd187f337e" + integrity sha512-S8qNSZiYzFd0wAcyG5AXCvUHC5Sr7xpZ9wZ2py9XR88jUz8wooStVx5M6dRzczbBWjic9NP7+rY0Xi7qqK/aMQ== "@inquirer/confirm@^5.0.0": - version "5.1.19" - resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.1.19.tgz#bf28b420898999eb7479ab55623a3fbaf1453ff4" - integrity sha512-wQNz9cfcxrtEnUyG5PndC8g3gZ7lGDBzmWiXZkX8ot3vfZ+/BLjR8EvyGX4YzQLeVqtAlY/YScZpW7CW8qMoDQ== + version "5.1.21" + resolved "https://registry.yarnpkg.com/@inquirer/confirm/-/confirm-5.1.21.tgz#610c4acd7797d94890a6e2dde2c98eb1e891dd12" + integrity sha512-KR8edRkIsUayMXV+o3Gv+q4jlhENF9nMYUZs9PA2HzrXeHI8M5uDag70U7RJn9yyiMZSbtF5/UexBtAVtZGSbQ== dependencies: - "@inquirer/core" "^10.3.0" - "@inquirer/type" "^3.0.9" + "@inquirer/core" "^10.3.2" + "@inquirer/type" "^3.0.10" -"@inquirer/core@^10.3.0": - version "10.3.0" - resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.3.0.tgz#342e4fd62cbd33ea62089364274995dbec1f2ffe" - integrity sha512-Uv2aPPPSK5jeCplQmQ9xadnFx2Zhj9b5Dj7bU6ZeCdDNNY11nhYy4btcSdtDguHqCT2h5oNeQTcUNSGGLA7NTA== +"@inquirer/core@^10.3.2": + version "10.3.2" + resolved "https://registry.yarnpkg.com/@inquirer/core/-/core-10.3.2.tgz#535979ff3ff4fe1e7cc4f83e2320504c743b7e20" + integrity sha512-43RTuEbfP8MbKzedNqBrlhhNKVwoK//vUFNW3Q3vZ88BLcrs4kYpGg+B2mm5p2K/HfygoCxuKwJJiv8PbGmE0A== dependencies: - "@inquirer/ansi" "^1.0.1" - "@inquirer/figures" "^1.0.14" - "@inquirer/type" "^3.0.9" + "@inquirer/ansi" "^1.0.2" + "@inquirer/figures" "^1.0.15" + "@inquirer/type" "^3.0.10" cli-width "^4.1.0" mute-stream "^2.0.0" signal-exit "^4.1.0" wrap-ansi "^6.2.0" - yoctocolors-cjs "^2.1.2" + yoctocolors-cjs "^2.1.3" -"@inquirer/figures@^1.0.14": - version "1.0.14" - resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.14.tgz#12a7bfd344a83ae6cc5d6004b389ed11f6db6be4" - integrity sha512-DbFgdt+9/OZYFM+19dbpXOSeAstPy884FPy1KjDu4anWwymZeOYhMY1mdFri172htv6mvc/uvIAAi7b7tvjJBQ== +"@inquirer/figures@^1.0.15": + version "1.0.15" + resolved "https://registry.yarnpkg.com/@inquirer/figures/-/figures-1.0.15.tgz#dbb49ed80df11df74268023b496ac5d9acd22b3a" + integrity sha512-t2IEY+unGHOzAaVM5Xx6DEWKeXlDDcNPeDyUpsRc6CUhBfU3VQOEl+Vssh7VNp1dR8MdUJBWhuObjXCsVpjN5g== -"@inquirer/type@^3.0.9": - version "3.0.9" - resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.9.tgz#f7f9696e9276e4e1ae9332767afb9199992e31d9" - integrity sha512-QPaNt/nmE2bLGQa9b7wwyRJoLZ7pN6rcyXvzU0YCmivmJyq1BVo94G98tStRWkoD1RgDX5C+dPlhhHzNdu/W/w== +"@inquirer/type@^3.0.10": + version "3.0.10" + resolved "https://registry.yarnpkg.com/@inquirer/type/-/type-3.0.10.tgz#11ed564ec78432a200ea2601a212d24af8150d50" + integrity sha512-BvziSRxfz5Ov8ch0z/n3oijRSEcEsHnhggm4xFZe93DHcUCTlutlq9Ox4SVENAfcRD22UQq7T/atg9Wr3k09eA== "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" @@ -625,10 +557,10 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@mswjs/interceptors@^0.39.1": - version "0.39.8" - resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.39.8.tgz#0a2cf4cf26a731214ca4156273121f67dff7ebf8" - integrity sha512-2+BzZbjRO7Ct61k8fMNHEtoKjeWI9pIlHFTqBwZ5icHpqszIgEZbjb1MW5Z0+bITTCTl3gk4PDBxs9tA/csXvA== +"@mswjs/interceptors@^0.40.0": + version "0.40.0" + resolved "https://registry.yarnpkg.com/@mswjs/interceptors/-/interceptors-0.40.0.tgz#1b45f215ba8c2983ed133763ca03af92896083d6" + integrity sha512-EFd6cVbHsgLa6wa4RljGj6Wk75qoHxUSyc5asLyyPSyuhIcdS2Q3Phw6ImS1q+CkALthJRShiYfKANcQMuMqsQ== dependencies: "@open-draft/deferred-promise" "^2.2.0" "@open-draft/logger" "^0.3.0" @@ -650,7 +582,7 @@ is-node-process "^1.2.0" outvariant "^1.4.0" -"@open-draft/until@^2.0.0", "@open-draft/until@^2.1.0": +"@open-draft/until@^2.0.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-2.1.0.tgz#0acf32f470af2ceaf47f095cdecd40d68666efda" integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== @@ -712,11 +644,6 @@ dependencies: "@babel/types" "^7.20.7" -"@types/cookie@^0.6.0": - version "0.6.0" - resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" - integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== - "@types/eslint-scope@^3.7.7": version "3.7.7" resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" @@ -795,9 +722,9 @@ form-data "^4.0.4" "@types/node@*": - version "24.9.2" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.9.2.tgz#90ded2422dbfcafcf72080f28975adc21366148d" - integrity sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA== + version "25.0.6" + resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.6.tgz#5ca3c46f2b256b59128f433426e42d464765dab1" + integrity sha512-NNu0sjyNxpoiW3YuVFfNz7mxSQ+S4X2G28uqg2s+CzoqoQjLPsWSbsFFyztIAqt2vb8kfEAsJNepMGPTxFDx3Q== dependencies: undici-types "~7.16.0" @@ -808,10 +735,15 @@ dependencies: undici-types "~5.26.4" +"@types/qs@^6.9.17": + version "6.14.0" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.14.0.tgz#d8b60cecf62f2db0fb68e5e006077b9178b85de5" + integrity sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ== + "@types/readable-stream@^4.0.18": - version "4.0.22" - resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.22.tgz#882fda4f17b6580acb257df3f22ca69c05470b29" - integrity sha512-/FFhJpfCLAPwAcN3mFycNUa77ddnr8jTgF5VmSNetaemWB2cIlfCA9t0YTM3JAT0wOcv8D4tjPo7pkDhK3EJIg== + version "4.0.23" + resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.23.tgz#fcd0f7472f45ceb43154f08f0083ccd1c76e53ce" + integrity sha512-wwXrtQvbMHxCbBgjHaMGEmImFTQxxpfMOR/ZoQnXxB1woqkUbdLGFDgauo00Py9IudiaqSeiBiulSV9i6XIPig== dependencies: "@types/node" "*" @@ -820,7 +752,7 @@ resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8" integrity sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw== -"@types/statuses@^2.0.4": +"@types/statuses@^2.0.6": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/statuses/-/statuses-2.0.6.tgz#66748315cc9a96d63403baa8671b2c124f8633aa" integrity sha512-xMAgYwceFhRA2zY+XbEA7mxYbA093wdiW8Vu6gZPGWy9cmOyU9XesH1tNcEWsKFd5Vzrqx5T3D38PWx1FIIXkA== @@ -830,15 +762,20 @@ resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" integrity sha512-/Ad8+nIOV7Rl++6f1BdKxFSMgmoqEoYbHRpPcx3JEfv8VRsQe9Z4mCXeJBzxs7mbHY/XOZZuXlRNfhpVPbs6ZA== +"@types/url-join@4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/url-join/-/url-join-4.0.1.tgz#4989c97f969464647a8586c7252d97b449cdc045" + integrity sha512-wDXw9LEEUHyV+7UWy7U315nrJGJ7p1BzaCxDpEoLr789Dk1WDVMMlf3iBfbG2F8NdWnYyFbtTxUn2ZNbm1Q4LQ== + "@types/yargs-parser@*": version "21.0.3" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.3.tgz#815e30b786d2e8f0dcd85fd5bcf5e1a04d008f15" integrity sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ== "@types/yargs@^17.0.8": - version "17.0.34" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.34.tgz#1c2f9635b71d5401827373a01ce2e8a7670ea839" - integrity sha512-KExbHVa92aJpw9WDQvzBaGVE2/Pz+pLZQloT2hjL8IqsZnV62rlPOYvNnLmf/L2dyllfVUOVBj64M0z/46eR2A== + version "17.0.35" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.35.tgz#07013e46aa4d7d7d50a49e15604c1c5340d4eb24" + integrity sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg== dependencies: "@types/yargs-parser" "*" @@ -1174,10 +1111,10 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== -baseline-browser-mapping@^2.8.19: - version "2.8.20" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.8.20.tgz#6766cf270f3668d20b6712b9c54cc911b87da714" - integrity sha512-JMWsdF+O8Orq3EMukbUN1QfbLK9mX2CkUmQBcW2T0s8OmdAUL5LLM/6wFwSrqXzlXB13yhyK9gTKS1rIizOduQ== +baseline-browser-mapping@^2.9.0: + version "2.9.14" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" + integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.11.9: version "4.12.2" @@ -1264,16 +1201,16 @@ browserify-sign@^4.2.3: readable-stream "^2.3.8" safe-buffer "^5.2.1" -browserslist@^4.24.0, browserslist@^4.26.3: - version "4.27.0" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.27.0.tgz#755654744feae978fbb123718b2f139bc0fa6697" - integrity sha512-AXVQwdhot1eqLihwasPElhX2tAZiBjWdJ9i/Zcj2S6QYIjkx62OKSfnobkriB81C3l4w0rVy3Nt4jaTBltYEpw== +browserslist@^4.24.0, browserslist@^4.28.1: + version "4.28.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" + integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== dependencies: - baseline-browser-mapping "^2.8.19" - caniuse-lite "^1.0.30001751" - electron-to-chromium "^1.5.238" - node-releases "^2.0.26" - update-browserslist-db "^1.1.4" + baseline-browser-mapping "^2.9.0" + caniuse-lite "^1.0.30001759" + electron-to-chromium "^1.5.263" + node-releases "^2.0.27" + update-browserslist-db "^1.2.0" bs-logger@^0.2.6: version "0.2.6" @@ -1325,7 +1262,7 @@ call-bind@^1.0.8: get-intrinsic "^1.2.4" set-function-length "^1.2.2" -call-bound@^1.0.3, call-bound@^1.0.4: +call-bound@^1.0.2, call-bound@^1.0.3, call-bound@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== @@ -1348,10 +1285,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001751: - version "1.0.30001751" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001751.tgz#dacd5d9f4baeea841641640139d2b2a4df4226ad" - integrity sha512-A0QJhug0Ly64Ii3eIqHu5X51ebln3k4yTUkY1j8drqpWHVreg/VLijN48cZ1bYPiqOQuqpkIKnzr/Ul8V+p6Cw== +caniuse-lite@^1.0.30001759: + version "1.0.30001764" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" + integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1448,10 +1385,10 @@ convert-source-map@^2.0.0: resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== -cookie@^0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.7.2.tgz#556369c472a2ba910f2979891b526b3436237ed7" - integrity sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w== +cookie@^1.0.2: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-1.1.1.tgz#3bb9bdfc82369db9c2f69c93c9c3ceb310c88b3c" + integrity sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ== core-util-is@~1.0.0: version "1.0.3" @@ -1575,9 +1512,9 @@ decimal.js@^10.4.2: integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== dedent@^1.0.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.0.tgz#c1f9445335f0175a96587be245a282ff451446ca" - integrity sha512-HGFtf8yhuhGhqO07SV79tRp+br4MnbdjeVxotpn1QBl30pcLLCQjX5b2295ll0fv8RKDKsmWYrl05usHM9CewQ== + version "1.7.1" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" + integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== deepmerge@^4.2.2: version "4.3.1" @@ -1641,10 +1578,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" gopd "^1.2.0" -electron-to-chromium@^1.5.238: - version "1.5.241" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.241.tgz#350a2cdcde43829d36af245a27167243e917c6ed" - integrity sha512-ILMvKX/ZV5WIJzzdtuHg8xquk2y0BOGlFOxBVwTpbiXqWIH0hamG45ddU4R3PQ0gYu+xgo0vdHXHli9sHIGb4w== +electron-to-chromium@^1.5.263: + version "1.5.267" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" + integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== elliptic@^6.5.3, elliptic@^6.6.1: version "6.6.1" @@ -1669,10 +1606,10 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.3: - version "5.18.3" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.3.tgz#9b5f4c5c076b8787c78fe540392ce76a88855b44" - integrity sha512-d4lC8xfavMeBjzGr2vECC3fsGXziXZQyJxD868h2M/mBI3PwAuODxAkLkq5HYuvrPYcUtiLzsTo8U3PgX3Ocww== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.4: + version "5.18.4" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" + integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== dependencies: graceful-fs "^4.2.4" tapable "^2.2.0" @@ -1699,10 +1636,10 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^1.2.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.7.0.tgz#9159601561880a85f2734560a9099b2c31e5372a" - integrity sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA== +es-module-lexer@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.0.0.tgz#f657cd7a9448dcdda9c070a3cb75e5dc1e85f5b1" + integrity sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw== es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: version "1.1.1" @@ -1871,9 +1808,9 @@ for-each@^0.3.5: is-callable "^1.2.7" form-data@^4.0.0, form-data@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" - integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== + version "4.0.5" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" + integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -1911,7 +1848,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -1972,10 +1909,10 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== -graphql@^16.8.1: - version "16.11.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.11.0.tgz#96d17f66370678027fdf59b2d4c20b4efaa8a633" - integrity sha512-mS1lbMsxgQj6hge1XZ6p7GPhbrtFwUFYi3wRzXAC/FmYnyXMTvvI3td3rjmQ2u8ewXueaSvRPWaEcgVVOT9Jnw== +graphql@^16.12.0: + version "16.12.0" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.12.0.tgz#28cc2462435b1ac3fdc6976d030cef83a0c13ac7" + integrity sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ== handlebars@^4.7.8: version "4.7.8" @@ -2643,15 +2580,20 @@ jest@^29.7.0: import-local "^3.0.2" jest-cli "^29.7.0" +js-base64@3.7.7: + version "3.7.7" + resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-3.7.7.tgz#e51b84bf78fbf5702b9541e2cb7bfcb893b43e79" + integrity sha512-7rCnleh0z2CkXhH67J8K1Ytz0b2Y+yxTPL+/KOJoa20hfnVQ/3/T6W/KflYI4bRHRagNeXeU2bkNGI3v1oS/lw== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + version "3.14.2" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.2.tgz#77485ce1dd7f33c061fd1b16ecea23b55fcb04b0" + integrity sha512-PMSmkqxr106Xa156c2M265Z+FTrPl+oxd/rgOQy2tijQeK5TxQ43psO1ZCwhVOSdnn+RzkzlRz/eY4BgJBYVpg== dependencies: argparse "^1.0.7" esprima "^4.0.0" @@ -2723,7 +2665,7 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -loader-runner@^4.2.0: +loader-runner@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.1.tgz#6c76ed29b0ccce9af379208299f07f876de737e3" integrity sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q== @@ -2845,29 +2787,28 @@ ms@^2.1.3: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== -msw@2.11.2: - version "2.11.2" - resolved "https://registry.yarnpkg.com/msw/-/msw-2.11.2.tgz#622d83855f456a5f93b1528f6eb6f4c0114623c3" - integrity sha512-MI54hLCsrMwiflkcqlgYYNJJddY5/+S0SnONvhv1owOplvqohKSQyGejpNdUGyCwgs4IH7PqaNbPw/sKOEze9Q== +msw@^2.8.4: + version "2.12.7" + resolved "https://registry.yarnpkg.com/msw/-/msw-2.12.7.tgz#755fa4a0df51133bf76ebc9b7d4bdcc4355f0c8e" + integrity sha512-retd5i3xCZDVWMYjHEVuKTmhqY8lSsxujjVrZiGbbdoxxIBg5S7rCuYy/YQpfrTYIxpd/o0Kyb/3H+1udBMoYg== dependencies: - "@bundled-es-modules/cookie" "^2.0.1" - "@bundled-es-modules/statuses" "^1.0.1" "@inquirer/confirm" "^5.0.0" - "@mswjs/interceptors" "^0.39.1" + "@mswjs/interceptors" "^0.40.0" "@open-draft/deferred-promise" "^2.2.0" - "@open-draft/until" "^2.1.0" - "@types/cookie" "^0.6.0" - "@types/statuses" "^2.0.4" - graphql "^16.8.1" + "@types/statuses" "^2.0.6" + cookie "^1.0.2" + graphql "^16.12.0" headers-polyfill "^4.0.2" is-node-process "^1.2.0" outvariant "^1.4.3" path-to-regexp "^6.3.0" picocolors "^1.1.1" rettime "^0.7.0" + statuses "^2.0.2" strict-event-emitter "^0.5.1" tough-cookie "^6.0.0" - type-fest "^4.26.1" + type-fest "^5.2.0" + until-async "^3.0.2" yargs "^17.7.2" mute-stream@^2.0.0: @@ -2897,10 +2838,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.26: - version "2.0.26" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.26.tgz#fdfa272f2718a1309489d18aef4ef5ba7f5dfb52" - integrity sha512-S2M9YimhSjBSvYnlr5/+umAnPHE++ODwt5e2Ij6FoX45HA/s4vHdkDx1eax2pAPeAOqu4s9b7ppahsyEFdVqQA== +node-releases@^2.0.27: + version "2.0.27" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" + integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== normalize-path@^3.0.0: version "3.0.0" @@ -2915,9 +2856,14 @@ npm-run-path@^4.0.1: path-key "^3.0.0" nwsapi@^2.2.2: - version "2.2.22" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.22.tgz#109f9530cda6c156d6a713cdf5939e9f0de98b9d" - integrity sha512-ujSMe1OWVn55euT1ihwCI1ZcAaAU3nxUiDwfDQldc51ZXaB9m2AyOn6/jh1BLe2t/G8xd6uKG1UBF2aZJeg2SQ== + version "2.2.23" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.23.tgz#59712c3a88e6de2bb0b6ccc1070397267019cf6c" + integrity sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ== + +object-inspect@^1.13.3: + version "1.13.4" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" + integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== once@^1.3.0: version "1.4.0" @@ -3056,6 +3002,11 @@ possible-typed-array-names@^1.0.0: resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== +prettier@^3.4.2: + version "3.7.4" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.7.4.tgz#d2f8335d4b1cec47e1c8098645411b0c9dff9c0f" + integrity sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA== + pretty-format@^29.0.0, pretty-format@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" @@ -3117,6 +3068,13 @@ pure-rand@^6.0.0: resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.1.0.tgz#d173cf23258231976ccbdb05247c9787957604f2" integrity sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA== +qs@^6.13.1: + version "6.14.1" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.14.1.tgz#a41d85b9d3902f31d27861790506294881871159" + integrity sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ== + dependencies: + side-channel "^1.1.0" + querystringify@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" @@ -3302,6 +3260,46 @@ shebang-regex@^3.0.0: resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== +side-channel-list@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad" + integrity sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + +side-channel-map@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/side-channel-map/-/side-channel-map-1.0.1.tgz#d6bb6b37902c6fef5174e5f533fab4c732a26f42" + integrity sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + +side-channel-weakmap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz#11dda19d5368e40ce9ec2bdc1fb0ecbc0790ecea" + integrity sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A== + dependencies: + call-bound "^1.0.2" + es-errors "^1.3.0" + get-intrinsic "^1.2.5" + object-inspect "^1.13.3" + side-channel-map "^1.0.1" + +side-channel@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" + integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== + dependencies: + es-errors "^1.3.0" + object-inspect "^1.13.3" + side-channel-list "^1.0.0" + side-channel-map "^1.0.1" + side-channel-weakmap "^1.0.2" + signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" @@ -3360,7 +3358,7 @@ stack-utils@^2.0.3: dependencies: escape-string-regexp "^2.0.0" -statuses@^2.0.1: +statuses@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.2.tgz#8f75eecef765b5e1cfcdc080da59409ed424e382" integrity sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw== @@ -3447,15 +3445,20 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== +tagged-tag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tagged-tag/-/tagged-tag-1.0.0.tgz#a0b5917c2864cba54841495abfa3f6b13edcf4d6" + integrity sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng== + tapable@^2.2.0, tapable@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.0.tgz#7e3ea6d5ca31ba8e078b560f0d83ce9a14aa8be6" integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== -terser-webpack-plugin@^5.3.11: - version "5.3.14" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.14.tgz#9031d48e57ab27567f02ace85c7d690db66c3e06" - integrity sha512-vkZjpUjb6OMS7dhV+tILUW6BhpDR7P2L/aQSAv+Uwk+m8KATX9EccViHTJR2qDtACKPIYndLGCyl3FMo+r2LMw== +terser-webpack-plugin@^5.3.16: + version "5.3.16" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz#741e448cc3f93d8026ebe4f7ef9e4afacfd56330" + integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" @@ -3464,9 +3467,9 @@ terser-webpack-plugin@^5.3.11: terser "^5.31.1" terser@^5.31.1: - version "5.44.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.0.tgz#ebefb8e5b8579d93111bfdfc39d2cf63879f4a82" - integrity sha512-nIVck8DK+GM/0Frwd+nIhZ84pR/BX7rmXMfYwyg+Sri5oGVE99/E3KvXqpC2xHFxyqXyGHTKBSioxxplrO4I4w== + version "5.44.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" + integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3482,17 +3485,17 @@ test-exclude@^6.0.0: glob "^7.1.4" minimatch "^3.0.4" -tldts-core@^7.0.17: - version "7.0.17" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.17.tgz#dadfee3750dd272ed219d7367beb7cbb2ff29eb8" - integrity sha512-DieYoGrP78PWKsrXr8MZwtQ7GLCUeLxihtjC1jZsW1DnvSMdKPitJSe8OSYDM2u5H6g3kWJZpePqkp43TfLh0g== +tldts-core@^7.0.19: + version "7.0.19" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.19.tgz#9dd8a457a09b4e65c8266c029f1847fa78dead20" + integrity sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A== tldts@^7.0.5: - version "7.0.17" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.17.tgz#a6cdc067b9e80ea05f3be471c0ea410688cc78b2" - integrity sha512-Y1KQBgDd/NUc+LfOtKS6mNsC9CCaH+m2P1RoIZy7RAPo3C3/t8X45+zgut31cRZtZ3xKPjfn3TkGTrctC2TQIQ== + version "7.0.19" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.19.tgz#84cd7a7f04e68ec93b93b106fac038c527b99368" + integrity sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA== dependencies: - tldts-core "^7.0.17" + tldts-core "^7.0.19" tmpl@1.0.5: version "1.0.5" @@ -3545,9 +3548,9 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.3.4: - version "29.4.5" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.5.tgz#a6b0dc401e521515d5342234be87f1ca96390a6f" - integrity sha512-HO3GyiWn2qvTQA4kTgjDcXiMwYQt68a1Y8+JuLRVpdIzm+UOLSHgl/XqR4c6nzJkq5rOkjc02O2I7P7l/Yof0Q== + version "29.4.6" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" + integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== dependencies: bs-logger "^0.2.6" fast-json-stable-stringify "^2.1.0" @@ -3580,11 +3583,18 @@ type-fest@^0.21.3: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== -type-fest@^4.26.1, type-fest@^4.41.0: +type-fest@^4.41.0: version "4.41.0" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== +type-fest@^5.2.0: + version "5.4.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-5.4.0.tgz#be169ec21eaaae88769b3fc69fe0cbbf05350731" + integrity sha512-wfkA6r0tBpVfGiyO+zbf9e10QkRQSlK9F2UvyfnjoCmrvH2bjHyhPzhugSBOuq1dog3P0+FKckqe+Xf6WKVjwg== + dependencies: + tagged-tag "^1.0.0" + typed-array-buffer@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" @@ -3619,14 +3629,24 @@ universalify@^0.2.0: resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.4.tgz#7802aa2ae91477f255b86e0e46dbc787a206ad4a" - integrity sha512-q0SPT4xyU84saUX+tomz1WLkxUbuaJnR1xWt17M7fJtEJigJeWUNGUqrauFXsHnqev9y9JTRGwk13tFBuKby4A== +until-async@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/until-async/-/until-async-3.0.2.tgz#447f1531fdd7bb2b4c7a98869bdb1a4c2a23865f" + integrity sha512-IiSk4HlzAMqTUseHHe3VhIGyuFmN90zMTpD3Z3y8jeQbzLIq500MVM7Jq2vUAnTKAFPJrqwkzr6PoTcPhGcOiw== + +update-browserslist-db@^1.2.0: + version "1.2.3" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" + integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== dependencies: escalade "^3.2.0" picocolors "^1.1.1" +url-join@4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" + integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + url-parse@^1.5.3: version "1.5.10" resolved "https://registry.yarnpkg.com/url-parse/-/url-parse-1.5.10.tgz#9d3c2f736c1d75dd3bd2be507dcc111f1e2ea9c1" @@ -3664,9 +3684,9 @@ walker@^1.0.8: makeerror "1.0.12" watchpack@^2.4.4: - version "2.4.4" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.4.tgz#473bda72f0850453da6425081ea46fc0d7602947" - integrity sha512-c5EGNOiyxxV5qmTtAB7rbiXxi1ooX1pQKMLX/MIabJjRA0SJBQOjKF+KSVfHkr9U1cADPon0mRiVe/riyaiDUA== + version "2.5.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.0.tgz#fa115d5ccaa4bf3aa594f586257c0bc4768939fd" + integrity sha512-e6vZvY6xboSwLz2GD36c16+O/2Z6fKvIf4pOXptw2rY9MVwE/TXc6RGqxD3I3x0a28lwBY7DE+76uTPSsBrrCA== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -3687,9 +3707,9 @@ webpack-sources@^3.3.3: integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== webpack@^5.97.1: - version "5.102.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.102.1.tgz#1003a3024741a96ba99c37431938bf61aad3d988" - integrity sha512-7h/weGm9d/ywQ6qzJ+Xy+r9n/3qgp/thalBbpOi5i223dPXKi04IBtqPN9nTd+jBc7QKfvDbaBnFipYp4sJAUQ== + version "5.104.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.1.tgz#94bd41eb5dbf06e93be165ba8be41b8260d4fb1a" + integrity sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3699,21 +3719,21 @@ webpack@^5.97.1: "@webassemblyjs/wasm-parser" "^1.14.1" acorn "^8.15.0" acorn-import-phases "^1.0.3" - browserslist "^4.26.3" + browserslist "^4.28.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.3" - es-module-lexer "^1.2.1" + enhanced-resolve "^5.17.4" + es-module-lexer "^2.0.0" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" - loader-runner "^4.2.0" + loader-runner "^4.3.1" mime-types "^2.1.27" neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" - terser-webpack-plugin "^5.3.11" + terser-webpack-plugin "^5.3.16" watchpack "^2.4.4" webpack-sources "^3.3.3" @@ -3802,9 +3822,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.11.0: - version "8.18.3" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.3.tgz#b56b88abffde62791c639170400c93dcb0c95472" - integrity sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg== + version "8.19.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.19.0.tgz#ddc2bdfa5b9ad860204f5a72a4863a8895fd8c8b" + integrity sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg== xml-name-validator@^4.0.0: version "4.0.0" @@ -3849,7 +3869,7 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -yoctocolors-cjs@^2.1.2: +yoctocolors-cjs@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/yoctocolors-cjs/-/yoctocolors-cjs-2.1.3.tgz#7e4964ea8ec422b7a40ac917d3a344cfd2304baa" integrity sha512-U/PBtDf35ff0D8X8D0jfdzHYEPFxAI7jJlxZXwCSez5M3190m+QobIfh+sWDWSHMCWWJN2AWamkegn6vr6YBTw==