diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index d03365a2bd..0000000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM debian:bookworm-slim AS stainless - -RUN apt-get update && apt-get install -y \ - nodejs \ - npm \ - yarnpkg \ - && apt-get clean autoclean - -# Yarn -RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn - -WORKDIR /workspace - -COPY package.json yarn.lock /workspace/ - -RUN yarn install - -COPY . /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d55fc4d671..763462fada 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,20 +1,17 @@ // For format details, see https://aka.ms/devcontainer.json. For config options, see the // README at: https://github.com/devcontainers/templates/tree/main/src/debian { - "name": "Debian", - "build": { - "dockerfile": "Dockerfile" + "name": "Development", + "image": "mcr.microsoft.com/devcontainers/typescript-node:latest", + "features": { + "ghcr.io/devcontainers/features/node:1": {} + }, + "postCreateCommand": "yarn install", + "customizations": { + "vscode": { + "extensions": [ + "esbenp.prettier-vscode" + ] + } } - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - // "remoteUser": "root" } diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e6d1af638..871a5f467e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,30 +1,112 @@ name: CI on: push: - branches: - - main + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' pull_request: - branches: - - main + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' jobs: lint: + timeout-minutes: 10 name: lint - runs-on: ubuntu-latest - + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + steps: + - uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Bootstrap + run: ./scripts/bootstrap + - name: Check types + run: ./scripts/lint + + build: + timeout-minutes: 5 + name: build + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + permissions: + contents: read + id-token: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v4 with: node-version: '18' + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Check build + run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/cloudflare-node' + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: github.repository == 'stainless-sdks/cloudflare-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh + test: + timeout-minutes: 10 + name: test + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + steps: + - uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test + examples: + timeout-minutes: 10 + name: examples + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.repository == 'cloudflare/cloudflare-typescript' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) + + steps: + - uses: actions/checkout@v6 + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: '20' - name: Install dependencies run: | yarn install - - name: Check types + - env: + CLOUDFLARE_ACCOUNT_ID: f037e56e89293a057740de681ac9abbe + CLOUDFLARE_EMAIL: terraform-acceptance-test@cfapi.net + CLOUDFLARE_ZONE_ID: 0da42c8d2132a9ddaf714f9e7c92011 + CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }} run: | - yarn build + yarn tsn ./examples/ai/demo.ts diff --git a/.github/workflows/detect-breaking-changes.yml b/.github/workflows/detect-breaking-changes.yml new file mode 100644 index 0000000000..bdd7ff0b1b --- /dev/null +++ b/.github/workflows/detect-breaking-changes.yml @@ -0,0 +1,36 @@ +name: CI +on: + pull_request: + branches: + - main + - next + +jobs: + detect_breaking_changes: + runs-on: 'ubuntu-latest' + name: detect-breaking-changes + if: github.repository == 'cloudflare/cloudflare-typescript' + steps: + - name: Calculate fetch-depth + run: | + echo "FETCH_DEPTH=$(expr ${{ github.event.pull_request.commits }} + 1)" >> $GITHUB_ENV + + - uses: actions/checkout@v6 + with: + # Ensure we can check out the pull request base in the script below. + fetch-depth: ${{ env.FETCH_DEPTH }} + + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version: '20' + - name: Install dependencies + run: | + yarn install + + - name: Detect breaking changes + run: | + # Try to check out previous versions of the breaking change detection script. This ensures that + # we still detect breaking changes when entire files and their tests are removed. + git checkout "${{ github.event.pull_request.base.sha }}" -- ./scripts/detect-breaking-changes 2>/dev/null || true + ./scripts/detect-breaking-changes ${{ github.event.pull_request.base.sha }} diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 285da6d7c0..826ed49693 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -14,12 +14,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 86102f95ed..e3a93da734 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -1,6 +1,8 @@ name: Release Doctor on: pull_request: + branches: + - main workflow_dispatch: jobs: @@ -10,10 +12,11 @@ jobs: if: github.repository == 'cloudflare/cloudflare-typescript' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Check release environment run: | bash ./bin/check-release-environment env: NPM_TOKEN: ${{ secrets.CLOUDFLARE_NPM_TOKEN || secrets.NPM_TOKEN }} + diff --git a/.gitignore b/.gitignore index 58b3944a13..2412bb77a3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ +.prism.log node_modules yarn-error.log codegen.log +Brewfile.lock.json dist -/deno +dist-deno /*.tgz .idea/ +.eslintcache + diff --git a/.prettierignore b/.prettierignore index fc6160fb10..3548c5af9c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,5 @@ CHANGELOG.md -/ecosystem-tests +/ecosystem-tests/*/** /node_modules /deno diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b985ff6e79..d41bd0f113 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "6.0.0-beta.1" } diff --git a/.stats.yml b/.stats.yml index 24aae68af5..4e17ca8002 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,4 @@ -configured_endpoints: 1282 +configured_endpoints: 2018 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-502ff5e05c48b9d2cafd71f7fa1b833f7ccf8f328350e5f4648d065d456e765c.yml +openapi_spec_hash: 659199fd85eae22382ad710a8b1d7be1 +config_hash: 7a08b6d7e050d324501d76c833118c84 diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000000..e4feee6014 --- /dev/null +++ b/Brewfile @@ -0,0 +1 @@ +brew "node" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f3d6729593..1cdd45f8d6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,38 +1,38 @@ ## Setting up the environment -This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable). +This repository uses [`yarn@v1`](https://classic.yarnpkg.com/lang/en/docs/install). Other package managers may work but are not officially supported for development. To set up the repository, run: -```bash -yarn -yarn build +```sh +$ yarn +$ yarn build ``` This will install all the required dependencies and build output files to `dist/`. ## Modifying/Adding code -Most of the SDK is generated code, and any modified code will be overridden on the next generation. The -`src/lib/` and `examples/` directories are exceptions and will never be overridden. +Most of the SDK is generated code. Modifications to code will be persisted between generations, but may +result in merge conflicts between manual patches and changes from the generator. The generator will never +modify the contents of the `src/lib/` and `examples/` directories. ## Adding and running examples -All files in the `examples/` directory are not modified by the Stainless generator and can be freely edited or -added to. +All files in the `examples/` directory are not modified by the generator and can be freely edited or added to. -```bash +```ts // add an example to examples/.ts #!/usr/bin/env -S npm run tsn -T … ``` -``` -chmod +x examples/.ts +```sh +$ chmod +x examples/.ts # run the example against your api -yarn tsn -T examples/.ts +$ yarn tsn -T examples/.ts ``` ## Using the repository from source @@ -41,38 +41,38 @@ If you’d like to use the repository from source, you can either install from g To install via git: -```bash -npm install git+ssh://git@github.com:cloudflare/cloudflare-typescript.git +```sh +$ npm install git+ssh://git@github.com:cloudflare/cloudflare-typescript.git ``` Alternatively, to link a local copy of the repo: -```bash +```sh # Clone -git clone https://www.github.com/cloudflare/cloudflare-typescript -cd cloudflare-typescript +$ git clone https://www.github.com/cloudflare/cloudflare-typescript +$ cd cloudflare-typescript # With yarn -yarn link -cd ../my-package -yarn link cloudflare +$ yarn link +$ cd ../my-package +$ yarn link cloudflare # With pnpm -pnpm link --global -cd ../my-package -pnpm link -—global cloudflare +$ pnpm link --global +$ cd ../my-package +$ pnpm link -—global cloudflare ``` ## Running tests Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. -```bash -npx prism path/to/your/openapi.yml +```sh +$ npx prism mock path/to/your/openapi.yml ``` -```bash -yarn run test +```sh +$ yarn run test ``` ## Linting and formatting @@ -82,14 +82,14 @@ This repository uses [prettier](https://www.npmjs.com/package/prettier) and To lint: -```bash -yarn lint +```sh +$ yarn lint ``` To format and fix all lint issues automatically: -```bash -yarn fix +```sh +$ yarn fix ``` ## Publishing and releases diff --git a/LICENSE b/LICENSE index 827fca03dd..27db488677 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2024 Cloudflare + Copyright 2026 Cloudflare Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/README.md b/README.md index c6bf9d012b..deff793459 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,21 @@ # Cloudflare Node API Library -[![NPM version](https://img.shields.io/npm/v/cloudflare.svg)](https://npmjs.org/package/cloudflare) +[![NPM version](https://img.shields.io/npm/v/cloudflare.svg)](https://npmjs.org/package/cloudflare) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/cloudflare) This library provides convenient access to the Cloudflare REST API from server-side TypeScript or JavaScript. -The REST API documentation can be found [on developers.cloudflare.com](https://developers.cloudflare.com/api). The full API of this library can be found in [api.md](api.md). +The REST API documentation can be found on [developers.cloudflare.com](https://developers.cloudflare.com/api). The full API of this library can be found in [api.md](api.md). + +It is generated with [Stainless](https://www.stainless.com/). + +## MCP Server + +Use the Cloudflare MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application. + +[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=cloudflare-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImNsb3VkZmxhcmUtbWNwIl19) +[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22cloudflare-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22cloudflare-mcp%22%5D%7D) + +> Note: You may need to set environment variables in your MCP client. ## Installation @@ -20,22 +31,17 @@ The full API of this library can be found in [api.md](api.md). ```js import Cloudflare from 'cloudflare'; -const cloudflare = new Cloudflare({ - apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted - apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted +const client = new Cloudflare({ + apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); -async function main() { - const zoneCreateResponse = await cloudflare.zones.create({ - account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, - name: 'example.com', - type: 'full', - }); - - console.log(zoneCreateResponse.id); -} +const zone = await client.zones.create({ + account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, + name: 'example.com', + type: 'full', +}); -main(); +console.log(zone.id); ``` ### Request & Response types @@ -46,25 +52,65 @@ This library includes TypeScript definitions for all request params and response ```ts import Cloudflare from 'cloudflare'; -const cloudflare = new Cloudflare({ - apiEmail: process.env['CLOUDFLARE_EMAIL'], // This is the default and can be omitted - apiKey: process.env['CLOUDFLARE_API_KEY'], // This is the default and can be omitted +const client = new Cloudflare({ + apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); -async function main() { - const params: Cloudflare.ZoneCreateParams = { - account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, - name: 'example.com', - type: 'full', - }; - const zoneCreateResponse: Cloudflare.ZoneCreateResponse = await cloudflare.zones.create(params); -} - -main(); +const params: Cloudflare.ZoneCreateParams = { + account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, + name: 'example.com', + type: 'full', +}; +const zone: Cloudflare.Zone = await client.zones.create(params); ``` Documentation for each method, request param, and response field are available in docstrings and will appear on hover in most modern editors. +## File uploads + +Request parameters that correspond to file uploads can be passed in many different forms: + +- `File` (or an object with the same structure) +- a `fetch` `Response` (or an object with the same structure) +- an `fs.ReadStream` +- the return value of our `toFile` helper + +```ts +import fs from 'fs'; +import fetch from 'node-fetch'; +import Cloudflare, { toFile } from 'cloudflare'; + +const client = new Cloudflare(); + +// If you have access to Node `fs` we recommend using `fs.createReadStream()`: +await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: fs.createReadStream('/path/to/file'), +}); + +// Or if you have the web `File` API you can pass a `File` instance: +await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: new File(['my bytes'], 'file'), +}); + +// You can also pass a `fetch` `Response`: +await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: await fetch('https://somesite/file'), +}); + +// Finally, if none of the above are convenient, you can use our `toFile` helper: +await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: await toFile(Buffer.from('my bytes'), 'file'), +}); +await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + value: await toFile(new Uint8Array([0, 1, 2]), 'file'), +}); +``` + ## Handling errors When the library is unable to connect to the API, @@ -73,24 +119,20 @@ a subclass of `APIError` will be thrown: ```ts -async function main() { - const zone = await cloudflare.zones - .get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }) - .catch(async (err) => { - if (err instanceof Cloudflare.APIError) { - console.log(err.status); // 400 - console.log(err.name); // BadRequestError - console.log(err.headers); // {server: 'nginx', ...} - } else { - throw err; - } - }); -} - -main(); +const zone = await client.zones + .get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }) + .catch(async (err) => { + if (err instanceof Cloudflare.APIError) { + console.log(err.status); // 400 + console.log(err.name); // BadRequestError + console.log(err.headers); // {server: 'nginx', ...} + } else { + throw err; + } + }); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | @@ -114,12 +156,12 @@ You can use the `maxRetries` option to configure or disable this: ```js // Configure the default for all requests: -const cloudflare = new Cloudflare({ +const client = new Cloudflare({ maxRetries: 0, // default is 2 }); // Or, configure per-request: -await cloudflare.zones.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, { +await client.zones.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, { maxRetries: 5, }); ``` @@ -131,12 +173,12 @@ Requests time out after 1 minute by default. You can configure this with a `time ```ts // Configure the default for all requests: -const cloudflare = new Cloudflare({ +const client = new Cloudflare({ timeout: 20 * 1000, // 20 seconds (default is 1 minute) }); // Override per-request: -await cloudflare.zones.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, { +await client.zones.edit({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, { timeout: 5 * 1000, }); ``` @@ -148,30 +190,30 @@ Note that requests which time out will be [retried twice by default](#retries). ## Auto-pagination List methods in the Cloudflare API are paginated. -You can use `for await … of` syntax to iterate through items across all pages: +You can use the `for await … of` syntax to iterate through items across all pages: ```ts async function fetchAllAccounts(params) { const allAccounts = []; // Automatically fetches more pages as needed. - for await (const accountListResponse of cloudflare.accounts.list()) { - allAccounts.push(accountListResponse); + for await (const account of client.accounts.list()) { + allAccounts.push(account); } return allAccounts; } ``` -Alternatively, you can make request a single page at a time: +Alternatively, you can request a single page at a time: ```ts -let page = await cloudflare.accounts.list(); -for (const accountListResponse of page.result) { - console.log(accountListResponse); +let page = await client.accounts.list(); +for (const account of page.result) { + console.log(account); } // Convenience methods are provided for manually paginating: while (page.hasNextPage()) { - page = page.getNextPage(); + page = await page.getNextPage(); // ... } ``` @@ -186,22 +228,74 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi ```ts -const cloudflare = new Cloudflare(); +const client = new Cloudflare(); -const response = await cloudflare.zones - .create({ account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, name: 'example.com', type: 'full' }) +const response = await client.zones + .create({ + account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, + name: 'example.com', + type: 'full', + }) .asResponse(); console.log(response.headers.get('X-My-Header')); console.log(response.statusText); // access the underlying Response object -const { data: zoneCreateResponse, response: raw } = await cloudflare.zones - .create({ account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, name: 'example.com', type: 'full' }) +const { data: zone, response: raw } = await client.zones + .create({ + account: { id: '023e105f4ecef8ad9ca31a8372d0c353' }, + name: 'example.com', + type: 'full', + }) .withResponse(); console.log(raw.headers.get('X-My-Header')); -console.log(zoneCreateResponse.id); +console.log(zone.id); +``` + +### Making custom/undocumented requests + +This library is typed for convenient access to the documented API. If you need to access undocumented +endpoints, params, or response properties, the library can still be used. + +#### Undocumented endpoints + +To make requests to undocumented endpoints, you can use `client.get`, `client.post`, and other HTTP verbs. +Options on the client, such as retries, will be respected when making these requests. + +```ts +await client.post('/some/path', { + body: { some_prop: 'foo' }, + query: { some_query_arg: 'bar' }, +}); +``` + +#### Undocumented request params + +To make requests using undocumented parameters, you may use `// @ts-expect-error` on the undocumented +parameter. This library doesn't validate at runtime that the request matches the type, so any extra values you +send will be sent as-is. + +```ts +client.foo.create({ + foo: 'my_param', + bar: 12, + // @ts-expect-error baz is not yet public + baz: 'undocumented option', +}); ``` -## Customizing the fetch client +For requests with the `GET` verb, any extra params will be in the query, all other requests will send the +extra param in the body. + +If you want to explicitly send an extra argument, you can do so with the `query`, `body`, and `headers` request +options. + +#### Undocumented response properties + +To access undocumented response properties, you may access the response object with `// @ts-expect-error` on +the response object, or cast the response object to the requisite type. Like the request params, we do not +validate or strip extra properties from the response from the API. + +### Customizing the fetch client By default, this library uses `node-fetch` in Node, and expects a global `fetch` function in other environments. @@ -219,6 +313,8 @@ import Cloudflare from 'cloudflare'; To do the inverse, add `import "cloudflare/shims/node"` (which does import polyfills). This can also be useful if you are getting the wrong TypeScript types for `Response` ([more details](https://github.com/cloudflare/cloudflare-typescript/tree/main/src/_shims#readme)). +### Logging and middleware + You may also provide a custom `fetch` function when instantiating the client, which can be used to inspect or alter the `Request` or `Response` before/after each request: @@ -239,7 +335,7 @@ const client = new Cloudflare({ Note that if given a `DEBUG=true` environment variable, this library will log all requests and responses automatically. This is intended for debugging purposes only and may change in the future without notice. -## Configuring an HTTP(S) Agent (e.g., for proxies) +### Configuring an HTTP(S) Agent (e.g., for proxies) By default, this library uses a stable agent for all http/https requests to reuse TCP connections, eliminating many TCP & TLS handshakes and shaving around 100ms off most requests. @@ -251,12 +347,12 @@ import http from 'http'; import { HttpsProxyAgent } from 'https-proxy-agent'; // Configure the default for all requests: -const cloudflare = new Cloudflare({ +const client = new Cloudflare({ httpAgent: new HttpsProxyAgent(process.env.PROXY_URL), }); // Override per-request: -await cloudflare.zones.delete( +await client.zones.delete( { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, { httpAgent: new http.Agent({ keepAlive: false }), @@ -264,12 +360,12 @@ await cloudflare.zones.delete( ); ``` -## Semantic Versioning +## Semantic versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: 1. Changes that only affect static types, without breaking runtime behavior. -2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_. +2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_ 3. Changes that we do not expect to impact the vast majority of users in practice. We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience. @@ -282,8 +378,9 @@ TypeScript >= 4.5 is supported. The following runtimes are supported: +- Web browsers (Up-to-date Chrome, Firefox, Safari, Edge, and more) - Node.js 18 LTS or later ([non-EOL](https://endoflife.date/nodejs)) versions. -- Deno v1.28.0 or higher, using `import Cloudflare from "npm:cloudflare"`. +- Deno v1.28.0 or higher. - Bun 1.0 or later. - Cloudflare Workers. - Vercel Edge Runtime. @@ -293,3 +390,7 @@ The following runtimes are supported: Note that React Native is not supported at this time. If you are interested in other runtime environments, please open or upvote an issue on GitHub. + +## Contributing + +See [the contributing documentation](./CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..09e9c70cbb --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Cloudflare, please follow the respective company's security reporting guidelines. + +### Cloudflare Terms and Policies + +Please contact api@cloudflare.com for any questions or concerns regarding the security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/api.md b/api.md index 3bf9afa1d3..0805b0ad23 100644 --- a/api.md +++ b/api.md @@ -1,250 +1,259 @@ +# Shared + +Types: + +- ASN +- AuditLog +- CertificateCA +- CertificateRequestType +- CloudflareTunnel +- ErrorData +- Identifier +- LoadBalancerPreview +- Member +- PaginationInfo +- Permission +- PermissionGrant +- RatePlan +- ResponseInfo +- Result +- Role +- SortDirection +- Subscription +- SubscriptionComponent +- SubscriptionZone +- Token +- TokenConditionCIDRList +- TokenPolicy +- TokenValue + # Accounts Types: - Account -- AccountUpdateResponse -- AccountListResponse -- AccountGetResponse +- AccountDeleteResponse Methods: -- client.accounts.update({ ...params }) -> AccountUpdateResponse -- client.accounts.list({ ...params }) -> AccountListResponsesV4PagePaginationArray -- client.accounts.get({ ...params }) -> AccountGetResponse +- client.accounts.create({ ...params }) -> Account +- client.accounts.update({ ...params }) -> Account +- client.accounts.list({ ...params }) -> AccountsV4PagePaginationArray +- client.accounts.delete({ ...params }) -> AccountDeleteResponse | null +- client.accounts.get({ ...params }) -> Account ## Members Types: -- AccountMember -- AccountMemberWithID -- MemberListResponse +- Status - MemberDeleteResponse Methods: -- client.accounts.members.create({ ...params }) -> AccountMemberWithID -- client.accounts.members.update(memberId, { ...params }) -> AccountMember -- client.accounts.members.list({ ...params }) -> MemberListResponsesV4PagePaginationArray +- client.accounts.members.create({ ...params }) -> Member +- client.accounts.members.update(memberId, { ...params }) -> Member +- client.accounts.members.list({ ...params }) -> MembersV4PagePaginationArray - client.accounts.members.delete(memberId, { ...params }) -> MemberDeleteResponse | null -- client.accounts.members.get(memberId, { ...params }) -> AccountMember +- client.accounts.members.get(memberId, { ...params }) -> Member ## Roles -Types: - -- IamSchemasRole -- RoleListResponse -- RoleGetResponse - Methods: -- client.accounts.roles.list({ ...params }) -> RoleListResponse | null -- client.accounts.roles.get(roleId, { ...params }) -> RoleGetResponse +- client.accounts.roles.list({ ...params }) -> RolesV4PagePaginationArray +- client.accounts.roles.get(roleId, { ...params }) -> Role -# OriginCACertificates +## Subscriptions Types: -- OriginCACertificate -- OriginCACertificateCreateResponse -- OriginCACertificateListResponse -- OriginCACertificateDeleteResponse -- OriginCACertificateGetResponse +- SubscriptionDeleteResponse Methods: -- client.originCACertificates.create({ ...params }) -> OriginCACertificateCreateResponse -- client.originCACertificates.list() -> OriginCACertificateListResponse | null -- client.originCACertificates.delete(certificateId) -> OriginCACertificateDeleteResponse -- client.originCACertificates.get(certificateId) -> OriginCACertificateGetResponse +- client.accounts.subscriptions.create({ ...params }) -> Subscription +- client.accounts.subscriptions.update(subscriptionIdentifier, { ...params }) -> Subscription +- client.accounts.subscriptions.delete(subscriptionIdentifier, { ...params }) -> SubscriptionDeleteResponse +- client.accounts.subscriptions.get({ ...params }) -> SubscriptionsSinglePage -# IPs +## Tokens Types: -- IPs -- JdcloudIPs -- IPListResponse +- TokenCreateResponse +- TokenDeleteResponse +- TokenVerifyResponse Methods: -- client.ips.list({ ...params }) -> IPListResponse +- client.accounts.tokens.create({ ...params }) -> TokenCreateResponse +- client.accounts.tokens.update(tokenId, { ...params }) -> Token +- client.accounts.tokens.list({ ...params }) -> TokensV4PagePaginationArray +- client.accounts.tokens.delete(tokenId, { ...params }) -> TokenDeleteResponse | null +- client.accounts.tokens.get(tokenId, { ...params }) -> Token +- client.accounts.tokens.verify({ ...params }) -> TokenVerifyResponse -# Memberships +### PermissionGroups Types: -- Membership -- MembershipUpdateResponse -- MembershipDeleteResponse -- MembershipGetResponse +- PermissionGroupListResponse +- PermissionGroupGetResponse Methods: -- client.memberships.update(membershipId, { ...params }) -> MembershipUpdateResponse -- client.memberships.list({ ...params }) -> MembershipsV4PagePaginationArray -- client.memberships.delete(membershipId) -> MembershipDeleteResponse -- client.memberships.get(membershipId) -> MembershipGetResponse +- client.accounts.tokens.permissionGroups.list({ ...params }) -> PermissionGroupListResponsesSinglePage +- client.accounts.tokens.permissionGroups.get({ ...params }) -> PermissionGroupGetResponse -# User +### Value + +Methods: + +- client.accounts.tokens.value.update(tokenId, { ...params }) -> TokenValue + +## Logs + +### Audit Types: -- User -- UserEditResponse -- UserGetResponse +- AuditListResponse Methods: -- client.user.edit({ ...params }) -> UserEditResponse -- client.user.get() -> UserGetResponse +- client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorPaginationAfter -## AuditLogs +# Organizations Types: -- AuditLogListResponse +- Organization +- OrganizationDeleteResponse Methods: -- client.user.auditLogs.list({ ...params }) -> AuditLogListResponsesV4PagePaginationArray - -## Billing +- client.organizations.create({ ...params }) -> Organization +- client.organizations.update(organizationId, { ...params }) -> Organization +- client.organizations.list({ ...params }) -> OrganizationsSinglePage +- client.organizations.delete(organizationId) -> OrganizationDeleteResponse +- client.organizations.get(organizationId) -> Organization -### History +## OrganizationProfile Types: -- BillSubsAPIBillingHistory -- HistoryGetResponse +- OrganizationProfile Methods: -- client.user.billing.history.get({ ...params }) -> HistoryGetResponse | null +- client.organizations.organizationProfile.update(organizationId, { ...params }) -> void +- client.organizations.organizationProfile.get(organizationId) -> organizations_api_ProfileResponse.Result -### Profile +# OriginCACertificates Types: -- ProfileGetResponse +- OriginCACertificate +- OriginCACertificateDeleteResponse Methods: -- client.user.billing.profile.get() -> ProfileGetResponse - -## Firewall +- client.originCACertificates.create({ ...params }) -> OriginCACertificate +- client.originCACertificates.list({ ...params }) -> OriginCACertificatesV4PagePaginationArray +- client.originCACertificates.delete(certificateId) -> OriginCACertificateDeleteResponse +- client.originCACertificates.get(certificateId) -> OriginCACertificate -### AccessRules +# IPs Types: -- LegacyJhsRule -- AccessRuleDeleteResponse +- IPsArray +- IPListResponse Methods: -- client.user.firewall.accessRules.create({ ...params }) -> LegacyJhsRule | null -- client.user.firewall.accessRules.list({ ...params }) -> LegacyJhsRulesV4PagePaginationArray -- client.user.firewall.accessRules.delete(identifier) -> AccessRuleDeleteResponse | null -- client.user.firewall.accessRules.edit(identifier, { ...params }) -> LegacyJhsRule | null +- client.ips.list({ ...params }) -> IPListResponse -## Invites +# Memberships Types: -- IamSchemasInvite -- InviteListResponse -- InviteEditResponse -- InviteGetResponse +- Membership +- MembershipUpdateResponse +- MembershipDeleteResponse +- MembershipGetResponse Methods: -- client.user.invites.list() -> InviteListResponse | null -- client.user.invites.edit(inviteId, { ...params }) -> InviteEditResponse -- client.user.invites.get(inviteId) -> InviteGetResponse - -## LoadBalancers +- client.memberships.update(membershipId, { ...params }) -> MembershipUpdateResponse +- client.memberships.list({ ...params }) -> MembershipsV4PagePaginationArray +- client.memberships.delete(membershipId) -> MembershipDeleteResponse +- client.memberships.get(membershipId) -> MembershipGetResponse -### Monitors +# User Types: -- LoadBalancingMonitor -- MonitorListResponse -- MonitorDeleteResponse -- MonitorPreviewResponse -- MonitorReferencesResponse +- UserEditResponse +- UserGetResponse + +Methods: + +- client.user.edit({ ...params }) -> UserEditResponse +- client.user.get() -> UserGetResponse + +## AuditLogs Methods: -- client.user.loadBalancers.monitors.create({ ...params }) -> LoadBalancingMonitor -- client.user.loadBalancers.monitors.update(monitorId, { ...params }) -> LoadBalancingMonitor -- client.user.loadBalancers.monitors.list() -> MonitorListResponse | null -- client.user.loadBalancers.monitors.delete(monitorId) -> MonitorDeleteResponse -- client.user.loadBalancers.monitors.edit(monitorId, { ...params }) -> LoadBalancingMonitor -- client.user.loadBalancers.monitors.get(monitorId) -> LoadBalancingMonitor -- client.user.loadBalancers.monitors.preview(monitorId, { ...params }) -> MonitorPreviewResponse -- client.user.loadBalancers.monitors.references(monitorId) -> MonitorReferencesResponse | null +- client.user.auditLogs.list({ ...params }) -> AuditLogsV4PagePaginationArray + +## Billing -### Pools +### History Types: -- LoadBalancingPool -- PoolListResponse -- PoolDeleteResponse -- PoolHealthResponse -- PoolPreviewResponse -- PoolReferencesResponse +- BillingHistory Methods: -- client.user.loadBalancers.pools.create({ ...params }) -> LoadBalancingPool -- client.user.loadBalancers.pools.update(poolId, { ...params }) -> LoadBalancingPool -- client.user.loadBalancers.pools.list({ ...params }) -> PoolListResponse | null -- client.user.loadBalancers.pools.delete(poolId) -> PoolDeleteResponse -- client.user.loadBalancers.pools.edit(poolId, { ...params }) -> LoadBalancingPool -- client.user.loadBalancers.pools.get(poolId) -> LoadBalancingPool -- client.user.loadBalancers.pools.health(poolId) -> PoolHealthResponse -- client.user.loadBalancers.pools.preview(poolId, { ...params }) -> PoolPreviewResponse -- client.user.loadBalancers.pools.references(poolId) -> PoolReferencesResponse | null +- client.user.billing.history.list({ ...params }) -> BillingHistoriesV4PagePaginationArray -### Preview +### Profile Types: -- LoadBalancingPreviewResult +- ProfileGetResponse Methods: -- client.user.loadBalancers.preview.get(previewId) -> LoadBalancingPreviewResult - -### Analytics +- client.user.billing.profile.get() -> ProfileGetResponse -#### Events +## Invites Types: -- LoadBalancingAnalytics -- EventListResponse +- Invite Methods: -- client.user.loadBalancers.analytics.events.list({ ...params }) -> EventListResponse | null +- client.user.invites.list() -> InvitesSinglePage +- client.user.invites.edit(inviteId, { ...params }) -> Invite +- client.user.invites.get(inviteId) -> Invite ## Organizations Types: -- IamOrganization +- Organization - OrganizationDeleteResponse - OrganizationGetResponse Methods: -- client.user.organizations.list({ ...params }) -> IamOrganizationsV4PagePaginationArray +- client.user.organizations.list({ ...params }) -> OrganizationsV4PagePaginationArray - client.user.organizations.delete(organizationId) -> OrganizationDeleteResponse - client.user.organizations.get(organizationId) -> OrganizationGetResponse @@ -252,37 +261,30 @@ Methods: Types: -- BillSubsAPISubscription - SubscriptionUpdateResponse - SubscriptionDeleteResponse -- SubscriptionEditResponse -- SubscriptionGetResponse Methods: - client.user.subscriptions.update(identifier, { ...params }) -> SubscriptionUpdateResponse - client.user.subscriptions.delete(identifier) -> SubscriptionDeleteResponse -- client.user.subscriptions.edit(identifier, { ...params }) -> SubscriptionEditResponse -- client.user.subscriptions.get() -> SubscriptionGetResponse | null +- client.user.subscriptions.get() -> SubscriptionsSinglePage ## Tokens Types: - TokenCreateResponse -- TokenUpdateResponse -- TokenListResponse - TokenDeleteResponse -- TokenGetResponse - TokenVerifyResponse Methods: - client.user.tokens.create({ ...params }) -> TokenCreateResponse -- client.user.tokens.update(tokenId, { ...params }) -> TokenUpdateResponse -- client.user.tokens.list({ ...params }) -> TokenListResponsesV4PagePaginationArray +- client.user.tokens.update(tokenId, { ...params }) -> Token +- client.user.tokens.list({ ...params }) -> TokensV4PagePaginationArray - client.user.tokens.delete(tokenId) -> TokenDeleteResponse | null -- client.user.tokens.get(tokenId) -> TokenGetResponse +- client.user.tokens.get(tokenId) -> Token - client.user.tokens.verify() -> TokenVerifyResponse ### PermissionGroups @@ -293,36 +295,29 @@ Types: Methods: -- client.user.tokens.permissionGroups.list() -> PermissionGroupListResponse | null +- client.user.tokens.permissionGroups.list({ ...params }) -> PermissionGroupListResponsesSinglePage ### Value -Types: - -- IamValue - Methods: -- client.user.tokens.value.update(tokenId, { ...params }) -> IamValue +- client.user.tokens.value.update(tokenId, { ...params }) -> TokenValue # Zones Types: +- Type - Zone -- ZoneCreateResponse -- ZoneListResponse - ZoneDeleteResponse -- ZoneEditResponse -- ZoneGetResponse Methods: -- client.zones.create({ ...params }) -> ZoneCreateResponse -- client.zones.list({ ...params }) -> ZoneListResponsesV4PagePaginationArray +- client.zones.create({ ...params }) -> Zone +- client.zones.list({ ...params }) -> ZonesV4PagePaginationArray - client.zones.delete({ ...params }) -> ZoneDeleteResponse | null -- client.zones.edit({ ...params }) -> ZoneEditResponse -- client.zones.get({ ...params }) -> ZoneGetResponse +- client.zones.edit({ ...params }) -> Zone +- client.zones.get({ ...params }) -> Zone ## ActivationCheck @@ -338,2385 +333,2470 @@ Methods: Types: -- SettingEditResponse -- SettingGetResponse - -Methods: - -- client.zones.settings.edit({ ...params }) -> SettingEditResponse -- client.zones.settings.get({ ...params }) -> SettingGetResponse +- AdvancedDDoS +- Aegis +- AlwaysOnline +- AlwaysUseHTTPS +- AutomaticHTTPSRewrites +- AutomaticPlatformOptimization +- Brotli +- BrowserCacheTTL +- BrowserCheck +- CacheLevel +- ChallengeTTL +- Ciphers +- DevelopmentMode +- EarlyHints +- EmailObfuscation +- FontSettings +- H2Prioritization +- HotlinkProtection +- HTTP2 +- HTTP3 +- ImageResizing +- IPGeolocation +- IPV6 +- MinTLSVersion +- Mirage +- NEL +- OpportunisticEncryption +- OpportunisticOnion +- OrangeToOrange +- OriginErrorPagePassThru +- OriginMaxHTTPVersion +- Polish +- PrefetchPreload +- ProxyReadTimeout +- PseudoIPV4 +- ResponseBuffering +- RocketLoader +- SecurityHeaders +- SecurityLevel +- ServerSideExcludes +- SortQueryStringForCache +- SSL +- SSLRecommender +- TLS1_3 +- TLSClientAuth +- TrueClientIPHeader +- WAF +- WebP +- Websocket +- ZeroRTT +- SettingEditResponse +- SettingGetResponse + +Methods: + +- client.zones.settings.edit(settingId, { ...params }) -> SettingEditResponse +- client.zones.settings.get(settingId, { ...params }) -> SettingGetResponse -### ZeroRTT +## CustomNameservers Types: -- Zones0rtt +- CustomNameserverUpdateResponse +- CustomNameserverGetResponse Methods: -- client.zones.settings.zeroRTT.edit({ ...params }) -> Zones0rtt -- client.zones.settings.zeroRTT.get({ ...params }) -> Zones0rtt +- client.zones.customNameservers.update({ ...params }) -> CustomNameserverUpdateResponsesSinglePage +- client.zones.customNameservers.get({ ...params }) -> CustomNameserverGetResponse -### AdvancedDDOS +## Holds Types: -- ZonesAdvancedDDOS +- ZoneHold Methods: -- client.zones.settings.advancedDDOS.get({ ...params }) -> ZonesAdvancedDDOS +- client.zones.holds.create({ ...params }) -> ZoneHold +- client.zones.holds.delete({ ...params }) -> ZoneHold +- client.zones.holds.edit({ ...params }) -> ZoneHold +- client.zones.holds.get({ ...params }) -> ZoneHold -### AlwaysOnline +## Subscriptions Types: -- ZonesAlwaysOnline +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionGetResponse Methods: -- client.zones.settings.alwaysOnline.edit({ ...params }) -> ZonesAlwaysOnline -- client.zones.settings.alwaysOnline.get({ ...params }) -> ZonesAlwaysOnline +- client.zones.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.zones.subscriptions.update({ ...params }) -> SubscriptionUpdateResponse +- client.zones.subscriptions.get({ ...params }) -> SubscriptionGetResponse -### AlwaysUseHTTPS +## Plans Types: -- ZonesAlwaysUseHTTPS +- AvailableRatePlan Methods: -- client.zones.settings.alwaysUseHTTPS.edit({ ...params }) -> ZonesAlwaysUseHTTPS -- client.zones.settings.alwaysUseHTTPS.get({ ...params }) -> ZonesAlwaysUseHTTPS +- client.zones.plans.list({ ...params }) -> AvailableRatePlansSinglePage +- client.zones.plans.get(planIdentifier, { ...params }) -> AvailableRatePlan -### AutomaticHTTPSRewrites +## RatePlans Types: -- ZonesAutomaticHTTPSRewrites +- RatePlanGetResponse Methods: -- client.zones.settings.automaticHTTPSRewrites.edit({ ...params }) -> ZonesAutomaticHTTPSRewrites -- client.zones.settings.automaticHTTPSRewrites.get({ ...params }) -> ZonesAutomaticHTTPSRewrites +- client.zones.ratePlans.get({ ...params }) -> RatePlanGetResponsesSinglePage -### AutomaticPlatformOptimization +# LoadBalancers Types: -- ZonesAutomaticPlatformOptimization +- AdaptiveRouting +- CheckRegion +- DefaultPools +- FilterOptions +- Header +- Host +- LoadBalancer +- LoadShedding +- LocationStrategy +- NotificationFilter +- Origin +- OriginSteering +- RandomSteering +- Rules +- SessionAffinity +- SessionAffinityAttributes +- SteeringPolicy +- LoadBalancerDeleteResponse Methods: -- client.zones.settings.automaticPlatformOptimization.edit({ ...params }) -> ZonesAutomaticPlatformOptimization -- client.zones.settings.automaticPlatformOptimization.get({ ...params }) -> ZonesAutomaticPlatformOptimization +- client.loadBalancers.create({ ...params }) -> LoadBalancer +- client.loadBalancers.update(loadBalancerId, { ...params }) -> LoadBalancer +- client.loadBalancers.list({ ...params }) -> LoadBalancersSinglePage +- client.loadBalancers.delete(loadBalancerId, { ...params }) -> LoadBalancerDeleteResponse +- client.loadBalancers.edit(loadBalancerId, { ...params }) -> LoadBalancer +- client.loadBalancers.get(loadBalancerId, { ...params }) -> LoadBalancer -### Brotli +## Monitors Types: -- ZonesBrotli +- Monitor +- MonitorDeleteResponse Methods: -- client.zones.settings.brotli.edit({ ...params }) -> ZonesBrotli -- client.zones.settings.brotli.get({ ...params }) -> ZonesBrotli +- client.loadBalancers.monitors.create({ ...params }) -> Monitor +- client.loadBalancers.monitors.update(monitorId, { ...params }) -> Monitor +- client.loadBalancers.monitors.list({ ...params }) -> MonitorsSinglePage +- client.loadBalancers.monitors.delete(monitorId, { ...params }) -> MonitorDeleteResponse +- client.loadBalancers.monitors.edit(monitorId, { ...params }) -> Monitor +- client.loadBalancers.monitors.get(monitorId, { ...params }) -> Monitor -### BrowserCacheTTL +### Previews Types: -- ZonesBrowserCacheTTL +- PreviewCreateResponse Methods: -- client.zones.settings.browserCacheTTL.edit({ ...params }) -> ZonesBrowserCacheTTL -- client.zones.settings.browserCacheTTL.get({ ...params }) -> ZonesBrowserCacheTTL +- client.loadBalancers.monitors.previews.create(monitorId, { ...params }) -> PreviewCreateResponse -### BrowserCheck +### References Types: -- ZonesBrowserCheck +- ReferenceGetResponse Methods: -- client.zones.settings.browserCheck.edit({ ...params }) -> ZonesBrowserCheck -- client.zones.settings.browserCheck.get({ ...params }) -> ZonesBrowserCheck +- client.loadBalancers.monitors.references.get(monitorId, { ...params }) -> ReferenceGetResponsesSinglePage -### CacheLevel +## MonitorGroups Types: -- ZonesCacheLevel +- MonitorGroup Methods: -- client.zones.settings.cacheLevel.edit({ ...params }) -> ZonesCacheLevel -- client.zones.settings.cacheLevel.get({ ...params }) -> ZonesCacheLevel +- client.loadBalancers.monitorGroups.create({ ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.update(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.list({ ...params }) -> MonitorGroupsSinglePage +- client.loadBalancers.monitorGroups.delete(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.edit(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.get(monitorGroupId, { ...params }) -> MonitorGroup -### ChallengeTTL +## Pools Types: -- ZonesChallengeTTL +- Pool +- PoolDeleteResponse Methods: -- client.zones.settings.challengeTTL.edit({ ...params }) -> ZonesChallengeTTL -- client.zones.settings.challengeTTL.get({ ...params }) -> ZonesChallengeTTL +- client.loadBalancers.pools.create({ ...params }) -> Pool +- client.loadBalancers.pools.update(poolId, { ...params }) -> Pool +- client.loadBalancers.pools.list({ ...params }) -> PoolsSinglePage +- client.loadBalancers.pools.delete(poolId, { ...params }) -> PoolDeleteResponse +- client.loadBalancers.pools.bulkEdit({ ...params }) -> PoolsSinglePage +- client.loadBalancers.pools.edit(poolId, { ...params }) -> Pool +- client.loadBalancers.pools.get(poolId, { ...params }) -> Pool -### Ciphers +### Health Types: -- ZonesCiphers +- HealthCreateResponse +- HealthGetResponse Methods: -- client.zones.settings.ciphers.edit({ ...params }) -> ZonesCiphers -- client.zones.settings.ciphers.get({ ...params }) -> ZonesCiphers +- client.loadBalancers.pools.health.create(poolId, { ...params }) -> HealthCreateResponse +- client.loadBalancers.pools.health.get(poolId, { ...params }) -> HealthGetResponse -### DevelopmentMode +### References Types: -- ZonesDevelopmentMode +- ReferenceGetResponse Methods: -- client.zones.settings.developmentMode.edit({ ...params }) -> ZonesDevelopmentMode -- client.zones.settings.developmentMode.get({ ...params }) -> ZonesDevelopmentMode +- client.loadBalancers.pools.references.get(poolId, { ...params }) -> ReferenceGetResponsesSinglePage -### EarlyHints +## Previews Types: -- ZonesEarlyHints +- PreviewGetResponse Methods: -- client.zones.settings.earlyHints.edit({ ...params }) -> ZonesEarlyHints -- client.zones.settings.earlyHints.get({ ...params }) -> ZonesEarlyHints +- client.loadBalancers.previews.get(previewId, { ...params }) -> PreviewGetResponse -### EmailObfuscation +## Regions Types: -- ZonesEmailObfuscation +- RegionListResponse +- RegionGetResponse Methods: -- client.zones.settings.emailObfuscation.edit({ ...params }) -> ZonesEmailObfuscation -- client.zones.settings.emailObfuscation.get({ ...params }) -> ZonesEmailObfuscation +- client.loadBalancers.regions.list({ ...params }) -> RegionListResponse +- client.loadBalancers.regions.get(regionId, { ...params }) -> RegionGetResponse -### H2Prioritization +## Searches Types: -- ZonesH2Prioritization +- SearchListResponse Methods: -- client.zones.settings.h2Prioritization.edit({ ...params }) -> ZonesH2Prioritization -- client.zones.settings.h2Prioritization.get({ ...params }) -> ZonesH2Prioritization +- client.loadBalancers.searches.list({ ...params }) -> SearchListResponsesV4PagePagination -### HotlinkProtection +# Cache Types: -- ZonesHotlinkProtection +- CachePurgeResponse Methods: -- client.zones.settings.hotlinkProtection.edit({ ...params }) -> ZonesHotlinkProtection -- client.zones.settings.hotlinkProtection.get({ ...params }) -> ZonesHotlinkProtection +- client.cache.purge({ ...params }) -> CachePurgeResponse | null -### HTTP2 +## CacheReserve Types: -- ZonesHTTP2 +- CacheReserve +- CacheReserveClear +- State +- CacheReserveClearResponse +- CacheReserveEditResponse +- CacheReserveGetResponse +- CacheReserveStatusResponse Methods: -- client.zones.settings.http2.edit({ ...params }) -> ZonesHTTP2 -- client.zones.settings.http2.get({ ...params }) -> ZonesHTTP2 +- client.cache.cacheReserve.clear({ ...params }) -> CacheReserveClearResponse +- client.cache.cacheReserve.edit({ ...params }) -> CacheReserveEditResponse +- client.cache.cacheReserve.get({ ...params }) -> CacheReserveGetResponse +- client.cache.cacheReserve.status({ ...params }) -> CacheReserveStatusResponse -### HTTP3 +## SmartTieredCache Types: -- ZonesHTTP3 +- SmartTieredCacheDeleteResponse +- SmartTieredCacheEditResponse +- SmartTieredCacheGetResponse Methods: -- client.zones.settings.http3.edit({ ...params }) -> ZonesHTTP3 -- client.zones.settings.http3.get({ ...params }) -> ZonesHTTP3 +- client.cache.smartTieredCache.delete({ ...params }) -> SmartTieredCacheDeleteResponse +- client.cache.smartTieredCache.edit({ ...params }) -> SmartTieredCacheEditResponse +- client.cache.smartTieredCache.get({ ...params }) -> SmartTieredCacheGetResponse -### ImageResizing +## Variants Types: -- ZonesImageResizing +- CacheVariant +- VariantDeleteResponse +- VariantEditResponse +- VariantGetResponse Methods: -- client.zones.settings.imageResizing.edit({ ...params }) -> ZonesImageResizing -- client.zones.settings.imageResizing.get({ ...params }) -> ZonesImageResizing +- client.cache.variants.delete({ ...params }) -> VariantDeleteResponse +- client.cache.variants.edit({ ...params }) -> VariantEditResponse +- client.cache.variants.get({ ...params }) -> VariantGetResponse -### IPGeolocation +## RegionalTieredCache Types: -- ZonesIPGeolocation +- RegionalTieredCache +- RegionalTieredCacheEditResponse +- RegionalTieredCacheGetResponse Methods: -- client.zones.settings.ipGeolocation.edit({ ...params }) -> ZonesIPGeolocation -- client.zones.settings.ipGeolocation.get({ ...params }) -> ZonesIPGeolocation +- client.cache.regionalTieredCache.edit({ ...params }) -> RegionalTieredCacheEditResponse +- client.cache.regionalTieredCache.get({ ...params }) -> RegionalTieredCacheGetResponse + +# SSL -### IPV6 +## Analyze Types: -- ZonesIPV6 +- AnalyzeCreateResponse Methods: -- client.zones.settings.ipv6.edit({ ...params }) -> ZonesIPV6 -- client.zones.settings.ipv6.get({ ...params }) -> ZonesIPV6 +- client.ssl.analyze.create({ ...params }) -> AnalyzeCreateResponse -### MinTLSVersion +## CertificatePacks Types: -- ZonesMinTLSVersion +- Host +- RequestValidity +- Status +- ValidationMethod +- CertificatePackCreateResponse +- CertificatePackListResponse +- CertificatePackDeleteResponse +- CertificatePackEditResponse +- CertificatePackGetResponse Methods: -- client.zones.settings.minTLSVersion.edit({ ...params }) -> ZonesMinTLSVersion -- client.zones.settings.minTLSVersion.get({ ...params }) -> ZonesMinTLSVersion +- client.ssl.certificatePacks.create({ ...params }) -> CertificatePackCreateResponse +- client.ssl.certificatePacks.list({ ...params }) -> CertificatePackListResponsesV4PagePaginationArray +- client.ssl.certificatePacks.delete(certificatePackId, { ...params }) -> CertificatePackDeleteResponse +- client.ssl.certificatePacks.edit(certificatePackId, { ...params }) -> CertificatePackEditResponse +- client.ssl.certificatePacks.get(certificatePackId, { ...params }) -> CertificatePackGetResponse -### Minify +### Quota Types: -- ZonesMinify +- QuotaGetResponse Methods: -- client.zones.settings.minify.edit({ ...params }) -> ZonesMinify -- client.zones.settings.minify.get({ ...params }) -> ZonesMinify +- client.ssl.certificatePacks.quota.get({ ...params }) -> QuotaGetResponse -### Mirage +## Recommendations Types: -- ZonesMirage +- RecommendationGetResponse Methods: -- client.zones.settings.mirage.edit({ ...params }) -> ZonesMirage -- client.zones.settings.mirage.get({ ...params }) -> ZonesMirage +- client.ssl.recommendations.get({ ...params }) -> RecommendationGetResponse + +## Universal -### MobileRedirect +### Settings Types: -- ZonesMobileRedirect +- UniversalSSLSettings Methods: -- client.zones.settings.mobileRedirect.edit({ ...params }) -> ZonesMobileRedirect -- client.zones.settings.mobileRedirect.get({ ...params }) -> ZonesMobileRedirect +- client.ssl.universal.settings.edit({ ...params }) -> UniversalSSLSettings +- client.ssl.universal.settings.get({ ...params }) -> UniversalSSLSettings -### NEL +## Verification Types: -- ZonesNEL +- Verification +- VerificationEditResponse +- VerificationGetResponse Methods: -- client.zones.settings.nel.edit({ ...params }) -> ZonesNEL -- client.zones.settings.nel.get({ ...params }) -> ZonesNEL +- client.ssl.verification.edit(certificatePackId, { ...params }) -> VerificationEditResponse +- client.ssl.verification.get({ ...params }) -> VerificationGetResponse + +# ACM -### OpportunisticEncryption +## TotalTLS Types: -- ZonesOpportunisticEncryption +- CertificateAuthority +- TotalTLSUpdateResponse +- TotalTLSEditResponse +- TotalTLSGetResponse Methods: -- client.zones.settings.opportunisticEncryption.edit({ ...params }) -> ZonesOpportunisticEncryption -- client.zones.settings.opportunisticEncryption.get({ ...params }) -> ZonesOpportunisticEncryption +- client.acm.totalTLS.update({ ...params }) -> TotalTLSUpdateResponse +- client.acm.totalTLS.edit({ ...params }) -> TotalTLSEditResponse +- client.acm.totalTLS.get({ ...params }) -> TotalTLSGetResponse + +# Argo -### OpportunisticOnion +## SmartRouting Types: -- ZonesOpportunisticOnion +- SmartRoutingEditResponse +- SmartRoutingGetResponse Methods: -- client.zones.settings.opportunisticOnion.edit({ ...params }) -> ZonesOpportunisticOnion -- client.zones.settings.opportunisticOnion.get({ ...params }) -> ZonesOpportunisticOnion +- client.argo.smartRouting.edit({ ...params }) -> SmartRoutingEditResponse +- client.argo.smartRouting.get({ ...params }) -> SmartRoutingGetResponse -### OrangeToOrange +## TieredCaching Types: -- ZonesOrangeToOrange +- TieredCachingEditResponse +- TieredCachingGetResponse Methods: -- client.zones.settings.orangeToOrange.edit({ ...params }) -> ZonesOrangeToOrange -- client.zones.settings.orangeToOrange.get({ ...params }) -> ZonesOrangeToOrange +- client.argo.tieredCaching.edit({ ...params }) -> TieredCachingEditResponse +- client.argo.tieredCaching.get({ ...params }) -> TieredCachingGetResponse + +# CertificateAuthorities -### OriginErrorPagePassThru +## HostnameAssociations Types: -- ZonesOriginErrorPagePassThru +- HostnameAssociation +- TLSHostnameAssociation +- HostnameAssociationUpdateResponse +- HostnameAssociationGetResponse Methods: -- client.zones.settings.originErrorPagePassThru.edit({ ...params }) -> ZonesOriginErrorPagePassThru -- client.zones.settings.originErrorPagePassThru.get({ ...params }) -> ZonesOriginErrorPagePassThru +- client.certificateAuthorities.hostnameAssociations.update({ ...params }) -> HostnameAssociationUpdateResponse +- client.certificateAuthorities.hostnameAssociations.get({ ...params }) -> HostnameAssociationGetResponse -### OriginMaxHTTPVersion +# ClientCertificates Types: -- OriginMaxHTTPVersionEditResponse -- OriginMaxHTTPVersionGetResponse +- ClientCertificate Methods: -- client.zones.settings.originMaxHTTPVersion.edit({ ...params }) -> OriginMaxHTTPVersionEditResponse -- client.zones.settings.originMaxHTTPVersion.get({ ...params }) -> OriginMaxHTTPVersionGetResponse +- client.clientCertificates.create({ ...params }) -> ClientCertificate +- client.clientCertificates.list({ ...params }) -> ClientCertificatesV4PagePaginationArray +- client.clientCertificates.delete(clientCertificateId, { ...params }) -> ClientCertificate +- client.clientCertificates.edit(clientCertificateId, { ...params }) -> ClientCertificate +- client.clientCertificates.get(clientCertificateId, { ...params }) -> ClientCertificate -### Polish +# CustomCertificates Types: -- ZonesPolish +- CustomCertificate +- GeoRestrictions +- Status +- CustomCertificateDeleteResponse Methods: -- client.zones.settings.polish.edit({ ...params }) -> ZonesPolish -- client.zones.settings.polish.get({ ...params }) -> ZonesPolish - -### PrefetchPreload - -Types: +- client.customCertificates.create({ ...params }) -> CustomCertificate +- client.customCertificates.list({ ...params }) -> CustomCertificatesV4PagePaginationArray +- client.customCertificates.delete(customCertificateId, { ...params }) -> CustomCertificateDeleteResponse +- client.customCertificates.edit(customCertificateId, { ...params }) -> CustomCertificate +- client.customCertificates.get(customCertificateId, { ...params }) -> CustomCertificate -- ZonesPrefetchPreload +## Prioritize Methods: -- client.zones.settings.prefetchPreload.edit({ ...params }) -> ZonesPrefetchPreload -- client.zones.settings.prefetchPreload.get({ ...params }) -> ZonesPrefetchPreload +- client.customCertificates.prioritize.update({ ...params }) -> CustomCertificatesSinglePage -### ProxyReadTimeout +# CustomHostnames Types: -- ZonesProxyReadTimeout +- BundleMethod +- CustomHostname +- DCVMethod +- DomainValidationType +- CustomHostnameCreateResponse +- CustomHostnameListResponse +- CustomHostnameDeleteResponse +- CustomHostnameEditResponse +- CustomHostnameGetResponse Methods: -- client.zones.settings.proxyReadTimeout.edit({ ...params }) -> ZonesProxyReadTimeout -- client.zones.settings.proxyReadTimeout.get({ ...params }) -> ZonesProxyReadTimeout +- client.customHostnames.create({ ...params }) -> CustomHostnameCreateResponse +- client.customHostnames.list({ ...params }) -> CustomHostnameListResponsesV4PagePaginationArray +- client.customHostnames.delete(customHostnameId, { ...params }) -> CustomHostnameDeleteResponse +- client.customHostnames.edit(customHostnameId, { ...params }) -> CustomHostnameEditResponse +- client.customHostnames.get(customHostnameId, { ...params }) -> CustomHostnameGetResponse -### PseudoIPV4 +## FallbackOrigin Types: -- ZonesPseudoIPV4 +- FallbackOriginUpdateResponse +- FallbackOriginDeleteResponse +- FallbackOriginGetResponse Methods: -- client.zones.settings.pseudoIPV4.edit({ ...params }) -> ZonesPseudoIPV4 -- client.zones.settings.pseudoIPV4.get({ ...params }) -> ZonesPseudoIPV4 +- client.customHostnames.fallbackOrigin.update({ ...params }) -> FallbackOriginUpdateResponse +- client.customHostnames.fallbackOrigin.delete({ ...params }) -> FallbackOriginDeleteResponse +- client.customHostnames.fallbackOrigin.get({ ...params }) -> FallbackOriginGetResponse + +## CertificatePack -### ResponseBuffering +### Certificates Types: -- ZonesBuffering +- CertificateUpdateResponse +- CertificateDeleteResponse Methods: -- client.zones.settings.responseBuffering.edit({ ...params }) -> ZonesBuffering -- client.zones.settings.responseBuffering.get({ ...params }) -> ZonesBuffering +- client.customHostnames.certificatePack.certificates.update(customHostnameId, certificatePackId, certificateId, { ...params }) -> CertificateUpdateResponse +- client.customHostnames.certificatePack.certificates.delete(customHostnameId, certificatePackId, certificateId, { ...params }) -> CertificateDeleteResponse -### RocketLoader +# CustomNameservers Types: -- ZonesRocketLoader +- CustomNameserver +- CustomNameserverDeleteResponse Methods: -- client.zones.settings.rocketLoader.edit({ ...params }) -> ZonesRocketLoader -- client.zones.settings.rocketLoader.get({ ...params }) -> ZonesRocketLoader +- client.customNameservers.create({ ...params }) -> CustomNameserver +- client.customNameservers.delete(customNSId, { ...params }) -> CustomNameserverDeleteResponsesSinglePage +- client.customNameservers.get({ ...params }) -> CustomNameserversSinglePage -### SecurityHeaders +# DNSFirewall Types: -- ZonesSecurityHeader +- AttackMitigation +- FirewallIPs +- UpstreamIPs +- DNSFirewallCreateResponse +- DNSFirewallListResponse +- DNSFirewallDeleteResponse +- DNSFirewallEditResponse +- DNSFirewallGetResponse Methods: -- client.zones.settings.securityHeaders.edit({ ...params }) -> ZonesSecurityHeader -- client.zones.settings.securityHeaders.get({ ...params }) -> ZonesSecurityHeader +- client.dnsFirewall.create({ ...params }) -> DNSFirewallCreateResponse +- client.dnsFirewall.list({ ...params }) -> DNSFirewallListResponsesV4PagePaginationArray +- client.dnsFirewall.delete(dnsFirewallId, { ...params }) -> DNSFirewallDeleteResponse +- client.dnsFirewall.edit(dnsFirewallId, { ...params }) -> DNSFirewallEditResponse +- client.dnsFirewall.get(dnsFirewallId, { ...params }) -> DNSFirewallGetResponse + +## Analytics -### SecurityLevel +### Reports -Types: +Methods: -- ZonesSecurityLevel +- client.dnsFirewall.analytics.reports.get(dnsFirewallId, { ...params }) -> Report + +#### Bytimes Methods: -- client.zones.settings.securityLevel.edit({ ...params }) -> ZonesSecurityLevel -- client.zones.settings.securityLevel.get({ ...params }) -> ZonesSecurityLevel +- client.dnsFirewall.analytics.reports.bytimes.get(dnsFirewallId, { ...params }) -> ByTime -### ServerSideExcludes +## ReverseDNS Types: -- ZonesServerSideExclude +- ReverseDNSEditResponse +- ReverseDNSGetResponse Methods: -- client.zones.settings.serverSideExcludes.edit({ ...params }) -> ZonesServerSideExclude -- client.zones.settings.serverSideExcludes.get({ ...params }) -> ZonesServerSideExclude +- client.dnsFirewall.reverseDNS.edit(dnsFirewallId, { ...params }) -> ReverseDNSEditResponse +- client.dnsFirewall.reverseDNS.get(dnsFirewallId, { ...params }) -> ReverseDNSGetResponse + +# DNS -### SortQueryStringForCache +## DNSSEC Types: -- ZonesSortQueryStringForCache +- DNSSEC +- DNSSECDeleteResponse Methods: -- client.zones.settings.sortQueryStringForCache.edit({ ...params }) -> ZonesSortQueryStringForCache -- client.zones.settings.sortQueryStringForCache.get({ ...params }) -> ZonesSortQueryStringForCache +- client.dns.dnssec.delete({ ...params }) -> DNSSECDeleteResponse +- client.dns.dnssec.edit({ ...params }) -> DNSSEC +- client.dns.dnssec.get({ ...params }) -> DNSSEC -### SSL +## Records Types: -- ZonesSSL +- ARecord +- AAAARecord +- BatchPatch +- BatchPut +- CAARecord +- CERTRecord +- CNAMERecord +- DNSKEYRecord +- DSRecord +- HTTPSRecord +- LOCRecord +- MXRecord +- NAPTRRecord +- NSRecord +- PTRRecord +- Record +- RecordResponse +- RecordTags +- SMIMEARecord +- SRVRecord +- SSHFPRecord +- SVCBRecord +- TLSARecord +- TTL +- TXTRecord +- URIRecord +- RecordDeleteResponse +- RecordBatchResponse +- RecordExportResponse +- RecordImportResponse +- RecordScanResponse +- RecordScanReviewResponse +- RecordScanTriggerResponse Methods: -- client.zones.settings.ssl.edit({ ...params }) -> ZonesSSL -- client.zones.settings.ssl.get({ ...params }) -> ZonesSSL +- client.dns.records.create({ ...params }) -> RecordResponse +- client.dns.records.update(dnsRecordId, { ...params }) -> RecordResponse +- client.dns.records.list({ ...params }) -> RecordResponsesV4PagePaginationArray +- client.dns.records.delete(dnsRecordId, { ...params }) -> RecordDeleteResponse +- client.dns.records.batch({ ...params }) -> RecordBatchResponse +- client.dns.records.edit(dnsRecordId, { ...params }) -> RecordResponse +- client.dns.records.export({ ...params }) -> string +- client.dns.records.get(dnsRecordId, { ...params }) -> RecordResponse +- client.dns.records.import({ ...params }) -> RecordImportResponse +- client.dns.records.scan({ ...params }) -> RecordScanResponse +- client.dns.records.scanList({ ...params }) -> RecordResponsesSinglePage +- client.dns.records.scanReview({ ...params }) -> RecordScanReviewResponse +- client.dns.records.scanTrigger({ ...params }) -> RecordScanTriggerResponse + +## Settings -### SSLRecommender +### Zone Types: -- ZonesSSLRecommender +- ZoneEditResponse +- ZoneGetResponse Methods: -- client.zones.settings.sslRecommender.edit({ ...params }) -> ZonesSSLRecommender -- client.zones.settings.sslRecommender.get({ ...params }) -> ZonesSSLRecommender +- client.dns.settings.zone.edit({ ...params }) -> ZoneEditResponse +- client.dns.settings.zone.get({ ...params }) -> ZoneGetResponse -### TLS1_3 +### Account Types: -- ZonesTLS1_3 +- AccountEditResponse +- AccountGetResponse Methods: -- client.zones.settings.tls1_3.edit({ ...params }) -> ZonesTLS1_3 -- client.zones.settings.tls1_3.get({ ...params }) -> ZonesTLS1_3 +- client.dns.settings.account.edit({ ...params }) -> AccountEditResponse +- client.dns.settings.account.get({ ...params }) -> AccountGetResponse -### TLSClientAuth +#### Views Types: -- ZonesTLSClientAuth +- ViewCreateResponse +- ViewListResponse +- ViewDeleteResponse +- ViewEditResponse +- ViewGetResponse Methods: -- client.zones.settings.tlsClientAuth.edit({ ...params }) -> ZonesTLSClientAuth -- client.zones.settings.tlsClientAuth.get({ ...params }) -> ZonesTLSClientAuth +- client.dns.settings.account.views.create({ ...params }) -> ViewCreateResponse +- client.dns.settings.account.views.list({ ...params }) -> ViewListResponsesV4PagePaginationArray +- client.dns.settings.account.views.delete(viewId, { ...params }) -> ViewDeleteResponse +- client.dns.settings.account.views.edit(viewId, { ...params }) -> ViewEditResponse +- client.dns.settings.account.views.get(viewId, { ...params }) -> ViewGetResponse + +## Analytics -### TrueClientIPHeader +### Reports Types: -- ZonesTrueClientIPHeader +- Report Methods: -- client.zones.settings.trueClientIPHeader.edit({ ...params }) -> ZonesTrueClientIPHeader -- client.zones.settings.trueClientIPHeader.get({ ...params }) -> ZonesTrueClientIPHeader +- client.dns.analytics.reports.get({ ...params }) -> Report -### WAF +#### Bytimes Types: -- ZonesWAF +- ByTime Methods: -- client.zones.settings.waf.edit({ ...params }) -> ZonesWAF -- client.zones.settings.waf.get({ ...params }) -> ZonesWAF +- client.dns.analytics.reports.bytimes.get({ ...params }) -> ByTime + +## ZoneTransfers -### Webp +### ForceAXFR Types: -- ZonesWebp +- ForceAXFR Methods: -- client.zones.settings.webp.edit({ ...params }) -> ZonesWebp -- client.zones.settings.webp.get({ ...params }) -> ZonesWebp +- client.dns.zoneTransfers.forceAXFR.create({ ...params }) -> ForceAXFR -### Websocket +### Incoming Types: -- ZonesWebsockets +- Incoming +- IncomingCreateResponse +- IncomingUpdateResponse +- IncomingDeleteResponse +- IncomingGetResponse Methods: -- client.zones.settings.websocket.edit({ ...params }) -> ZonesWebsockets -- client.zones.settings.websocket.get({ ...params }) -> ZonesWebsockets +- client.dns.zoneTransfers.incoming.create({ ...params }) -> IncomingCreateResponse +- client.dns.zoneTransfers.incoming.update({ ...params }) -> IncomingUpdateResponse +- client.dns.zoneTransfers.incoming.delete({ ...params }) -> IncomingDeleteResponse +- client.dns.zoneTransfers.incoming.get({ ...params }) -> IncomingGetResponse -### FontSettings +### Outgoing Types: -- SpeedCloudflareFonts +- DisableTransfer +- EnableTransfer +- Outgoing +- OutgoingStatus +- OutgoingCreateResponse +- OutgoingUpdateResponse +- OutgoingDeleteResponse +- OutgoingForceNotifyResponse +- OutgoingGetResponse Methods: -- client.zones.settings.fontSettings.edit({ ...params }) -> SpeedCloudflareFonts -- client.zones.settings.fontSettings.get({ ...params }) -> SpeedCloudflareFonts +- client.dns.zoneTransfers.outgoing.create({ ...params }) -> OutgoingCreateResponse +- client.dns.zoneTransfers.outgoing.update({ ...params }) -> OutgoingUpdateResponse +- client.dns.zoneTransfers.outgoing.delete({ ...params }) -> OutgoingDeleteResponse +- client.dns.zoneTransfers.outgoing.disable({ ...params }) -> DisableTransfer +- client.dns.zoneTransfers.outgoing.enable({ ...params }) -> EnableTransfer +- client.dns.zoneTransfers.outgoing.forceNotify({ ...params }) -> OutgoingForceNotifyResponse +- client.dns.zoneTransfers.outgoing.get({ ...params }) -> OutgoingGetResponse -## CustomNameservers - -Types: - -- CustomNameserverUpdateResponse -- CustomNameserverGetResponse +#### Status Methods: -- client.zones.customNameservers.update({ ...params }) -> CustomNameserverUpdateResponse | null -- client.zones.customNameservers.get({ ...params }) -> CustomNameserverGetResponse | null +- client.dns.zoneTransfers.outgoing.status.get({ ...params }) -> EnableTransfer -## Holds +### ACLs Types: -- HoldCreateResponse -- HoldDeleteResponse -- HoldGetResponse +- ACL +- ACLDeleteResponse Methods: -- client.zones.holds.create({ ...params }) -> HoldCreateResponse -- client.zones.holds.delete({ ...params }) -> HoldDeleteResponse -- client.zones.holds.get({ ...params }) -> HoldGetResponse +- client.dns.zoneTransfers.acls.create({ ...params }) -> ACL +- client.dns.zoneTransfers.acls.update(aclId, { ...params }) -> ACL +- client.dns.zoneTransfers.acls.list({ ...params }) -> ACLsSinglePage +- client.dns.zoneTransfers.acls.delete(aclId, { ...params }) -> ACLDeleteResponse +- client.dns.zoneTransfers.acls.get(aclId, { ...params }) -> ACL -## Workers - -### Script +### Peers Types: -- ScriptUpdateResponse +- Peer +- PeerDeleteResponse Methods: -- client.zones.workers.script.update({ ...params }) -> ScriptUpdateResponse -- client.zones.workers.script.delete({ ...params }) -> void -- client.zones.workers.script.get({ ...params }) -> Response +- client.dns.zoneTransfers.peers.create({ ...params }) -> Peer +- client.dns.zoneTransfers.peers.update(peerId, { ...params }) -> Peer +- client.dns.zoneTransfers.peers.list({ ...params }) -> PeersSinglePage +- client.dns.zoneTransfers.peers.delete(peerId, { ...params }) -> PeerDeleteResponse +- client.dns.zoneTransfers.peers.get(peerId, { ...params }) -> Peer -## Subscriptions +### TSIGs Types: -- SubscriptionCreateResponse -- SubscriptionListResponse -- SubscriptionGetResponse +- TSIG +- TSIGDeleteResponse Methods: -- client.zones.subscriptions.create(identifier, { ...params }) -> SubscriptionCreateResponse -- client.zones.subscriptions.list(accountIdentifier) -> SubscriptionListResponse | null -- client.zones.subscriptions.get(identifier) -> SubscriptionGetResponse +- client.dns.zoneTransfers.tsigs.create({ ...params }) -> TSIG +- client.dns.zoneTransfers.tsigs.update(tsigId, { ...params }) -> TSIG +- client.dns.zoneTransfers.tsigs.list({ ...params }) -> TSIGsSinglePage +- client.dns.zoneTransfers.tsigs.delete(tsigId, { ...params }) -> TSIGDeleteResponse +- client.dns.zoneTransfers.tsigs.get(tsigId, { ...params }) -> TSIG -# LoadBalancers +# EmailSecurity + +## Investigate Types: -- LoadBalancer -- LoadBalancerListResponse -- LoadBalancerDeleteResponse +- InvestigateListResponse +- InvestigateGetResponse Methods: -- client.loadBalancers.create({ ...params }) -> LoadBalancer -- client.loadBalancers.update(loadBalancerId, { ...params }) -> LoadBalancer -- client.loadBalancers.list({ ...params }) -> LoadBalancerListResponse | null -- client.loadBalancers.delete(loadBalancerId, { ...params }) -> LoadBalancerDeleteResponse -- client.loadBalancers.edit(loadBalancerId, { ...params }) -> LoadBalancer -- client.loadBalancers.get(loadBalancerId, { ...params }) -> LoadBalancer +- client.emailSecurity.investigate.list({ ...params }) -> InvestigateListResponsesV4PagePaginationArray +- client.emailSecurity.investigate.get(postfixId, { ...params }) -> InvestigateGetResponse -## Monitors +### Detections Types: -- MonitorListResponse -- MonitorDeleteResponse +- DetectionGetResponse Methods: -- client.loadBalancers.monitors.create({ ...params }) -> LoadBalancingMonitor -- client.loadBalancers.monitors.update(monitorId, { ...params }) -> LoadBalancingMonitor -- client.loadBalancers.monitors.list({ ...params }) -> MonitorListResponse | null -- client.loadBalancers.monitors.delete(monitorId, { ...params }) -> MonitorDeleteResponse -- client.loadBalancers.monitors.edit(monitorId, { ...params }) -> LoadBalancingMonitor -- client.loadBalancers.monitors.get(monitorId, { ...params }) -> LoadBalancingMonitor +- client.emailSecurity.investigate.detections.get(postfixId, { ...params }) -> DetectionGetResponse -### Previews +### Preview Types: -- PreviewCreateResponse +- PreviewCreateResponse +- PreviewGetResponse Methods: -- client.loadBalancers.monitors.previews.create(monitorId, { ...params }) -> PreviewCreateResponse +- client.emailSecurity.investigate.preview.create({ ...params }) -> PreviewCreateResponse +- client.emailSecurity.investigate.preview.get(postfixId, { ...params }) -> PreviewGetResponse -### References +### Raw Types: -- ReferenceGetResponse +- RawGetResponse Methods: -- client.loadBalancers.monitors.references.get(monitorId, { ...params }) -> ReferenceGetResponse | null +- client.emailSecurity.investigate.raw.get(postfixId, { ...params }) -> RawGetResponse -## Pools +### Trace Types: -- PoolListResponse -- PoolDeleteResponse +- TraceGetResponse Methods: -- client.loadBalancers.pools.create({ ...params }) -> LoadBalancingPool -- client.loadBalancers.pools.update(poolId, { ...params }) -> LoadBalancingPool -- client.loadBalancers.pools.list({ ...params }) -> PoolListResponse | null -- client.loadBalancers.pools.delete(poolId, { ...params }) -> PoolDeleteResponse -- client.loadBalancers.pools.edit(poolId, { ...params }) -> LoadBalancingPool -- client.loadBalancers.pools.get(poolId, { ...params }) -> LoadBalancingPool +- client.emailSecurity.investigate.trace.get(postfixId, { ...params }) -> TraceGetResponse -### Health +### Move Types: -- HealthCreateResponse -- HealthGetResponse +- MoveCreateResponse +- MoveBulkResponse Methods: -- client.loadBalancers.pools.health.create(poolId, { ...params }) -> HealthCreateResponse -- client.loadBalancers.pools.health.get(poolId, { ...params }) -> HealthGetResponse +- client.emailSecurity.investigate.move.create(postfixId, { ...params }) -> MoveCreateResponsesSinglePage +- client.emailSecurity.investigate.move.bulk({ ...params }) -> MoveBulkResponsesSinglePage -### References +### Reclassify Types: -- ReferenceGetResponse +- ReclassifyCreateResponse Methods: -- client.loadBalancers.pools.references.get(poolId, { ...params }) -> ReferenceGetResponse | null +- client.emailSecurity.investigate.reclassify.create(postfixId, { ...params }) -> ReclassifyCreateResponse -## Previews +### Release + +Types: + +- ReleaseBulkResponse Methods: -- client.loadBalancers.previews.get(previewId, { ...params }) -> LoadBalancingPreviewResult +- client.emailSecurity.investigate.release.bulk([ ...body ]) -> ReleaseBulkResponsesSinglePage -## Regions +## Settings + +### AllowPolicies Types: -- RegionListResponse -- RegionGetResponse +- AllowPolicyCreateResponse +- AllowPolicyListResponse +- AllowPolicyDeleteResponse +- AllowPolicyEditResponse +- AllowPolicyGetResponse Methods: -- client.loadBalancers.regions.list({ ...params }) -> RegionListResponse -- client.loadBalancers.regions.get(regionId, { ...params }) -> RegionGetResponse +- client.emailSecurity.settings.allowPolicies.create({ ...params }) -> AllowPolicyCreateResponse +- client.emailSecurity.settings.allowPolicies.list({ ...params }) -> AllowPolicyListResponsesV4PagePaginationArray +- client.emailSecurity.settings.allowPolicies.delete(policyId, { ...params }) -> AllowPolicyDeleteResponse +- client.emailSecurity.settings.allowPolicies.edit(policyId, { ...params }) -> AllowPolicyEditResponse +- client.emailSecurity.settings.allowPolicies.get(policyId, { ...params }) -> AllowPolicyGetResponse -## Searches +### BlockSenders Types: -- SearchGetResponse +- BlockSenderCreateResponse +- BlockSenderListResponse +- BlockSenderDeleteResponse +- BlockSenderEditResponse +- BlockSenderGetResponse Methods: -- client.loadBalancers.searches.get({ ...params }) -> SearchGetResponse | null +- client.emailSecurity.settings.blockSenders.create({ ...params }) -> BlockSenderCreateResponse +- client.emailSecurity.settings.blockSenders.list({ ...params }) -> BlockSenderListResponsesV4PagePaginationArray +- client.emailSecurity.settings.blockSenders.delete(patternId, { ...params }) -> BlockSenderDeleteResponse +- client.emailSecurity.settings.blockSenders.edit(patternId, { ...params }) -> BlockSenderEditResponse +- client.emailSecurity.settings.blockSenders.get(patternId, { ...params }) -> BlockSenderGetResponse -# Cache +### Domains Types: -- CachePurgeResponse +- DomainListResponse +- DomainDeleteResponse +- DomainBulkDeleteResponse +- DomainEditResponse +- DomainGetResponse Methods: -- client.cache.purge({ ...params }) -> CachePurgeResponse | null +- client.emailSecurity.settings.domains.list({ ...params }) -> DomainListResponsesV4PagePaginationArray +- client.emailSecurity.settings.domains.delete(domainId, { ...params }) -> DomainDeleteResponse +- client.emailSecurity.settings.domains.bulkDelete({ ...params }) -> DomainBulkDeleteResponsesSinglePage +- client.emailSecurity.settings.domains.edit(domainId, { ...params }) -> DomainEditResponse +- client.emailSecurity.settings.domains.get(domainId, { ...params }) -> DomainGetResponse -## CacheReserve +### ImpersonationRegistry Types: -- CacheReserveClearResponse -- CacheReserveEditResponse -- CacheReserveGetResponse -- CacheReserveStatusResponse +- ImpersonationRegistryCreateResponse +- ImpersonationRegistryListResponse +- ImpersonationRegistryDeleteResponse +- ImpersonationRegistryEditResponse +- ImpersonationRegistryGetResponse Methods: -- client.cache.cacheReserve.clear({ ...params }) -> CacheReserveClearResponse -- client.cache.cacheReserve.edit({ ...params }) -> CacheReserveEditResponse -- client.cache.cacheReserve.get({ ...params }) -> CacheReserveGetResponse -- client.cache.cacheReserve.status({ ...params }) -> CacheReserveStatusResponse +- client.emailSecurity.settings.impersonationRegistry.create({ ...params }) -> ImpersonationRegistryCreateResponse +- client.emailSecurity.settings.impersonationRegistry.list({ ...params }) -> ImpersonationRegistryListResponsesV4PagePaginationArray +- client.emailSecurity.settings.impersonationRegistry.delete(displayNameId, { ...params }) -> ImpersonationRegistryDeleteResponse +- client.emailSecurity.settings.impersonationRegistry.edit(displayNameId, { ...params }) -> ImpersonationRegistryEditResponse +- client.emailSecurity.settings.impersonationRegistry.get(displayNameId, { ...params }) -> ImpersonationRegistryGetResponse -## SmartTieredCache +### TrustedDomains Types: -- SmartTieredCacheDeleteResponse -- SmartTieredCacheEditResponse -- SmartTieredCacheGetResponse +- TrustedDomainCreateResponse +- TrustedDomainListResponse +- TrustedDomainDeleteResponse +- TrustedDomainEditResponse +- TrustedDomainGetResponse Methods: -- client.cache.smartTieredCache.delete({ ...params }) -> SmartTieredCacheDeleteResponse -- client.cache.smartTieredCache.edit({ ...params }) -> SmartTieredCacheEditResponse -- client.cache.smartTieredCache.get({ ...params }) -> SmartTieredCacheGetResponse +- client.emailSecurity.settings.trustedDomains.create({ ...params }) -> TrustedDomainCreateResponse +- client.emailSecurity.settings.trustedDomains.list({ ...params }) -> TrustedDomainListResponsesV4PagePaginationArray +- client.emailSecurity.settings.trustedDomains.delete(trustedDomainId, { ...params }) -> TrustedDomainDeleteResponse +- client.emailSecurity.settings.trustedDomains.edit(trustedDomainId, { ...params }) -> TrustedDomainEditResponse +- client.emailSecurity.settings.trustedDomains.get(trustedDomainId, { ...params }) -> TrustedDomainGetResponse -## Variants +## Submissions Types: -- CacheVariants -- VariantEditResponse -- VariantGetResponse +- SubmissionListResponse Methods: -- client.cache.variants.delete({ ...params }) -> CacheVariants -- client.cache.variants.edit({ ...params }) -> VariantEditResponse -- client.cache.variants.get({ ...params }) -> VariantGetResponse +- client.emailSecurity.submissions.list({ ...params }) -> SubmissionListResponsesV4PagePaginationArray -## RegionalTieredCache +# EmailRouting Types: -- RegionalTieredCacheEditResponse -- RegionalTieredCacheGetResponse +- Settings Methods: -- client.cache.regionalTieredCache.edit({ ...params }) -> RegionalTieredCacheEditResponse -- client.cache.regionalTieredCache.get({ ...params }) -> RegionalTieredCacheGetResponse - -# SSL +- client.emailRouting.disable({ ...params }) -> Settings +- client.emailRouting.enable({ ...params }) -> Settings +- client.emailRouting.get({ ...params }) -> Settings -## Analyze +## DNS Types: -- AnalyzeCreateResponse +- DNSRecord +- DNSGetResponse Methods: -- client.ssl.analyze.create({ ...params }) -> AnalyzeCreateResponse +- client.emailRouting.dns.create({ ...params }) -> Settings +- client.emailRouting.dns.delete({ ...params }) -> DNSRecordsSinglePage +- client.emailRouting.dns.edit({ ...params }) -> Settings +- client.emailRouting.dns.get({ ...params }) -> DNSGetResponse -## CertificatePacks +## Rules Types: -- CertificatePackListResponse -- CertificatePackDeleteResponse -- CertificatePackEditResponse -- CertificatePackGetResponse +- Action +- EmailRoutingRule +- Matcher Methods: -- client.ssl.certificatePacks.list({ ...params }) -> CertificatePackListResponse | null -- client.ssl.certificatePacks.delete(certificatePackId, { ...params }) -> CertificatePackDeleteResponse -- client.ssl.certificatePacks.edit(certificatePackId, { ...params }) -> CertificatePackEditResponse -- client.ssl.certificatePacks.get(certificatePackId, { ...params }) -> CertificatePackGetResponse +- client.emailRouting.rules.create({ ...params }) -> EmailRoutingRule +- client.emailRouting.rules.update(ruleIdentifier, { ...params }) -> EmailRoutingRule +- client.emailRouting.rules.list({ ...params }) -> EmailRoutingRulesV4PagePaginationArray +- client.emailRouting.rules.delete(ruleIdentifier, { ...params }) -> EmailRoutingRule +- client.emailRouting.rules.get(ruleIdentifier, { ...params }) -> EmailRoutingRule -### Order +### CatchAlls Types: -- OrderCreateResponse +- CatchAllAction +- CatchAllMatcher +- CatchAllUpdateResponse +- CatchAllGetResponse Methods: -- client.ssl.certificatePacks.order.create({ ...params }) -> OrderCreateResponse +- client.emailRouting.rules.catchAlls.update({ ...params }) -> CatchAllUpdateResponse +- client.emailRouting.rules.catchAlls.get({ ...params }) -> CatchAllGetResponse -### Quota +## Addresses Types: -- QuotaGetResponse +- Address Methods: -- client.ssl.certificatePacks.quota.get({ ...params }) -> QuotaGetResponse +- client.emailRouting.addresses.create({ ...params }) -> Address +- client.emailRouting.addresses.list({ ...params }) -> AddressesV4PagePaginationArray +- client.emailRouting.addresses.delete(destinationAddressIdentifier, { ...params }) -> Address +- client.emailRouting.addresses.get(destinationAddressIdentifier, { ...params }) -> Address -## Recommendations +# Filters Types: -- RecommendationGetResponse +- FirewallFilter +- FilterDeleteResponse +- FilterBulkDeleteResponse Methods: -- client.ssl.recommendations.get(zoneIdentifier) -> RecommendationGetResponse | null +- client.filters.create([ ...body ]) -> FirewallFiltersSinglePage +- client.filters.update(filterId, { ...params }) -> FirewallFilter +- client.filters.list({ ...params }) -> FirewallFiltersV4PagePaginationArray +- client.filters.delete(filterId, { ...params }) -> FilterDeleteResponse +- client.filters.bulkDelete({ ...params }) -> FilterBulkDeleteResponse | null +- client.filters.bulkUpdate([ ...body ]) -> FirewallFiltersSinglePage +- client.filters.get(filterId, { ...params }) -> FirewallFilter -## Universal +# Firewall -### Settings +## Lockdowns Types: -- TLSCertificatesAndHostnamesUniversal +- Configuration +- Lockdown +- LockdownCIDRConfiguration +- LockdownIPConfiguration +- LockdownURL +- LockdownDeleteResponse Methods: -- client.ssl.universal.settings.edit({ ...params }) -> TLSCertificatesAndHostnamesUniversal -- client.ssl.universal.settings.get({ ...params }) -> TLSCertificatesAndHostnamesUniversal +- client.firewall.lockdowns.create({ ...params }) -> Lockdown +- client.firewall.lockdowns.update(lockDownsId, { ...params }) -> Lockdown +- client.firewall.lockdowns.list({ ...params }) -> LockdownsV4PagePaginationArray +- client.firewall.lockdowns.delete(lockDownsId, { ...params }) -> LockdownDeleteResponse +- client.firewall.lockdowns.get(lockDownsId, { ...params }) -> Lockdown -## Verification +## Rules Types: -- TLSCertificatesAndHostnamesVerification -- VerificationEditResponse -- VerificationGetResponse +- DeletedFilter +- FirewallRule +- Product Methods: -- client.ssl.verification.edit(certificatePackId, { ...params }) -> VerificationEditResponse -- client.ssl.verification.get({ ...params }) -> VerificationGetResponse +- client.firewall.rules.create({ ...params }) -> FirewallRulesSinglePage +- client.firewall.rules.update(ruleId, { ...params }) -> FirewallRule +- client.firewall.rules.list({ ...params }) -> FirewallRulesV4PagePaginationArray +- client.firewall.rules.delete(ruleId, { ...params }) -> FirewallRule +- client.firewall.rules.bulkDelete({ ...params }) -> FirewallRulesSinglePage +- client.firewall.rules.bulkEdit({ ...params }) -> FirewallRulesSinglePage +- client.firewall.rules.bulkUpdate({ ...params }) -> FirewallRulesSinglePage +- client.firewall.rules.edit(ruleId, { ...params }) -> FirewallRulesSinglePage +- client.firewall.rules.get(ruleId, { ...params }) -> FirewallRule -# Subscriptions +## AccessRules Types: -- SubscriptionCreateResponse -- SubscriptionUpdateResponse -- SubscriptionListResponse -- SubscriptionDeleteResponse -- SubscriptionGetResponse +- AccessRuleCIDRConfiguration +- AccessRuleIPConfiguration +- ASNConfiguration +- CountryConfiguration +- IPV6Configuration +- AccessRuleCreateResponse +- AccessRuleListResponse +- AccessRuleDeleteResponse +- AccessRuleEditResponse +- AccessRuleGetResponse Methods: -- client.subscriptions.create(identifier, { ...params }) -> SubscriptionCreateResponse -- client.subscriptions.update(accountIdentifier, subscriptionIdentifier, { ...params }) -> SubscriptionUpdateResponse -- client.subscriptions.list(accountIdentifier) -> SubscriptionListResponse | null -- client.subscriptions.delete(accountIdentifier, subscriptionIdentifier) -> SubscriptionDeleteResponse -- client.subscriptions.get(identifier) -> SubscriptionGetResponse - -# ACM +- client.firewall.accessRules.create({ ...params }) -> AccessRuleCreateResponse +- client.firewall.accessRules.list({ ...params }) -> AccessRuleListResponsesV4PagePaginationArray +- client.firewall.accessRules.delete(ruleId, { ...params }) -> AccessRuleDeleteResponse | null +- client.firewall.accessRules.edit(ruleId, { ...params }) -> AccessRuleEditResponse +- client.firewall.accessRules.get(ruleId, { ...params }) -> AccessRuleGetResponse -## TotalTLS +## UARules Types: -- TotalTLSCreateResponse -- TotalTLSGetResponse +- UARuleCreateResponse +- UARuleUpdateResponse +- UARuleListResponse +- UARuleDeleteResponse +- UARuleGetResponse Methods: -- client.acm.totalTLS.create({ ...params }) -> TotalTLSCreateResponse -- client.acm.totalTLS.get({ ...params }) -> TotalTLSGetResponse +- client.firewall.uaRules.create({ ...params }) -> UARuleCreateResponse +- client.firewall.uaRules.update(uaRuleId, { ...params }) -> UARuleUpdateResponse +- client.firewall.uaRules.list({ ...params }) -> UARuleListResponsesV4PagePaginationArray +- client.firewall.uaRules.delete(uaRuleId, { ...params }) -> UARuleDeleteResponse +- client.firewall.uaRules.get(uaRuleId, { ...params }) -> UARuleGetResponse -# Argo +## WAF -## SmartRouting +### Overrides Types: -- SmartRoutingEditResponse -- SmartRoutingGetResponse +- Override +- OverrideURL +- RewriteAction +- WAFRule +- OverrideDeleteResponse Methods: -- client.argo.smartRouting.edit({ ...params }) -> SmartRoutingEditResponse -- client.argo.smartRouting.get({ ...params }) -> SmartRoutingGetResponse +- client.firewall.waf.overrides.create({ ...params }) -> Override +- client.firewall.waf.overrides.update(overridesId, { ...params }) -> Override +- client.firewall.waf.overrides.list({ ...params }) -> OverridesV4PagePaginationArray +- client.firewall.waf.overrides.delete(overridesId, { ...params }) -> OverrideDeleteResponse +- client.firewall.waf.overrides.get(overridesId, { ...params }) -> Override -## TieredCaching +### Packages Types: -- TieredCachingEditResponse -- TieredCachingGetResponse +- PackageListResponse +- PackageGetResponse Methods: -- client.argo.tieredCaching.edit({ ...params }) -> TieredCachingEditResponse -- client.argo.tieredCaching.get({ ...params }) -> TieredCachingGetResponse +- client.firewall.waf.packages.list({ ...params }) -> PackageListResponsesV4PagePaginationArray +- client.firewall.waf.packages.get(packageId, { ...params }) -> PackageGetResponse -# AvailablePlans +#### Groups Types: -- BillSubsAPIAvailableRatePlan -- AvailablePlanListResponse +- Group +- GroupEditResponse +- GroupGetResponse Methods: -- client.availablePlans.list(zoneIdentifier) -> AvailablePlanListResponse | null -- client.availablePlans.get(zoneIdentifier, planIdentifier) -> BillSubsAPIAvailableRatePlan +- client.firewall.waf.packages.groups.list(packageId, { ...params }) -> GroupsV4PagePaginationArray +- client.firewall.waf.packages.groups.edit(packageId, groupId, { ...params }) -> GroupEditResponse +- client.firewall.waf.packages.groups.get(packageId, groupId, { ...params }) -> GroupGetResponse -# AvailableRatePlans +#### Rules Types: -- BillSubsRatePlan -- AvailableRatePlanGetResponse +- AllowedModesAnomaly +- WAFRuleGroup +- RuleListResponse +- RuleEditResponse +- RuleGetResponse Methods: -- client.availableRatePlans.get(zoneIdentifier) -> AvailableRatePlanGetResponse | null - -# CertificateAuthorities +- client.firewall.waf.packages.rules.list(packageId, { ...params }) -> RuleListResponsesV4PagePaginationArray +- client.firewall.waf.packages.rules.edit(packageId, ruleId, { ...params }) -> RuleEditResponse +- client.firewall.waf.packages.rules.get(packageId, ruleId, { ...params }) -> RuleGetResponse -## HostnameAssociations +# Healthchecks Types: -- TLSCertificatesAndHostnamesHostnameAssociation +- CheckRegion +- Healthcheck +- HTTPConfiguration +- QueryHealthcheck +- TCPConfiguration +- HealthcheckDeleteResponse Methods: -- client.certificateAuthorities.hostnameAssociations.update({ ...params }) -> TLSCertificatesAndHostnamesHostnameAssociation -- client.certificateAuthorities.hostnameAssociations.get({ ...params }) -> TLSCertificatesAndHostnamesHostnameAssociation +- client.healthchecks.create({ ...params }) -> Healthcheck +- client.healthchecks.update(healthcheckId, { ...params }) -> Healthcheck +- client.healthchecks.list({ ...params }) -> HealthchecksV4PagePaginationArray +- client.healthchecks.delete(healthcheckId, { ...params }) -> HealthcheckDeleteResponse +- client.healthchecks.edit(healthcheckId, { ...params }) -> Healthcheck +- client.healthchecks.get(healthcheckId, { ...params }) -> Healthcheck -# ClientCertificates +## Previews Types: -- TLSCertificatesAndHostnamesClientCertificate +- PreviewDeleteResponse Methods: -- client.clientCertificates.create({ ...params }) -> TLSCertificatesAndHostnamesClientCertificate -- client.clientCertificates.list({ ...params }) -> TLSCertificatesAndHostnamesClientCertificatesV4PagePaginationArray -- client.clientCertificates.delete(clientCertificateId, { ...params }) -> TLSCertificatesAndHostnamesClientCertificate -- client.clientCertificates.edit(clientCertificateId, { ...params }) -> TLSCertificatesAndHostnamesClientCertificate -- client.clientCertificates.get(clientCertificateId, { ...params }) -> TLSCertificatesAndHostnamesClientCertificate +- client.healthchecks.previews.create({ ...params }) -> Healthcheck +- client.healthchecks.previews.delete(healthcheckId, { ...params }) -> PreviewDeleteResponse +- client.healthchecks.previews.get(healthcheckId, { ...params }) -> Healthcheck -# CustomCertificates +# KeylessCertificates Types: -- TLSCertificatesAndHostnamesCustomCertificate -- CustomCertificateCreateResponse -- CustomCertificateDeleteResponse -- CustomCertificateEditResponse -- CustomCertificateGetResponse +- KeylessCertificate +- Tunnel +- KeylessCertificateDeleteResponse Methods: -- client.customCertificates.create({ ...params }) -> CustomCertificateCreateResponse -- client.customCertificates.list({ ...params }) -> TLSCertificatesAndHostnamesCustomCertificatesV4PagePaginationArray -- client.customCertificates.delete(customCertificateId, { ...params }) -> CustomCertificateDeleteResponse -- client.customCertificates.edit(customCertificateId, { ...params }) -> CustomCertificateEditResponse -- client.customCertificates.get(customCertificateId, { ...params }) -> CustomCertificateGetResponse +- client.keylessCertificates.create({ ...params }) -> KeylessCertificate +- client.keylessCertificates.list({ ...params }) -> KeylessCertificatesSinglePage +- client.keylessCertificates.delete(keylessCertificateId, { ...params }) -> KeylessCertificateDeleteResponse +- client.keylessCertificates.edit(keylessCertificateId, { ...params }) -> KeylessCertificate +- client.keylessCertificates.get(keylessCertificateId, { ...params }) -> KeylessCertificate -## Prioritize +# Logpush + +## Datasets + +### Fields Types: -- PrioritizeUpdateResponse +- FieldGetResponse Methods: -- client.customCertificates.prioritize.update({ ...params }) -> PrioritizeUpdateResponse | null +- client.logpush.datasets.fields.get(datasetId, { ...params }) -> FieldGetResponse -# CustomHostnames +### Jobs + +Methods: + +- client.logpush.datasets.jobs.get(datasetId, { ...params }) -> LogpushJobsSinglePage + +## Edge Types: -- TLSCertificatesAndHostnamesCustomHostname -- CustomHostnameCreateResponse -- CustomHostnameListResponse -- CustomHostnameDeleteResponse -- CustomHostnameEditResponse -- CustomHostnameGetResponse +- InstantLogpushJob Methods: -- client.customHostnames.create({ ...params }) -> CustomHostnameCreateResponse -- client.customHostnames.list({ ...params }) -> CustomHostnameListResponsesV4PagePaginationArray -- client.customHostnames.delete(customHostnameId, { ...params }) -> CustomHostnameDeleteResponse -- client.customHostnames.edit(customHostnameId, { ...params }) -> CustomHostnameEditResponse -- client.customHostnames.get(customHostnameId, { ...params }) -> CustomHostnameGetResponse +- client.logpush.edge.create({ ...params }) -> InstantLogpushJob | null +- client.logpush.edge.get({ ...params }) -> InstantLogpushJobsSinglePage -## FallbackOrigin +## Jobs Types: -- FallbackOriginUpdateResponse -- FallbackOriginDeleteResponse -- FallbackOriginGetResponse +- LogpushJob +- OutputOptions +- JobDeleteResponse Methods: -- client.customHostnames.fallbackOrigin.update({ ...params }) -> FallbackOriginUpdateResponse -- client.customHostnames.fallbackOrigin.delete({ ...params }) -> FallbackOriginDeleteResponse -- client.customHostnames.fallbackOrigin.get({ ...params }) -> FallbackOriginGetResponse +- client.logpush.jobs.create({ ...params }) -> LogpushJob | null +- client.logpush.jobs.update(jobId, { ...params }) -> LogpushJob | null +- client.logpush.jobs.list({ ...params }) -> LogpushJobsSinglePage +- client.logpush.jobs.delete(jobId, { ...params }) -> JobDeleteResponse +- client.logpush.jobs.get(jobId, { ...params }) -> LogpushJob | null -# CustomNameservers +## Ownership Types: -- DNSCustomNameserversCustomNS -- CustomNameserverDeleteResponse -- CustomNameserverAvailabiltyResponse -- CustomNameserverGetResponse -- CustomNameserverVerifyResponse +- OwnershipValidation +- OwnershipCreateResponse Methods: -- client.customNameservers.create({ ...params }) -> DNSCustomNameserversCustomNS -- client.customNameservers.delete(customNSId, { ...params }) -> CustomNameserverDeleteResponse | null -- client.customNameservers.availabilty({ ...params }) -> CustomNameserverAvailabiltyResponse | null -- client.customNameservers.get({ ...params }) -> CustomNameserverGetResponse | null -- client.customNameservers.verify({ ...params }) -> CustomNameserverVerifyResponse | null - -# DNS +- client.logpush.ownership.create({ ...params }) -> OwnershipCreateResponse | null +- client.logpush.ownership.validate({ ...params }) -> OwnershipValidation | null -## Records +## Validate Types: -- DNSRecord -- RecordCreateResponse -- RecordUpdateResponse -- RecordListResponse -- RecordDeleteResponse -- RecordEditResponse -- RecordExportResponse -- RecordGetResponse -- RecordImportResponse -- RecordScanResponse +- ValidateDestinationResponse +- ValidateDestinationExistsResponse +- ValidateOriginResponse Methods: -- client.dns.records.create({ ...params }) -> RecordCreateResponse -- client.dns.records.update(dnsRecordId, { ...params }) -> RecordUpdateResponse -- client.dns.records.list({ ...params }) -> RecordListResponsesV4PagePaginationArray -- client.dns.records.delete(dnsRecordId, { ...params }) -> RecordDeleteResponse -- client.dns.records.edit(dnsRecordId, { ...params }) -> RecordEditResponse -- client.dns.records.export({ ...params }) -> string -- client.dns.records.get(dnsRecordId, { ...params }) -> RecordGetResponse -- client.dns.records.import({ ...params }) -> RecordImportResponse -- client.dns.records.scan({ ...params }) -> RecordScanResponse +- client.logpush.validate.destination({ ...params }) -> ValidateDestinationResponse | null +- client.logpush.validate.destinationExists({ ...params }) -> ValidateDestinationExistsResponse | null +- client.logpush.validate.origin({ ...params }) -> ValidateOriginResponse | null -## Analytics +# Logs -### Reports +## Control + +### Retention Types: -- DNSDNSAnalyticsAPIReport +- RetentionCreateResponse +- RetentionGetResponse Methods: -- client.dns.analytics.reports.get(identifier, { ...params }) -> DNSDNSAnalyticsAPIReport +- client.logs.control.retention.create({ ...params }) -> RetentionCreateResponse | null +- client.logs.control.retention.get({ ...params }) -> RetentionGetResponse | null -#### Bytimes +### Cmb + +#### Config Types: -- DNSDNSAnalyticsAPIReportBytime +- CmbConfig +- ConfigDeleteResponse Methods: -- client.dns.analytics.reports.bytimes.get(identifier, { ...params }) -> DNSDNSAnalyticsAPIReportBytime +- client.logs.control.cmb.config.create({ ...params }) -> CmbConfig | null +- client.logs.control.cmb.config.delete({ ...params }) -> ConfigDeleteResponse | null +- client.logs.control.cmb.config.get({ ...params }) -> CmbConfig | null -## Firewall +## RayID Types: -- DNSFirewallDNSFirewall -- FirewallDeleteResponse +- RayIDGetResponse Methods: -- client.dns.firewall.create({ ...params }) -> DNSFirewallDNSFirewall -- client.dns.firewall.list({ ...params }) -> DNSFirewallDNSFirewallsV4PagePaginationArray -- client.dns.firewall.delete(dnsFirewallId, { ...params }) -> FirewallDeleteResponse -- client.dns.firewall.edit(dnsFirewallId, { ...params }) -> DNSFirewallDNSFirewall -- client.dns.firewall.get(dnsFirewallId, { ...params }) -> DNSFirewallDNSFirewall +- client.logs.RayID.get(RayID, { ...params }) -> RayIDGetResponse -### Analytics - -#### Reports - -Methods: +## Received -- client.dns.firewall.analytics.reports.get(accountIdentifier, identifier, { ...params }) -> DNSDNSAnalyticsAPIReport +Types: -##### Bytimes +- ReceivedGetResponse Methods: -- client.dns.firewall.analytics.reports.bytimes.get(accountIdentifier, identifier, { ...params }) -> DNSDNSAnalyticsAPIReportBytime +- client.logs.received.get({ ...params }) -> ReceivedGetResponse -# DNSSEC +### Fields Types: -- DNSSECDNSSEC -- DNSSECDeleteResponse +- FieldGetResponse Methods: -- client.dnssec.delete({ ...params }) -> DNSSECDeleteResponse -- client.dnssec.edit({ ...params }) -> DNSSECDNSSEC -- client.dnssec.get({ ...params }) -> DNSSECDNSSEC +- client.logs.received.fields.get({ ...params }) -> FieldGetResponse -# EmailRouting - -## Routing +# OriginTLSClientAuth Types: -- EmailSettings -- RoutingDisableResponse -- RoutingEnableResponse -- RoutingGetResponse +- OriginTLSClientAuthCreateResponse +- OriginTLSClientAuthListResponse +- OriginTLSClientAuthDeleteResponse +- OriginTLSClientAuthGetResponse Methods: -- client.emailRouting.routing.disable(zoneIdentifier) -> RoutingDisableResponse -- client.emailRouting.routing.enable(zoneIdentifier) -> RoutingEnableResponse -- client.emailRouting.routing.get(zoneIdentifier) -> RoutingGetResponse +- client.originTLSClientAuth.create({ ...params }) -> OriginTLSClientAuthCreateResponse +- client.originTLSClientAuth.list({ ...params }) -> OriginTLSClientAuthListResponsesSinglePage +- client.originTLSClientAuth.delete(certificateId, { ...params }) -> OriginTLSClientAuthDeleteResponse +- client.originTLSClientAuth.get(certificateId, { ...params }) -> OriginTLSClientAuthGetResponse -### DNS +## ZoneCertificates Types: -- EmailDNSRecord -- DNSGetResponse +- ZoneAuthenticatedOriginPull +- ZoneCertificateCreateResponse +- ZoneCertificateListResponse +- ZoneCertificateDeleteResponse +- ZoneCertificateGetResponse Methods: -- client.emailRouting.routing.dns.get(zoneIdentifier) -> DNSGetResponse | null +- client.originTLSClientAuth.zoneCertificates.create({ ...params }) -> ZoneCertificateCreateResponse +- client.originTLSClientAuth.zoneCertificates.list({ ...params }) -> ZoneCertificateListResponsesSinglePage +- client.originTLSClientAuth.zoneCertificates.delete(certificateId, { ...params }) -> ZoneCertificateDeleteResponse +- client.originTLSClientAuth.zoneCertificates.get(certificateId, { ...params }) -> ZoneCertificateGetResponse -### Rules +## Hostnames Types: -- EmailRules -- RuleCreateResponse -- RuleUpdateResponse -- RuleListResponse -- RuleDeleteResponse -- RuleGetResponse +- AuthenticatedOriginPull +- HostnameUpdateResponse Methods: -- client.emailRouting.routing.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse -- client.emailRouting.routing.rules.update(zoneIdentifier, ruleIdentifier, { ...params }) -> RuleUpdateResponse -- client.emailRouting.routing.rules.list(zoneIdentifier, { ...params }) -> RuleListResponsesV4PagePaginationArray -- client.emailRouting.routing.rules.delete(zoneIdentifier, ruleIdentifier) -> RuleDeleteResponse -- client.emailRouting.routing.rules.get(zoneIdentifier, ruleIdentifier) -> RuleGetResponse +- client.originTLSClientAuth.hostnames.update({ ...params }) -> HostnameUpdateResponsesSinglePage +- client.originTLSClientAuth.hostnames.get(hostname, { ...params }) -> AuthenticatedOriginPull -#### CatchAlls +## HostnameCertificates Types: -- EmailCatchAllRule +- Certificate +- HostnameCertificateCreateResponse +- HostnameCertificateListResponse +- HostnameCertificateDeleteResponse +- HostnameCertificateGetResponse Methods: -- client.emailRouting.routing.rules.catchAlls.update(zoneIdentifier, { ...params }) -> EmailCatchAllRule -- client.emailRouting.routing.rules.catchAlls.get(zoneIdentifier) -> EmailCatchAllRule +- client.originTLSClientAuth.hostnameCertificates.create({ ...params }) -> HostnameCertificateCreateResponse +- client.originTLSClientAuth.hostnameCertificates.list({ ...params }) -> HostnameCertificateListResponsesSinglePage +- client.originTLSClientAuth.hostnameCertificates.delete(certificateId, { ...params }) -> HostnameCertificateDeleteResponse +- client.originTLSClientAuth.hostnameCertificates.get(certificateId, { ...params }) -> HostnameCertificateGetResponse -### Addresses +## Settings Types: -- EmailAddresses -- AddressCreateResponse -- AddressListResponse -- AddressDeleteResponse -- AddressGetResponse +- SettingUpdateResponse +- SettingGetResponse Methods: -- client.emailRouting.routing.addresses.create(accountIdentifier, { ...params }) -> AddressCreateResponse -- client.emailRouting.routing.addresses.list(accountIdentifier, { ...params }) -> AddressListResponsesV4PagePaginationArray -- client.emailRouting.routing.addresses.delete(accountIdentifier, destinationAddressIdentifier) -> AddressDeleteResponse -- client.emailRouting.routing.addresses.get(accountIdentifier, destinationAddressIdentifier) -> AddressGetResponse +- client.originTLSClientAuth.settings.update({ ...params }) -> SettingUpdateResponse +- client.originTLSClientAuth.settings.get({ ...params }) -> SettingGetResponse -# Filters +# PageRules Types: -- LegacyJhsFilter -- FilterCreateResponse +- PageRule +- Target +- PageRuleListResponse +- PageRuleDeleteResponse Methods: -- client.filters.create(zoneIdentifier, { ...params }) -> FilterCreateResponse | null -- client.filters.update(zoneIdentifier, id, { ...params }) -> LegacyJhsFilter | null -- client.filters.list(zoneIdentifier, { ...params }) -> LegacyJhsFiltersV4PagePaginationArray -- client.filters.delete(zoneIdentifier, id) -> LegacyJhsFilter | null -- client.filters.get(zoneIdentifier, id) -> LegacyJhsFilter | null - -# Firewall +- client.pageRules.create({ ...params }) -> PageRule +- client.pageRules.update(pageruleId, { ...params }) -> PageRule +- client.pageRules.list({ ...params }) -> PageRuleListResponse +- client.pageRules.delete(pageruleId, { ...params }) -> PageRuleDeleteResponse | null +- client.pageRules.edit(pageruleId, { ...params }) -> PageRule +- client.pageRules.get(pageruleId, { ...params }) -> PageRule -## Lockdowns +# RateLimits Types: -- LegacyJhsZonelockdown -- LockdownDeleteResponse +- Action +- RateLimit +- RateLimitDeleteResponse Methods: -- client.firewall.lockdowns.create(zoneIdentifier, { ...params }) -> LegacyJhsZonelockdown | null -- client.firewall.lockdowns.update(zoneIdentifier, id, { ...params }) -> LegacyJhsZonelockdown | null -- client.firewall.lockdowns.list(zoneIdentifier, { ...params }) -> LegacyJhsZonelockdownsV4PagePaginationArray -- client.firewall.lockdowns.delete(zoneIdentifier, id) -> LockdownDeleteResponse -- client.firewall.lockdowns.get(zoneIdentifier, id) -> LegacyJhsZonelockdown | null +- client.rateLimits.create({ ...params }) -> RateLimit +- client.rateLimits.list({ ...params }) -> RateLimitsV4PagePaginationArray +- client.rateLimits.delete(rateLimitId, { ...params }) -> RateLimitDeleteResponse +- client.rateLimits.edit(rateLimitId, { ...params }) -> RateLimit +- client.rateLimits.get(rateLimitId, { ...params }) -> RateLimit -## Rules +# WaitingRooms Types: -- LegacyJhsFilterRule -- RuleCreateResponse -- RuleEditResponse +- AdditionalRoutes +- CookieAttributes +- Query +- WaitingRoom +- WaitingRoomDeleteResponse Methods: -- client.firewall.rules.create(zoneIdentifier, { ...params }) -> RuleCreateResponse | null -- client.firewall.rules.update(zoneIdentifier, id, { ...params }) -> LegacyJhsFilterRule | null -- client.firewall.rules.list(zoneIdentifier, { ...params }) -> LegacyJhsFilterRulesV4PagePaginationArray -- client.firewall.rules.delete(zoneIdentifier, id, { ...params }) -> LegacyJhsFilterRule | null -- client.firewall.rules.edit(zoneIdentifier, id, { ...params }) -> RuleEditResponse | null -- client.firewall.rules.get(zoneIdentifier, id) -> LegacyJhsFilterRule | null +- client.waitingRooms.create({ ...params }) -> WaitingRoom +- client.waitingRooms.update(waitingRoomId, { ...params }) -> WaitingRoom +- client.waitingRooms.list({ ...params }) -> WaitingRoomsV4PagePaginationArray +- client.waitingRooms.delete(waitingRoomId, { ...params }) -> WaitingRoomDeleteResponse +- client.waitingRooms.edit(waitingRoomId, { ...params }) -> WaitingRoom +- client.waitingRooms.get(waitingRoomId, { ...params }) -> WaitingRoom -## AccessRules +## Page Types: -- AccessRuleCreateResponse -- AccessRuleListResponse -- AccessRuleDeleteResponse -- AccessRuleEditResponse -- AccessRuleGetResponse +- PagePreviewResponse Methods: -- client.firewall.accessRules.create({ ...params }) -> AccessRuleCreateResponse | null -- client.firewall.accessRules.list({ ...params }) -> AccessRuleListResponsesV4PagePaginationArray -- client.firewall.accessRules.delete(identifier, { ...params }) -> AccessRuleDeleteResponse | null -- client.firewall.accessRules.edit(identifier, { ...params }) -> AccessRuleEditResponse | null -- client.firewall.accessRules.get(identifier, { ...params }) -> AccessRuleGetResponse | null +- client.waitingRooms.page.preview({ ...params }) -> PagePreviewResponse -## UARules +## Events Types: -- LegacyJhsUARules -- UARuleCreateResponse -- UARuleUpdateResponse -- UARuleListResponse -- UARuleDeleteResponse -- UARuleGetResponse +- Event +- EventDeleteResponse Methods: -- client.firewall.uaRules.create(zoneIdentifier, { ...params }) -> UARuleCreateResponse | null -- client.firewall.uaRules.update(zoneIdentifier, id, { ...params }) -> UARuleUpdateResponse | null -- client.firewall.uaRules.list(zoneIdentifier, { ...params }) -> UARuleListResponsesV4PagePaginationArray -- client.firewall.uaRules.delete(zoneIdentifier, id) -> UARuleDeleteResponse | null -- client.firewall.uaRules.get(zoneIdentifier, id) -> UARuleGetResponse | null - -## WAF +- client.waitingRooms.events.create(waitingRoomId, { ...params }) -> Event +- client.waitingRooms.events.update(waitingRoomId, eventId, { ...params }) -> Event +- client.waitingRooms.events.list(waitingRoomId, { ...params }) -> EventsV4PagePaginationArray +- client.waitingRooms.events.delete(waitingRoomId, eventId, { ...params }) -> EventDeleteResponse +- client.waitingRooms.events.edit(waitingRoomId, eventId, { ...params }) -> Event +- client.waitingRooms.events.get(waitingRoomId, eventId, { ...params }) -> Event -### Overrides +### Details Types: -- LegacyJhsOverride -- OverrideDeleteResponse +- EventQuery +- DetailGetResponse Methods: -- client.firewall.waf.overrides.create(zoneIdentifier, { ...params }) -> LegacyJhsOverride | null -- client.firewall.waf.overrides.update(zoneIdentifier, id, { ...params }) -> LegacyJhsOverride | null -- client.firewall.waf.overrides.list(zoneIdentifier, { ...params }) -> LegacyJhsOverridesV4PagePaginationArray -- client.firewall.waf.overrides.delete(zoneIdentifier, id) -> OverrideDeleteResponse -- client.firewall.waf.overrides.get(zoneIdentifier, id) -> LegacyJhsOverride | null +- client.waitingRooms.events.details.get(waitingRoomId, eventId, { ...params }) -> DetailGetResponse -### Packages +## Rules Types: -- PackageListResponse -- PackageGetResponse +- WaitingRoomRule Methods: -- client.firewall.waf.packages.list(zoneIdentifier, { ...params }) -> PackageListResponsesV4PagePaginationArray -- client.firewall.waf.packages.get(zoneIdentifier, identifier) -> PackageGetResponse +- client.waitingRooms.rules.create(waitingRoomId, { ...params }) -> WaitingRoomRulesSinglePage +- client.waitingRooms.rules.update(waitingRoomId, [ ...rules ]) -> WaitingRoomRulesSinglePage +- client.waitingRooms.rules.delete(waitingRoomId, ruleId, { ...params }) -> WaitingRoomRulesSinglePage +- client.waitingRooms.rules.edit(waitingRoomId, ruleId, { ...params }) -> WaitingRoomRulesSinglePage +- client.waitingRooms.rules.get(waitingRoomId, { ...params }) -> WaitingRoomRulesSinglePage -#### Groups +## Statuses Types: -- WAFManagedRulesSchemasGroup -- GroupEditResponse -- GroupGetResponse +- StatusGetResponse Methods: -- client.firewall.waf.packages.groups.list(packageId, { ...params }) -> WAFManagedRulesSchemasGroupsV4PagePaginationArray -- client.firewall.waf.packages.groups.edit(packageId, groupId, { ...params }) -> GroupEditResponse -- client.firewall.waf.packages.groups.get(packageId, groupId, { ...params }) -> GroupGetResponse +- client.waitingRooms.statuses.get(waitingRoomId, { ...params }) -> StatusGetResponse -#### Rules +## Settings Types: -- WAFManagedRulesRule -- RuleEditResponse -- RuleGetResponse +- Setting +- SettingUpdateResponse +- SettingEditResponse +- SettingGetResponse Methods: -- client.firewall.waf.packages.rules.list(packageId, { ...params }) -> WAFManagedRulesRulesV4PagePaginationArray -- client.firewall.waf.packages.rules.edit(packageId, ruleId, { ...params }) -> RuleEditResponse -- client.firewall.waf.packages.rules.get(packageId, ruleId, { ...params }) -> RuleGetResponse +- client.waitingRooms.settings.update({ ...params }) -> SettingUpdateResponse +- client.waitingRooms.settings.edit({ ...params }) -> SettingEditResponse +- client.waitingRooms.settings.get({ ...params }) -> SettingGetResponse -# Healthchecks +# Web3 + +## Hostnames Types: -- HealthchecksHealthchecks -- HealthcheckListResponse -- HealthcheckDeleteResponse +- Hostname +- HostnameDeleteResponse Methods: -- client.healthchecks.create(zoneIdentifier, { ...params }) -> HealthchecksHealthchecks -- client.healthchecks.update(zoneIdentifier, identifier, { ...params }) -> HealthchecksHealthchecks -- client.healthchecks.list(zoneIdentifier) -> HealthcheckListResponse | null -- client.healthchecks.delete(zoneIdentifier, identifier) -> HealthcheckDeleteResponse -- client.healthchecks.edit(zoneIdentifier, identifier, { ...params }) -> HealthchecksHealthchecks -- client.healthchecks.get(zoneIdentifier, identifier) -> HealthchecksHealthchecks +- client.web3.hostnames.create({ ...params }) -> Hostname +- client.web3.hostnames.list({ ...params }) -> HostnamesSinglePage +- client.web3.hostnames.delete(identifier, { ...params }) -> HostnameDeleteResponse | null +- client.web3.hostnames.edit(identifier, { ...params }) -> Hostname +- client.web3.hostnames.get(identifier, { ...params }) -> Hostname -## Previews +### IPFSUniversalPaths + +#### ContentLists Types: -- PreviewDeleteResponse +- ContentList Methods: -- client.healthchecks.previews.create(zoneIdentifier, { ...params }) -> HealthchecksHealthchecks -- client.healthchecks.previews.delete(zoneIdentifier, identifier) -> PreviewDeleteResponse -- client.healthchecks.previews.get(zoneIdentifier, identifier) -> HealthchecksHealthchecks +- client.web3.hostnames.ipfsUniversalPaths.contentLists.update(identifier, { ...params }) -> ContentList +- client.web3.hostnames.ipfsUniversalPaths.contentLists.get(identifier, { ...params }) -> ContentList -# KeylessCertificates +##### Entries Types: -- TLSCertificatesAndHostnamesBase -- TLSCertificatesAndHostnamesKeylessCertificate -- KeylessCertificateListResponse -- KeylessCertificateDeleteResponse +- EntryCreateResponse +- EntryUpdateResponse +- EntryListResponse +- EntryDeleteResponse +- EntryGetResponse Methods: -- client.keylessCertificates.create({ ...params }) -> TLSCertificatesAndHostnamesBase -- client.keylessCertificates.list({ ...params }) -> KeylessCertificateListResponse | null -- client.keylessCertificates.delete(keylessCertificateId, { ...params }) -> KeylessCertificateDeleteResponse -- client.keylessCertificates.edit(keylessCertificateId, { ...params }) -> TLSCertificatesAndHostnamesBase -- client.keylessCertificates.get(keylessCertificateId, { ...params }) -> TLSCertificatesAndHostnamesBase - -# Logpush - -## Datasets +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create(identifier, { ...params }) -> EntryCreateResponse +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update(identifier, contentListEntryIdentifier, { ...params }) -> EntryUpdateResponse +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list(identifier, { ...params }) -> EntryListResponse | null +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete(identifier, contentListEntryIdentifier, { ...params }) -> EntryDeleteResponse | null +- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get(identifier, contentListEntryIdentifier, { ...params }) -> EntryGetResponse -### Fields +# Workers Types: -- FieldGetResponse - -Methods: +- MigrationStep +- SingleStepMigration +- WorkerMetadata -- client.logpush.datasets.fields.get(datasetId, { ...params }) -> FieldGetResponse +## Beta -### Jobs +### Workers Types: -- LogpushLogpushJob -- JobGetResponse +- Worker +- WorkerDeleteResponse Methods: -- client.logpush.datasets.jobs.get(datasetId, { ...params }) -> JobGetResponse +- client.workers.beta.workers.create({ ...params }) -> Worker +- client.workers.beta.workers.update(workerId, { ...params }) -> Worker +- client.workers.beta.workers.list({ ...params }) -> WorkersV4PagePaginationArray +- client.workers.beta.workers.delete(workerId, { ...params }) -> WorkerDeleteResponse +- client.workers.beta.workers.edit(workerId, { ...params }) -> Worker +- client.workers.beta.workers.get(workerId, { ...params }) -> Worker -## Edge +#### Versions Types: -- LogpushInstantLogsJob -- EdgeGetResponse +- Version +- VersionDeleteResponse Methods: -- client.logpush.edge.create({ ...params }) -> LogpushInstantLogsJob | null -- client.logpush.edge.get({ ...params }) -> EdgeGetResponse +- client.workers.beta.workers.versions.create(workerId, { ...params }) -> Version +- client.workers.beta.workers.versions.list(workerId, { ...params }) -> VersionsV4PagePaginationArray +- client.workers.beta.workers.versions.delete(workerId, versionId, { ...params }) -> VersionDeleteResponse +- client.workers.beta.workers.versions.get(workerId, versionId, { ...params }) -> Version -## Jobs +## Routes Types: -- JobListResponse -- JobDeleteResponse +- RouteCreateResponse +- RouteUpdateResponse +- RouteListResponse +- RouteDeleteResponse +- RouteGetResponse Methods: -- client.logpush.jobs.create({ ...params }) -> LogpushLogpushJob | null -- client.logpush.jobs.update(jobId, { ...params }) -> LogpushLogpushJob | null -- client.logpush.jobs.list({ ...params }) -> JobListResponse -- client.logpush.jobs.delete(jobId, { ...params }) -> JobDeleteResponse | null -- client.logpush.jobs.get(jobId, { ...params }) -> LogpushLogpushJob | null +- client.workers.routes.create({ ...params }) -> RouteCreateResponse +- client.workers.routes.update(routeId, { ...params }) -> RouteUpdateResponse +- client.workers.routes.list({ ...params }) -> RouteListResponsesSinglePage +- client.workers.routes.delete(routeId, { ...params }) -> RouteDeleteResponse +- client.workers.routes.get(routeId, { ...params }) -> RouteGetResponse + +## Assets -## Ownership +### Upload Types: -- OwnershipCreateResponse -- OwnershipValidateResponse +- UploadCreateResponse Methods: -- client.logpush.ownership.create({ ...params }) -> OwnershipCreateResponse | null -- client.logpush.ownership.validate({ ...params }) -> OwnershipValidateResponse | null +- client.workers.assets.upload.create({ ...params }) -> UploadCreateResponse -## Validate +## Scripts Types: -- ValidateDestinationResponse -- ValidateOriginResponse +- Script +- ScriptSetting +- ScriptUpdateResponse +- ScriptListResponse +- ScriptDeleteResponse +- ScriptGetResponse +- ScriptSearchResponse Methods: -- client.logpush.validate.destination({ ...params }) -> ValidateDestinationResponse | null -- client.logpush.validate.origin({ ...params }) -> ValidateOriginResponse | null - -# Logs - -## Control +- client.workers.scripts.update(scriptName, { ...params }) -> ScriptUpdateResponse +- client.workers.scripts.list({ ...params }) -> ScriptListResponsesSinglePage +- client.workers.scripts.delete(scriptName, { ...params }) -> ScriptDeleteResponse | null +- client.workers.scripts.get(scriptName, { ...params }) -> string +- client.workers.scripts.search({ ...params }) -> ScriptSearchResponse -### Retention +### Assets -#### Flag +#### Upload Types: -- FlagCreateResponse -- FlagGetResponse +- UploadCreateResponse Methods: -- client.logs.control.retention.flag.create(zoneIdentifier, { ...params }) -> FlagCreateResponse -- client.logs.control.retention.flag.get(zoneIdentifier) -> FlagGetResponse - -### Cmb +- client.workers.scripts.assets.upload.create(scriptName, { ...params }) -> UploadCreateResponse -#### Config +### Subdomain Types: -- LogcontrolCmbConfig -- ConfigDeleteResponse +- SubdomainCreateResponse +- SubdomainDeleteResponse +- SubdomainGetResponse Methods: -- client.logs.control.cmb.config.create({ ...params }) -> LogcontrolCmbConfig | null -- client.logs.control.cmb.config.delete({ ...params }) -> ConfigDeleteResponse | null -- client.logs.control.cmb.config.get({ ...params }) -> LogcontrolCmbConfig | null +- client.workers.scripts.subdomain.create(scriptName, { ...params }) -> SubdomainCreateResponse +- client.workers.scripts.subdomain.delete(scriptName, { ...params }) -> SubdomainDeleteResponse +- client.workers.scripts.subdomain.get(scriptName, { ...params }) -> SubdomainGetResponse -## Rayid +### Schedules Types: -- RayidGetResponse +- ScheduleUpdateResponse +- ScheduleGetResponse Methods: -- client.logs.rayid.get(zoneIdentifier, rayIdentifier, { ...params }) -> RayidGetResponse +- client.workers.scripts.schedules.update(scriptName, [ ...body ]) -> ScheduleUpdateResponse +- client.workers.scripts.schedules.get(scriptName, { ...params }) -> ScheduleGetResponse -## Received +### Tail Types: -- ReceivedGetResponse +- ConsumerScript +- TailCreateResponse +- TailDeleteResponse +- TailGetResponse Methods: -- client.logs.received.get(zoneIdentifier, { ...params }) -> ReceivedGetResponse +- client.workers.scripts.tail.create(scriptName, { ...params }) -> TailCreateResponse +- client.workers.scripts.tail.delete(scriptName, id, { ...params }) -> TailDeleteResponse +- client.workers.scripts.tail.get(scriptName, { ...params }) -> TailGetResponse -### Fields +### Content -Types: +Methods: -- FieldGetResponse +- client.workers.scripts.content.update(scriptName, { ...params }) -> Script +- client.workers.scripts.content.get(scriptName, { ...params }) -> Response + +### Settings Methods: -- client.logs.received.fields.get(zoneIdentifier) -> FieldGetResponse +- client.workers.scripts.settings.edit(scriptName, { ...params }) -> ScriptSetting +- client.workers.scripts.settings.get(scriptName, { ...params }) -> ScriptSetting -# OriginTLSClientAuth +### Deployments Types: -- TLSCertificatesAndHostnamesZoneAuthenticatedOriginPull -- OriginTLSClientAuthCreateResponse -- OriginTLSClientAuthListResponse -- OriginTLSClientAuthDeleteResponse -- OriginTLSClientAuthGetResponse +- Deployment +- DeploymentListResponse +- DeploymentDeleteResponse Methods: -- client.originTLSClientAuth.create({ ...params }) -> OriginTLSClientAuthCreateResponse -- client.originTLSClientAuth.list({ ...params }) -> OriginTLSClientAuthListResponse | null -- client.originTLSClientAuth.delete(certificateId, { ...params }) -> OriginTLSClientAuthDeleteResponse -- client.originTLSClientAuth.get(certificateId, { ...params }) -> OriginTLSClientAuthGetResponse +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment +- client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse +- client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment -## Hostnames +### Versions Types: -- TLSCertificatesAndHostnamesHostnameAuthenticatedOriginPull -- TLSCertificatesAndHostnamesHostnameCertidObject -- HostnameUpdateResponse +- VersionCreateResponse +- VersionListResponse +- VersionGetResponse Methods: -- client.originTLSClientAuth.hostnames.update({ ...params }) -> HostnameUpdateResponse | null -- client.originTLSClientAuth.hostnames.get(hostname, { ...params }) -> TLSCertificatesAndHostnamesHostnameCertidObject +- client.workers.scripts.versions.create(scriptName, { ...params }) -> VersionCreateResponse +- client.workers.scripts.versions.list(scriptName, { ...params }) -> VersionListResponsesV4PagePagination +- client.workers.scripts.versions.get(scriptName, versionId, { ...params }) -> VersionGetResponse -### Certificates +### Secrets Types: -- TLSCertificatesAndHostnamesSchemasCertificateObject -- CertificateListResponse +- SecretUpdateResponse +- SecretListResponse +- SecretDeleteResponse +- SecretGetResponse Methods: -- client.originTLSClientAuth.hostnames.certificates.create({ ...params }) -> TLSCertificatesAndHostnamesSchemasCertificateObject -- client.originTLSClientAuth.hostnames.certificates.list({ ...params }) -> CertificateListResponse | null -- client.originTLSClientAuth.hostnames.certificates.delete(certificateId, { ...params }) -> TLSCertificatesAndHostnamesSchemasCertificateObject -- client.originTLSClientAuth.hostnames.certificates.get(certificateId, { ...params }) -> TLSCertificatesAndHostnamesSchemasCertificateObject +- client.workers.scripts.secrets.update(scriptName, { ...params }) -> SecretUpdateResponse +- client.workers.scripts.secrets.list(scriptName, { ...params }) -> SecretListResponsesSinglePage +- client.workers.scripts.secrets.delete(scriptName, secretName, { ...params }) -> SecretDeleteResponse | null +- client.workers.scripts.secrets.get(scriptName, secretName, { ...params }) -> SecretGetResponse -## Settings +### ScriptAndVersionSettings Types: -- SettingUpdateResponse -- SettingGetResponse +- ScriptAndVersionSettingEditResponse +- ScriptAndVersionSettingGetResponse Methods: -- client.originTLSClientAuth.settings.update({ ...params }) -> SettingUpdateResponse -- client.originTLSClientAuth.settings.get({ ...params }) -> SettingGetResponse +- client.workers.scripts.scriptAndVersionSettings.edit(scriptName, { ...params }) -> ScriptAndVersionSettingEditResponse +- client.workers.scripts.scriptAndVersionSettings.get(scriptName, { ...params }) -> ScriptAndVersionSettingGetResponse -# Pagerules +## AccountSettings Types: -- ZonesPageRule -- PageruleCreateResponse -- PageruleUpdateResponse -- PageruleListResponse -- PageruleDeleteResponse -- PageruleEditResponse -- PageruleGetResponse +- AccountSettingUpdateResponse +- AccountSettingGetResponse Methods: -- client.pagerules.create({ ...params }) -> PageruleCreateResponse -- client.pagerules.update(pageruleId, { ...params }) -> PageruleUpdateResponse -- client.pagerules.list({ ...params }) -> PageruleListResponse -- client.pagerules.delete(pageruleId, { ...params }) -> PageruleDeleteResponse | null -- client.pagerules.edit(pageruleId, { ...params }) -> PageruleEditResponse -- client.pagerules.get(pageruleId, { ...params }) -> PageruleGetResponse +- client.workers.accountSettings.update({ ...params }) -> AccountSettingUpdateResponse +- client.workers.accountSettings.get({ ...params }) -> AccountSettingGetResponse -## Settings +## Domains Types: -- ZonesSettings +- Domain Methods: -- client.pagerules.settings.list({ ...params }) -> ZonesSettings +- client.workers.domains.update({ ...params }) -> Domain +- client.workers.domains.list({ ...params }) -> DomainsSinglePage +- client.workers.domains.delete(domainId, { ...params }) -> void +- client.workers.domains.get(domainId, { ...params }) -> Domain -# RateLimits +## Subdomains Types: -- LegacyJhsRateLimits -- RateLimitCreateResponse -- RateLimitListResponse -- RateLimitDeleteResponse -- RateLimitEditResponse -- RateLimitGetResponse +- SubdomainUpdateResponse +- SubdomainGetResponse Methods: -- client.rateLimits.create(zoneIdentifier, { ...params }) -> RateLimitCreateResponse | null -- client.rateLimits.list(zoneIdentifier, { ...params }) -> RateLimitListResponsesV4PagePaginationArray -- client.rateLimits.delete(zoneIdentifier, id) -> RateLimitDeleteResponse | null -- client.rateLimits.edit(zoneIdentifier, id, { ...params }) -> RateLimitEditResponse | null -- client.rateLimits.get(zoneIdentifier, id) -> RateLimitGetResponse | null +- client.workers.subdomains.update({ ...params }) -> SubdomainUpdateResponse +- client.workers.subdomains.delete({ ...params }) -> void +- client.workers.subdomains.get({ ...params }) -> SubdomainGetResponse -# SecondaryDNS +## Observability -## ForceAXFR +### Telemetry Types: -- SecondaryDNSForceResult +- TelemetryKeysResponse +- TelemetryQueryResponse +- TelemetryValuesResponse Methods: -- client.secondaryDNS.forceAXFR.create({ ...params }) -> SecondaryDNSForceResult +- client.workers.observability.telemetry.keys({ ...params }) -> TelemetryKeysResponsesSinglePage +- client.workers.observability.telemetry.query({ ...params }) -> TelemetryQueryResponse +- client.workers.observability.telemetry.values({ ...params }) -> TelemetryValuesResponsesSinglePage + +# KV -## Incoming +## Namespaces Types: -- IncomingCreateResponse -- IncomingUpdateResponse -- IncomingDeleteResponse -- IncomingGetResponse +- Namespace +- NamespaceDeleteResponse +- NamespaceBulkDeleteResponse +- NamespaceBulkGetResponse +- NamespaceBulkUpdateResponse Methods: -- client.secondaryDNS.incoming.create({ ...params }) -> IncomingCreateResponse -- client.secondaryDNS.incoming.update({ ...params }) -> IncomingUpdateResponse -- client.secondaryDNS.incoming.delete({ ...params }) -> IncomingDeleteResponse -- client.secondaryDNS.incoming.get({ ...params }) -> IncomingGetResponse +- client.kv.namespaces.create({ ...params }) -> Namespace +- client.kv.namespaces.update(namespaceId, { ...params }) -> Namespace +- client.kv.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray +- client.kv.namespaces.delete(namespaceId, { ...params }) -> NamespaceDeleteResponse | null +- client.kv.namespaces.bulkDelete(namespaceId, [ ...body ]) -> NamespaceBulkDeleteResponse | null +- client.kv.namespaces.bulkGet(namespaceId, { ...params }) -> NamespaceBulkGetResponse | null +- client.kv.namespaces.bulkUpdate(namespaceId, [ ...body ]) -> NamespaceBulkUpdateResponse | null +- client.kv.namespaces.get(namespaceId, { ...params }) -> Namespace -## Outgoing +### Keys Types: -- SecondaryDNSDisableTransferResult -- SecondaryDNSEnableTransferResult -- SecondaryDNSSchemasForceResult -- OutgoingCreateResponse -- OutgoingUpdateResponse -- OutgoingDeleteResponse -- OutgoingGetResponse +- Key +- KeyBulkDeleteResponse +- KeyBulkGetResponse +- KeyBulkUpdateResponse Methods: -- client.secondaryDNS.outgoing.create({ ...params }) -> OutgoingCreateResponse -- client.secondaryDNS.outgoing.update({ ...params }) -> OutgoingUpdateResponse -- client.secondaryDNS.outgoing.delete({ ...params }) -> OutgoingDeleteResponse -- client.secondaryDNS.outgoing.disable({ ...params }) -> SecondaryDNSDisableTransferResult -- client.secondaryDNS.outgoing.enable({ ...params }) -> SecondaryDNSEnableTransferResult -- client.secondaryDNS.outgoing.forceNotify({ ...params }) -> SecondaryDNSSchemasForceResult -- client.secondaryDNS.outgoing.get({ ...params }) -> OutgoingGetResponse +- client.kv.namespaces.keys.list(namespaceId, { ...params }) -> KeysCursorLimitPagination +- client.kv.namespaces.keys.bulkDelete(namespaceId, [ ...body ]) -> KeyBulkDeleteResponse | null +- client.kv.namespaces.keys.bulkGet(namespaceId, { ...params }) -> KeyBulkGetResponse | null +- client.kv.namespaces.keys.bulkUpdate(namespaceId, [ ...body ]) -> KeyBulkUpdateResponse | null -### Status - -Methods: - -- client.secondaryDNS.outgoing.status.get({ ...params }) -> SecondaryDNSEnableTransferResult - -## ACLs +### Metadata Types: -- SecondaryDNSACL -- ACLListResponse -- ACLDeleteResponse +- MetadataGetResponse Methods: -- client.secondaryDNS.acls.create({ ...params }) -> SecondaryDNSACL -- client.secondaryDNS.acls.update(aclId, { ...params }) -> SecondaryDNSACL -- client.secondaryDNS.acls.list({ ...params }) -> ACLListResponse | null -- client.secondaryDNS.acls.delete(aclId, { ...params }) -> ACLDeleteResponse -- client.secondaryDNS.acls.get(aclId, { ...params }) -> SecondaryDNSACL +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse -## Peers +### Values Types: -- SecondaryDNSPeer -- PeerListResponse -- PeerDeleteResponse +- ValueUpdateResponse +- ValueDeleteResponse Methods: -- client.secondaryDNS.peers.create({ ...params }) -> SecondaryDNSPeer -- client.secondaryDNS.peers.update(peerId, { ...params }) -> SecondaryDNSPeer -- client.secondaryDNS.peers.list({ ...params }) -> PeerListResponse | null -- client.secondaryDNS.peers.delete(peerId, { ...params }) -> PeerDeleteResponse -- client.secondaryDNS.peers.get(peerId, { ...params }) -> SecondaryDNSPeer +- client.kv.namespaces.values.update(namespaceId, keyName, { ...params }) -> ValueUpdateResponse | null +- client.kv.namespaces.values.delete(namespaceId, keyName, { ...params }) -> ValueDeleteResponse | null +- client.kv.namespaces.values.get(namespaceId, keyName, { ...params }) -> Response + +# DurableObjects -## TSIGs +## Namespaces Types: -- SecondaryDNSTSIG -- TSIGListResponse -- TSIGDeleteResponse +- Namespace Methods: -- client.secondaryDNS.tsigs.create({ ...params }) -> SecondaryDNSTSIG -- client.secondaryDNS.tsigs.update(tsigId, { ...params }) -> SecondaryDNSTSIG -- client.secondaryDNS.tsigs.list({ ...params }) -> TSIGListResponse | null -- client.secondaryDNS.tsigs.delete(tsigId, { ...params }) -> TSIGDeleteResponse -- client.secondaryDNS.tsigs.get(tsigId, { ...params }) -> SecondaryDNSTSIG +- client.durableObjects.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray -# WaitingRooms +### Objects Types: -- WaitingroomWaitingroom -- WaitingRoomListResponse -- WaitingRoomDeleteResponse +- DurableObject Methods: -- client.waitingRooms.create(zoneIdentifier, { ...params }) -> WaitingroomWaitingroom -- client.waitingRooms.update(zoneIdentifier, waitingRoomId, { ...params }) -> WaitingroomWaitingroom -- client.waitingRooms.list(zoneIdentifier) -> WaitingRoomListResponse | null -- client.waitingRooms.delete(zoneIdentifier, waitingRoomId) -> WaitingRoomDeleteResponse -- client.waitingRooms.edit(zoneIdentifier, waitingRoomId, { ...params }) -> WaitingroomWaitingroom -- client.waitingRooms.get(zoneIdentifier, waitingRoomId) -> WaitingroomWaitingroom +- client.durableObjects.namespaces.objects.list(id, { ...params }) -> DurableObjectsCursorPaginationAfter -## Page +# Queues Types: -- PagePreviewResponse +- Queue +- QueueDeleteResponse Methods: -- client.waitingRooms.page.preview(zoneIdentifier, { ...params }) -> PagePreviewResponse +- client.queues.create({ ...params }) -> Queue +- client.queues.update(queueId, { ...params }) -> Queue +- client.queues.list({ ...params }) -> QueuesSinglePage +- client.queues.delete(queueId, { ...params }) -> QueueDeleteResponse +- client.queues.edit(queueId, { ...params }) -> Queue +- client.queues.get(queueId, { ...params }) -> Queue -## Events +## Messages Types: -- WaitingroomEventResult -- EventListResponse -- EventDeleteResponse +- MessageAckResponse +- MessageBulkPushResponse +- MessagePullResponse +- MessagePushResponse Methods: -- client.waitingRooms.events.create(zoneIdentifier, waitingRoomId, { ...params }) -> WaitingroomEventResult -- client.waitingRooms.events.update(zoneIdentifier, waitingRoomId, eventId, { ...params }) -> WaitingroomEventResult -- client.waitingRooms.events.list(zoneIdentifier, waitingRoomId) -> EventListResponse | null -- client.waitingRooms.events.delete(zoneIdentifier, waitingRoomId, eventId) -> EventDeleteResponse -- client.waitingRooms.events.edit(zoneIdentifier, waitingRoomId, eventId, { ...params }) -> WaitingroomEventResult -- client.waitingRooms.events.get(zoneIdentifier, waitingRoomId, eventId) -> WaitingroomEventResult +- client.queues.messages.ack(queueId, { ...params }) -> MessageAckResponse +- client.queues.messages.bulkPush(queueId, { ...params }) -> MessageBulkPushResponse +- client.queues.messages.pull(queueId, { ...params }) -> MessagePullResponse +- client.queues.messages.push(queueId, { ...params }) -> MessagePushResponse -### Details +## Purge Types: -- WaitingroomEventDetailsResult +- PurgeStatusResponse Methods: -- client.waitingRooms.events.details.get(zoneIdentifier, waitingRoomId, eventId) -> WaitingroomEventDetailsResult +- client.queues.purge.start(queueId, { ...params }) -> Queue +- client.queues.purge.status(queueId, { ...params }) -> PurgeStatusResponse -## Rules +## Consumers Types: -- WaitingroomRuleResult -- RuleCreateResponse -- RuleUpdateResponse -- RuleListResponse -- RuleDeleteResponse -- RuleEditResponse +- ConsumerCreateResponse +- ConsumerUpdateResponse +- ConsumerListResponse +- ConsumerDeleteResponse +- ConsumerGetResponse Methods: -- client.waitingRooms.rules.create(zoneIdentifier, waitingRoomId, { ...params }) -> RuleCreateResponse | null -- client.waitingRooms.rules.update(zoneIdentifier, waitingRoomId, [ ...body ]) -> RuleUpdateResponse | null -- client.waitingRooms.rules.list(zoneIdentifier, waitingRoomId) -> RuleListResponse | null -- client.waitingRooms.rules.delete(zoneIdentifier, waitingRoomId, ruleId) -> RuleDeleteResponse | null -- client.waitingRooms.rules.edit(zoneIdentifier, waitingRoomId, ruleId, { ...params }) -> RuleEditResponse | null +- client.queues.consumers.create(queueId, { ...params }) -> ConsumerCreateResponse +- client.queues.consumers.update(queueId, consumerId, { ...params }) -> ConsumerUpdateResponse +- client.queues.consumers.list(queueId, { ...params }) -> ConsumerListResponsesSinglePage +- client.queues.consumers.delete(queueId, consumerId, { ...params }) -> ConsumerDeleteResponse +- client.queues.consumers.get(queueId, consumerId, { ...params }) -> ConsumerGetResponse -## Statuses +## Subscriptions Types: -- StatusGetResponse +- SubscriptionCreateResponse +- SubscriptionUpdateResponse +- SubscriptionListResponse +- SubscriptionDeleteResponse +- SubscriptionGetResponse Methods: -- client.waitingRooms.statuses.get(zoneIdentifier, waitingRoomId) -> StatusGetResponse +- client.queues.subscriptions.create({ ...params }) -> SubscriptionCreateResponse +- client.queues.subscriptions.update(subscriptionId, { ...params }) -> SubscriptionUpdateResponse +- client.queues.subscriptions.list({ ...params }) -> SubscriptionListResponsesV4PagePaginationArray +- client.queues.subscriptions.delete(subscriptionId, { ...params }) -> SubscriptionDeleteResponse +- client.queues.subscriptions.get(subscriptionId, { ...params }) -> SubscriptionGetResponse -## Settings +# APIGateway + +## Configurations Types: -- SettingUpdateResponse -- SettingEditResponse -- SettingGetResponse +- Configuration Methods: -- client.waitingRooms.settings.update(zoneIdentifier, { ...params }) -> SettingUpdateResponse -- client.waitingRooms.settings.edit(zoneIdentifier, { ...params }) -> SettingEditResponse -- client.waitingRooms.settings.get(zoneIdentifier) -> SettingGetResponse +- client.apiGateway.configurations.update({ ...params }) -> Configuration +- client.apiGateway.configurations.get({ ...params }) -> Configuration -# Web3 - -## Hostnames +## Discovery Types: -- DwebConfigWeb3Hostname -- HostnameListResponse -- HostnameDeleteResponse +- DiscoveryOperation +- DiscoveryGetResponse Methods: -- client.web3.hostnames.create(zoneIdentifier, { ...params }) -> DwebConfigWeb3Hostname -- client.web3.hostnames.list(zoneIdentifier) -> HostnameListResponse | null -- client.web3.hostnames.delete(zoneIdentifier, identifier) -> HostnameDeleteResponse | null -- client.web3.hostnames.edit(zoneIdentifier, identifier, { ...params }) -> DwebConfigWeb3Hostname -- client.web3.hostnames.get(zoneIdentifier, identifier) -> DwebConfigWeb3Hostname +- client.apiGateway.discovery.get({ ...params }) -> DiscoveryGetResponse -### IPFSUniversalPaths - -#### ContentLists +### Operations Types: -- DwebConfigContentListDetails +- OperationBulkEditResponse +- OperationEditResponse Methods: -- client.web3.hostnames.ipfsUniversalPaths.contentLists.update(zoneIdentifier, identifier, { ...params }) -> DwebConfigContentListDetails -- client.web3.hostnames.ipfsUniversalPaths.contentLists.get(zoneIdentifier, identifier) -> DwebConfigContentListDetails +- client.apiGateway.discovery.operations.list({ ...params }) -> DiscoveryOperationsV4PagePaginationArray +- client.apiGateway.discovery.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse +- client.apiGateway.discovery.operations.edit(operationId, { ...params }) -> OperationEditResponse -##### Entries +## Operations Types: -- DwebConfigContentListEntry -- EntryListResponse -- EntryDeleteResponse +- APIShield +- OperationCreateResponse +- OperationListResponse +- OperationDeleteResponse +- OperationBulkCreateResponse +- OperationBulkDeleteResponse +- OperationGetResponse Methods: -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.create(zoneIdentifier, identifier, { ...params }) -> DwebConfigContentListEntry -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.update(zoneIdentifier, identifier, contentListEntryIdentifier, { ...params }) -> DwebConfigContentListEntry -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.list(zoneIdentifier, identifier) -> EntryListResponse | null -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.delete(zoneIdentifier, identifier, contentListEntryIdentifier) -> EntryDeleteResponse | null -- client.web3.hostnames.ipfsUniversalPaths.contentLists.entries.get(zoneIdentifier, identifier, contentListEntryIdentifier) -> DwebConfigContentListEntry - -# Workers +- client.apiGateway.operations.create({ ...params }) -> OperationCreateResponse +- client.apiGateway.operations.list({ ...params }) -> OperationListResponsesV4PagePaginationArray +- client.apiGateway.operations.delete(operationId, { ...params }) -> OperationDeleteResponse +- client.apiGateway.operations.bulkCreate([ ...body ]) -> OperationBulkCreateResponsesSinglePage +- client.apiGateway.operations.bulkDelete({ ...params }) -> OperationBulkDeleteResponse +- client.apiGateway.operations.get(operationId, { ...params }) -> OperationGetResponse -## AI +### SchemaValidation Types: -- AIRunResponse +- SettingsMultipleRequest +- SchemaValidationUpdateResponse +- SchemaValidationGetResponse Methods: -- client.workers.ai.run(modelName, { ...params }) -> AIRunResponse +- client.apiGateway.operations.schemaValidation.update(operationId, { ...params }) -> SchemaValidationUpdateResponse +- client.apiGateway.operations.schemaValidation.edit({ ...params }) -> SettingsMultipleRequest +- client.apiGateway.operations.schemaValidation.get(operationId, { ...params }) -> SchemaValidationGetResponse -## Scripts +## Schemas Types: -- WorkersScript -- ScriptListResponse +- SchemaListResponse Methods: -- client.workers.scripts.update(scriptName, { ...params }) -> WorkersScript -- client.workers.scripts.list({ ...params }) -> ScriptListResponse -- client.workers.scripts.delete(scriptName, { ...params }) -> void -- client.workers.scripts.get(scriptName, { ...params }) -> Response +- client.apiGateway.schemas.list({ ...params }) -> SchemaListResponse -### Bindings +## Settings Types: -- WorkersSchemasBinding -- BindingGetResponse +- Settings + +### SchemaValidation Methods: -- client.workers.scripts.bindings.get({ ...params }) -> BindingGetResponse +- client.apiGateway.settings.schemaValidation.update({ ...params }) -> Settings +- client.apiGateway.settings.schemaValidation.edit({ ...params }) -> Settings +- client.apiGateway.settings.schemaValidation.get({ ...params }) -> Settings -### Schedules +## UserSchemas Types: -- ScheduleUpdateResponse -- ScheduleGetResponse +- Message +- OldPublicSchema +- UserSchemaCreateResponse +- UserSchemaDeleteResponse Methods: -- client.workers.scripts.schedules.update(scriptName, { ...params }) -> ScheduleUpdateResponse -- client.workers.scripts.schedules.get(scriptName, { ...params }) -> ScheduleGetResponse +- client.apiGateway.userSchemas.create({ ...params }) -> UserSchemaCreateResponse +- client.apiGateway.userSchemas.list({ ...params }) -> OldPublicSchemasV4PagePaginationArray +- client.apiGateway.userSchemas.delete(schemaId, { ...params }) -> UserSchemaDeleteResponse +- client.apiGateway.userSchemas.edit(schemaId, { ...params }) -> OldPublicSchema +- client.apiGateway.userSchemas.get(schemaId, { ...params }) -> OldPublicSchema -### Tail +### Operations Types: -- TailCreateResponse -- TailDeleteResponse -- TailGetResponse +- OperationListResponse Methods: -- client.workers.scripts.tail.create(scriptName, { ...params }) -> TailCreateResponse -- client.workers.scripts.tail.delete(scriptName, id, { ...params }) -> TailDeleteResponse -- client.workers.scripts.tail.get(scriptName, { ...params }) -> TailGetResponse +- client.apiGateway.userSchemas.operations.list(schemaId, { ...params }) -> OperationListResponsesV4PagePaginationArray -### UsageModel +### Hosts Types: -- UsageModelUpdateResponse -- UsageModelGetResponse +- HostListResponse Methods: -- client.workers.scripts.usageModel.update(scriptName, { ...params }) -> UsageModelUpdateResponse -- client.workers.scripts.usageModel.get(scriptName, { ...params }) -> UsageModelGetResponse +- client.apiGateway.userSchemas.hosts.list({ ...params }) -> HostListResponsesV4PagePaginationArray -### Content +## ExpressionTemplate -Methods: +### Fallthrough -- client.workers.scripts.content.update(scriptName, { ...params }) -> WorkersScript +Types: -### ContentV2 +- FallthroughCreateResponse Methods: -- client.workers.scripts.contentV2.get(scriptName, { ...params }) -> Response +- client.apiGateway.expressionTemplate.fallthrough.create({ ...params }) -> FallthroughCreateResponse -### Settings +# ManagedTransforms Types: -- SettingEditResponse -- SettingGetResponse +- ManagedTransformListResponse +- ManagedTransformEditResponse Methods: -- client.workers.scripts.settings.edit(scriptName, { ...params }) -> SettingEditResponse -- client.workers.scripts.settings.get(scriptName, { ...params }) -> SettingGetResponse +- client.managedTransforms.list({ ...params }) -> ManagedTransformListResponse +- client.managedTransforms.delete({ ...params }) -> void +- client.managedTransforms.edit({ ...params }) -> ManagedTransformEditResponse -## Filters +# PageShield Types: -- WorkersFilters -- FilterCreateResponse -- FilterListResponse -- FilterDeleteResponse +- Setting +- PageShieldUpdateResponse Methods: -- client.workers.filters.create({ ...params }) -> FilterCreateResponse | null -- client.workers.filters.update(filterId, { ...params }) -> WorkersFilters -- client.workers.filters.list({ ...params }) -> FilterListResponse -- client.workers.filters.delete(filterId, { ...params }) -> FilterDeleteResponse | null +- client.pageShield.update({ ...params }) -> PageShieldUpdateResponse +- client.pageShield.get({ ...params }) -> Setting | null -## Routes +## Policies Types: -- WorkersRoutes -- RouteCreateResponse -- RouteListResponse -- RouteDeleteResponse +- Policy +- PolicyCreateResponse +- PolicyUpdateResponse +- PolicyListResponse +- PolicyGetResponse Methods: -- client.workers.routes.create({ ...params }) -> RouteCreateResponse -- client.workers.routes.update(routeId, { ...params }) -> WorkersRoutes -- client.workers.routes.list({ ...params }) -> RouteListResponse -- client.workers.routes.delete(routeId, { ...params }) -> RouteDeleteResponse -- client.workers.routes.get(routeId, { ...params }) -> WorkersRoutes +- client.pageShield.policies.create({ ...params }) -> PolicyCreateResponse | null +- client.pageShield.policies.update(policyId, { ...params }) -> PolicyUpdateResponse | null +- client.pageShield.policies.list({ ...params }) -> PolicyListResponsesSinglePage +- client.pageShield.policies.delete(policyId, { ...params }) -> void +- client.pageShield.policies.get(policyId, { ...params }) -> PolicyGetResponse | null -## AccountSettings +## Connections Types: -- AccountSettingUpdateResponse -- AccountSettingGetResponse +- Connection Methods: -- client.workers.accountSettings.update({ ...params }) -> AccountSettingUpdateResponse -- client.workers.accountSettings.get({ ...params }) -> AccountSettingGetResponse - -## Deployments +- client.pageShield.connections.list({ ...params }) -> ConnectionsSinglePage +- client.pageShield.connections.get(connectionId, { ...params }) -> Connection | null -### ByScripts +## Scripts Types: -- ByScriptGetResponse +- Script +- ScriptGetResponse Methods: -- client.workers.deployments.byScripts.get(scriptId, { ...params }) -> ByScriptGetResponse +- client.pageShield.scripts.list({ ...params }) -> ScriptsSinglePage +- client.pageShield.scripts.get(scriptId, { ...params }) -> ScriptGetResponse | null -#### Details +## Cookies Types: -- DetailGetResponse +- CookieListResponse +- CookieGetResponse Methods: -- client.workers.deployments.byScripts.details.get(scriptId, deploymentId, { ...params }) -> DetailGetResponse +- client.pageShield.cookies.list({ ...params }) -> CookieListResponsesSinglePage +- client.pageShield.cookies.get(cookieId, { ...params }) -> CookieGetResponse | null -## Domains - -Types: - -- WorkersDomain -- DomainListResponse - -Methods: - -- client.workers.domains.update({ ...params }) -> WorkersDomain -- client.workers.domains.list({ ...params }) -> DomainListResponse -- client.workers.domains.delete(domainId, { ...params }) -> void -- client.workers.domains.get(domainId, { ...params }) -> WorkersDomain - -## Subdomains - -Types: - -- SubdomainUpdateResponse -- SubdomainGetResponse - -Methods: - -- client.workers.subdomains.update({ ...params }) -> SubdomainUpdateResponse -- client.workers.subdomains.get({ ...params }) -> SubdomainGetResponse - -## Services - -### Environments - -#### Content - -Methods: - -- client.workers.services.environments.content.update(serviceName, environmentName, { ...params }) -> WorkersScript -- client.workers.services.environments.content.get(serviceName, environmentName, { ...params }) -> Response - -#### Settings - -Types: - -- SettingEditResponse -- SettingGetResponse - -Methods: - -- client.workers.services.environments.settings.edit(serviceName, environmentName, { ...params }) -> SettingEditResponse -- client.workers.services.environments.settings.get(serviceName, environmentName, { ...params }) -> SettingGetResponse - -# KV - -## Namespaces - -Types: - -- WorkersKVNamespace -- NamespaceUpdateResponse -- NamespaceDeleteResponse - -Methods: - -- client.kv.namespaces.create({ ...params }) -> WorkersKVNamespace -- client.kv.namespaces.update(namespaceId, { ...params }) -> NamespaceUpdateResponse -- client.kv.namespaces.list({ ...params }) -> WorkersKVNamespacesV4PagePaginationArray -- client.kv.namespaces.delete(namespaceId, { ...params }) -> NamespaceDeleteResponse - -### Bulk - -Types: - -- BulkUpdateResponse -- BulkDeleteResponse - -Methods: - -- client.kv.namespaces.bulk.update(namespaceId, [ ...body ]) -> BulkUpdateResponse -- client.kv.namespaces.bulk.delete(namespaceId, [ ...body ]) -> BulkDeleteResponse - -### Keys - -Types: - -- WorkersKVKey - -Methods: - -- client.kv.namespaces.keys.list(namespaceId, { ...params }) -> WorkersKVKeysCursorLimitPagination - -### Metadata - -Types: - -- MetadataGetResponse - -Methods: - -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse - -### Values - -Types: - -- ValueUpdateResponse -- ValueDeleteResponse -- ValueGetResponse - -Methods: - -- client.kv.namespaces.values.update(namespaceId, keyName, { ...params }) -> ValueUpdateResponse -- client.kv.namespaces.values.delete(namespaceId, keyName, { ...params }) -> ValueDeleteResponse -- client.kv.namespaces.values.get(namespaceId, keyName, { ...params }) -> string - -# DurableObjects - -## Namespaces - -Types: - -- WorkersNamespace -- NamespaceListResponse - -Methods: - -- client.durableObjects.namespaces.list({ ...params }) -> NamespaceListResponse | null - -### Objects - -Types: - -- WorkersObject - -Methods: - -- client.durableObjects.namespaces.objects.list(id, { ...params }) -> WorkersObjectsCursorLimitPagination - -# Queues - -Types: - -- WorkersQueue -- WorkersQueueCreated -- WorkersQueueUpdated -- QueueListResponse -- QueueDeleteResponse - -Methods: - -- client.queues.create({ ...params }) -> WorkersQueueCreated | null -- client.queues.update(name, { ...params }) -> WorkersQueueUpdated | null -- client.queues.list({ ...params }) -> QueueListResponse | null -- client.queues.delete(name, { ...params }) -> QueueDeleteResponse | null -- client.queues.get(name, { ...params }) -> WorkersQueue | null - -## Consumers - -Types: - -- WorkersConsumer -- WorkersConsumerCreated -- WorkersConsumerUpdated -- ConsumerDeleteResponse -- ConsumerGetResponse - -Methods: - -- client.queues.consumers.create(name, { ...params }) -> WorkersConsumerCreated | null -- client.queues.consumers.update(name, consumerName, { ...params }) -> WorkersConsumerUpdated | null -- client.queues.consumers.delete(name, consumerName, { ...params }) -> ConsumerDeleteResponse | null -- client.queues.consumers.get(name, { ...params }) -> ConsumerGetResponse | null - -# ManagedHeaders - -Types: - -- ManagedHeaderListResponse -- ManagedHeaderEditResponse - -Methods: - -- client.managedHeaders.list({ ...params }) -> ManagedHeaderListResponse -- client.managedHeaders.edit({ ...params }) -> ManagedHeaderEditResponse - -# PageShield - -Types: - -- PageShieldGetZoneSettings -- PageShieldUpdateZoneSettings - -Methods: - -- client.pageShield.update({ ...params }) -> PageShieldUpdateZoneSettings -- client.pageShield.get({ ...params }) -> PageShieldGetZoneSettings - -## Policies +# Rulesets Types: -- PageShieldPageshieldPolicy -- PolicyListResponse +- Kind +- Phase +- Ruleset +- RulesetCreateResponse +- RulesetUpdateResponse +- RulesetListResponse +- RulesetGetResponse Methods: -- client.pageShield.policies.create({ ...params }) -> PageShieldPageshieldPolicy -- client.pageShield.policies.update(policyId, { ...params }) -> PageShieldPageshieldPolicy -- client.pageShield.policies.list({ ...params }) -> PolicyListResponse | null -- client.pageShield.policies.delete(policyId, { ...params }) -> void -- client.pageShield.policies.get(policyId, { ...params }) -> PageShieldPageshieldPolicy +- client.rulesets.create({ ...params }) -> RulesetCreateResponse +- client.rulesets.update(rulesetId, { ...params }) -> RulesetUpdateResponse +- client.rulesets.list({ ...params }) -> RulesetListResponsesCursorPagination +- client.rulesets.delete(rulesetId, { ...params }) -> void +- client.rulesets.get(rulesetId, { ...params }) -> RulesetGetResponse -## Connections +## Phases Types: -- PageShieldConnection -- ConnectionListResponse +- PhaseUpdateResponse +- PhaseGetResponse Methods: -- client.pageShield.connections.list({ ...params }) -> ConnectionListResponse | null -- client.pageShield.connections.get(connectionId, { ...params }) -> PageShieldConnection +- client.rulesets.phases.update(rulesetPhase, { ...params }) -> PhaseUpdateResponse +- client.rulesets.phases.get(rulesetPhase, { ...params }) -> PhaseGetResponse -## Scripts +### Versions Types: -- PageShieldScript -- ScriptListResponse -- ScriptGetResponse +- VersionListResponse +- VersionGetResponse Methods: -- client.pageShield.scripts.list({ ...params }) -> ScriptListResponse | null -- client.pageShield.scripts.get(scriptId, { ...params }) -> ScriptGetResponse +- client.rulesets.phases.versions.list(rulesetPhase, { ...params }) -> VersionListResponsesSinglePage +- client.rulesets.phases.versions.get(rulesetPhase, rulesetVersion, { ...params }) -> VersionGetResponse -# Rulesets +## Rules Types: -- RulesetsRulesetResponse -- RulesetsRulesetsResponse +- BlockRule +- CompressResponseRule +- DDoSDynamicRule +- ExecuteRule +- ForceConnectionCloseRule +- LogCustomFieldRule +- LogRule +- Logging +- ManagedChallengeRule +- RedirectRule +- RewriteRule +- RouteRule +- RulesetRule +- ScoreRule +- ServeErrorRule +- SetCacheSettingsRule +- SetConfigRule +- SkipRule +- RuleCreateResponse +- RuleDeleteResponse +- RuleEditResponse Methods: -- client.rulesets.create({ ...params }) -> RulesetsRulesetResponse -- client.rulesets.update(rulesetId, { ...params }) -> RulesetsRulesetResponse -- client.rulesets.list({ ...params }) -> RulesetsRulesetsResponse -- client.rulesets.delete(rulesetId, { ...params }) -> void -- client.rulesets.get(rulesetId, { ...params }) -> RulesetsRulesetResponse - -## Phases - -Methods: - -- client.rulesets.phases.update(rulesetPhase, { ...params }) -> RulesetsRulesetResponse -- client.rulesets.phases.get(rulesetPhase, { ...params }) -> RulesetsRulesetResponse - -### Versions - -Methods: - -- client.rulesets.phases.versions.list(rulesetPhase, { ...params }) -> RulesetsRulesetsResponse -- client.rulesets.phases.versions.get(rulesetPhase, rulesetVersion, { ...params }) -> RulesetsRulesetResponse - -## Rules - -Methods: - -- client.rulesets.rules.create(rulesetId, { ...params }) -> RulesetsRulesetResponse -- client.rulesets.rules.delete(rulesetId, ruleId, { ...params }) -> RulesetsRulesetResponse -- client.rulesets.rules.edit(rulesetId, ruleId, { ...params }) -> RulesetsRulesetResponse +- client.rulesets.rules.create(rulesetId, { ...params }) -> RuleCreateResponse +- client.rulesets.rules.delete(rulesetId, ruleId, { ...params }) -> RuleDeleteResponse +- client.rulesets.rules.edit(rulesetId, ruleId, { ...params }) -> RuleEditResponse ## Versions -Methods: - -- client.rulesets.versions.list(rulesetId, { ...params }) -> RulesetsRulesetsResponse -- client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void -- client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> RulesetsRulesetResponse +Types: -### ByTags +- VersionListResponse +- VersionGetResponse Methods: -- client.rulesets.versions.byTags.get(rulesetId, rulesetVersion, ruleTag, { ...params }) -> RulesetsRulesetResponse +- client.rulesets.versions.list(rulesetId, { ...params }) -> VersionListResponsesSinglePage +- client.rulesets.versions.delete(rulesetId, rulesetVersion, { ...params }) -> void +- client.rulesets.versions.get(rulesetId, rulesetVersion, { ...params }) -> VersionGetResponse # URLNormalization @@ -2728,10 +2808,18 @@ Types: Methods: - client.urlNormalization.update({ ...params }) -> URLNormalizationUpdateResponse +- client.urlNormalization.delete({ ...params }) -> void - client.urlNormalization.get({ ...params }) -> URLNormalizationGetResponse # Spectrum +Types: + +- DNS +- EdgeIPs +- OriginDNS +- OriginPort + ## Analytics ### Aggregates @@ -2744,10 +2832,14 @@ Types: Methods: -- client.spectrum.analytics.aggregates.currents.get(zone, { ...params }) -> CurrentGetResponse +- client.spectrum.analytics.aggregates.currents.get({ ...params }) -> CurrentGetResponse ### Events +Types: + +- Dimension + #### Bytimes Types: @@ -2756,7 +2848,7 @@ Types: Methods: -- client.spectrum.analytics.events.bytimes.get(zone, { ...params }) -> BytimeGetResponse | null +- client.spectrum.analytics.events.bytimes.get({ ...params }) -> BytimeGetResponse #### Summaries @@ -2766,7 +2858,7 @@ Types: Methods: -- client.spectrum.analytics.events.summaries.get(zone, { ...params }) -> SummaryGetResponse | null +- client.spectrum.analytics.events.summaries.get({ ...params }) -> SummaryGetResponse ## Apps @@ -2780,14 +2872,42 @@ Types: Methods: -- client.spectrum.apps.create(zone, { ...params }) -> AppCreateResponse | null -- client.spectrum.apps.update(zone, appId, { ...params }) -> AppUpdateResponse | null -- client.spectrum.apps.list(zone, { ...params }) -> AppListResponsesV4PagePaginationArray -- client.spectrum.apps.delete(zone, appId) -> AppDeleteResponse | null -- client.spectrum.apps.get(zone, appId) -> AppGetResponse | null +- client.spectrum.apps.create({ ...params }) -> AppCreateResponse +- client.spectrum.apps.update(appId, { ...params }) -> AppUpdateResponse +- client.spectrum.apps.list({ ...params }) -> AppListResponsesV4PagePaginationArray +- client.spectrum.apps.delete(appId, { ...params }) -> AppDeleteResponse | null +- client.spectrum.apps.get(appId, { ...params }) -> AppGetResponse # Addressing +## RegionalHostnames + +Types: + +- RegionalHostnameCreateResponse +- RegionalHostnameListResponse +- RegionalHostnameDeleteResponse +- RegionalHostnameEditResponse +- RegionalHostnameGetResponse + +Methods: + +- client.addressing.regionalHostnames.create({ ...params }) -> RegionalHostnameCreateResponse +- client.addressing.regionalHostnames.list({ ...params }) -> RegionalHostnameListResponsesSinglePage +- client.addressing.regionalHostnames.delete(hostname, { ...params }) -> RegionalHostnameDeleteResponse +- client.addressing.regionalHostnames.edit(hostname, { ...params }) -> RegionalHostnameEditResponse +- client.addressing.regionalHostnames.get(hostname, { ...params }) -> RegionalHostnameGetResponse + +### Regions + +Types: + +- RegionListResponse + +Methods: + +- client.addressing.regionalHostnames.regions.list({ ...params }) -> RegionListResponsesSinglePage + ## Services Types: @@ -2796,24 +2916,24 @@ Types: Methods: -- client.addressing.services.list({ ...params }) -> ServiceListResponse +- client.addressing.services.list({ ...params }) -> ServiceListResponsesSinglePage ## AddressMaps Types: -- AddressingAddressMaps +- AddressMap +- Kind - AddressMapCreateResponse -- AddressMapListResponse - AddressMapDeleteResponse - AddressMapGetResponse Methods: - client.addressing.addressMaps.create({ ...params }) -> AddressMapCreateResponse -- client.addressing.addressMaps.list({ ...params }) -> AddressMapListResponse | null -- client.addressing.addressMaps.delete(addressMapId, { ...params }) -> AddressMapDeleteResponse | null -- client.addressing.addressMaps.edit(addressMapId, { ...params }) -> AddressingAddressMaps +- client.addressing.addressMaps.list({ ...params }) -> AddressMapsSinglePage +- client.addressing.addressMaps.delete(addressMapId, { ...params }) -> AddressMapDeleteResponse +- client.addressing.addressMaps.edit(addressMapId, { ...params }) -> AddressMap - client.addressing.addressMaps.get(addressMapId, { ...params }) -> AddressMapGetResponse ### Accounts @@ -2825,8 +2945,8 @@ Types: Methods: -- client.addressing.addressMaps.accounts.update(addressMapId, { ...params }) -> AccountUpdateResponse | null -- client.addressing.addressMaps.accounts.delete(addressMapId, { ...params }) -> AccountDeleteResponse | null +- client.addressing.addressMaps.accounts.update(addressMapId, { ...params }) -> AccountUpdateResponse +- client.addressing.addressMaps.accounts.delete(addressMapId, { ...params }) -> AccountDeleteResponse ### IPs @@ -2837,8 +2957,8 @@ Types: Methods: -- client.addressing.addressMaps.ips.update(addressMapId, ipAddress, { ...params }) -> IPUpdateResponse | null -- client.addressing.addressMaps.ips.delete(addressMapId, ipAddress, { ...params }) -> IPDeleteResponse | null +- client.addressing.addressMaps.ips.update(addressMapId, ipAddress, { ...params }) -> IPUpdateResponse +- client.addressing.addressMaps.ips.delete(addressMapId, ipAddress, { ...params }) -> IPDeleteResponse ### Zones @@ -2849,110 +2969,92 @@ Types: Methods: -- client.addressing.addressMaps.zones.update(addressMapId, { ...params }) -> ZoneUpdateResponse | null -- client.addressing.addressMaps.zones.delete(addressMapId, { ...params }) -> ZoneDeleteResponse | null +- client.addressing.addressMaps.zones.update(addressMapId, { ...params }) -> ZoneUpdateResponse +- client.addressing.addressMaps.zones.delete(addressMapId, { ...params }) -> ZoneDeleteResponse ## LOADocuments Types: -- LOADocumentCreateResponse - -Methods: - -- client.addressing.loaDocuments.create({ ...params }) -> LOADocumentCreateResponse - -### Downloads - -Types: - -- DownloadGetResponse +- LOADocumentCreateResponse Methods: -- client.addressing.loaDocuments.downloads.get(loaDocumentId, { ...params }) -> unknown +- client.addressing.loaDocuments.create({ ...params }) -> LOADocumentCreateResponse +- client.addressing.loaDocuments.get(loaDocumentId, { ...params }) -> Response ## Prefixes Types: -- AddressingIpamPrefixes -- PrefixListResponse +- Prefix - PrefixDeleteResponse Methods: -- client.addressing.prefixes.create({ ...params }) -> AddressingIpamPrefixes -- client.addressing.prefixes.list({ ...params }) -> PrefixListResponse | null -- client.addressing.prefixes.delete(prefixId, { ...params }) -> PrefixDeleteResponse | null -- client.addressing.prefixes.edit(prefixId, { ...params }) -> AddressingIpamPrefixes -- client.addressing.prefixes.get(prefixId, { ...params }) -> AddressingIpamPrefixes +- client.addressing.prefixes.create({ ...params }) -> Prefix +- client.addressing.prefixes.list({ ...params }) -> PrefixesSinglePage +- client.addressing.prefixes.delete(prefixId, { ...params }) -> PrefixDeleteResponse +- client.addressing.prefixes.edit(prefixId, { ...params }) -> Prefix +- client.addressing.prefixes.get(prefixId, { ...params }) -> Prefix -### BGP - -#### Bindings +### ServiceBindings Types: -- AddressingServiceBinding -- BindingListResponse -- BindingDeleteResponse +- ServiceBinding +- ServiceBindingDeleteResponse Methods: -- client.addressing.prefixes.bgp.bindings.create(prefixId, { ...params }) -> AddressingServiceBinding -- client.addressing.prefixes.bgp.bindings.list(prefixId, { ...params }) -> BindingListResponse -- client.addressing.prefixes.bgp.bindings.delete(prefixId, bindingId, { ...params }) -> BindingDeleteResponse -- client.addressing.prefixes.bgp.bindings.get(prefixId, bindingId, { ...params }) -> AddressingServiceBinding +- client.addressing.prefixes.serviceBindings.create(prefixId, { ...params }) -> ServiceBinding +- client.addressing.prefixes.serviceBindings.list(prefixId, { ...params }) -> ServiceBindingsSinglePage +- client.addressing.prefixes.serviceBindings.delete(prefixId, bindingId, { ...params }) -> ServiceBindingDeleteResponse +- client.addressing.prefixes.serviceBindings.get(prefixId, bindingId, { ...params }) -> ServiceBinding -#### Prefixes +### BGPPrefixes Types: -- AddressingIpamBGPPrefixes -- PrefixListResponse +- BGPPrefix Methods: -- client.addressing.prefixes.bgp.prefixes.list(prefixId, { ...params }) -> PrefixListResponse | null -- client.addressing.prefixes.bgp.prefixes.edit(prefixId, bgpPrefixId, { ...params }) -> AddressingIpamBGPPrefixes -- client.addressing.prefixes.bgp.prefixes.get(prefixId, bgpPrefixId, { ...params }) -> AddressingIpamBGPPrefixes +- client.addressing.prefixes.bgpPrefixes.create(prefixId, { ...params }) -> BGPPrefix +- client.addressing.prefixes.bgpPrefixes.list(prefixId, { ...params }) -> BGPPrefixesSinglePage +- client.addressing.prefixes.bgpPrefixes.edit(prefixId, bgpPrefixId, { ...params }) -> BGPPrefix +- client.addressing.prefixes.bgpPrefixes.get(prefixId, bgpPrefixId, { ...params }) -> BGPPrefix -#### Statuses +### AdvertisementStatus Types: -- StatusEditResponse -- StatusGetResponse +- AdvertisementStatusEditResponse +- AdvertisementStatusGetResponse Methods: -- client.addressing.prefixes.bgp.statuses.edit(prefixId, { ...params }) -> StatusEditResponse -- client.addressing.prefixes.bgp.statuses.get(prefixId, { ...params }) -> StatusGetResponse +- client.addressing.prefixes.advertisementStatus.edit(prefixId, { ...params }) -> AdvertisementStatusEditResponse +- client.addressing.prefixes.advertisementStatus.get(prefixId, { ...params }) -> AdvertisementStatusGetResponse ### Delegations Types: -- AddressingIpamDelegations -- DelegationListResponse +- Delegations - DelegationDeleteResponse Methods: -- client.addressing.prefixes.delegations.create(prefixId, { ...params }) -> AddressingIpamDelegations -- client.addressing.prefixes.delegations.list(prefixId, { ...params }) -> DelegationListResponse | null +- client.addressing.prefixes.delegations.create(prefixId, { ...params }) -> Delegations +- client.addressing.prefixes.delegations.list(prefixId, { ...params }) -> DelegationsSinglePage - client.addressing.prefixes.delegations.delete(prefixId, delegationId, { ...params }) -> DelegationDeleteResponse # AuditLogs -Types: - -- AuditLogListResponse - Methods: -- client.auditLogs.list({ ...params }) -> AuditLogListResponsesV4PagePaginationArray +- client.auditLogs.list({ ...params }) -> AuditLogsV4PagePaginationArray # Billing @@ -2964,19 +3066,64 @@ Types: Methods: -- client.billing.profiles.get(accountIdentifier) -> ProfileGetResponse +- client.billing.profiles.get({ ...params }) -> ProfileGetResponse # BrandProtection Types: -- IntelPhishingURLInfo -- IntelPhishingURLSubmit +- Info +- Submit +- BrandProtectionSubmitResponse +- BrandProtectionURLInfoResponse + +Methods: + +- client.brandProtection.submit({ ...params }) -> BrandProtectionSubmitResponse +- client.brandProtection.urlInfo({ ...params }) -> BrandProtectionURLInfoResponsesSinglePage + +## Queries + +Methods: + +- client.brandProtection.queries.create({ ...params }) -> void +- client.brandProtection.queries.delete({ ...params }) -> void +- client.brandProtection.queries.bulk({ ...params }) -> void + +## Matches + +Types: + +- MatchDownloadResponse +- MatchGetResponse + +Methods: + +- client.brandProtection.matches.download({ ...params }) -> MatchDownloadResponse +- client.brandProtection.matches.get({ ...params }) -> MatchGetResponse + +## Logos + +Types: + +- LogoCreateResponse + +Methods: + +- client.brandProtection.logos.create({ ...params }) -> LogoCreateResponse +- client.brandProtection.logos.delete(logoId, { ...params }) -> void + +## LogoMatches + +Types: + +- LogoMatchDownloadResponse +- LogoMatchGetResponse Methods: -- client.brandProtection.submit({ ...params }) -> IntelPhishingURLSubmit -- client.brandProtection.urlInfo({ ...params }) -> IntelPhishingURLInfo +- client.brandProtection.logoMatches.download({ ...params }) -> LogoMatchDownloadResponse +- client.brandProtection.logoMatches.get({ ...params }) -> LogoMatchGetResponse # Diagnostics @@ -2984,12 +3131,30 @@ Methods: Types: -- MagicTransitTargetResult -- TracerouteCreateResponse +- Traceroute + +Methods: + +- client.diagnostics.traceroutes.create({ ...params }) -> TraceroutesSinglePage + +## EndpointHealthchecks + +Types: + +- EndpointHealthcheck +- EndpointHealthcheckCreateResponse +- EndpointHealthcheckUpdateResponse +- EndpointHealthcheckListResponse +- EndpointHealthcheckDeleteResponse +- EndpointHealthcheckGetResponse Methods: -- client.diagnostics.traceroutes.create({ ...params }) -> TracerouteCreateResponse | null +- client.diagnostics.endpointHealthchecks.create({ ...params }) -> EndpointHealthcheckCreateResponse +- client.diagnostics.endpointHealthchecks.update(id, { ...params }) -> EndpointHealthcheckUpdateResponse +- client.diagnostics.endpointHealthchecks.list({ ...params }) -> EndpointHealthcheckListResponse +- client.diagnostics.endpointHealthchecks.delete(id, { ...params }) -> EndpointHealthcheckDeleteResponse +- client.diagnostics.endpointHealthchecks.get(id, { ...params }) -> EndpointHealthcheckGetResponse # Images @@ -2997,55 +3162,60 @@ Methods: Types: -- ImagesImage +- Image - V1ListResponse - V1DeleteResponse Methods: -- client.images.v1.create({ ...params }) -> ImagesImage +- client.images.v1.create({ ...params }) -> Image - client.images.v1.list({ ...params }) -> V1ListResponsesV4PagePagination - client.images.v1.delete(imageId, { ...params }) -> V1DeleteResponse -- client.images.v1.edit(imageId, { ...params }) -> ImagesImage -- client.images.v1.get(imageId, { ...params }) -> ImagesImage +- client.images.v1.edit(imageId, { ...params }) -> Image +- client.images.v1.get(imageId, { ...params }) -> Image ### Keys Types: -- ImagesImageKeys +- Key +- KeyUpdateResponse +- KeyListResponse +- KeyDeleteResponse Methods: -- client.images.v1.keys.update(signingKeyName, { ...params }) -> ImagesImageKeys -- client.images.v1.keys.list({ ...params }) -> ImagesImageKeys -- client.images.v1.keys.delete(signingKeyName, { ...params }) -> ImagesImageKeys +- client.images.v1.keys.update(signingKeyName, { ...params }) -> KeyUpdateResponse +- client.images.v1.keys.list({ ...params }) -> KeyListResponse +- client.images.v1.keys.delete(signingKeyName, { ...params }) -> KeyDeleteResponse ### Stats Types: -- ImagesImagesStats +- Stat Methods: -- client.images.v1.stats.get({ ...params }) -> ImagesImagesStats +- client.images.v1.stats.get({ ...params }) -> Stat ### Variants Types: -- ImageVariant -- ImageVariants +- Variant +- VariantCreateResponse - VariantDeleteResponse +- VariantEditResponse +- VariantGetResponse Methods: -- client.images.v1.variants.create({ ...params }) -> ImageVariant -- client.images.v1.variants.list({ ...params }) -> ImageVariants +- client.images.v1.variants.create({ ...params }) -> VariantCreateResponse +- client.images.v1.variants.list({ ...params }) -> Variant - client.images.v1.variants.delete(variantId, { ...params }) -> VariantDeleteResponse -- client.images.v1.variants.edit(variantId, { ...params }) -> ImageVariant -- client.images.v1.variants.get(variantId, { ...params }) -> ImageVariant +- client.images.v1.variants.edit(variantId, { ...params }) -> VariantEditResponse +- client.images.v1.variants.get(variantId, { ...params }) -> VariantGetResponse ### Blobs @@ -3077,13 +3247,9 @@ Methods: ## ASN -Types: - -- IntelASN - Methods: -- client.intel.asn.get(asn, { ...params }) -> IntelASN +- client.intel.asn.get(asn, { ...params }) -> ASN ### Subnets @@ -3099,21 +3265,21 @@ Methods: Types: -- IntelPassiveDNSByIP +- DNS Methods: -- client.intel.dns.get({ ...params }) -> IntelPassiveDNSByIP +- client.intel.dns.list({ ...params }) -> DNSV4PagePagination ## Domains Types: -- IntelDomain +- Domain Methods: -- client.intel.domains.get({ ...params }) -> IntelDomain +- client.intel.domains.get({ ...params }) -> Domain ### Bulks @@ -3129,7 +3295,7 @@ Methods: Types: -- IntelDomainHistory +- DomainHistory - DomainHistoryGetResponse Methods: @@ -3140,7 +3306,7 @@ Methods: Types: -- IntelSchemasIP +- IP - IPGetResponse Methods: @@ -3151,12 +3317,7 @@ Methods: Types: -- IntelIPList -- IPListGetResponse - -Methods: - -- client.intel.ipLists.get({ ...params }) -> IPListGetResponse | null +- IPList ## Miscategorizations @@ -3172,54 +3333,66 @@ Methods: Types: -- IntelWhois +- Whois +- WhoisGetResponse Methods: -- client.intel.whois.get({ ...params }) -> IntelWhois +- client.intel.whois.get({ ...params }) -> WhoisGetResponse ## IndicatorFeeds Types: -- IntelIndicatorFeedItem -- IntelIndicatorFeedMetadata -- IntelUpdateFeed +- IndicatorFeedCreateResponse +- IndicatorFeedUpdateResponse - IndicatorFeedListResponse - IndicatorFeedDataResponse +- IndicatorFeedGetResponse Methods: -- client.intel.indicatorFeeds.create({ ...params }) -> IntelIndicatorFeedItem -- client.intel.indicatorFeeds.update(feedId, { ...params }) -> IntelUpdateFeed -- client.intel.indicatorFeeds.list({ ...params }) -> IndicatorFeedListResponse +- client.intel.indicatorFeeds.create({ ...params }) -> IndicatorFeedCreateResponse +- client.intel.indicatorFeeds.update(feedId, { ...params }) -> IndicatorFeedUpdateResponse +- client.intel.indicatorFeeds.list({ ...params }) -> IndicatorFeedListResponsesSinglePage - client.intel.indicatorFeeds.data(feedId, { ...params }) -> string -- client.intel.indicatorFeeds.get(feedId, { ...params }) -> IntelIndicatorFeedMetadata +- client.intel.indicatorFeeds.get(feedId, { ...params }) -> IndicatorFeedGetResponse + +### Snapshots + +Types: + +- SnapshotUpdateResponse + +Methods: + +- client.intel.indicatorFeeds.snapshots.update(feedId, { ...params }) -> SnapshotUpdateResponse ### Permissions Types: -- IntelPermissionListItem -- IntelPermissionsUpdate +- PermissionCreateResponse - PermissionListResponse +- PermissionDeleteResponse Methods: -- client.intel.indicatorFeeds.permissions.create({ ...params }) -> IntelPermissionsUpdate +- client.intel.indicatorFeeds.permissions.create({ ...params }) -> PermissionCreateResponse - client.intel.indicatorFeeds.permissions.list({ ...params }) -> PermissionListResponse -- client.intel.indicatorFeeds.permissions.delete({ ...params }) -> IntelPermissionsUpdate +- client.intel.indicatorFeeds.permissions.delete({ ...params }) -> PermissionDeleteResponse + +### Downloads ## Sinkholes Types: -- IntelSinkholesSinkholeItem -- SinkholeListResponse +- Sinkhole Methods: -- client.intel.sinkholes.list({ ...params }) -> SinkholeListResponse +- client.intel.sinkholes.list({ ...params }) -> SinkholesSinglePage ## AttackSurfaceReport @@ -3231,12 +3404,14 @@ Types: Methods: -- client.intel.attackSurfaceReport.issueTypes.get({ ...params }) -> IssueTypeGetResponse +- client.intel.attackSurfaceReport.issueTypes.get({ ...params }) -> IssueTypeGetResponsesSinglePage ### Issues Types: +- IssueType +- SeverityQueryParam - IssueListResponse - IssueClassResponse - IssueDismissResponse @@ -3253,19 +3428,45 @@ Methods: # MagicTransit +Types: + +- HealthCheck +- HealthCheckRate +- HealthCheckType + +## Apps + +Types: + +- AppCreateResponse +- AppUpdateResponse +- AppListResponse +- AppDeleteResponse +- AppEditResponse + +Methods: + +- client.magicTransit.apps.create({ ...params }) -> AppCreateResponse | null +- client.magicTransit.apps.update(accountAppId, { ...params }) -> AppUpdateResponse | null +- client.magicTransit.apps.list({ ...params }) -> AppListResponsesSinglePage +- client.magicTransit.apps.delete(accountAppId, { ...params }) -> AppDeleteResponse | null +- client.magicTransit.apps.edit(accountAppId, { ...params }) -> AppEditResponse | null + ## CfInterconnects Types: - CfInterconnectUpdateResponse - CfInterconnectListResponse +- CfInterconnectBulkUpdateResponse - CfInterconnectGetResponse Methods: -- client.magicTransit.cfInterconnects.update(accountIdentifier, tunnelIdentifier, { ...params }) -> CfInterconnectUpdateResponse -- client.magicTransit.cfInterconnects.list(accountIdentifier) -> CfInterconnectListResponse -- client.magicTransit.cfInterconnects.get(accountIdentifier, tunnelIdentifier) -> CfInterconnectGetResponse +- client.magicTransit.cfInterconnects.update(cfInterconnectId, { ...params }) -> CfInterconnectUpdateResponse +- client.magicTransit.cfInterconnects.list({ ...params }) -> CfInterconnectListResponse +- client.magicTransit.cfInterconnects.bulkUpdate({ ...params }) -> CfInterconnectBulkUpdateResponse +- client.magicTransit.cfInterconnects.get(cfInterconnectId, { ...params }) -> CfInterconnectGetResponse ## GRETunnels @@ -3275,304 +3476,557 @@ Types: - GRETunnelUpdateResponse - GRETunnelListResponse - GRETunnelDeleteResponse +- GRETunnelBulkUpdateResponse - GRETunnelGetResponse Methods: -- client.magicTransit.greTunnels.create(accountIdentifier, { ...params }) -> GRETunnelCreateResponse -- client.magicTransit.greTunnels.update(accountIdentifier, tunnelIdentifier, { ...params }) -> GRETunnelUpdateResponse -- client.magicTransit.greTunnels.list(accountIdentifier) -> GRETunnelListResponse -- client.magicTransit.greTunnels.delete(accountIdentifier, tunnelIdentifier) -> GRETunnelDeleteResponse -- client.magicTransit.greTunnels.get(accountIdentifier, tunnelIdentifier) -> GRETunnelGetResponse +- client.magicTransit.greTunnels.create({ ...params }) -> GRETunnelCreateResponse +- client.magicTransit.greTunnels.update(greTunnelId, { ...params }) -> GRETunnelUpdateResponse +- client.magicTransit.greTunnels.list({ ...params }) -> GRETunnelListResponse +- client.magicTransit.greTunnels.delete(greTunnelId, { ...params }) -> GRETunnelDeleteResponse +- client.magicTransit.greTunnels.bulkUpdate({ ...params }) -> GRETunnelBulkUpdateResponse +- client.magicTransit.greTunnels.get(greTunnelId, { ...params }) -> GRETunnelGetResponse ## IPSECTunnels Types: +- PSKMetadata - IPSECTunnelCreateResponse - IPSECTunnelUpdateResponse - IPSECTunnelListResponse - IPSECTunnelDeleteResponse +- IPSECTunnelBulkUpdateResponse - IPSECTunnelGetResponse - IPSECTunnelPSKGenerateResponse Methods: -- client.magicTransit.ipsecTunnels.create(accountIdentifier, { ...params }) -> IPSECTunnelCreateResponse -- client.magicTransit.ipsecTunnels.update(accountIdentifier, tunnelIdentifier, { ...params }) -> IPSECTunnelUpdateResponse -- client.magicTransit.ipsecTunnels.list(accountIdentifier) -> IPSECTunnelListResponse -- client.magicTransit.ipsecTunnels.delete(accountIdentifier, tunnelIdentifier) -> IPSECTunnelDeleteResponse -- client.magicTransit.ipsecTunnels.get(accountIdentifier, tunnelIdentifier) -> IPSECTunnelGetResponse -- client.magicTransit.ipsecTunnels.pskGenerate(accountIdentifier, tunnelIdentifier) -> IPSECTunnelPSKGenerateResponse +- client.magicTransit.ipsecTunnels.create({ ...params }) -> IPSECTunnelCreateResponse +- client.magicTransit.ipsecTunnels.update(ipsecTunnelId, { ...params }) -> IPSECTunnelUpdateResponse +- client.magicTransit.ipsecTunnels.list({ ...params }) -> IPSECTunnelListResponse +- client.magicTransit.ipsecTunnels.delete(ipsecTunnelId, { ...params }) -> IPSECTunnelDeleteResponse +- client.magicTransit.ipsecTunnels.bulkUpdate({ ...params }) -> IPSECTunnelBulkUpdateResponse +- client.magicTransit.ipsecTunnels.get(ipsecTunnelId, { ...params }) -> IPSECTunnelGetResponse +- client.magicTransit.ipsecTunnels.pskGenerate(ipsecTunnelId, { ...params }) -> IPSECTunnelPSKGenerateResponse ## Routes Types: +- Scope - RouteCreateResponse - RouteUpdateResponse - RouteListResponse - RouteDeleteResponse +- RouteBulkUpdateResponse - RouteEmptyResponse - RouteGetResponse Methods: -- client.magicTransit.routes.create(accountIdentifier, { ...params }) -> RouteCreateResponse -- client.magicTransit.routes.update(accountIdentifier, routeIdentifier, { ...params }) -> RouteUpdateResponse -- client.magicTransit.routes.list(accountIdentifier) -> RouteListResponse -- client.magicTransit.routes.delete(accountIdentifier, routeIdentifier) -> RouteDeleteResponse -- client.magicTransit.routes.empty(accountIdentifier, { ...params }) -> RouteEmptyResponse -- client.magicTransit.routes.get(accountIdentifier, routeIdentifier) -> RouteGetResponse +- client.magicTransit.routes.create({ ...params }) -> RouteCreateResponse +- client.magicTransit.routes.update(routeId, { ...params }) -> RouteUpdateResponse +- client.magicTransit.routes.list({ ...params }) -> RouteListResponse +- client.magicTransit.routes.delete(routeId, { ...params }) -> RouteDeleteResponse +- client.magicTransit.routes.bulkUpdate({ ...params }) -> RouteBulkUpdateResponse +- client.magicTransit.routes.empty({ ...params }) -> RouteEmptyResponse +- client.magicTransit.routes.get(routeId, { ...params }) -> RouteGetResponse ## Sites Types: -- SiteCreateResponse -- SiteUpdateResponse -- SiteListResponse -- SiteDeleteResponse -- SiteGetResponse +- Site +- SiteLocation Methods: -- client.magicTransit.sites.create(accountIdentifier, { ...params }) -> SiteCreateResponse -- client.magicTransit.sites.update(accountIdentifier, siteIdentifier, { ...params }) -> SiteUpdateResponse -- client.magicTransit.sites.list(accountIdentifier) -> SiteListResponse -- client.magicTransit.sites.delete(accountIdentifier, siteIdentifier) -> SiteDeleteResponse -- client.magicTransit.sites.get(accountIdentifier, siteIdentifier) -> SiteGetResponse +- client.magicTransit.sites.create({ ...params }) -> Site +- client.magicTransit.sites.update(siteId, { ...params }) -> Site +- client.magicTransit.sites.list({ ...params }) -> SitesSinglePage +- client.magicTransit.sites.delete(siteId, { ...params }) -> Site +- client.magicTransit.sites.edit(siteId, { ...params }) -> Site +- client.magicTransit.sites.get(siteId, { ...params }) -> Site ### ACLs Types: -- ACLCreateResponse -- ACLUpdateResponse -- ACLListResponse -- ACLDeleteResponse -- ACLGetResponse +- ACL +- ACLConfiguration +- AllowedProtocol +- Subnet Methods: -- client.magicTransit.sites.acls.create(accountIdentifier, siteIdentifier, { ...params }) -> ACLCreateResponse -- client.magicTransit.sites.acls.update(accountIdentifier, siteIdentifier, aclIdentifier, { ...params }) -> ACLUpdateResponse -- client.magicTransit.sites.acls.list(accountIdentifier, siteIdentifier) -> ACLListResponse -- client.magicTransit.sites.acls.delete(accountIdentifier, siteIdentifier, aclIdentifier) -> ACLDeleteResponse -- client.magicTransit.sites.acls.get(accountIdentifier, siteIdentifier, aclIdentifier) -> ACLGetResponse +- client.magicTransit.sites.acls.create(siteId, { ...params }) -> ACL +- client.magicTransit.sites.acls.update(siteId, aclId, { ...params }) -> ACL +- client.magicTransit.sites.acls.list(siteId, { ...params }) -> ACLsSinglePage +- client.magicTransit.sites.acls.delete(siteId, aclId, { ...params }) -> ACL +- client.magicTransit.sites.acls.edit(siteId, aclId, { ...params }) -> ACL +- client.magicTransit.sites.acls.get(siteId, aclId, { ...params }) -> ACL -### Lans +### LANs Types: -- LanCreateResponse -- LanUpdateResponse -- LanListResponse -- LanDeleteResponse -- LanGetResponse +- DHCPRelay +- DHCPServer +- LAN +- LANStaticAddressing +- Nat +- RoutedSubnet Methods: -- client.magicTransit.sites.lans.create(accountIdentifier, siteIdentifier, { ...params }) -> LanCreateResponse -- client.magicTransit.sites.lans.update(accountIdentifier, siteIdentifier, lanIdentifier, { ...params }) -> LanUpdateResponse -- client.magicTransit.sites.lans.list(accountIdentifier, siteIdentifier) -> LanListResponse -- client.magicTransit.sites.lans.delete(accountIdentifier, siteIdentifier, lanIdentifier) -> LanDeleteResponse -- client.magicTransit.sites.lans.get(accountIdentifier, siteIdentifier, lanIdentifier) -> LanGetResponse +- client.magicTransit.sites.lans.create(siteId, { ...params }) -> LANsSinglePage +- client.magicTransit.sites.lans.update(siteId, lanId, { ...params }) -> LAN +- client.magicTransit.sites.lans.list(siteId, { ...params }) -> LANsSinglePage +- client.magicTransit.sites.lans.delete(siteId, lanId, { ...params }) -> LAN +- client.magicTransit.sites.lans.edit(siteId, lanId, { ...params }) -> LAN +- client.magicTransit.sites.lans.get(siteId, lanId, { ...params }) -> LAN -### Wans +### WANs Types: -- WanCreateResponse -- WanUpdateResponse -- WanListResponse -- WanDeleteResponse -- WanGetResponse +- WAN +- WANStaticAddressing Methods: -- client.magicTransit.sites.wans.create(accountIdentifier, siteIdentifier, { ...params }) -> WanCreateResponse -- client.magicTransit.sites.wans.update(accountIdentifier, siteIdentifier, wanIdentifier, { ...params }) -> WanUpdateResponse -- client.magicTransit.sites.wans.list(accountIdentifier, siteIdentifier) -> WanListResponse -- client.magicTransit.sites.wans.delete(accountIdentifier, siteIdentifier, wanIdentifier) -> WanDeleteResponse -- client.magicTransit.sites.wans.get(accountIdentifier, siteIdentifier, wanIdentifier) -> WanGetResponse +- client.magicTransit.sites.wans.create(siteId, { ...params }) -> WANsSinglePage +- client.magicTransit.sites.wans.update(siteId, wanId, { ...params }) -> WAN +- client.magicTransit.sites.wans.list(siteId, { ...params }) -> WANsSinglePage +- client.magicTransit.sites.wans.delete(siteId, wanId, { ...params }) -> WAN +- client.magicTransit.sites.wans.edit(siteId, wanId, { ...params }) -> WAN +- client.magicTransit.sites.wans.get(siteId, wanId, { ...params }) -> WAN -# MagicNetworkMonitoring - -## Configs +## Connectors Types: -- MagicVisibilityMNMConfig +- ConnectorCreateResponse +- ConnectorUpdateResponse +- ConnectorListResponse +- ConnectorDeleteResponse +- ConnectorEditResponse +- ConnectorGetResponse Methods: -- client.magicNetworkMonitoring.configs.create(accountIdentifier) -> MagicVisibilityMNMConfig -- client.magicNetworkMonitoring.configs.update(accountIdentifier) -> MagicVisibilityMNMConfig -- client.magicNetworkMonitoring.configs.delete(accountIdentifier) -> MagicVisibilityMNMConfig -- client.magicNetworkMonitoring.configs.edit(accountIdentifier) -> MagicVisibilityMNMConfig -- client.magicNetworkMonitoring.configs.get(accountIdentifier) -> MagicVisibilityMNMConfig +- client.magicTransit.connectors.create({ ...params }) -> ConnectorCreateResponse +- client.magicTransit.connectors.update(connectorId, { ...params }) -> ConnectorUpdateResponse +- client.magicTransit.connectors.list({ ...params }) -> ConnectorListResponsesSinglePage +- client.magicTransit.connectors.delete(connectorId, { ...params }) -> ConnectorDeleteResponse +- client.magicTransit.connectors.edit(connectorId, { ...params }) -> ConnectorEditResponse +- client.magicTransit.connectors.get(connectorId, { ...params }) -> ConnectorGetResponse -### Full +### Events + +Types: + +- EventListResponse +- EventGetResponse + +Methods: + +- client.magicTransit.connectors.events.list(connectorId, { ...params }) -> EventListResponse +- client.magicTransit.connectors.events.get(connectorId, eventT, eventN, { ...params }) -> EventGetResponse + +#### Latest + +Types: + +- LatestListResponse + +Methods: + +- client.magicTransit.connectors.events.latest.list(connectorId, { ...params }) -> LatestListResponse + +### Snapshots + +Types: + +- SnapshotListResponse +- SnapshotGetResponse + +Methods: + +- client.magicTransit.connectors.snapshots.list(connectorId, { ...params }) -> SnapshotListResponse +- client.magicTransit.connectors.snapshots.get(connectorId, snapshotT, { ...params }) -> SnapshotGetResponse + +#### Latest + +Types: + +- LatestListResponse + +Methods: + +- client.magicTransit.connectors.snapshots.latest.list(connectorId, { ...params }) -> LatestListResponse + +## PCAPs + +Types: + +- PCAP +- PCAPFilter +- PCAPCreateResponse +- PCAPListResponse +- PCAPGetResponse + +Methods: + +- client.magicTransit.pcaps.create({ ...params }) -> PCAPCreateResponse +- client.magicTransit.pcaps.list({ ...params }) -> PCAPListResponsesSinglePage +- client.magicTransit.pcaps.get(pcapId, { ...params }) -> PCAPGetResponse +- client.magicTransit.pcaps.stop(pcapId, { ...params }) -> void + +### Ownership + +Types: + +- Ownership + +Methods: + +- client.magicTransit.pcaps.ownership.create({ ...params }) -> Ownership +- client.magicTransit.pcaps.ownership.delete(ownershipId, { ...params }) -> void +- client.magicTransit.pcaps.ownership.get({ ...params }) -> OwnershipsSinglePage +- client.magicTransit.pcaps.ownership.validate({ ...params }) -> Ownership + +### Download + +Methods: + +- client.magicTransit.pcaps.download.get(pcapId, { ...params }) -> Response + +# MagicNetworkMonitoring + +## VPCFlows + +### Tokens + +Types: + +- TokenCreateResponse + +Methods: + +- client.magicNetworkMonitoring.vpcFlows.tokens.create({ ...params }) -> TokenCreateResponse + +## Configs + +Types: + +- Configuration + +Methods: + +- client.magicNetworkMonitoring.configs.create({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.update({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.delete({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.edit({ ...params }) -> Configuration +- client.magicNetworkMonitoring.configs.get({ ...params }) -> Configuration + +### Full Methods: -- client.magicNetworkMonitoring.configs.full.get(accountIdentifier) -> MagicVisibilityMNMConfig +- client.magicNetworkMonitoring.configs.full.get({ ...params }) -> Configuration ## Rules Types: -- MagicVisibilityMNMRule -- RuleListResponse +- MagicNetworkMonitoringRule Methods: -- client.magicNetworkMonitoring.rules.create(accountIdentifier) -> MagicVisibilityMNMRule | null -- client.magicNetworkMonitoring.rules.update(accountIdentifier) -> MagicVisibilityMNMRule | null -- client.magicNetworkMonitoring.rules.list(accountIdentifier) -> RuleListResponse | null -- client.magicNetworkMonitoring.rules.delete(accountIdentifier, ruleIdentifier) -> MagicVisibilityMNMRule | null -- client.magicNetworkMonitoring.rules.edit(accountIdentifier, ruleIdentifier) -> MagicVisibilityMNMRule | null -- client.magicNetworkMonitoring.rules.get(accountIdentifier, ruleIdentifier) -> MagicVisibilityMNMRule | null +- client.magicNetworkMonitoring.rules.create({ ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.update({ ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.list({ ...params }) -> MagicNetworkMonitoringRulesSinglePage +- client.magicNetworkMonitoring.rules.delete(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.edit(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null +- client.magicNetworkMonitoring.rules.get(ruleId, { ...params }) -> MagicNetworkMonitoringRule | null ### Advertisements Types: -- MagicVisibilityMNMRuleAdvertisable +- Advertisement Methods: -- client.magicNetworkMonitoring.rules.advertisements.edit(accountIdentifier, ruleIdentifier) -> MagicVisibilityMNMRuleAdvertisable | null +- client.magicNetworkMonitoring.rules.advertisements.edit(ruleId, { ...params }) -> Advertisement | null -# MTLSCertificates +# MagicCloudNetworking + +## CatalogSyncs Types: -- TLSCertificatesAndHostnamesCertificateObjectPost -- TLSCertificatesAndHostnamesComponentsSchemasCertificateObject -- MTLSCertificateListResponse +- CatalogSyncCreateResponse +- CatalogSyncUpdateResponse +- CatalogSyncListResponse +- CatalogSyncDeleteResponse +- CatalogSyncEditResponse +- CatalogSyncGetResponse +- CatalogSyncRefreshResponse Methods: -- client.mtlsCertificates.create({ ...params }) -> TLSCertificatesAndHostnamesCertificateObjectPost -- client.mtlsCertificates.list({ ...params }) -> MTLSCertificateListResponse | null -- client.mtlsCertificates.delete(mtlsCertificateId, { ...params }) -> TLSCertificatesAndHostnamesComponentsSchemasCertificateObject -- client.mtlsCertificates.get(mtlsCertificateId, { ...params }) -> TLSCertificatesAndHostnamesComponentsSchemasCertificateObject +- client.magicCloudNetworking.catalogSyncs.create({ ...params }) -> CatalogSyncCreateResponse +- client.magicCloudNetworking.catalogSyncs.update(syncId, { ...params }) -> CatalogSyncUpdateResponse +- client.magicCloudNetworking.catalogSyncs.list({ ...params }) -> CatalogSyncListResponsesSinglePage +- client.magicCloudNetworking.catalogSyncs.delete(syncId, { ...params }) -> CatalogSyncDeleteResponse +- client.magicCloudNetworking.catalogSyncs.edit(syncId, { ...params }) -> CatalogSyncEditResponse +- client.magicCloudNetworking.catalogSyncs.get(syncId, { ...params }) -> CatalogSyncGetResponse +- client.magicCloudNetworking.catalogSyncs.refresh(syncId, { ...params }) -> CatalogSyncRefreshResponse -## Associations +### PrebuiltPolicies Types: -- TLSCertificatesAndHostnamesAssociationObject -- AssociationGetResponse +- PrebuiltPolicyListResponse Methods: -- client.mtlsCertificates.associations.get(mtlsCertificateId, { ...params }) -> AssociationGetResponse | null +- client.magicCloudNetworking.catalogSyncs.prebuiltPolicies.list({ ...params }) -> PrebuiltPolicyListResponsesSinglePage -# Pages +## OnRamps -## Projects +Types: + +- OnRampCreateResponse +- OnRampUpdateResponse +- OnRampListResponse +- OnRampDeleteResponse +- OnRampApplyResponse +- OnRampEditResponse +- OnRampGetResponse +- OnRampPlanResponse + +Methods: + +- client.magicCloudNetworking.onRamps.create({ ...params }) -> OnRampCreateResponse +- client.magicCloudNetworking.onRamps.update(onrampId, { ...params }) -> OnRampUpdateResponse +- client.magicCloudNetworking.onRamps.list({ ...params }) -> OnRampListResponsesSinglePage +- client.magicCloudNetworking.onRamps.delete(onrampId, { ...params }) -> OnRampDeleteResponse +- client.magicCloudNetworking.onRamps.apply(onrampId, { ...params }) -> OnRampApplyResponse +- client.magicCloudNetworking.onRamps.edit(onrampId, { ...params }) -> OnRampEditResponse +- client.magicCloudNetworking.onRamps.export(onrampId, { ...params }) -> Response +- client.magicCloudNetworking.onRamps.get(onrampId, { ...params }) -> OnRampGetResponse +- client.magicCloudNetworking.onRamps.plan(onrampId, { ...params }) -> OnRampPlanResponse + +### AddressSpaces Types: -- PagesDeployments -- PagesProjects -- ProjectCreateResponse -- ProjectListResponse -- ProjectDeleteResponse -- ProjectEditResponse -- ProjectPurgeBuildCacheResponse +- AddressSpaceUpdateResponse +- AddressSpaceListResponse +- AddressSpaceEditResponse Methods: -- client.pages.projects.create({ ...params }) -> ProjectCreateResponse -- client.pages.projects.list({ ...params }) -> ProjectListResponse -- client.pages.projects.delete(projectName, { ...params }) -> unknown -- client.pages.projects.edit(projectName, { ...params }) -> ProjectEditResponse -- client.pages.projects.get(projectName, { ...params }) -> PagesProjects -- client.pages.projects.purgeBuildCache(projectName, { ...params }) -> unknown +- client.magicCloudNetworking.onRamps.addressSpaces.update({ ...params }) -> AddressSpaceUpdateResponse +- client.magicCloudNetworking.onRamps.addressSpaces.list({ ...params }) -> AddressSpaceListResponse +- client.magicCloudNetworking.onRamps.addressSpaces.edit({ ...params }) -> AddressSpaceEditResponse -### Deployments +## CloudIntegrations Types: -- DeploymentListResponse -- DeploymentDeleteResponse +- CloudIntegrationCreateResponse +- CloudIntegrationUpdateResponse +- CloudIntegrationListResponse +- CloudIntegrationDeleteResponse +- CloudIntegrationDiscoverResponse +- CloudIntegrationDiscoverAllResponse +- CloudIntegrationEditResponse +- CloudIntegrationGetResponse +- CloudIntegrationInitialSetupResponse Methods: -- client.pages.projects.deployments.create(projectName, { ...params }) -> PagesDeployments -- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentListResponse -- client.pages.projects.deployments.delete(projectName, deploymentId, { ...params }) -> unknown -- client.pages.projects.deployments.get(projectName, deploymentId, { ...params }) -> PagesDeployments -- client.pages.projects.deployments.retry(projectName, deploymentId, { ...params }) -> PagesDeployments -- client.pages.projects.deployments.rollback(projectName, deploymentId, { ...params }) -> PagesDeployments +- client.magicCloudNetworking.cloudIntegrations.create({ ...params }) -> CloudIntegrationCreateResponse +- client.magicCloudNetworking.cloudIntegrations.update(providerId, { ...params }) -> CloudIntegrationUpdateResponse +- client.magicCloudNetworking.cloudIntegrations.list({ ...params }) -> CloudIntegrationListResponsesSinglePage +- client.magicCloudNetworking.cloudIntegrations.delete(providerId, { ...params }) -> CloudIntegrationDeleteResponse +- client.magicCloudNetworking.cloudIntegrations.discover(providerId, { ...params }) -> CloudIntegrationDiscoverResponse +- client.magicCloudNetworking.cloudIntegrations.discoverAll({ ...params }) -> CloudIntegrationDiscoverAllResponse +- client.magicCloudNetworking.cloudIntegrations.edit(providerId, { ...params }) -> CloudIntegrationEditResponse +- client.magicCloudNetworking.cloudIntegrations.get(providerId, { ...params }) -> CloudIntegrationGetResponse +- client.magicCloudNetworking.cloudIntegrations.initialSetup(providerId, { ...params }) -> CloudIntegrationInitialSetupResponse -#### History +## Resources -##### Logs +Types: + +- ResourceListResponse +- ResourceGetResponse +- ResourcePolicyPreviewResponse + +Methods: + +- client.magicCloudNetworking.resources.list({ ...params }) -> ResourceListResponsesV4PagePaginationArray +- client.magicCloudNetworking.resources.export({ ...params }) -> Response +- client.magicCloudNetworking.resources.get(resourceId, { ...params }) -> ResourceGetResponse +- client.magicCloudNetworking.resources.policyPreview({ ...params }) -> ResourcePolicyPreviewResponse + +# NetworkInterconnects + +## CNIs Types: -- LogGetResponse +- CNICreateResponse +- CNIUpdateResponse +- CNIListResponse +- CNIGetResponse Methods: -- client.pages.projects.deployments.history.logs.get(projectName, deploymentId, { ...params }) -> LogGetResponse +- client.networkInterconnects.cnis.create({ ...params }) -> CNICreateResponse +- client.networkInterconnects.cnis.update(cni, { ...params }) -> CNIUpdateResponse +- client.networkInterconnects.cnis.list({ ...params }) -> CNIListResponse +- client.networkInterconnects.cnis.delete(cni, { ...params }) -> void +- client.networkInterconnects.cnis.get(cni, { ...params }) -> CNIGetResponse -### Domains +## Interconnects Types: -- DomainCreateResponse -- DomainListResponse -- DomainDeleteResponse -- DomainEditResponse -- DomainGetResponse +- InterconnectCreateResponse +- InterconnectListResponse +- InterconnectGetResponse +- InterconnectStatusResponse Methods: -- client.pages.projects.domains.create(projectName, { ...params }) -> DomainCreateResponse | null -- client.pages.projects.domains.list(projectName, { ...params }) -> DomainListResponse -- client.pages.projects.domains.delete(projectName, domainName, { ...params }) -> unknown -- client.pages.projects.domains.edit(projectName, domainName, { ...params }) -> DomainEditResponse | null -- client.pages.projects.domains.get(projectName, domainName, { ...params }) -> DomainGetResponse | null +- client.networkInterconnects.interconnects.create({ ...params }) -> InterconnectCreateResponse +- client.networkInterconnects.interconnects.list({ ...params }) -> InterconnectListResponse +- client.networkInterconnects.interconnects.delete(icon, { ...params }) -> void +- client.networkInterconnects.interconnects.get(icon, { ...params }) -> InterconnectGetResponse +- client.networkInterconnects.interconnects.loa(icon, { ...params }) -> void +- client.networkInterconnects.interconnects.status(icon, { ...params }) -> InterconnectStatusResponse -# PCAPs +## Settings Types: -- PCAPCreateResponse -- PCAPListResponse -- PCAPGetResponse +- SettingUpdateResponse +- SettingGetResponse Methods: -- client.pcaps.create({ ...params }) -> PCAPCreateResponse -- client.pcaps.list({ ...params }) -> PCAPListResponse | null -- client.pcaps.get(pcapId, { ...params }) -> PCAPGetResponse +- client.networkInterconnects.settings.update({ ...params }) -> SettingUpdateResponse +- client.networkInterconnects.settings.get({ ...params }) -> SettingGetResponse -## Ownerships +## Slots Types: -- MagicVisibilityPCAPsOwnership -- OwnershipGetResponse +- SlotListResponse +- SlotGetResponse Methods: -- client.pcaps.ownerships.create({ ...params }) -> MagicVisibilityPCAPsOwnership -- client.pcaps.ownerships.delete(ownershipId, { ...params }) -> void -- client.pcaps.ownerships.get({ ...params }) -> OwnershipGetResponse | null -- client.pcaps.ownerships.validate({ ...params }) -> MagicVisibilityPCAPsOwnership +- client.networkInterconnects.slots.list({ ...params }) -> SlotListResponse +- client.networkInterconnects.slots.get(slot, { ...params }) -> SlotGetResponse -## Downloads +# MTLSCertificates + +Types: + +- MTLSCertificate +- MTLSCertificateCreateResponse + +Methods: + +- client.mtlsCertificates.create({ ...params }) -> MTLSCertificateCreateResponse +- client.mtlsCertificates.list({ ...params }) -> MTLSCertificatesSinglePage +- client.mtlsCertificates.delete(mtlsCertificateId, { ...params }) -> MTLSCertificate +- client.mtlsCertificates.get(mtlsCertificateId, { ...params }) -> MTLSCertificate + +## Associations + +Types: + +- CertificateAsssociation + +Methods: + +- client.mtlsCertificates.associations.get(mtlsCertificateId, { ...params }) -> CertificateAsssociationsSinglePage + +# Pages + +## Projects + +Types: + +- Deployment +- Project +- Stage +- ProjectDeleteResponse +- ProjectPurgeBuildCacheResponse + +Methods: + +- client.pages.projects.create({ ...params }) -> Project +- client.pages.projects.list({ ...params }) -> ProjectsV4PagePaginationArray +- client.pages.projects.delete(projectName, { ...params }) -> ProjectDeleteResponse | null +- client.pages.projects.edit(projectName, { ...params }) -> Project +- client.pages.projects.get(projectName, { ...params }) -> Project +- client.pages.projects.purgeBuildCache(projectName, { ...params }) -> ProjectPurgeBuildCacheResponse | null + +### Deployments + +Types: + +- DeploymentDeleteResponse + +Methods: + +- client.pages.projects.deployments.create(projectName, { ...params }) -> Deployment +- client.pages.projects.deployments.list(projectName, { ...params }) -> DeploymentsV4PagePaginationArray +- client.pages.projects.deployments.delete(projectName, deploymentId, { ...params }) -> DeploymentDeleteResponse | null +- client.pages.projects.deployments.get(projectName, deploymentId, { ...params }) -> Deployment +- client.pages.projects.deployments.retry(projectName, deploymentId, { ...params }) -> Deployment +- client.pages.projects.deployments.rollback(projectName, deploymentId, { ...params }) -> Deployment + +#### History + +##### Logs + +Types: + +- LogGetResponse Methods: -- client.pcaps.downloads.get(pcapId, { ...params }) -> Response +- client.pages.projects.deployments.history.logs.get(projectName, deploymentId, { ...params }) -> LogGetResponse + +### Domains + +Types: + +- DomainCreateResponse +- DomainListResponse +- DomainDeleteResponse +- DomainEditResponse +- DomainGetResponse + +Methods: + +- client.pages.projects.domains.create(projectName, { ...params }) -> DomainCreateResponse +- client.pages.projects.domains.list(projectName, { ...params }) -> DomainListResponsesSinglePage +- client.pages.projects.domains.delete(projectName, domainName, { ...params }) -> DomainDeleteResponse | null +- client.pages.projects.domains.edit(projectName, domainName, { ...params }) -> DomainEditResponse +- client.pages.projects.domains.get(projectName, domainName, { ...params }) -> DomainGetResponse # Registrar @@ -3580,15 +4034,14 @@ Methods: Types: -- RegistrarAPIDomains +- Domain - DomainUpdateResponse -- DomainListResponse - DomainGetResponse Methods: - client.registrar.domains.update(domainName, { ...params }) -> DomainUpdateResponse | null -- client.registrar.domains.list({ ...params }) -> DomainListResponse | null +- client.registrar.domains.list({ ...params }) -> DomainsSinglePage - client.registrar.domains.get(domainName, { ...params }) -> DomainGetResponse | null # RequestTracers @@ -3597,12 +4050,13 @@ Methods: Types: -- RequestTracerTrace +- Trace +- TraceItem - TraceCreateResponse Methods: -- client.requestTracers.traces.create(accountIdentifier, { ...params }) -> TraceCreateResponse +- client.requestTracers.traces.create({ ...params }) -> TraceCreateResponse # Rules @@ -3610,17 +4064,21 @@ Methods: Types: +- Hostname - ListsList -- ListListResponse +- Redirect +- ListCreateResponse +- ListUpdateResponse - ListDeleteResponse +- ListGetResponse Methods: -- client.rules.lists.create({ ...params }) -> ListsList | null -- client.rules.lists.update(listId, { ...params }) -> ListsList | null -- client.rules.lists.list({ ...params }) -> ListListResponse | null -- client.rules.lists.delete(listId, { ...params }) -> ListDeleteResponse | null -- client.rules.lists.get(listId, { ...params }) -> ListsList | null +- client.rules.lists.create({ ...params }) -> ListCreateResponse +- client.rules.lists.update(listId, { ...params }) -> ListUpdateResponse +- client.rules.lists.list({ ...params }) -> ListsListsSinglePage +- client.rules.lists.delete(listId, { ...params }) -> ListDeleteResponse +- client.rules.lists.get(listId, { ...params }) -> ListGetResponse ### BulkOperations @@ -3630,12 +4088,14 @@ Types: Methods: -- client.rules.lists.bulkOperations.get(accountIdentifier, operationId) -> BulkOperationGetResponse | null +- client.rules.lists.bulkOperations.get(operationId, { ...params }) -> BulkOperationGetResponse ### Items Types: +- ListCursor +- ListItem - ItemCreateResponse - ItemUpdateResponse - ItemListResponse @@ -3644,54 +4104,40 @@ Types: Methods: -- client.rules.lists.items.create(listId, [ ...body ]) -> ItemCreateResponse | null -- client.rules.lists.items.update(listId, [ ...body ]) -> ItemUpdateResponse | null -- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponsesCursorPagination -- client.rules.lists.items.delete(listId, { ...params }) -> ItemDeleteResponse | null -- client.rules.lists.items.get(accountIdentifier, listId, itemId) -> ItemGetResponse | null - -# Storage - -## Analytics - -Types: - -- WorkersKVComponentsSchemasResult -- WorkersKVSchemasResult - -Methods: - -- client.storage.analytics.list({ ...params }) -> WorkersKVSchemasResult -- client.storage.analytics.stored({ ...params }) -> WorkersKVComponentsSchemasResult +- client.rules.lists.items.create(listId, [ ...body ]) -> ItemCreateResponse +- client.rules.lists.items.update(listId, [ ...body ]) -> ItemUpdateResponse +- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponsesCursorPaginationAfter +- client.rules.lists.items.delete(listId, { ...params }) -> ItemDeleteResponse +- client.rules.lists.items.get(listId, itemId, { ...params }) -> ItemGetResponse # Stream Types: -- StreamVideos -- StreamListResponse +- AllowedOrigins +- Video Methods: - client.stream.create({ ...params }) -> void -- client.stream.list({ ...params }) -> StreamListResponse +- client.stream.list({ ...params }) -> VideosSinglePage - client.stream.delete(identifier, { ...params }) -> void -- client.stream.get(identifier, { ...params }) -> StreamVideos +- client.stream.edit(identifier, { ...params }) -> Video +- client.stream.get(identifier, { ...params }) -> Video ## AudioTracks Types: -- StreamAdditionalAudio +- Audio - AudioTrackDeleteResponse -- AudioTrackGetResponse Methods: - client.stream.audioTracks.delete(identifier, audioIdentifier, { ...params }) -> AudioTrackDeleteResponse -- client.stream.audioTracks.copy(identifier, { ...params }) -> StreamAdditionalAudio -- client.stream.audioTracks.edit(identifier, audioIdentifier, { ...params }) -> StreamAdditionalAudio -- client.stream.audioTracks.get(identifier, { ...params }) -> AudioTrackGetResponse +- client.stream.audioTracks.copy(identifier, { ...params }) -> Audio +- client.stream.audioTracks.edit(identifier, audioIdentifier, { ...params }) -> Audio +- client.stream.audioTracks.get(identifier, { ...params }) -> AudioSinglePage ## Videos @@ -3703,91 +4149,87 @@ Methods: - client.stream.videos.storageUsage({ ...params }) -> VideoStorageUsageResponse -## Clips +## Clip Types: -- StreamClipping +- Clip Methods: -- client.stream.clips.create({ ...params }) -> StreamClipping +- client.stream.clip.create({ ...params }) -> Clip -## Copies +## Copy Methods: -- client.stream.copies.create({ ...params }) -> StreamVideos +- client.stream.copy.create({ ...params }) -> Video -## DirectUploads +## DirectUpload Types: -- DirectUploadCreateResponse +- DirectUploadCreateResponse Methods: -- client.stream.directUploads.create({ ...params }) -> DirectUploadCreateResponse +- client.stream.directUpload.create({ ...params }) -> DirectUploadCreateResponse ## Keys Types: -- StreamKeys +- Keys - KeyDeleteResponse - KeyGetResponse Methods: -- client.stream.keys.create({ ...params }) -> StreamKeys +- client.stream.keys.create({ ...params }) -> Keys - client.stream.keys.delete(identifier, { ...params }) -> KeyDeleteResponse -- client.stream.keys.get({ ...params }) -> KeyGetResponse +- client.stream.keys.get({ ...params }) -> KeyGetResponsesSinglePage ## LiveInputs Types: -- StreamLiveInput +- LiveInput - LiveInputListResponse Methods: -- client.stream.liveInputs.create({ ...params }) -> StreamLiveInput -- client.stream.liveInputs.update(liveInputIdentifier, { ...params }) -> StreamLiveInput +- client.stream.liveInputs.create({ ...params }) -> LiveInput +- client.stream.liveInputs.update(liveInputIdentifier, { ...params }) -> LiveInput - client.stream.liveInputs.list({ ...params }) -> LiveInputListResponse - client.stream.liveInputs.delete(liveInputIdentifier, { ...params }) -> void -- client.stream.liveInputs.get(liveInputIdentifier, { ...params }) -> StreamLiveInput +- client.stream.liveInputs.get(liveInputIdentifier, { ...params }) -> LiveInput ### Outputs Types: -- StreamOutput -- OutputListResponse +- Output Methods: -- client.stream.liveInputs.outputs.create(liveInputIdentifier, { ...params }) -> StreamOutput -- client.stream.liveInputs.outputs.update(liveInputIdentifier, outputIdentifier, { ...params }) -> StreamOutput -- client.stream.liveInputs.outputs.list(liveInputIdentifier, { ...params }) -> OutputListResponse +- client.stream.liveInputs.outputs.create(liveInputIdentifier, { ...params }) -> Output +- client.stream.liveInputs.outputs.update(liveInputIdentifier, outputIdentifier, { ...params }) -> Output +- client.stream.liveInputs.outputs.list(liveInputIdentifier, { ...params }) -> OutputsSinglePage - client.stream.liveInputs.outputs.delete(liveInputIdentifier, outputIdentifier, { ...params }) -> void ## Watermarks Types: -- StreamWatermarks -- WatermarkCreateResponse -- WatermarkListResponse +- Watermark - WatermarkDeleteResponse -- WatermarkGetResponse Methods: -- client.stream.watermarks.create({ ...params }) -> WatermarkCreateResponse -- client.stream.watermarks.list({ ...params }) -> WatermarkListResponse +- client.stream.watermarks.create({ ...params }) -> Watermark +- client.stream.watermarks.list({ ...params }) -> WatermarksSinglePage - client.stream.watermarks.delete(identifier, { ...params }) -> WatermarkDeleteResponse -- client.stream.watermarks.get(identifier, { ...params }) -> WatermarkGetResponse +- client.stream.watermarks.get(identifier, { ...params }) -> Watermark ## Webhooks @@ -3807,16 +4249,34 @@ Methods: Types: -- StreamCaptions -- CaptionUpdateResponse -- CaptionDeleteResponse -- CaptionGetResponse +- Caption + +Methods: + +- client.stream.captions.get(identifier, { ...params }) -> CaptionsSinglePage + +### Language + +Types: + +- LanguageDeleteResponse + +Methods: + +- client.stream.captions.language.create(identifier, language, { ...params }) -> Caption +- client.stream.captions.language.update(identifier, language, { ...params }) -> Caption +- client.stream.captions.language.delete(identifier, language, { ...params }) -> LanguageDeleteResponse +- client.stream.captions.language.get(identifier, language, { ...params }) -> Caption + +#### Vtt + +Types: + +- VttGetResponse Methods: -- client.stream.captions.update(identifier, language, { ...params }) -> CaptionUpdateResponse -- client.stream.captions.delete(identifier, language, { ...params }) -> CaptionDeleteResponse -- client.stream.captions.get(identifier, { ...params }) -> CaptionGetResponse +- client.stream.captions.language.vtt.get(identifier, language, { ...params }) -> string ## Downloads @@ -3832,1312 +4292,2512 @@ Methods: - client.stream.downloads.delete(identifier, { ...params }) -> DownloadDeleteResponse - client.stream.downloads.get(identifier, { ...params }) -> DownloadGetResponse -## Embeds +## Embed Types: -- EmbedGetResponse +- EmbedGetResponse Methods: -- client.stream.embeds.get(identifier, { ...params }) -> unknown +- client.stream.embed.get(identifier, { ...params }) -> string -## Tokens +## Token Types: -- TokenCreateResponse +- TokenCreateResponse Methods: -- client.stream.tokens.create(identifier, { ...params }) -> TokenCreateResponse +- client.stream.token.create(identifier, { ...params }) -> TokenCreateResponse # Alerting -## V3 +## AvailableAlerts Types: -- V3ListResponse +- AvailableAlertListResponse Methods: -- client.alerting.v3.list({ ...params }) -> V3ListResponse | null +- client.alerting.availableAlerts.list({ ...params }) -> AvailableAlertListResponse -### Destinations +## Destinations -#### Eligible +### Eligible Types: -- EligibleGetResponse +- EligibleGetResponse Methods: -- client.alerting.v3.destinations.eligible.get({ ...params }) -> EligibleGetResponse | null +- client.alerting.destinations.eligible.get({ ...params }) -> EligibleGetResponse -#### Pagerduty +### Pagerduty Types: -- PagerdutyCreateResponse -- PagerdutyDeleteResponse -- PagerdutyGetResponse -- PagerdutyLinkResponse +- Pagerduty +- PagerdutyCreateResponse +- PagerdutyDeleteResponse +- PagerdutyLinkResponse Methods: -- client.alerting.v3.destinations.pagerduty.create({ ...params }) -> PagerdutyCreateResponse -- client.alerting.v3.destinations.pagerduty.delete({ ...params }) -> PagerdutyDeleteResponse | null -- client.alerting.v3.destinations.pagerduty.get({ ...params }) -> PagerdutyGetResponse | null -- client.alerting.v3.destinations.pagerduty.link(tokenId, { ...params }) -> PagerdutyLinkResponse +- client.alerting.destinations.pagerduty.create({ ...params }) -> PagerdutyCreateResponse +- client.alerting.destinations.pagerduty.delete({ ...params }) -> PagerdutyDeleteResponse +- client.alerting.destinations.pagerduty.get({ ...params }) -> PagerdutiesSinglePage +- client.alerting.destinations.pagerduty.link(tokenId, { ...params }) -> PagerdutyLinkResponse -#### Webhooks +### Webhooks Types: -- WebhookCreateResponse -- WebhookUpdateResponse -- WebhookListResponse -- WebhookDeleteResponse -- WebhookGetResponse +- Webhooks +- WebhookCreateResponse +- WebhookUpdateResponse +- WebhookDeleteResponse Methods: -- client.alerting.v3.destinations.webhooks.create({ ...params }) -> WebhookCreateResponse -- client.alerting.v3.destinations.webhooks.update(webhookId, { ...params }) -> WebhookUpdateResponse -- client.alerting.v3.destinations.webhooks.list({ ...params }) -> WebhookListResponse | null -- client.alerting.v3.destinations.webhooks.delete(webhookId, { ...params }) -> WebhookDeleteResponse | null -- client.alerting.v3.destinations.webhooks.get(webhookId, { ...params }) -> WebhookGetResponse +- client.alerting.destinations.webhooks.create({ ...params }) -> WebhookCreateResponse +- client.alerting.destinations.webhooks.update(webhookId, { ...params }) -> WebhookUpdateResponse +- client.alerting.destinations.webhooks.list({ ...params }) -> WebhooksSinglePage +- client.alerting.destinations.webhooks.delete(webhookId, { ...params }) -> WebhookDeleteResponse +- client.alerting.destinations.webhooks.get(webhookId, { ...params }) -> Webhooks -### Histories +## History Types: -- HistoryListResponse +- History Methods: -- client.alerting.v3.histories.list({ ...params }) -> HistoryListResponsesV4PagePaginationArray +- client.alerting.history.list({ ...params }) -> HistoriesV4PagePaginationArray -### Policies +## Policies Types: -- PolicyCreateResponse -- PolicyUpdateResponse -- PolicyListResponse -- PolicyDeleteResponse -- PolicyGetResponse +- Mechanism +- Policy +- PolicyFilter +- PolicyCreateResponse +- PolicyUpdateResponse +- PolicyDeleteResponse Methods: -- client.alerting.v3.policies.create({ ...params }) -> PolicyCreateResponse -- client.alerting.v3.policies.update(policyId, { ...params }) -> PolicyUpdateResponse -- client.alerting.v3.policies.list({ ...params }) -> PolicyListResponse | null -- client.alerting.v3.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse | null -- client.alerting.v3.policies.get(policyId, { ...params }) -> PolicyGetResponse +- client.alerting.policies.create({ ...params }) -> PolicyCreateResponse +- client.alerting.policies.update(policyId, { ...params }) -> PolicyUpdateResponse +- client.alerting.policies.list({ ...params }) -> PoliciesSinglePage +- client.alerting.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse +- client.alerting.policies.get(policyId, { ...params }) -> Policy -# D1 - -## Database +## Silences Types: -- D1CreateDatabase -- D1DatabaseDetails -- D1QueryResult -- DatabaseDeleteResponse -- DatabaseQueryResponse +- SilenceCreateResponse +- SilenceUpdateResponse +- SilenceListResponse +- SilenceDeleteResponse +- SilenceGetResponse Methods: -- client.d1.database.create({ ...params }) -> D1CreateDatabase -- client.d1.database.list({ ...params }) -> D1CreateDatabasesV4PagePaginationArray -- client.d1.database.delete(accountIdentifier, databaseIdentifier) -> DatabaseDeleteResponse | null -- client.d1.database.get(accountIdentifier, databaseIdentifier) -> D1DatabaseDetails -- client.d1.database.query(accountIdentifier, databaseIdentifier, { ...params }) -> DatabaseQueryResponse - -# R2 +- client.alerting.silences.create([ ...body ]) -> SilenceCreateResponse +- client.alerting.silences.update([ ...body ]) -> SilenceUpdateResponsesSinglePage +- client.alerting.silences.list({ ...params }) -> SilenceListResponsesSinglePage +- client.alerting.silences.delete(silenceId, { ...params }) -> SilenceDeleteResponse +- client.alerting.silences.get(silenceId, { ...params }) -> SilenceGetResponse -## Buckets +# D1 Types: -- R2Bucket -- BucketDeleteResponse - -Methods: - -- client.r2.buckets.create({ ...params }) -> R2Bucket -- client.r2.buckets.list({ ...params }) -> R2BucketsCursorPagination -- client.r2.buckets.delete(bucketName, { ...params }) -> BucketDeleteResponse -- client.r2.buckets.get(bucketName, { ...params }) -> R2Bucket +- D1 -## Sippy +## Database Types: -- R2Sippy -- SippyDeleteResponse +- QueryResult +- DatabaseListResponse +- DatabaseDeleteResponse +- DatabaseExportResponse +- DatabaseImportResponse +- DatabaseRawResponse Methods: -- client.r2.sippy.update(bucketName, { ...params }) -> R2Sippy -- client.r2.sippy.delete(bucketName, { ...params }) -> SippyDeleteResponse -- client.r2.sippy.get(bucketName, { ...params }) -> R2Sippy +- client.d1.database.create({ ...params }) -> D1 +- client.d1.database.update(databaseId, { ...params }) -> D1 +- client.d1.database.list({ ...params }) -> DatabaseListResponsesV4PagePaginationArray +- client.d1.database.delete(databaseId, { ...params }) -> DatabaseDeleteResponse | null +- client.d1.database.edit(databaseId, { ...params }) -> D1 +- client.d1.database.export(databaseId, { ...params }) -> DatabaseExportResponse +- client.d1.database.get(databaseId, { ...params }) -> D1 +- client.d1.database.import(databaseId, { ...params }) -> DatabaseImportResponse +- client.d1.database.query(databaseId, { ...params }) -> QueryResultsSinglePage +- client.d1.database.raw(databaseId, { ...params }) -> DatabaseRawResponsesSinglePage -# WARPConnector +### TimeTravel Types: -- WARPConnectorCreateResponse -- WARPConnectorListResponse -- WARPConnectorDeleteResponse -- WARPConnectorEditResponse -- WARPConnectorGetResponse -- WARPConnectorTokenResponse +- TimeTravelGetBookmarkResponse +- TimeTravelRestoreResponse Methods: -- client.warpConnector.create({ ...params }) -> WARPConnectorCreateResponse -- client.warpConnector.list({ ...params }) -> WARPConnectorListResponsesV4PagePaginationArray -- client.warpConnector.delete(tunnelId, { ...params }) -> WARPConnectorDeleteResponse -- client.warpConnector.edit(tunnelId, { ...params }) -> WARPConnectorEditResponse -- client.warpConnector.get(tunnelId, { ...params }) -> WARPConnectorGetResponse -- client.warpConnector.token(tunnelId, { ...params }) -> WARPConnectorTokenResponse - -# WorkersForPlatforms +- client.d1.database.timeTravel.getBookmark(databaseId, { ...params }) -> TimeTravelGetBookmarkResponse +- client.d1.database.timeTravel.restore(databaseId, { ...params }) -> TimeTravelRestoreResponse -## Dispatch +# R2 -### Namespaces +## Buckets Types: -- NamespaceCreateResponse -- NamespaceListResponse -- NamespaceDeleteResponse -- NamespaceGetResponse +- Bucket +- BucketListResponse +- BucketDeleteResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.create({ ...params }) -> NamespaceCreateResponse -- client.workersForPlatforms.dispatch.namespaces.list({ ...params }) -> NamespaceListResponse -- client.workersForPlatforms.dispatch.namespaces.delete(dispatchNamespace, { ...params }) -> NamespaceDeleteResponse | null -- client.workersForPlatforms.dispatch.namespaces.get(dispatchNamespace, { ...params }) -> NamespaceGetResponse +- client.r2.buckets.create({ ...params }) -> Bucket +- client.r2.buckets.list({ ...params }) -> BucketListResponse +- client.r2.buckets.delete(bucketName, { ...params }) -> BucketDeleteResponse +- client.r2.buckets.edit(bucketName, { ...params }) -> Bucket +- client.r2.buckets.get(bucketName, { ...params }) -> Bucket -#### Scripts +### Lifecycle Types: -- WorkersNamespaceScript +- LifecycleUpdateResponse +- LifecycleGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.update(dispatchNamespace, scriptName, { ...params }) -> WorkersScript -- client.workersForPlatforms.dispatch.namespaces.scripts.delete(dispatchNamespace, scriptName, { ...params }) -> void -- client.workersForPlatforms.dispatch.namespaces.scripts.get(dispatchNamespace, scriptName, { ...params }) -> WorkersNamespaceScript +- client.r2.buckets.lifecycle.update(bucketName, { ...params }) -> LifecycleUpdateResponse +- client.r2.buckets.lifecycle.get(bucketName, { ...params }) -> LifecycleGetResponse -##### Content +### CORS + +Types: -###### Scripts +- CORSUpdateResponse +- CORSDeleteResponse +- CORSGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.update(dispatchNamespace, scriptName, { ...params }) -> WorkersScript -- client.workersForPlatforms.dispatch.namespaces.scripts.content.scripts.get(dispatchNamespace, scriptName, { ...params }) -> Response +- client.r2.buckets.cors.update(bucketName, { ...params }) -> CORSUpdateResponse +- client.r2.buckets.cors.delete(bucketName, { ...params }) -> CORSDeleteResponse +- client.r2.buckets.cors.get(bucketName, { ...params }) -> CORSGetResponse -###### Settings +### Domains + +#### Custom Types: -- SettingEditResponse -- SettingGetResponse +- CustomCreateResponse +- CustomUpdateResponse +- CustomListResponse +- CustomDeleteResponse +- CustomGetResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.settings.edit(dispatchNamespace, scriptName, { ...params }) -> SettingEditResponse -- client.workersForPlatforms.dispatch.namespaces.scripts.content.settings.get(dispatchNamespace, scriptName, { ...params }) -> SettingGetResponse +- client.r2.buckets.domains.custom.create(bucketName, { ...params }) -> CustomCreateResponse +- client.r2.buckets.domains.custom.update(bucketName, domain, { ...params }) -> CustomUpdateResponse +- client.r2.buckets.domains.custom.list(bucketName, { ...params }) -> CustomListResponse +- client.r2.buckets.domains.custom.delete(bucketName, domain, { ...params }) -> CustomDeleteResponse +- client.r2.buckets.domains.custom.get(bucketName, domain, { ...params }) -> CustomGetResponse -###### Bindings +#### Managed Types: -- BindingGetResponse +- ManagedUpdateResponse +- ManagedListResponse Methods: -- client.workersForPlatforms.dispatch.namespaces.scripts.content.bindings.get(dispatchNamespace, scriptName, { ...params }) -> BindingGetResponse - -# ZeroTrust +- client.r2.buckets.domains.managed.update(bucketName, { ...params }) -> ManagedUpdateResponse +- client.r2.buckets.domains.managed.list(bucketName, { ...params }) -> ManagedListResponse -## Devices +### EventNotifications Types: -- TeamsDevicesDevices -- DeviceListResponse -- DeviceGetResponse +- EventNotificationUpdateResponse +- EventNotificationListResponse +- EventNotificationDeleteResponse +- EventNotificationGetResponse Methods: -- client.zeroTrust.devices.list({ ...params }) -> DeviceListResponse | null -- client.zeroTrust.devices.get(deviceId, { ...params }) -> DeviceGetResponse | null +- client.r2.buckets.eventNotifications.update(bucketName, queueId, { ...params }) -> EventNotificationUpdateResponse +- client.r2.buckets.eventNotifications.list(bucketName, { ...params }) -> EventNotificationListResponse +- client.r2.buckets.eventNotifications.delete(bucketName, queueId, { ...params }) -> EventNotificationDeleteResponse +- client.r2.buckets.eventNotifications.get(bucketName, queueId, { ...params }) -> EventNotificationGetResponse -### DEXTests +### Locks Types: -- TeamsDevicesDeviceDEXTestSchemasHTTP -- DEXTestListResponse -- DEXTestDeleteResponse +- LockUpdateResponse +- LockGetResponse Methods: -- client.zeroTrust.devices.dexTests.create({ ...params }) -> TeamsDevicesDeviceDEXTestSchemasHTTP | null -- client.zeroTrust.devices.dexTests.update(dexTestId, { ...params }) -> TeamsDevicesDeviceDEXTestSchemasHTTP | null -- client.zeroTrust.devices.dexTests.list({ ...params }) -> DEXTestListResponse | null -- client.zeroTrust.devices.dexTests.delete(dexTestId, { ...params }) -> DEXTestDeleteResponse | null -- client.zeroTrust.devices.dexTests.get(dexTestId, { ...params }) -> TeamsDevicesDeviceDEXTestSchemasHTTP | null +- client.r2.buckets.locks.update(bucketName, { ...params }) -> LockUpdateResponse +- client.r2.buckets.locks.get(bucketName, { ...params }) -> LockGetResponse -### Networks +### Metrics Types: -- TeamsDevicesDeviceManagedNetworks -- NetworkListResponse -- NetworkDeleteResponse +- MetricListResponse Methods: -- client.zeroTrust.devices.networks.create({ ...params }) -> TeamsDevicesDeviceManagedNetworks | null -- client.zeroTrust.devices.networks.update(networkId, { ...params }) -> TeamsDevicesDeviceManagedNetworks | null -- client.zeroTrust.devices.networks.list({ ...params }) -> NetworkListResponse | null -- client.zeroTrust.devices.networks.delete(networkId, { ...params }) -> NetworkDeleteResponse | null -- client.zeroTrust.devices.networks.get(networkId, { ...params }) -> TeamsDevicesDeviceManagedNetworks | null +- client.r2.buckets.metrics.list({ ...params }) -> MetricListResponse -### Policies +### Sippy Types: -- TeamsDevicesDeviceSettingsPolicy -- PolicyListResponse -- PolicyDeleteResponse +- Provider +- Sippy +- SippyDeleteResponse Methods: -- client.zeroTrust.devices.policies.create({ ...params }) -> TeamsDevicesDeviceSettingsPolicy | null -- client.zeroTrust.devices.policies.list({ ...params }) -> PolicyListResponse | null -- client.zeroTrust.devices.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse | null -- client.zeroTrust.devices.policies.edit(policyId, { ...params }) -> TeamsDevicesDeviceSettingsPolicy | null -- client.zeroTrust.devices.policies.get(policyId, { ...params }) -> TeamsDevicesDeviceSettingsPolicy | null +- client.r2.buckets.sippy.update(bucketName, { ...params }) -> Sippy +- client.r2.buckets.sippy.delete(bucketName, { ...params }) -> SippyDeleteResponse +- client.r2.buckets.sippy.get(bucketName, { ...params }) -> Sippy -#### DefaultPolicy +## TemporaryCredentials Types: -- DefaultPolicyGetResponse +- TemporaryCredential +- TemporaryCredentialCreateResponse Methods: -- client.zeroTrust.devices.policies.defaultPolicy.get({ ...params }) -> DefaultPolicyGetResponse | null +- client.r2.temporaryCredentials.create({ ...params }) -> TemporaryCredentialCreateResponse + +## SuperSlurper -#### Excludes +### Jobs Types: -- TeamsDevicesSplitTunnel -- ExcludeUpdateResponse -- ExcludeListResponse -- ExcludeGetResponse +- JobCreateResponse +- JobListResponse +- JobAbortResponse +- JobAbortAllResponse +- JobGetResponse +- JobPauseResponse +- JobProgressResponse +- JobResumeResponse Methods: -- client.zeroTrust.devices.policies.excludes.update([ ...body ]) -> ExcludeUpdateResponse | null -- client.zeroTrust.devices.policies.excludes.list({ ...params }) -> ExcludeListResponse | null -- client.zeroTrust.devices.policies.excludes.get(policyId, { ...params }) -> ExcludeGetResponse | null +- client.r2.superSlurper.jobs.create({ ...params }) -> JobCreateResponse +- client.r2.superSlurper.jobs.list({ ...params }) -> JobListResponsesSinglePage +- client.r2.superSlurper.jobs.abort(jobId, { ...params }) -> JobAbortResponse +- client.r2.superSlurper.jobs.abortAll({ ...params }) -> JobAbortAllResponse +- client.r2.superSlurper.jobs.get(jobId, { ...params }) -> JobGetResponse +- client.r2.superSlurper.jobs.pause(jobId, { ...params }) -> JobPauseResponse +- client.r2.superSlurper.jobs.progress(jobId, { ...params }) -> JobProgressResponse +- client.r2.superSlurper.jobs.resume(jobId, { ...params }) -> JobResumeResponse -#### FallbackDomains +#### Logs Types: -- TeamsDevicesFallbackDomain -- FallbackDomainUpdateResponse -- FallbackDomainListResponse -- FallbackDomainGetResponse +- LogListResponse Methods: -- client.zeroTrust.devices.policies.fallbackDomains.update(policyId, [ ...body ]) -> FallbackDomainUpdateResponse | null -- client.zeroTrust.devices.policies.fallbackDomains.list({ ...params }) -> FallbackDomainListResponse | null -- client.zeroTrust.devices.policies.fallbackDomains.get(policyId, { ...params }) -> FallbackDomainGetResponse | null +- client.r2.superSlurper.jobs.logs.list(jobId, { ...params }) -> LogListResponsesSinglePage -#### Includes +### ConnectivityPrecheck Types: -- TeamsDevicesSplitTunnelInclude -- IncludeUpdateResponse -- IncludeListResponse -- IncludeGetResponse +- ConnectivityPrecheckSourceResponse +- ConnectivityPrecheckTargetResponse Methods: -- client.zeroTrust.devices.policies.includes.update([ ...body ]) -> IncludeUpdateResponse | null -- client.zeroTrust.devices.policies.includes.list({ ...params }) -> IncludeListResponse | null -- client.zeroTrust.devices.policies.includes.get(policyId, { ...params }) -> IncludeGetResponse | null +- client.r2.superSlurper.connectivityPrecheck.source({ ...params }) -> ConnectivityPrecheckSourceResponse +- client.r2.superSlurper.connectivityPrecheck.target({ ...params }) -> ConnectivityPrecheckTargetResponse -### Posture +# R2DataCatalog Types: -- TeamsDevicesDevicePostureRules -- PostureListResponse -- PostureDeleteResponse +- R2DataCatalogListResponse +- R2DataCatalogEnableResponse +- R2DataCatalogGetResponse Methods: -- client.zeroTrust.devices.posture.create({ ...params }) -> TeamsDevicesDevicePostureRules | null -- client.zeroTrust.devices.posture.update(ruleId, { ...params }) -> TeamsDevicesDevicePostureRules | null -- client.zeroTrust.devices.posture.list({ ...params }) -> PostureListResponse | null -- client.zeroTrust.devices.posture.delete(ruleId, { ...params }) -> PostureDeleteResponse | null -- client.zeroTrust.devices.posture.get(ruleId, { ...params }) -> TeamsDevicesDevicePostureRules | null +- client.r2DataCatalog.list({ ...params }) -> R2DataCatalogListResponse +- client.r2DataCatalog.disable(bucketName, { ...params }) -> void +- client.r2DataCatalog.enable(bucketName, { ...params }) -> R2DataCatalogEnableResponse +- client.r2DataCatalog.get(bucketName, { ...params }) -> R2DataCatalogGetResponse -#### Integrations +## MaintenanceConfigs Types: -- TeamsDevicesDevicePostureIntegrations -- IntegrationListResponse -- IntegrationDeleteResponse +- MaintenanceConfigUpdateResponse +- MaintenanceConfigGetResponse Methods: -- client.zeroTrust.devices.posture.integrations.create({ ...params }) -> TeamsDevicesDevicePostureIntegrations | null -- client.zeroTrust.devices.posture.integrations.list({ ...params }) -> IntegrationListResponse | null -- client.zeroTrust.devices.posture.integrations.delete(integrationId, { ...params }) -> IntegrationDeleteResponse | null -- client.zeroTrust.devices.posture.integrations.edit(integrationId, { ...params }) -> TeamsDevicesDevicePostureIntegrations | null -- client.zeroTrust.devices.posture.integrations.get(integrationId, { ...params }) -> TeamsDevicesDevicePostureIntegrations | null +- client.r2DataCatalog.maintenanceConfigs.update(bucketName, { ...params }) -> MaintenanceConfigUpdateResponse +- client.r2DataCatalog.maintenanceConfigs.get(bucketName, { ...params }) -> MaintenanceConfigGetResponse -### Revokes +## Credentials Types: -- RevokeCreateResponse +- CredentialCreateResponse Methods: -- client.zeroTrust.devices.revokes.create([ ...body ]) -> RevokeCreateResponse | null +- client.r2DataCatalog.credentials.create(bucketName, { ...params }) -> CredentialCreateResponse | null -### Settings +## Namespaces Types: -- TeamsDevicesZeroTrustAccountDeviceSettings +- NamespaceListResponse Methods: -- client.zeroTrust.devices.settings.update({ ...params }) -> TeamsDevicesZeroTrustAccountDeviceSettings | null -- client.zeroTrust.devices.settings.list({ ...params }) -> TeamsDevicesZeroTrustAccountDeviceSettings | null +- client.r2DataCatalog.namespaces.list(bucketName, { ...params }) -> NamespaceListResponse -### Unrevokes +### Tables Types: -- UnrevokeCreateResponse +- TableListResponse Methods: -- client.zeroTrust.devices.unrevokes.create([ ...body ]) -> UnrevokeCreateResponse | null +- client.r2DataCatalog.namespaces.tables.list(bucketName, namespace, { ...params }) -> TableListResponse -### OverrideCodes +#### MaintenanceConfigs Types: -- OverrideCodeListResponse +- MaintenanceConfigUpdateResponse +- MaintenanceConfigGetResponse Methods: -- client.zeroTrust.devices.overrideCodes.list(deviceId, { ...params }) -> OverrideCodeListResponse | null +- client.r2DataCatalog.namespaces.tables.maintenanceConfigs.update(bucketName, namespace, tableName, { ...params }) -> MaintenanceConfigUpdateResponse +- client.r2DataCatalog.namespaces.tables.maintenanceConfigs.get(bucketName, namespace, tableName, { ...params }) -> MaintenanceConfigGetResponse -## IdentityProviders +# WorkersForPlatforms + +## Dispatch + +### Namespaces Types: -- AccessIdentityProviders -- IdentityProviderListResponse -- IdentityProviderDeleteResponse +- NamespaceCreateResponse +- NamespaceListResponse +- NamespaceDeleteResponse +- NamespaceGetResponse Methods: -- client.zeroTrust.identityProviders.create({ ...params }) -> AccessIdentityProviders -- client.zeroTrust.identityProviders.update(uuid, { ...params }) -> AccessIdentityProviders -- client.zeroTrust.identityProviders.list({ ...params }) -> IdentityProviderListResponse | null -- client.zeroTrust.identityProviders.delete(uuid, { ...params }) -> IdentityProviderDeleteResponse -- client.zeroTrust.identityProviders.get(uuid, { ...params }) -> AccessIdentityProviders +- client.workersForPlatforms.dispatch.namespaces.create({ ...params }) -> NamespaceCreateResponse +- client.workersForPlatforms.dispatch.namespaces.list({ ...params }) -> NamespaceListResponsesSinglePage +- client.workersForPlatforms.dispatch.namespaces.delete(dispatchNamespace, { ...params }) -> NamespaceDeleteResponse | null +- client.workersForPlatforms.dispatch.namespaces.get(dispatchNamespace, { ...params }) -> NamespaceGetResponse -## Organizations +#### Scripts Types: -- AccessOrganizations -- OrganizationRevokeUsersResponse +- Script +- ScriptUpdateResponse +- ScriptDeleteResponse Methods: -- client.zeroTrust.organizations.create({ ...params }) -> AccessOrganizations -- client.zeroTrust.organizations.update({ ...params }) -> AccessOrganizations -- client.zeroTrust.organizations.list({ ...params }) -> AccessOrganizations -- client.zeroTrust.organizations.revokeUsers({ ...params }) -> OrganizationRevokeUsersResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.update(dispatchNamespace, scriptName, { ...params }) -> ScriptUpdateResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.delete(dispatchNamespace, scriptName, { ...params }) -> ScriptDeleteResponse | null +- client.workersForPlatforms.dispatch.namespaces.scripts.get(dispatchNamespace, scriptName, { ...params }) -> Script -## Seats +##### AssetUpload Types: -- AccessSeats -- SeatEditResponse +- AssetUploadCreateResponse Methods: -- client.zeroTrust.seats.edit(identifier, [ ...body ]) -> SeatEditResponse | null +- client.workersForPlatforms.dispatch.namespaces.scripts.assetUpload.create(dispatchNamespace, scriptName, { ...params }) -> AssetUploadCreateResponse -## Access - -### Applications - -Types: - -- AccessApps -- ApplicationListResponse -- ApplicationDeleteResponse -- ApplicationRevokeTokensResponse +##### Content Methods: -- client.zeroTrust.access.applications.create({ ...params }) -> AccessApps -- client.zeroTrust.access.applications.update(appId, { ...params }) -> AccessApps -- client.zeroTrust.access.applications.list({ ...params }) -> ApplicationListResponse | null -- client.zeroTrust.access.applications.delete(appId, { ...params }) -> ApplicationDeleteResponse -- client.zeroTrust.access.applications.get(appId, { ...params }) -> AccessApps -- client.zeroTrust.access.applications.revokeTokens(appId, { ...params }) -> ApplicationRevokeTokensResponse | null +- client.workersForPlatforms.dispatch.namespaces.scripts.content.update(dispatchNamespace, scriptName, { ...params }) -> Script +- client.workersForPlatforms.dispatch.namespaces.scripts.content.get(dispatchNamespace, scriptName, { ...params }) -> Response -#### CAs +##### Settings Types: -- AccessCA -- CACreateResponse -- CAListResponse -- CADeleteResponse -- CAGetResponse +- SettingEditResponse +- SettingGetResponse Methods: -- client.zeroTrust.access.applications.cas.create(uuid, { ...params }) -> CACreateResponse -- client.zeroTrust.access.applications.cas.list({ ...params }) -> CAListResponse | null -- client.zeroTrust.access.applications.cas.delete(uuid, { ...params }) -> CADeleteResponse -- client.zeroTrust.access.applications.cas.get(uuid, { ...params }) -> CAGetResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.settings.edit(dispatchNamespace, scriptName, { ...params }) -> SettingEditResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.settings.get(dispatchNamespace, scriptName, { ...params }) -> SettingGetResponse -#### UserPolicyChecks +##### Bindings Types: -- UserPolicyCheckListResponse +- BindingGetResponse Methods: -- client.zeroTrust.access.applications.userPolicyChecks.list(appId, { ...params }) -> UserPolicyCheckListResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.bindings.get(dispatchNamespace, scriptName, { ...params }) -> BindingGetResponsesSinglePage -#### Policies +##### Secrets Types: -- AccessPolicies -- PolicyListResponse -- PolicyDeleteResponse +- SecretUpdateResponse +- SecretListResponse +- SecretDeleteResponse +- SecretGetResponse Methods: -- client.zeroTrust.access.applications.policies.create(uuid, { ...params }) -> AccessPolicies -- client.zeroTrust.access.applications.policies.update(uuid1, uuid, { ...params }) -> AccessPolicies -- client.zeroTrust.access.applications.policies.list(uuid, { ...params }) -> PolicyListResponse | null -- client.zeroTrust.access.applications.policies.delete(uuid1, uuid, { ...params }) -> PolicyDeleteResponse -- client.zeroTrust.access.applications.policies.get(uuid1, uuid, { ...params }) -> AccessPolicies +- client.workersForPlatforms.dispatch.namespaces.scripts.secrets.update(dispatchNamespace, scriptName, { ...params }) -> SecretUpdateResponse +- client.workersForPlatforms.dispatch.namespaces.scripts.secrets.list(dispatchNamespace, scriptName, { ...params }) -> SecretListResponsesSinglePage +- client.workersForPlatforms.dispatch.namespaces.scripts.secrets.delete(dispatchNamespace, scriptName, secretName, { ...params }) -> SecretDeleteResponse | null +- client.workersForPlatforms.dispatch.namespaces.scripts.secrets.get(dispatchNamespace, scriptName, secretName, { ...params }) -> SecretGetResponse -### Certificates +##### Tags Types: -- AccessCertificates -- CertificateListResponse -- CertificateDeleteResponse +- TagUpdateResponse +- TagListResponse +- TagDeleteResponse Methods: -- client.zeroTrust.access.certificates.create({ ...params }) -> AccessCertificates -- client.zeroTrust.access.certificates.update(uuid, { ...params }) -> AccessCertificates -- client.zeroTrust.access.certificates.list({ ...params }) -> CertificateListResponse | null -- client.zeroTrust.access.certificates.delete(uuid, { ...params }) -> CertificateDeleteResponse -- client.zeroTrust.access.certificates.get(uuid, { ...params }) -> AccessCertificates +- client.workersForPlatforms.dispatch.namespaces.scripts.tags.update(dispatchNamespace, scriptName, [ ...body ]) -> TagUpdateResponsesSinglePage +- client.workersForPlatforms.dispatch.namespaces.scripts.tags.list(dispatchNamespace, scriptName, { ...params }) -> TagListResponsesSinglePage +- client.workersForPlatforms.dispatch.namespaces.scripts.tags.delete(dispatchNamespace, scriptName, tag, { ...params }) -> TagDeleteResponse | null -#### Settings +# ZeroTrust + +## Devices Types: -- AccessSettings -- SettingUpdateResponse -- SettingListResponse +- Device +- DeviceGetResponse Methods: -- client.zeroTrust.access.certificates.settings.update({ ...params }) -> SettingUpdateResponse | null -- client.zeroTrust.access.certificates.settings.list({ ...params }) -> SettingListResponse | null +- client.zeroTrust.devices.list({ ...params }) -> DevicesSinglePage +- client.zeroTrust.devices.get(deviceId, { ...params }) -> DeviceGetResponse | null -### Groups +### Devices Types: -- AccessGroups -- GroupListResponse -- GroupDeleteResponse +- DeviceListResponse +- DeviceDeleteResponse +- DeviceGetResponse +- DeviceRevokeResponse Methods: -- client.zeroTrust.access.groups.create({ ...params }) -> AccessGroups -- client.zeroTrust.access.groups.update(uuid, { ...params }) -> AccessGroups -- client.zeroTrust.access.groups.list({ ...params }) -> GroupListResponse | null -- client.zeroTrust.access.groups.delete(uuid, { ...params }) -> GroupDeleteResponse -- client.zeroTrust.access.groups.get(uuid, { ...params }) -> AccessGroups +- client.zeroTrust.devices.devices.list({ ...params }) -> DeviceListResponsesCursorPagination +- client.zeroTrust.devices.devices.delete(deviceId, { ...params }) -> DeviceDeleteResponse | null +- client.zeroTrust.devices.devices.get(deviceId, { ...params }) -> DeviceGetResponse +- client.zeroTrust.devices.devices.revoke(deviceId, { ...params }) -> DeviceRevokeResponse | null -### ServiceTokens +### Resilience + +#### GlobalWARPOverride Types: -- AccessServiceTokens -- ServiceTokenCreateResponse -- ServiceTokenListResponse -- ServiceTokenRotateResponse +- GlobalWARPOverrideCreateResponse +- GlobalWARPOverrideGetResponse Methods: -- client.zeroTrust.access.serviceTokens.create({ ...params }) -> ServiceTokenCreateResponse -- client.zeroTrust.access.serviceTokens.update(uuid, { ...params }) -> AccessServiceTokens -- client.zeroTrust.access.serviceTokens.list({ ...params }) -> ServiceTokenListResponse | null -- client.zeroTrust.access.serviceTokens.delete(uuid, { ...params }) -> AccessServiceTokens -- client.zeroTrust.access.serviceTokens.refresh(identifier, uuid) -> AccessServiceTokens -- client.zeroTrust.access.serviceTokens.rotate(identifier, uuid) -> ServiceTokenRotateResponse +- client.zeroTrust.devices.resilience.globalWARPOverride.create({ ...params }) -> GlobalWARPOverrideCreateResponse | null +- client.zeroTrust.devices.resilience.globalWARPOverride.get({ ...params }) -> GlobalWARPOverrideGetResponse | null -### Bookmarks +### Registrations Types: -- AccessBookmarks -- BookmarkListResponse -- BookmarkDeleteResponse +- RegistrationListResponse +- RegistrationDeleteResponse +- RegistrationBulkDeleteResponse +- RegistrationGetResponse +- RegistrationRevokeResponse +- RegistrationUnrevokeResponse Methods: -- client.zeroTrust.access.bookmarks.create(identifier, uuid) -> AccessBookmarks -- client.zeroTrust.access.bookmarks.update(identifier, uuid) -> AccessBookmarks -- client.zeroTrust.access.bookmarks.list(identifier) -> BookmarkListResponse | null -- client.zeroTrust.access.bookmarks.delete(identifier, uuid) -> BookmarkDeleteResponse -- client.zeroTrust.access.bookmarks.get(identifier, uuid) -> AccessBookmarks +- client.zeroTrust.devices.registrations.list({ ...params }) -> RegistrationListResponsesCursorPagination +- client.zeroTrust.devices.registrations.delete(registrationId, { ...params }) -> RegistrationDeleteResponse | null +- client.zeroTrust.devices.registrations.bulkDelete({ ...params }) -> RegistrationBulkDeleteResponse | null +- client.zeroTrust.devices.registrations.get(registrationId, { ...params }) -> RegistrationGetResponse +- client.zeroTrust.devices.registrations.revoke({ ...params }) -> RegistrationRevokeResponse | null +- client.zeroTrust.devices.registrations.unrevoke({ ...params }) -> RegistrationUnrevokeResponse | null -### Keys +### DEXTests Types: -- KeyUpdateResponse -- KeyListResponse -- KeyRotateResponse +- SchemaData +- SchemaHTTP +- DEXTestCreateResponse +- DEXTestUpdateResponse +- DEXTestListResponse +- DEXTestDeleteResponse +- DEXTestGetResponse Methods: -- client.zeroTrust.access.keys.update(identifier, { ...params }) -> KeyUpdateResponse -- client.zeroTrust.access.keys.list(identifier) -> KeyListResponse -- client.zeroTrust.access.keys.rotate(identifier) -> KeyRotateResponse - -### Logs +- client.zeroTrust.devices.dexTests.create({ ...params }) -> DEXTestCreateResponse +- client.zeroTrust.devices.dexTests.update(dexTestId, { ...params }) -> DEXTestUpdateResponse +- client.zeroTrust.devices.dexTests.list({ ...params }) -> DEXTestListResponsesV4PagePaginationArray +- client.zeroTrust.devices.dexTests.delete(dexTestId, { ...params }) -> DEXTestDeleteResponse +- client.zeroTrust.devices.dexTests.get(dexTestId, { ...params }) -> DEXTestGetResponse -#### AccessRequests +### Networks Types: -- AccessAccessRequests -- AccessRequestListResponse +- DeviceNetwork Methods: -- client.zeroTrust.access.logs.accessRequests.list(identifier) -> AccessRequestListResponse | null +- client.zeroTrust.devices.networks.create({ ...params }) -> DeviceNetwork | null +- client.zeroTrust.devices.networks.update(networkId, { ...params }) -> DeviceNetwork | null +- client.zeroTrust.devices.networks.list({ ...params }) -> DeviceNetworksSinglePage +- client.zeroTrust.devices.networks.delete(networkId, { ...params }) -> DeviceNetworksSinglePage +- client.zeroTrust.devices.networks.get(networkId, { ...params }) -> DeviceNetwork | null -### Users +### FleetStatus Types: -- AccessUsers -- UserListResponse +- FleetStatusGetResponse Methods: -- client.zeroTrust.access.users.list(identifier) -> UserListResponse | null +- client.zeroTrust.devices.fleetStatus.get(deviceId, { ...params }) -> FleetStatusGetResponse -#### ActiveSessions +### Policies Types: -- ActiveSessionListResponse -- ActiveSessionGetResponse - -Methods: - -- client.zeroTrust.access.users.activeSessions.list(identifier, id) -> ActiveSessionListResponse | null -- client.zeroTrust.access.users.activeSessions.get(identifier, id, nonce) -> ActiveSessionGetResponse +- DevicePolicyCertificates +- FallbackDomain +- FallbackDomainPolicy +- SettingsPolicy +- SplitTunnelExclude +- SplitTunnelInclude -#### LastSeenIdentity +#### Default Types: -- AccessIdentity +- DefaultEditResponse +- DefaultGetResponse Methods: -- client.zeroTrust.access.users.lastSeenIdentity.get(identifier, id) -> AccessIdentity +- client.zeroTrust.devices.policies.default.edit({ ...params }) -> DefaultEditResponse | null +- client.zeroTrust.devices.policies.default.get({ ...params }) -> DefaultGetResponse | null -#### FailedLogins +##### Excludes -Types: +Methods: -- FailedLoginListResponse +- client.zeroTrust.devices.policies.default.excludes.update([ ...body ]) -> SplitTunnelExcludesSinglePage +- client.zeroTrust.devices.policies.default.excludes.get({ ...params }) -> SplitTunnelExcludesSinglePage + +##### Includes Methods: -- client.zeroTrust.access.users.failedLogins.list(identifier, id) -> FailedLoginListResponse | null +- client.zeroTrust.devices.policies.default.includes.update([ ...body ]) -> SplitTunnelIncludesSinglePage +- client.zeroTrust.devices.policies.default.includes.get({ ...params }) -> SplitTunnelIncludesSinglePage -### CustomPages +##### FallbackDomains -Types: +Methods: -- AccessCustomPage -- AccessCustomPageWithoutHTML -- CustomPageListResponse -- CustomPageDeleteResponse +- client.zeroTrust.devices.policies.default.fallbackDomains.update([ ...domains ]) -> FallbackDomainsSinglePage +- client.zeroTrust.devices.policies.default.fallbackDomains.get({ ...params }) -> FallbackDomainsSinglePage + +##### Certificates Methods: -- client.zeroTrust.access.customPages.create(identifier, { ...params }) -> AccessCustomPageWithoutHTML -- client.zeroTrust.access.customPages.update(identifier, uuid, { ...params }) -> AccessCustomPageWithoutHTML -- client.zeroTrust.access.customPages.list(identifier) -> CustomPageListResponse | null -- client.zeroTrust.access.customPages.delete(identifier, uuid) -> CustomPageDeleteResponse -- client.zeroTrust.access.customPages.get(identifier, uuid) -> AccessCustomPage +- client.zeroTrust.devices.policies.default.certificates.edit({ ...params }) -> DevicePolicyCertificates | null +- client.zeroTrust.devices.policies.default.certificates.get({ ...params }) -> DevicePolicyCertificates | null -### Tags +#### Custom -Types: +Methods: -- AccessTag -- TagListResponse -- TagDeleteResponse +- client.zeroTrust.devices.policies.custom.create({ ...params }) -> SettingsPolicy | null +- client.zeroTrust.devices.policies.custom.list({ ...params }) -> SettingsPoliciesSinglePage +- client.zeroTrust.devices.policies.custom.delete(policyId, { ...params }) -> SettingsPoliciesSinglePage +- client.zeroTrust.devices.policies.custom.edit(policyId, { ...params }) -> SettingsPolicy | null +- client.zeroTrust.devices.policies.custom.get(policyId, { ...params }) -> SettingsPolicy | null + +##### Excludes Methods: -- client.zeroTrust.access.tags.create(identifier, { ...params }) -> AccessTag -- client.zeroTrust.access.tags.update(identifier, tagName, { ...params }) -> AccessTag -- client.zeroTrust.access.tags.list(identifier) -> TagListResponse | null -- client.zeroTrust.access.tags.delete(identifier, name) -> TagDeleteResponse -- client.zeroTrust.access.tags.get(identifier, name) -> AccessTag +- client.zeroTrust.devices.policies.custom.excludes.update(policyId, [ ...body ]) -> SplitTunnelExcludesSinglePage +- client.zeroTrust.devices.policies.custom.excludes.get(policyId, { ...params }) -> SplitTunnelExcludesSinglePage -## DEX +##### Includes -### Colos +Methods: -Types: +- client.zeroTrust.devices.policies.custom.includes.update(policyId, [ ...body ]) -> SplitTunnelIncludesSinglePage +- client.zeroTrust.devices.policies.custom.includes.get(policyId, { ...params }) -> SplitTunnelIncludesSinglePage -- ColoListResponse +##### FallbackDomains Methods: -- client.zeroTrust.dex.colos.list({ ...params }) -> ColoListResponse | null +- client.zeroTrust.devices.policies.custom.fallbackDomains.update(policyId, [ ...domains ]) -> FallbackDomainsSinglePage +- client.zeroTrust.devices.policies.custom.fallbackDomains.get(policyId, { ...params }) -> FallbackDomainsSinglePage -### FleetStatus +### Posture Types: -- FleetStatusLiveResponse +- CarbonblackInput +- ClientCertificateInput +- CrowdstrikeInput +- DeviceInput +- DeviceMatch +- DevicePostureRule +- DiskEncryptionInput +- DomainJoinedInput +- FileInput +- FirewallInput +- IntuneInput +- KolideInput +- OSVersionInput +- SentineloneInput +- SentineloneS2sInput +- TaniumInput +- UniqueClientIDInput +- WorkspaceOneInput +- PostureDeleteResponse Methods: -- client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse -- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> void +- client.zeroTrust.devices.posture.create({ ...params }) -> DevicePostureRule | null +- client.zeroTrust.devices.posture.update(ruleId, { ...params }) -> DevicePostureRule | null +- client.zeroTrust.devices.posture.list({ ...params }) -> DevicePostureRulesSinglePage +- client.zeroTrust.devices.posture.delete(ruleId, { ...params }) -> PostureDeleteResponse | null +- client.zeroTrust.devices.posture.get(ruleId, { ...params }) -> DevicePostureRule | null -#### Devices +#### Integrations Types: -- DigitalExperienceMonitoringDevice +- Integration +- IntegrationDeleteResponse Methods: -- client.zeroTrust.dex.fleetStatus.devices.list({ ...params }) -> DigitalExperienceMonitoringDevicesV4PagePaginationArray +- client.zeroTrust.devices.posture.integrations.create({ ...params }) -> Integration | null +- client.zeroTrust.devices.posture.integrations.list({ ...params }) -> IntegrationsSinglePage +- client.zeroTrust.devices.posture.integrations.delete(integrationId, { ...params }) -> IntegrationDeleteResponse | null +- client.zeroTrust.devices.posture.integrations.edit(integrationId, { ...params }) -> Integration | null +- client.zeroTrust.devices.posture.integrations.get(integrationId, { ...params }) -> Integration | null -### HTTPTests +### Revoke Types: -- DigitalExperienceMonitoringHTTPDetails +- RevokeCreateResponse Methods: -- client.zeroTrust.dex.httpTests.get(testId, { ...params }) -> DigitalExperienceMonitoringHTTPDetails +- client.zeroTrust.devices.revoke.create([ ...body ]) -> RevokeCreateResponse | null -#### Percentiles +### Settings Types: -- DigitalExperienceMonitoringHTTPDetailsPercentiles +- DeviceSettings Methods: -- client.zeroTrust.dex.httpTests.percentiles.get(testId, { ...params }) -> DigitalExperienceMonitoringHTTPDetailsPercentiles +- client.zeroTrust.devices.settings.update({ ...params }) -> DeviceSettings | null +- client.zeroTrust.devices.settings.delete({ ...params }) -> DeviceSettings | null +- client.zeroTrust.devices.settings.edit({ ...params }) -> DeviceSettings | null +- client.zeroTrust.devices.settings.get({ ...params }) -> DeviceSettings | null -### Tests +### Unrevoke Types: -- DigitalExperienceMonitoringTests -- TestListResponse +- UnrevokeCreateResponse Methods: -- client.zeroTrust.dex.tests.list({ ...params }) -> TestListResponsesV4PagePagination +- client.zeroTrust.devices.unrevoke.create([ ...body ]) -> UnrevokeCreateResponse | null -#### UniqueDevices +### OverrideCodes Types: -- DigitalExperienceMonitoringUniqueDevices +- OverrideCodeListResponse +- OverrideCodeGetResponse Methods: -- client.zeroTrust.dex.tests.uniqueDevices.list({ ...params }) -> DigitalExperienceMonitoringUniqueDevices - -### TracerouteTestResults +- client.zeroTrust.devices.overrideCodes.list(deviceId, { ...params }) -> OverrideCodeListResponsesSinglePage +- client.zeroTrust.devices.overrideCodes.get(registrationId, { ...params }) -> OverrideCodeGetResponse -#### NetworkPath +## IdentityProviders Types: -- DigitalExperienceMonitoringTracerouteTestResultNetworkPath +- AzureAD +- GenericOAuthConfig +- IdentityProvider +- IdentityProviderSCIMConfig +- IdentityProviderType +- IdentityProviderListResponse +- IdentityProviderDeleteResponse Methods: -- client.zeroTrust.dex.tracerouteTestResults.networkPath.get(testResultId, { ...params }) -> DigitalExperienceMonitoringTracerouteTestResultNetworkPath +- client.zeroTrust.identityProviders.create({ ...params }) -> IdentityProvider +- client.zeroTrust.identityProviders.update(identityProviderId, { ...params }) -> IdentityProvider +- client.zeroTrust.identityProviders.list({ ...params }) -> IdentityProviderListResponsesV4PagePaginationArray +- client.zeroTrust.identityProviders.delete(identityProviderId, { ...params }) -> IdentityProviderDeleteResponse +- client.zeroTrust.identityProviders.get(identityProviderId, { ...params }) -> IdentityProvider -### TracerouteTests +### SCIM -Types: +#### Groups + +Methods: -- DigitalExperienceMonitoringTracerouteDetails -- DigitalExperienceMonitoringTracerouteDetailsPercentiles -- DigitalExperienceMonitoringTracerouteTestNetworkPath +- client.zeroTrust.identityProviders.scim.groups.list(identityProviderId, { ...params }) -> ZeroTrustGroupsV4PagePaginationArray + +#### Users Methods: -- client.zeroTrust.dex.tracerouteTests.get(testId, { ...params }) -> DigitalExperienceMonitoringTracerouteDetails -- client.zeroTrust.dex.tracerouteTests.networkPath(testId, { ...params }) -> DigitalExperienceMonitoringTracerouteTestNetworkPath -- client.zeroTrust.dex.tracerouteTests.percentiles(testId, { ...params }) -> DigitalExperienceMonitoringTracerouteDetailsPercentiles +- client.zeroTrust.identityProviders.scim.users.list(identityProviderId, { ...params }) -> AccessUsersV4PagePaginationArray -## Tunnels +## Organizations Types: -- TunnelArgoTunnel -- TunnelListResponse -- TunnelEditResponse +- LoginDesign +- Organization +- OrganizationRevokeUsersResponse Methods: -- client.zeroTrust.tunnels.create({ ...params }) -> TunnelArgoTunnel -- client.zeroTrust.tunnels.list({ ...params }) -> TunnelListResponsesV4PagePaginationArray -- client.zeroTrust.tunnels.delete(tunnelId, { ...params }) -> TunnelArgoTunnel -- client.zeroTrust.tunnels.edit(tunnelId, { ...params }) -> TunnelEditResponse -- client.zeroTrust.tunnels.get(tunnelId, { ...params }) -> TunnelArgoTunnel +- client.zeroTrust.organizations.create({ ...params }) -> Organization +- client.zeroTrust.organizations.update({ ...params }) -> Organization +- client.zeroTrust.organizations.list({ ...params }) -> Organization +- client.zeroTrust.organizations.revokeUsers({ ...params }) -> OrganizationRevokeUsersResponse -### Configurations +### DOH Types: -- ConfigurationUpdateResponse -- ConfigurationGetResponse +- DOHUpdateResponse +- DOHGetResponse Methods: -- client.zeroTrust.tunnels.configurations.update(tunnelId, { ...params }) -> ConfigurationUpdateResponse -- client.zeroTrust.tunnels.configurations.get(tunnelId, { ...params }) -> ConfigurationGetResponse +- client.zeroTrust.organizations.doh.update({ ...params }) -> DOHUpdateResponse +- client.zeroTrust.organizations.doh.get({ ...params }) -> DOHGetResponse -### Connections +## Seats Types: -- TunnelTunnelClient -- ConnectionDeleteResponse -- ConnectionGetResponse +- Seat Methods: -- client.zeroTrust.tunnels.connections.delete(tunnelId, { ...params }) -> ConnectionDeleteResponse -- client.zeroTrust.tunnels.connections.get(tunnelId, { ...params }) -> ConnectionGetResponse | null +- client.zeroTrust.seats.edit([ ...body ]) -> SeatsSinglePage -### Token +## Access -Types: +### AIControls -- TokenGetResponse +#### Mcp -Methods: +##### Portals -- client.zeroTrust.tunnels.token.get(tunnelId, { ...params }) -> TokenGetResponse +Types: -### Connectors +- PortalCreateResponse +- PortalUpdateResponse +- PortalListResponse +- PortalDeleteResponse +- PortalReadResponse Methods: -- client.zeroTrust.tunnels.connectors.get(tunnelId, connectorId, { ...params }) -> TunnelTunnelClient +- client.zeroTrust.access.aiControls.mcp.portals.create({ ...params }) -> PortalCreateResponse +- client.zeroTrust.access.aiControls.mcp.portals.update(id, { ...params }) -> PortalUpdateResponse +- client.zeroTrust.access.aiControls.mcp.portals.list({ ...params }) -> PortalListResponsesV4PagePaginationArray +- client.zeroTrust.access.aiControls.mcp.portals.delete(id, { ...params }) -> PortalDeleteResponse +- client.zeroTrust.access.aiControls.mcp.portals.read(id, { ...params }) -> PortalReadResponse -### Management +##### Servers Types: -- ManagementCreateResponse +- ServerCreateResponse +- ServerUpdateResponse +- ServerListResponse +- ServerDeleteResponse +- ServerReadResponse +- ServerSyncResponse Methods: -- client.zeroTrust.tunnels.management.create(tunnelId, { ...params }) -> ManagementCreateResponse +- client.zeroTrust.access.aiControls.mcp.servers.create({ ...params }) -> ServerCreateResponse +- client.zeroTrust.access.aiControls.mcp.servers.update(id, { ...params }) -> ServerUpdateResponse +- client.zeroTrust.access.aiControls.mcp.servers.list({ ...params }) -> ServerListResponsesV4PagePaginationArray +- client.zeroTrust.access.aiControls.mcp.servers.delete(id, { ...params }) -> ServerDeleteResponse +- client.zeroTrust.access.aiControls.mcp.servers.read(id, { ...params }) -> ServerReadResponse +- client.zeroTrust.access.aiControls.mcp.servers.sync(id, { ...params }) -> ServerSyncResponse -## ConnectivitySettings +### GatewayCA Types: -- ConnectivitySettingEditResponse -- ConnectivitySettingGetResponse +- GatewayCACreateResponse +- GatewayCAListResponse +- GatewayCADeleteResponse Methods: -- client.zeroTrust.connectivitySettings.edit({ ...params }) -> ConnectivitySettingEditResponse -- client.zeroTrust.connectivitySettings.get({ ...params }) -> ConnectivitySettingGetResponse +- client.zeroTrust.access.gatewayCA.create({ ...params }) -> GatewayCACreateResponse +- client.zeroTrust.access.gatewayCA.list({ ...params }) -> GatewayCAListResponsesSinglePage +- client.zeroTrust.access.gatewayCA.delete(certificateId, { ...params }) -> GatewayCADeleteResponse -## DLP +### Infrastructure -### Datasets +#### Targets Types: -- DLPDataset -- DLPDatasetArray -- DLPDatasetCreation +- TargetCreateResponse +- TargetUpdateResponse +- TargetListResponse +- TargetBulkUpdateResponse +- TargetGetResponse Methods: -- client.zeroTrust.dlp.datasets.create({ ...params }) -> DLPDatasetCreation -- client.zeroTrust.dlp.datasets.update(datasetId, { ...params }) -> DLPDataset -- client.zeroTrust.dlp.datasets.list({ ...params }) -> DLPDatasetArray -- client.zeroTrust.dlp.datasets.delete(datasetId, { ...params }) -> void -- client.zeroTrust.dlp.datasets.get(datasetId, { ...params }) -> DLPDataset +- client.zeroTrust.access.infrastructure.targets.create({ ...params }) -> TargetCreateResponse +- client.zeroTrust.access.infrastructure.targets.update(targetId, { ...params }) -> TargetUpdateResponse +- client.zeroTrust.access.infrastructure.targets.list({ ...params }) -> TargetListResponsesV4PagePaginationArray +- client.zeroTrust.access.infrastructure.targets.delete(targetId, { ...params }) -> void +- client.zeroTrust.access.infrastructure.targets.bulkDelete({ ...params }) -> void +- client.zeroTrust.access.infrastructure.targets.bulkDeleteV2({ ...params }) -> void +- client.zeroTrust.access.infrastructure.targets.bulkUpdate([ ...body ]) -> TargetBulkUpdateResponsesSinglePage +- client.zeroTrust.access.infrastructure.targets.get(targetId, { ...params }) -> TargetGetResponse -#### Upload +### Applications Types: -- DLPDatasetNewVersion +- AllowedHeaders +- AllowedIdPs +- AllowedMethods +- AllowedOrigins +- AppID +- Application +- ApplicationPolicy +- ApplicationSCIMConfig +- ApplicationType +- CORSHeaders +- Decision +- OIDCSaaSApp +- SaaSAppNameIDFormat +- SAMLSaaSApp +- SCIMConfigAuthenticationHTTPBasic +- SCIMConfigAuthenticationOAuthBearerToken +- SCIMConfigAuthenticationOauth2 +- SCIMConfigMapping +- SelfHostedDomains +- ApplicationCreateResponse +- ApplicationUpdateResponse +- ApplicationListResponse +- ApplicationDeleteResponse +- ApplicationGetResponse +- ApplicationRevokeTokensResponse Methods: -- client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> DLPDatasetNewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, { ...params }) -> DLPDataset +- client.zeroTrust.access.applications.create({ ...params }) -> ApplicationCreateResponse +- client.zeroTrust.access.applications.update(appId, { ...params }) -> ApplicationUpdateResponse +- client.zeroTrust.access.applications.list({ ...params }) -> ApplicationListResponsesV4PagePaginationArray +- client.zeroTrust.access.applications.delete(appId, { ...params }) -> ApplicationDeleteResponse +- client.zeroTrust.access.applications.get(appId, { ...params }) -> ApplicationGetResponse +- client.zeroTrust.access.applications.revokeTokens(appId, { ...params }) -> ApplicationRevokeTokensResponse | null -### Patterns +#### CAs Types: -- PatternValidateResponse +- CA +- CADeleteResponse Methods: -- client.zeroTrust.dlp.patterns.validate({ ...params }) -> PatternValidateResponse +- client.zeroTrust.access.applications.cas.create(appId, { ...params }) -> CA +- client.zeroTrust.access.applications.cas.list({ ...params }) -> CAsV4PagePaginationArray +- client.zeroTrust.access.applications.cas.delete(appId, { ...params }) -> CADeleteResponse +- client.zeroTrust.access.applications.cas.get(appId, { ...params }) -> CA -### PayloadLogs +#### UserPolicyChecks Types: -- PayloadLogUpdateResponse -- PayloadLogGetResponse +- UserPolicyCheckGeo +- UserPolicyCheckListResponse Methods: -- client.zeroTrust.dlp.payloadLogs.update({ ...params }) -> PayloadLogUpdateResponse -- client.zeroTrust.dlp.payloadLogs.get({ ...params }) -> PayloadLogGetResponse +- client.zeroTrust.access.applications.userPolicyChecks.list(appId, { ...params }) -> UserPolicyCheckListResponse -### Profiles +#### Policies Types: -- DLPProfiles -- ProfileListResponse -- ProfileGetResponse +- AccessDevicePostureRule +- AccessRule +- AnyValidServiceTokenRule +- AuthenticationMethodRule +- AzureGroupRule +- CertificateRule +- CountryRule +- DomainRule +- EmailListRule +- EmailRule +- EveryoneRule +- ExternalEvaluationRule +- GitHubOrganizationRule +- GroupRule +- GSuiteGroupRule +- IPListRule +- IPRule +- OktaGroupRule +- SAMLGroupRule +- ServiceTokenRule +- PolicyCreateResponse +- PolicyUpdateResponse +- PolicyListResponse +- PolicyDeleteResponse +- PolicyGetResponse Methods: -- client.zeroTrust.dlp.profiles.list({ ...params }) -> ProfileListResponse | null -- client.zeroTrust.dlp.profiles.get(profileId, { ...params }) -> ProfileGetResponse +- client.zeroTrust.access.applications.policies.create(appId, { ...params }) -> PolicyCreateResponse +- client.zeroTrust.access.applications.policies.update(appId, policyId, { ...params }) -> PolicyUpdateResponse +- client.zeroTrust.access.applications.policies.list(appId, { ...params }) -> PolicyListResponsesV4PagePaginationArray +- client.zeroTrust.access.applications.policies.delete(appId, policyId, { ...params }) -> PolicyDeleteResponse +- client.zeroTrust.access.applications.policies.get(appId, policyId, { ...params }) -> PolicyGetResponse -#### Custom +#### PolicyTests Types: -- DLPCustomProfile -- CustomCreateResponse -- CustomDeleteResponse +- PolicyTestCreateResponse +- PolicyTestGetResponse Methods: -- client.zeroTrust.dlp.profiles.custom.create({ ...params }) -> CustomCreateResponse | null -- client.zeroTrust.dlp.profiles.custom.update(profileId, { ...params }) -> DLPCustomProfile -- client.zeroTrust.dlp.profiles.custom.delete(profileId, { ...params }) -> CustomDeleteResponse -- client.zeroTrust.dlp.profiles.custom.get(profileId, { ...params }) -> DLPCustomProfile +- client.zeroTrust.access.applications.policyTests.create({ ...params }) -> PolicyTestCreateResponse +- client.zeroTrust.access.applications.policyTests.get(policyTestId, { ...params }) -> PolicyTestGetResponse -#### Predefined +##### Users Types: -- DLPPredefinedProfile +- UserListResponse Methods: -- client.zeroTrust.dlp.profiles.predefined.update(profileId, { ...params }) -> DLPPredefinedProfile -- client.zeroTrust.dlp.profiles.predefined.get(profileId, { ...params }) -> DLPPredefinedProfile +- client.zeroTrust.access.applications.policyTests.users.list(policyTestId, { ...params }) -> UserListResponsesV4PagePaginationArray -## Gateway +#### Settings Types: -- GatewayCreateResponse -- GatewayListResponse +- SettingUpdateResponse +- SettingEditResponse Methods: -- client.zeroTrust.gateway.create({ ...params }) -> GatewayCreateResponse -- client.zeroTrust.gateway.list({ ...params }) -> GatewayListResponse +- client.zeroTrust.access.applications.settings.update(appId, { ...params }) -> SettingUpdateResponse +- client.zeroTrust.access.applications.settings.edit(appId, { ...params }) -> SettingEditResponse -### AuditSSHSettings +### Certificates Types: -- ZeroTrustGatewaySettings +- AssociatedHostnames +- Certificate +- CertificateDeleteResponse Methods: -- client.zeroTrust.gateway.auditSSHSettings.update({ ...params }) -> ZeroTrustGatewaySettings -- client.zeroTrust.gateway.auditSSHSettings.get({ ...params }) -> ZeroTrustGatewaySettings +- client.zeroTrust.access.certificates.create({ ...params }) -> Certificate +- client.zeroTrust.access.certificates.update(certificateId, { ...params }) -> Certificate +- client.zeroTrust.access.certificates.list({ ...params }) -> CertificatesV4PagePaginationArray +- client.zeroTrust.access.certificates.delete(certificateId, { ...params }) -> CertificateDeleteResponse +- client.zeroTrust.access.certificates.get(certificateId, { ...params }) -> Certificate -### Categories +#### Settings Types: -- ZeroTrustGatewayCategories -- CategoryListResponse +- CertificateSettings Methods: -- client.zeroTrust.gateway.categories.list({ ...params }) -> CategoryListResponse | null +- client.zeroTrust.access.certificates.settings.update({ ...params }) -> CertificateSettingsSinglePage +- client.zeroTrust.access.certificates.settings.get({ ...params }) -> CertificateSettingsSinglePage -### AppTypes +### Groups Types: -- ZeroTrustGatewayAppTypes -- AppTypeListResponse +- ZeroTrustGroup +- GroupCreateResponse +- GroupUpdateResponse +- GroupListResponse +- GroupDeleteResponse +- GroupGetResponse Methods: -- client.zeroTrust.gateway.appTypes.list({ ...params }) -> AppTypeListResponse | null +- client.zeroTrust.access.groups.create({ ...params }) -> GroupCreateResponse +- client.zeroTrust.access.groups.update(groupId, { ...params }) -> GroupUpdateResponse +- client.zeroTrust.access.groups.list({ ...params }) -> GroupListResponsesV4PagePaginationArray +- client.zeroTrust.access.groups.delete(groupId, { ...params }) -> GroupDeleteResponse +- client.zeroTrust.access.groups.get(groupId, { ...params }) -> GroupGetResponse -### Configurations +### ServiceTokens Types: -- ConfigurationUpdateResponse -- ConfigurationEditResponse -- ConfigurationGetResponse +- ServiceToken +- ServiceTokenCreateResponse +- ServiceTokenRotateResponse Methods: -- client.zeroTrust.gateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse -- client.zeroTrust.gateway.configurations.edit({ ...params }) -> ConfigurationEditResponse -- client.zeroTrust.gateway.configurations.get({ ...params }) -> ConfigurationGetResponse +- client.zeroTrust.access.serviceTokens.create({ ...params }) -> ServiceTokenCreateResponse +- client.zeroTrust.access.serviceTokens.update(serviceTokenId, { ...params }) -> ServiceToken +- client.zeroTrust.access.serviceTokens.list({ ...params }) -> ServiceTokensV4PagePaginationArray +- client.zeroTrust.access.serviceTokens.delete(serviceTokenId, { ...params }) -> ServiceToken +- client.zeroTrust.access.serviceTokens.get(serviceTokenId, { ...params }) -> ServiceToken +- client.zeroTrust.access.serviceTokens.refresh(serviceTokenId, { ...params }) -> ServiceToken +- client.zeroTrust.access.serviceTokens.rotate(serviceTokenId, { ...params }) -> ServiceTokenRotateResponse -### Lists +### Bookmarks Types: -- ZeroTrustGatewayLists -- ListCreateResponse -- ListListResponse -- ListDeleteResponse +- Bookmark +- BookmarkDeleteResponse Methods: -- client.zeroTrust.gateway.lists.create({ ...params }) -> ListCreateResponse -- client.zeroTrust.gateway.lists.update(listId, { ...params }) -> ZeroTrustGatewayLists -- client.zeroTrust.gateway.lists.list({ ...params }) -> ListListResponse | null -- client.zeroTrust.gateway.lists.delete(listId, { ...params }) -> ListDeleteResponse -- client.zeroTrust.gateway.lists.edit(listId, { ...params }) -> ZeroTrustGatewayLists -- client.zeroTrust.gateway.lists.get(listId, { ...params }) -> ZeroTrustGatewayLists +- client.zeroTrust.access.bookmarks.create(bookmarkId, { ...params }) -> Bookmark +- client.zeroTrust.access.bookmarks.update(bookmarkId, { ...params }) -> Bookmark +- client.zeroTrust.access.bookmarks.list({ ...params }) -> BookmarksSinglePage +- client.zeroTrust.access.bookmarks.delete(bookmarkId, { ...params }) -> BookmarkDeleteResponse +- client.zeroTrust.access.bookmarks.get(bookmarkId, { ...params }) -> Bookmark -#### Items +### Keys Types: -- ItemListResponse +- KeyUpdateResponse +- KeyGetResponse +- KeyRotateResponse Methods: -- client.zeroTrust.gateway.lists.items.list(listId, { ...params }) -> ItemListResponse | null +- client.zeroTrust.access.keys.update({ ...params }) -> KeyUpdateResponse +- client.zeroTrust.access.keys.get({ ...params }) -> KeyGetResponse +- client.zeroTrust.access.keys.rotate({ ...params }) -> KeyRotateResponse -### Locations +### Logs + +#### AccessRequests Types: -- ZeroTrustGatewayLocations -- LocationListResponse -- LocationDeleteResponse +- AccessRequestListResponse Methods: -- client.zeroTrust.gateway.locations.create({ ...params }) -> ZeroTrustGatewayLocations -- client.zeroTrust.gateway.locations.update(locationId, { ...params }) -> ZeroTrustGatewayLocations -- client.zeroTrust.gateway.locations.list({ ...params }) -> LocationListResponse | null -- client.zeroTrust.gateway.locations.delete(locationId, { ...params }) -> LocationDeleteResponse -- client.zeroTrust.gateway.locations.get(locationId, { ...params }) -> ZeroTrustGatewayLocations +- client.zeroTrust.access.logs.accessRequests.list({ ...params }) -> AccessRequestListResponse -### Logging +#### SCIM Types: -- ZeroTrustGatewayGatewayAccountLoggingSettings - -Methods: - -- client.zeroTrust.gateway.logging.update({ ...params }) -> ZeroTrustGatewayGatewayAccountLoggingSettings -- client.zeroTrust.gateway.logging.get({ ...params }) -> ZeroTrustGatewayGatewayAccountLoggingSettings +- AccessRequest -### ProxyEndpoints +##### Updates Types: -- ZeroTrustGatewayProxyEndpoints -- ProxyEndpointListResponse -- ProxyEndpointDeleteResponse +- UpdateListResponse Methods: -- client.zeroTrust.gateway.proxyEndpoints.create({ ...params }) -> ZeroTrustGatewayProxyEndpoints -- client.zeroTrust.gateway.proxyEndpoints.list({ ...params }) -> ProxyEndpointListResponse | null -- client.zeroTrust.gateway.proxyEndpoints.delete(proxyEndpointId, { ...params }) -> ProxyEndpointDeleteResponse -- client.zeroTrust.gateway.proxyEndpoints.edit(proxyEndpointId, { ...params }) -> ZeroTrustGatewayProxyEndpoints -- client.zeroTrust.gateway.proxyEndpoints.get(proxyEndpointId, { ...params }) -> ZeroTrustGatewayProxyEndpoints +- client.zeroTrust.access.logs.scim.updates.list({ ...params }) -> UpdateListResponsesV4PagePaginationArray -### Rules +### Users Types: -- ZeroTrustGatewayRules -- RuleListResponse -- RuleDeleteResponse +- AccessUser +- UserListResponse Methods: -- client.zeroTrust.gateway.rules.create({ ...params }) -> ZeroTrustGatewayRules -- client.zeroTrust.gateway.rules.update(ruleId, { ...params }) -> ZeroTrustGatewayRules -- client.zeroTrust.gateway.rules.list({ ...params }) -> RuleListResponse | null -- client.zeroTrust.gateway.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse -- client.zeroTrust.gateway.rules.get(ruleId, { ...params }) -> ZeroTrustGatewayRules - -## Networks +- client.zeroTrust.access.users.list({ ...params }) -> UserListResponsesV4PagePaginationArray -### Routes +#### ActiveSessions Types: -- TunnelRoute -- TunnelTeamnet +- ActiveSessionListResponse +- ActiveSessionGetResponse Methods: -- client.zeroTrust.networks.routes.create({ ...params }) -> TunnelRoute -- client.zeroTrust.networks.routes.list({ ...params }) -> TunnelTeamnetsV4PagePaginationArray -- client.zeroTrust.networks.routes.delete(routeId, { ...params }) -> TunnelRoute -- client.zeroTrust.networks.routes.edit(routeId, { ...params }) -> TunnelRoute - -#### IPs +- client.zeroTrust.access.users.activeSessions.list(userId, { ...params }) -> ActiveSessionListResponsesSinglePage +- client.zeroTrust.access.users.activeSessions.get(userId, nonce, { ...params }) -> ActiveSessionGetResponse -Methods: +#### LastSeenIdentity -- client.zeroTrust.networks.routes.ips.get(ip, { ...params }) -> TunnelTeamnet +Types: -#### Networks +- Identity Methods: -- client.zeroTrust.networks.routes.networks.create(ipNetworkEncoded, { ...params }) -> TunnelRoute -- client.zeroTrust.networks.routes.networks.delete(ipNetworkEncoded, { ...params }) -> TunnelRoute -- client.zeroTrust.networks.routes.networks.edit(ipNetworkEncoded, { ...params }) -> TunnelRoute +- client.zeroTrust.access.users.lastSeenIdentity.get(userId, { ...params }) -> Identity -### VirtualNetworks +#### FailedLogins Types: -- TunnelVirtualNetwork -- VirtualNetworkCreateResponse -- VirtualNetworkListResponse -- VirtualNetworkDeleteResponse -- VirtualNetworkEditResponse +- FailedLoginListResponse Methods: -- client.zeroTrust.networks.virtualNetworks.create({ ...params }) -> VirtualNetworkCreateResponse -- client.zeroTrust.networks.virtualNetworks.list({ ...params }) -> VirtualNetworkListResponse | null -- client.zeroTrust.networks.virtualNetworks.delete(virtualNetworkId, { ...params }) -> VirtualNetworkDeleteResponse -- client.zeroTrust.networks.virtualNetworks.edit(virtualNetworkId, { ...params }) -> VirtualNetworkEditResponse - -# Challenges - -## Widgets - -# Hyperdrive +- client.zeroTrust.access.users.failedLogins.list(userId, { ...params }) -> FailedLoginListResponsesSinglePage -## Configs +### CustomPages Types: -- HyperdriveHyperdriveWithIdentifier -- ConfigCreateResponse -- ConfigUpdateResponse -- ConfigListResponse -- ConfigDeleteResponse -- ConfigEditResponse -- ConfigGetResponse +- CustomPage +- CustomPageWithoutHTML +- CustomPageDeleteResponse Methods: -- client.hyperdrive.configs.create({ ...params }) -> ConfigCreateResponse | null -- client.hyperdrive.configs.update(hyperdriveId, { ...params }) -> ConfigUpdateResponse | null -- client.hyperdrive.configs.list({ ...params }) -> ConfigListResponse -- client.hyperdrive.configs.delete(hyperdriveId, { ...params }) -> ConfigDeleteResponse | null -- client.hyperdrive.configs.edit(hyperdriveId, { ...params }) -> ConfigEditResponse | null -- client.hyperdrive.configs.get(hyperdriveId, { ...params }) -> ConfigGetResponse | null - -# RUM +- client.zeroTrust.access.customPages.create({ ...params }) -> CustomPageWithoutHTML +- client.zeroTrust.access.customPages.update(customPageId, { ...params }) -> CustomPageWithoutHTML +- client.zeroTrust.access.customPages.list({ ...params }) -> CustomPageWithoutHTMLsV4PagePaginationArray +- client.zeroTrust.access.customPages.delete(customPageId, { ...params }) -> CustomPageDeleteResponse +- client.zeroTrust.access.customPages.get(customPageId, { ...params }) -> CustomPage -## SiteInfos +### Tags Types: -- RUMSite -- SiteInfoDeleteResponse +- Tag +- TagDeleteResponse Methods: -- client.rum.siteInfos.create({ ...params }) -> RUMSite -- client.rum.siteInfos.update(siteId, { ...params }) -> RUMSite -- client.rum.siteInfos.list({ ...params }) -> RUMSitesV4PagePaginationArray -- client.rum.siteInfos.delete(siteId, { ...params }) -> SiteInfoDeleteResponse -- client.rum.siteInfos.get(siteId, { ...params }) -> RUMSite +- client.zeroTrust.access.tags.create({ ...params }) -> Tag +- client.zeroTrust.access.tags.update(tagName, { ...params }) -> Tag +- client.zeroTrust.access.tags.list({ ...params }) -> TagsV4PagePaginationArray +- client.zeroTrust.access.tags.delete(tagName, { ...params }) -> TagDeleteResponse +- client.zeroTrust.access.tags.get(tagName, { ...params }) -> Tag -## Rules +### Policies Types: -- RUMRule -- RuleListResponse -- RuleDeleteResponse +- ApprovalGroup +- Policy +- PolicyCreateResponse +- PolicyUpdateResponse +- PolicyListResponse +- PolicyDeleteResponse +- PolicyGetResponse Methods: -- client.rum.rules.create(rulesetId, { ...params }) -> RUMRule -- client.rum.rules.update(rulesetId, ruleId, { ...params }) -> RUMRule -- client.rum.rules.list(rulesetId, { ...params }) -> RuleListResponse -- client.rum.rules.delete(rulesetId, ruleId, { ...params }) -> RuleDeleteResponse +- client.zeroTrust.access.policies.create({ ...params }) -> PolicyCreateResponse +- client.zeroTrust.access.policies.update(policyId, { ...params }) -> PolicyUpdateResponse +- client.zeroTrust.access.policies.list({ ...params }) -> PolicyListResponsesV4PagePaginationArray +- client.zeroTrust.access.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse +- client.zeroTrust.access.policies.get(policyId, { ...params }) -> PolicyGetResponse -# Vectorize +## DEX -## Indexes +Types: + +- DigitalExperienceMonitor +- NetworkPath +- NetworkPathResponse +- Percentiles + +### WARPChangeEvents Types: -- VectorizeCreateIndex -- VectorizeIndexDeleteVectorsByID -- VectorizeIndexInsert -- VectorizeIndexQuery -- VectorizeIndexUpsert -- IndexListResponse -- IndexDeleteResponse -- IndexGetByIDsResponse +- WARPChangeEventGetResponse Methods: -- client.vectorize.indexes.create(accountIdentifier, { ...params }) -> VectorizeCreateIndex | null -- client.vectorize.indexes.update(accountIdentifier, indexName, { ...params }) -> VectorizeCreateIndex | null -- client.vectorize.indexes.list(accountIdentifier) -> IndexListResponse -- client.vectorize.indexes.delete(accountIdentifier, indexName) -> IndexDeleteResponse | null -- client.vectorize.indexes.deleteByIds(accountIdentifier, indexName, { ...params }) -> VectorizeIndexDeleteVectorsByID | null -- client.vectorize.indexes.get(accountIdentifier, indexName) -> VectorizeCreateIndex | null -- client.vectorize.indexes.getByIds(accountIdentifier, indexName, { ...params }) -> IndexGetByIDsResponse | null -- client.vectorize.indexes.insert(accountIdentifier, indexName) -> VectorizeIndexInsert | null -- client.vectorize.indexes.query(accountIdentifier, indexName, { ...params }) -> VectorizeIndexQuery | null -- client.vectorize.indexes.upsert(accountIdentifier, indexName) -> VectorizeIndexUpsert | null +- client.zeroTrust.dex.warpChangeEvents.get({ ...params }) -> WARPChangeEventGetResponse -# URLScanner +### Commands Types: -- URLScannerScanResponse +- CommandCreateResponse +- CommandListResponse Methods: -- client.urlScanner.scan(accountId, { ...params }) -> URLScannerScanResponse +- client.zeroTrust.dex.commands.create({ ...params }) -> CommandCreateResponse +- client.zeroTrust.dex.commands.list({ ...params }) -> CommandListResponsesV4PagePagination -## Scans +#### Devices Types: -- ScanCreateResponse -- ScanGetResponse -- ScanHarResponse +- DeviceListResponse Methods: -- client.urlScanner.scans.create(accountId, { ...params }) -> ScanCreateResponse -- client.urlScanner.scans.get(accountId, scanId) -> ScanGetResponse -- client.urlScanner.scans.har(accountId, scanId) -> ScanHarResponse -- client.urlScanner.scans.screenshot(accountId, scanId, { ...params }) -> Response +- client.zeroTrust.dex.commands.devices.list({ ...params }) -> DeviceListResponsesV4PagePagination -# Radar +#### Downloads -## Annotations +Methods: -### Outages +- client.zeroTrust.dex.commands.downloads.get(commandId, filename, { ...params }) -> Response + +#### Quota Types: -- OutageGetResponse -- OutageLocationsResponse +- QuotaGetResponse Methods: -- client.radar.annotations.outages.get({ ...params }) -> OutageGetResponse -- client.radar.annotations.outages.locations({ ...params }) -> OutageLocationsResponse +- client.zeroTrust.dex.commands.quota.get({ ...params }) -> QuotaGetResponse -## BGP +### Colos + +Types: + +- ColoListResponse + +Methods: + +- client.zeroTrust.dex.colos.list({ ...params }) -> ColoListResponsesSinglePage + +### FleetStatus + +Types: + +- LiveStat +- FleetStatusLiveResponse +- FleetStatusOverTimeResponse + +Methods: + +- client.zeroTrust.dex.fleetStatus.live({ ...params }) -> FleetStatusLiveResponse +- client.zeroTrust.dex.fleetStatus.overTime({ ...params }) -> FleetStatusOverTimeResponse + +#### Devices + +Types: + +- DeviceListResponse + +Methods: + +- client.zeroTrust.dex.fleetStatus.devices.list({ ...params }) -> DeviceListResponsesV4PagePaginationArray + +### HTTPTests + +Types: + +- HTTPDetails + +Methods: + +- client.zeroTrust.dex.httpTests.get(testId, { ...params }) -> HTTPDetails + +#### Percentiles + +Types: + +- HTTPDetailsPercentiles +- TestStatOverTime + +Methods: + +- client.zeroTrust.dex.httpTests.percentiles.get(testId, { ...params }) -> HTTPDetailsPercentiles + +### Tests + +Types: + +- AggregateTimePeriod +- Tests + +Methods: + +- client.zeroTrust.dex.tests.list({ ...params }) -> TestsV4PagePagination + +#### UniqueDevices + +Types: + +- UniqueDevices + +Methods: + +- client.zeroTrust.dex.tests.uniqueDevices.list({ ...params }) -> UniqueDevices + +### TracerouteTestResults + +#### NetworkPath + +Types: + +- NetworkPathGetResponse + +Methods: + +- client.zeroTrust.dex.tracerouteTestResults.networkPath.get(testResultId, { ...params }) -> NetworkPathGetResponse + +### TracerouteTests + +Types: + +- Traceroute +- TracerouteTestPercentilesResponse + +Methods: + +- client.zeroTrust.dex.tracerouteTests.get(testId, { ...params }) -> Traceroute +- client.zeroTrust.dex.tracerouteTests.networkPath(testId, { ...params }) -> NetworkPathResponse +- client.zeroTrust.dex.tracerouteTests.percentiles(testId, { ...params }) -> TracerouteTestPercentilesResponse + +## Tunnels + +Types: + +- Connection +- TunnelListResponse + +Methods: + +- client.zeroTrust.tunnels.list({ ...params }) -> TunnelListResponsesV4PagePaginationArray + +### Cloudflared + +Methods: + +- client.zeroTrust.tunnels.cloudflared.create({ ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.list({ ...params }) -> CloudflareTunnelsV4PagePaginationArray +- client.zeroTrust.tunnels.cloudflared.delete(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.edit(tunnelId, { ...params }) -> CloudflareTunnel +- client.zeroTrust.tunnels.cloudflared.get(tunnelId, { ...params }) -> CloudflareTunnel + +#### Configurations + +Types: + +- ConfigurationUpdateResponse +- ConfigurationGetResponse + +Methods: + +- client.zeroTrust.tunnels.cloudflared.configurations.update(tunnelId, { ...params }) -> ConfigurationUpdateResponse +- client.zeroTrust.tunnels.cloudflared.configurations.get(tunnelId, { ...params }) -> ConfigurationGetResponse + +#### Connections + +Types: + +- Client +- ConnectionDeleteResponse + +Methods: + +- client.zeroTrust.tunnels.cloudflared.connections.delete(tunnelId, { ...params }) -> ConnectionDeleteResponse | null +- client.zeroTrust.tunnels.cloudflared.connections.get(tunnelId, { ...params }) -> ClientsSinglePage + +#### Token + +Types: + +- TokenGetResponse + +Methods: + +- client.zeroTrust.tunnels.cloudflared.token.get(tunnelId, { ...params }) -> TokenGetResponse + +#### Connectors + +Methods: + +- client.zeroTrust.tunnels.cloudflared.connectors.get(tunnelId, connectorId, { ...params }) -> Client + +#### Management + +Types: + +- ManagementCreateResponse + +Methods: + +- client.zeroTrust.tunnels.cloudflared.management.create(tunnelId, { ...params }) -> ManagementCreateResponse + +### WARPConnector + +Types: + +- WARPConnectorCreateResponse +- WARPConnectorListResponse +- WARPConnectorDeleteResponse +- WARPConnectorEditResponse +- WARPConnectorGetResponse + +Methods: + +- client.zeroTrust.tunnels.warpConnector.create({ ...params }) -> WARPConnectorCreateResponse +- client.zeroTrust.tunnels.warpConnector.list({ ...params }) -> WARPConnectorListResponsesV4PagePaginationArray +- client.zeroTrust.tunnels.warpConnector.delete(tunnelId, { ...params }) -> WARPConnectorDeleteResponse +- client.zeroTrust.tunnels.warpConnector.edit(tunnelId, { ...params }) -> WARPConnectorEditResponse +- client.zeroTrust.tunnels.warpConnector.get(tunnelId, { ...params }) -> WARPConnectorGetResponse + +#### Token + +Types: + +- TokenGetResponse + +Methods: + +- client.zeroTrust.tunnels.warpConnector.token.get(tunnelId, { ...params }) -> TokenGetResponse + +## ConnectivitySettings + +Types: + +- ConnectivitySettingEditResponse +- ConnectivitySettingGetResponse + +Methods: + +- client.zeroTrust.connectivitySettings.edit({ ...params }) -> ConnectivitySettingEditResponse +- client.zeroTrust.connectivitySettings.get({ ...params }) -> ConnectivitySettingGetResponse + +## DLP + +### Datasets + +Types: + +- Dataset +- DatasetArray +- DatasetCreation +- DatasetCreateResponse +- DatasetUpdateResponse +- DatasetGetResponse + +Methods: + +- client.zeroTrust.dlp.datasets.create({ ...params }) -> DatasetCreateResponse +- client.zeroTrust.dlp.datasets.update(datasetId, { ...params }) -> DatasetUpdateResponse +- client.zeroTrust.dlp.datasets.list({ ...params }) -> DatasetsSinglePage +- client.zeroTrust.dlp.datasets.delete(datasetId, { ...params }) -> void +- client.zeroTrust.dlp.datasets.get(datasetId, { ...params }) -> DatasetGetResponse + +#### Upload + +Types: + +- NewVersion +- UploadCreateResponse +- UploadEditResponse + +Methods: + +- client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> UploadCreateResponse +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> UploadEditResponse + +#### Versions + +Types: + +- VersionCreateResponse + +Methods: + +- client.zeroTrust.dlp.datasets.versions.create(datasetId, version, [ ...body ]) -> VersionCreateResponsesSinglePage + +##### Entries + +Types: + +- EntryCreateResponse + +Methods: + +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse + +### Patterns + +Types: + +- PatternValidateResponse + +Methods: + +- client.zeroTrust.dlp.patterns.validate({ ...params }) -> PatternValidateResponse + +### PayloadLogs + +Types: + +- PayloadLogUpdateResponse +- PayloadLogGetResponse + +Methods: + +- client.zeroTrust.dlp.payloadLogs.update({ ...params }) -> PayloadLogUpdateResponse +- client.zeroTrust.dlp.payloadLogs.get({ ...params }) -> PayloadLogGetResponse + +### Email + +#### AccountMapping + +Types: + +- AccountMappingCreateResponse +- AccountMappingGetResponse + +Methods: + +- client.zeroTrust.dlp.email.accountMapping.create({ ...params }) -> AccountMappingCreateResponse +- client.zeroTrust.dlp.email.accountMapping.get({ ...params }) -> AccountMappingGetResponse + +#### Rules + +Types: + +- RuleCreateResponse +- RuleUpdateResponse +- RuleListResponse +- RuleDeleteResponse +- RuleBulkEditResponse +- RuleGetResponse + +Methods: + +- client.zeroTrust.dlp.email.rules.create({ ...params }) -> RuleCreateResponse +- client.zeroTrust.dlp.email.rules.update(ruleId, { ...params }) -> RuleUpdateResponse +- client.zeroTrust.dlp.email.rules.list({ ...params }) -> RuleListResponsesSinglePage +- client.zeroTrust.dlp.email.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse +- client.zeroTrust.dlp.email.rules.bulkEdit({ ...params }) -> RuleBulkEditResponse +- client.zeroTrust.dlp.email.rules.get(ruleId, { ...params }) -> RuleGetResponse + +### Profiles + +Types: + +- ContextAwareness +- Profile +- SkipConfiguration +- ProfileGetResponse + +Methods: + +- client.zeroTrust.dlp.profiles.list({ ...params }) -> ProfilesSinglePage +- client.zeroTrust.dlp.profiles.get(profileId, { ...params }) -> ProfileGetResponse + +#### Custom + +Types: + +- CustomProfile +- Pattern +- CustomCreateResponse +- CustomUpdateResponse +- CustomDeleteResponse +- CustomGetResponse + +Methods: + +- client.zeroTrust.dlp.profiles.custom.create({ ...params }) -> CustomCreateResponse +- client.zeroTrust.dlp.profiles.custom.update(profileId, { ...params }) -> CustomUpdateResponse +- client.zeroTrust.dlp.profiles.custom.delete(profileId, { ...params }) -> CustomDeleteResponse | null +- client.zeroTrust.dlp.profiles.custom.get(profileId, { ...params }) -> CustomGetResponse + +#### Predefined + +Types: + +- PredefinedProfile +- PredefinedUpdateResponse +- PredefinedDeleteResponse +- PredefinedGetResponse + +Methods: + +- client.zeroTrust.dlp.profiles.predefined.update(profileId, { ...params }) -> PredefinedUpdateResponse +- client.zeroTrust.dlp.profiles.predefined.delete(profileId, { ...params }) -> PredefinedDeleteResponse | null +- client.zeroTrust.dlp.profiles.predefined.get(profileId, { ...params }) -> PredefinedGetResponse + +### Limits + +Types: + +- LimitListResponse + +Methods: + +- client.zeroTrust.dlp.limits.list({ ...params }) -> LimitListResponse + +### Entries + +Types: + +- EntryCreateResponse +- EntryUpdateResponse +- EntryListResponse +- EntryDeleteResponse +- EntryGetResponse + +Methods: + +- client.zeroTrust.dlp.entries.create({ ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.entries.update(entryId, { ...params }) -> EntryUpdateResponse +- client.zeroTrust.dlp.entries.list({ ...params }) -> EntryListResponsesSinglePage +- client.zeroTrust.dlp.entries.delete(entryId, { ...params }) -> EntryDeleteResponse | null +- client.zeroTrust.dlp.entries.get(entryId, { ...params }) -> EntryGetResponse + +#### Custom + +Types: + +- CustomCreateResponse +- CustomUpdateResponse +- CustomListResponse +- CustomDeleteResponse +- CustomGetResponse + +Methods: + +- client.zeroTrust.dlp.entries.custom.create({ ...params }) -> CustomCreateResponse +- client.zeroTrust.dlp.entries.custom.update(entryId, { ...params }) -> CustomUpdateResponse +- client.zeroTrust.dlp.entries.custom.list({ ...params }) -> CustomListResponsesSinglePage +- client.zeroTrust.dlp.entries.custom.delete(entryId, { ...params }) -> CustomDeleteResponse | null +- client.zeroTrust.dlp.entries.custom.get(entryId, { ...params }) -> CustomGetResponse + +#### Predefined + +Types: + +- PredefinedCreateResponse +- PredefinedUpdateResponse +- PredefinedListResponse +- PredefinedDeleteResponse +- PredefinedGetResponse + +Methods: + +- client.zeroTrust.dlp.entries.predefined.create({ ...params }) -> PredefinedCreateResponse +- client.zeroTrust.dlp.entries.predefined.update(entryId, { ...params }) -> PredefinedUpdateResponse +- client.zeroTrust.dlp.entries.predefined.list({ ...params }) -> PredefinedListResponsesSinglePage +- client.zeroTrust.dlp.entries.predefined.delete(entryId, { ...params }) -> PredefinedDeleteResponse | null +- client.zeroTrust.dlp.entries.predefined.get(entryId, { ...params }) -> PredefinedGetResponse + +#### Integration + +Types: + +- IntegrationCreateResponse +- IntegrationUpdateResponse +- IntegrationListResponse +- IntegrationDeleteResponse +- IntegrationGetResponse + +Methods: + +- client.zeroTrust.dlp.entries.integration.create({ ...params }) -> IntegrationCreateResponse +- client.zeroTrust.dlp.entries.integration.update(entryId, { ...params }) -> IntegrationUpdateResponse +- client.zeroTrust.dlp.entries.integration.list({ ...params }) -> IntegrationListResponsesSinglePage +- client.zeroTrust.dlp.entries.integration.delete(entryId, { ...params }) -> IntegrationDeleteResponse | null +- client.zeroTrust.dlp.entries.integration.get(entryId, { ...params }) -> IntegrationGetResponse + +## Gateway + +Types: + +- GatewayCreateResponse +- GatewayListResponse + +Methods: + +- client.zeroTrust.gateway.create({ ...params }) -> GatewayCreateResponse +- client.zeroTrust.gateway.list({ ...params }) -> GatewayListResponse + +### AuditSSHSettings + +Types: + +- GatewaySettings + +Methods: + +- client.zeroTrust.gateway.auditSSHSettings.update({ ...params }) -> GatewaySettings +- client.zeroTrust.gateway.auditSSHSettings.get({ ...params }) -> GatewaySettings +- client.zeroTrust.gateway.auditSSHSettings.rotateSeed({ ...params }) -> GatewaySettings + +### Categories + +Types: + +- Category + +Methods: + +- client.zeroTrust.gateway.categories.list({ ...params }) -> CategoriesSinglePage + +### AppTypes + +Types: + +- AppType + +Methods: + +- client.zeroTrust.gateway.appTypes.list({ ...params }) -> AppTypesSinglePage + +### Configurations + +Types: + +- ActivityLogSettings +- AntiVirusSettings +- BlockPageSettings +- BodyScanningSettings +- BrowserIsolationSettings +- CustomCertificateSettings +- ExtendedEmailMatching +- FipsSettings +- GatewayConfigurationSettings +- NotificationSettings +- ProtocolDetection +- TLSSettings +- ConfigurationUpdateResponse +- ConfigurationEditResponse +- ConfigurationGetResponse + +Methods: + +- client.zeroTrust.gateway.configurations.update({ ...params }) -> ConfigurationUpdateResponse +- client.zeroTrust.gateway.configurations.edit({ ...params }) -> ConfigurationEditResponse +- client.zeroTrust.gateway.configurations.get({ ...params }) -> ConfigurationGetResponse + +#### CustomCertificate + +Methods: + +- client.zeroTrust.gateway.configurations.customCertificate.get({ ...params }) -> CustomCertificateSettings | null + +### Lists + +Types: + +- GatewayItem +- GatewayList +- ListCreateResponse +- ListDeleteResponse + +Methods: + +- client.zeroTrust.gateway.lists.create({ ...params }) -> ListCreateResponse +- client.zeroTrust.gateway.lists.update(listId, { ...params }) -> GatewayList +- client.zeroTrust.gateway.lists.list({ ...params }) -> GatewayListsSinglePage +- client.zeroTrust.gateway.lists.delete(listId, { ...params }) -> ListDeleteResponse +- client.zeroTrust.gateway.lists.edit(listId, { ...params }) -> GatewayList +- client.zeroTrust.gateway.lists.get(listId, { ...params }) -> GatewayList + +#### Items + +Types: + +- ItemListResponse + +Methods: + +- client.zeroTrust.gateway.lists.items.list(listId, { ...params }) -> ItemListResponsesSinglePage + +### Locations + +Types: + +- DOHEndpoint +- DOTEndpoint +- Endpoint +- IPNetwork +- IPV4Endpoint +- IPV6Endpoint +- IPV6Network +- Location +- LocationDeleteResponse + +Methods: + +- client.zeroTrust.gateway.locations.create({ ...params }) -> Location +- client.zeroTrust.gateway.locations.update(locationId, { ...params }) -> Location +- client.zeroTrust.gateway.locations.list({ ...params }) -> LocationsSinglePage +- client.zeroTrust.gateway.locations.delete(locationId, { ...params }) -> LocationDeleteResponse +- client.zeroTrust.gateway.locations.get(locationId, { ...params }) -> Location + +### Logging + +Types: + +- LoggingSetting + +Methods: + +- client.zeroTrust.gateway.logging.update({ ...params }) -> LoggingSetting +- client.zeroTrust.gateway.logging.get({ ...params }) -> LoggingSetting + +### ProxyEndpoints + +Types: + +- GatewayIPs +- ProxyEndpoint +- ProxyEndpointDeleteResponse + +Methods: + +- client.zeroTrust.gateway.proxyEndpoints.create({ ...params }) -> ProxyEndpoint +- client.zeroTrust.gateway.proxyEndpoints.list({ ...params }) -> ProxyEndpointsSinglePage +- client.zeroTrust.gateway.proxyEndpoints.delete(proxyEndpointId, { ...params }) -> ProxyEndpointDeleteResponse +- client.zeroTrust.gateway.proxyEndpoints.edit(proxyEndpointId, { ...params }) -> ProxyEndpoint +- client.zeroTrust.gateway.proxyEndpoints.get(proxyEndpointId, { ...params }) -> ProxyEndpoint + +### Rules + +Types: + +- DNSResolverSettingsV4 +- DNSResolverSettingsV6 +- GatewayFilter +- GatewayRule +- RuleSetting +- Schedule +- RuleDeleteResponse + +Methods: + +- client.zeroTrust.gateway.rules.create({ ...params }) -> GatewayRule +- client.zeroTrust.gateway.rules.update(ruleId, { ...params }) -> GatewayRule +- client.zeroTrust.gateway.rules.list({ ...params }) -> GatewayRulesSinglePage +- client.zeroTrust.gateway.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse +- client.zeroTrust.gateway.rules.get(ruleId, { ...params }) -> GatewayRule +- client.zeroTrust.gateway.rules.listTenant({ ...params }) -> GatewayRulesSinglePage +- client.zeroTrust.gateway.rules.resetExpiration(ruleId, { ...params }) -> GatewayRule + +### Certificates + +Types: + +- CertificateCreateResponse +- CertificateListResponse +- CertificateDeleteResponse +- CertificateActivateResponse +- CertificateDeactivateResponse +- CertificateGetResponse + +Methods: + +- client.zeroTrust.gateway.certificates.create({ ...params }) -> CertificateCreateResponse +- client.zeroTrust.gateway.certificates.list({ ...params }) -> CertificateListResponsesSinglePage +- client.zeroTrust.gateway.certificates.delete(certificateId, { ...params }) -> CertificateDeleteResponse +- client.zeroTrust.gateway.certificates.activate(certificateId, { ...params }) -> CertificateActivateResponse +- client.zeroTrust.gateway.certificates.deactivate(certificateId, { ...params }) -> CertificateDeactivateResponse +- client.zeroTrust.gateway.certificates.get(certificateId, { ...params }) -> CertificateGetResponse + +## Networks + +### Routes + +Types: + +- NetworkRoute +- Route +- Teamnet + +Methods: + +- client.zeroTrust.networks.routes.create({ ...params }) -> Route +- client.zeroTrust.networks.routes.list({ ...params }) -> TeamnetsV4PagePaginationArray +- client.zeroTrust.networks.routes.delete(routeId, { ...params }) -> Route +- client.zeroTrust.networks.routes.edit(routeId, { ...params }) -> Route +- client.zeroTrust.networks.routes.get(routeId, { ...params }) -> Route + +#### IPs + +Methods: + +- client.zeroTrust.networks.routes.ips.get(ip, { ...params }) -> Teamnet + +#### Networks + +Methods: + +- client.zeroTrust.networks.routes.networks.create(ipNetworkEncoded, { ...params }) -> Route +- client.zeroTrust.networks.routes.networks.delete(ipNetworkEncoded, { ...params }) -> Route +- client.zeroTrust.networks.routes.networks.edit(ipNetworkEncoded, { ...params }) -> Route + +### VirtualNetworks + +Types: + +- VirtualNetwork + +Methods: + +- client.zeroTrust.networks.virtualNetworks.create({ ...params }) -> VirtualNetwork +- client.zeroTrust.networks.virtualNetworks.list({ ...params }) -> VirtualNetworksSinglePage +- client.zeroTrust.networks.virtualNetworks.delete(virtualNetworkId, { ...params }) -> VirtualNetwork +- client.zeroTrust.networks.virtualNetworks.edit(virtualNetworkId, { ...params }) -> VirtualNetwork +- client.zeroTrust.networks.virtualNetworks.get(virtualNetworkId, { ...params }) -> VirtualNetwork + +### Subnets + +Types: + +- SubnetListResponse + +Methods: + +- client.zeroTrust.networks.subnets.list({ ...params }) -> SubnetListResponsesV4PagePaginationArray + +#### WARP + +Types: + +- WARPCreateResponse +- WARPDeleteResponse +- WARPEditResponse +- WARPGetResponse + +Methods: + +- client.zeroTrust.networks.subnets.warp.create({ ...params }) -> WARPCreateResponse +- client.zeroTrust.networks.subnets.warp.delete(subnetId, { ...params }) -> WARPDeleteResponse | null +- client.zeroTrust.networks.subnets.warp.edit(subnetId, { ...params }) -> WARPEditResponse +- client.zeroTrust.networks.subnets.warp.get(subnetId, { ...params }) -> WARPGetResponse + +#### CloudflareSource + +Types: + +- CloudflareSourceUpdateResponse + +Methods: + +- client.zeroTrust.networks.subnets.cloudflareSource.update(addressFamily, { ...params }) -> CloudflareSourceUpdateResponse + +### HostnameRoutes + +Types: + +- HostnameRoute + +Methods: + +- client.zeroTrust.networks.hostnameRoutes.create({ ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.list({ ...params }) -> HostnameRoutesV4PagePaginationArray +- client.zeroTrust.networks.hostnameRoutes.delete(hostnameRouteId, { ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.edit(hostnameRouteId, { ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.get(hostnameRouteId, { ...params }) -> HostnameRoute + +## RiskScoring + +Types: + +- RiskScoringGetResponse +- RiskScoringResetResponse + +Methods: + +- client.zeroTrust.riskScoring.get(userId, { ...params }) -> RiskScoringGetResponse +- client.zeroTrust.riskScoring.reset(userId, { ...params }) -> RiskScoringResetResponse | null + +### Behaviours + +Types: + +- BehaviourUpdateResponse +- BehaviourGetResponse + +Methods: + +- client.zeroTrust.riskScoring.behaviours.update({ ...params }) -> BehaviourUpdateResponse +- client.zeroTrust.riskScoring.behaviours.get({ ...params }) -> BehaviourGetResponse + +### Summary + +Types: + +- SummaryGetResponse + +Methods: + +- client.zeroTrust.riskScoring.summary.get({ ...params }) -> SummaryGetResponse + +### Integrations + +Types: + +- IntegrationCreateResponse +- IntegrationUpdateResponse +- IntegrationListResponse +- IntegrationDeleteResponse +- IntegrationGetResponse + +Methods: + +- client.zeroTrust.riskScoring.integrations.create({ ...params }) -> IntegrationCreateResponse +- client.zeroTrust.riskScoring.integrations.update(integrationId, { ...params }) -> IntegrationUpdateResponse +- client.zeroTrust.riskScoring.integrations.list({ ...params }) -> IntegrationListResponsesSinglePage +- client.zeroTrust.riskScoring.integrations.delete(integrationId, { ...params }) -> IntegrationDeleteResponse | null +- client.zeroTrust.riskScoring.integrations.get(integrationId, { ...params }) -> IntegrationGetResponse + +#### References + +Types: + +- ReferenceGetResponse + +Methods: + +- client.zeroTrust.riskScoring.integrations.references.get(referenceId, { ...params }) -> ReferenceGetResponse + +# Turnstile + +## Widgets + +Types: + +- Widget +- WidgetDomain +- WidgetListResponse + +Methods: + +- client.turnstile.widgets.create({ ...params }) -> Widget +- client.turnstile.widgets.update(sitekey, { ...params }) -> Widget +- client.turnstile.widgets.list({ ...params }) -> WidgetListResponsesV4PagePaginationArray +- client.turnstile.widgets.delete(sitekey, { ...params }) -> Widget +- client.turnstile.widgets.get(sitekey, { ...params }) -> Widget +- client.turnstile.widgets.rotateSecret(sitekey, { ...params }) -> Widget + +# Connectivity + +## Directory + +### Services + +Types: + +- ServiceCreateResponse +- ServiceUpdateResponse +- ServiceListResponse +- ServiceGetResponse + +Methods: + +- client.connectivity.directory.services.create({ ...params }) -> ServiceCreateResponse +- client.connectivity.directory.services.update(serviceId, { ...params }) -> ServiceUpdateResponse +- client.connectivity.directory.services.list({ ...params }) -> ServiceListResponsesV4PagePaginationArray +- client.connectivity.directory.services.delete(serviceId, { ...params }) -> void +- client.connectivity.directory.services.get(serviceId, { ...params }) -> ServiceGetResponse + +# Hyperdrive + +Types: + +- Configuration +- Hyperdrive + +## Configs + +Types: + +- ConfigDeleteResponse + +Methods: + +- client.hyperdrive.configs.create({ ...params }) -> Hyperdrive +- client.hyperdrive.configs.update(hyperdriveId, { ...params }) -> Hyperdrive +- client.hyperdrive.configs.list({ ...params }) -> HyperdrivesSinglePage +- client.hyperdrive.configs.delete(hyperdriveId, { ...params }) -> ConfigDeleteResponse | null +- client.hyperdrive.configs.edit(hyperdriveId, { ...params }) -> Hyperdrive +- client.hyperdrive.configs.get(hyperdriveId, { ...params }) -> Hyperdrive + +# RUM + +## SiteInfo + +Types: + +- Site +- SiteInfoDeleteResponse + +Methods: + +- client.rum.siteInfo.create({ ...params }) -> Site +- client.rum.siteInfo.update(siteId, { ...params }) -> Site +- client.rum.siteInfo.list({ ...params }) -> SitesV4PagePaginationArray +- client.rum.siteInfo.delete(siteId, { ...params }) -> SiteInfoDeleteResponse +- client.rum.siteInfo.get(siteId, { ...params }) -> Site + +## Rules + +Types: + +- RUMRule +- RuleListResponse +- RuleDeleteResponse +- RuleBulkCreateResponse + +Methods: + +- client.rum.rules.create(rulesetId, { ...params }) -> RUMRule +- client.rum.rules.update(rulesetId, ruleId, { ...params }) -> RUMRule +- client.rum.rules.list(rulesetId, { ...params }) -> RuleListResponse +- client.rum.rules.delete(rulesetId, ruleId, { ...params }) -> RuleDeleteResponse +- client.rum.rules.bulkCreate(rulesetId, { ...params }) -> RuleBulkCreateResponse + +# Vectorize + +## Indexes + +Types: + +- CreateIndex +- IndexDeleteVectorsByID +- IndexDimensionConfiguration +- IndexInsert +- IndexQuery +- IndexUpsert +- IndexDeleteResponse +- IndexDeleteByIDsResponse +- IndexGetByIDsResponse +- IndexInfoResponse +- IndexInsertResponse +- IndexListVectorsResponse +- IndexQueryResponse +- IndexUpsertResponse + +Methods: + +- client.vectorize.indexes.create({ ...params }) -> CreateIndex | null +- client.vectorize.indexes.list({ ...params }) -> CreateIndicesSinglePage +- client.vectorize.indexes.delete(indexName, { ...params }) -> IndexDeleteResponse | null +- client.vectorize.indexes.deleteByIds(indexName, { ...params }) -> IndexDeleteByIDsResponse | null +- client.vectorize.indexes.get(indexName, { ...params }) -> CreateIndex | null +- client.vectorize.indexes.getByIds(indexName, { ...params }) -> IndexGetByIDsResponse | null +- client.vectorize.indexes.info(indexName, { ...params }) -> IndexInfoResponse | null +- client.vectorize.indexes.insert(indexName, { ...params }) -> IndexInsertResponse | null +- client.vectorize.indexes.listVectors(indexName, { ...params }) -> IndexListVectorsResponse | null +- client.vectorize.indexes.query(indexName, { ...params }) -> IndexQueryResponse | null +- client.vectorize.indexes.upsert(indexName, { ...params }) -> IndexUpsertResponse | null + +### MetadataIndex + +Types: + +- MetadataIndexCreateResponse +- MetadataIndexListResponse +- MetadataIndexDeleteResponse + +Methods: + +- client.vectorize.indexes.metadataIndex.create(indexName, { ...params }) -> MetadataIndexCreateResponse | null +- client.vectorize.indexes.metadataIndex.list(indexName, { ...params }) -> MetadataIndexListResponse | null +- client.vectorize.indexes.metadataIndex.delete(indexName, { ...params }) -> MetadataIndexDeleteResponse | null + +# URLScanner + +Types: + +- URLScannerDomain +- URLScannerTask + +## Responses + +Types: + +- ResponseGetResponse + +Methods: + +- client.urlScanner.responses.get(responseId, { ...params }) -> string + +## Scans + +Types: + +- ScanCreateResponse +- ScanListResponse +- ScanBulkCreateResponse +- ScanDOMResponse +- ScanGetResponse +- ScanHARResponse + +Methods: + +- client.urlScanner.scans.create({ ...params }) -> ScanCreateResponse +- client.urlScanner.scans.list({ ...params }) -> ScanListResponse +- client.urlScanner.scans.bulkCreate([ ...body ]) -> ScanBulkCreateResponse +- client.urlScanner.scans.dom(scanId, { ...params }) -> string +- client.urlScanner.scans.get(scanId, { ...params }) -> ScanGetResponse +- client.urlScanner.scans.har(scanId, { ...params }) -> ScanHARResponse +- client.urlScanner.scans.screenshot(scanId, { ...params }) -> Response + +# Radar + +## AI + +### ToMarkdown + +Types: + +- ToMarkdownCreateResponse + +Methods: + +- client.radar.ai.toMarkdown.create({ ...params }) -> ToMarkdownCreateResponsesSinglePage + +### Inference + +Types: + +- InferenceSummaryV2Response +- InferenceTimeseriesGroupsV2Response + +Methods: + +- client.radar.ai.inference.summaryV2(dimension, { ...params }) -> InferenceSummaryV2Response +- client.radar.ai.inference.timeseriesGroupsV2(dimension, { ...params }) -> InferenceTimeseriesGroupsV2Response + +#### Summary + +Types: + +- SummaryModelResponse +- SummaryTaskResponse + +Methods: + +- client.radar.ai.inference.summary.model({ ...params }) -> SummaryModelResponse +- client.radar.ai.inference.summary.task({ ...params }) -> SummaryTaskResponse + +#### TimeseriesGroups + +##### Summary + +Types: + +- SummaryModelResponse +- SummaryTaskResponse + +Methods: + +- client.radar.ai.inference.timeseriesGroups.summary.model({ ...params }) -> SummaryModelResponse +- client.radar.ai.inference.timeseriesGroups.summary.task({ ...params }) -> SummaryTaskResponse + +### Bots + +Types: + +- BotSummaryV2Response +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summaryV2(dimension, { ...params }) -> BotSummaryV2Response +- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse + +#### Summary + +Types: + +- SummaryUserAgentResponse + +Methods: + +- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse + +### TimeseriesGroups + +Types: + +- TimeseriesGroupSummaryResponse +- TimeseriesGroupTimeseriesResponse +- TimeseriesGroupTimeseriesGroupsResponse +- TimeseriesGroupUserAgentResponse + +Methods: + +- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse +- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse + +## CT + +Types: + +- CTSummaryResponse +- CTTimeseriesResponse +- CTTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CTSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CTTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CTTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + +## Annotations + +Types: + +- AnnotationListResponse + +Methods: + +- client.radar.annotations.list({ ...params }) -> AnnotationListResponse + +### Outages + +Types: + +- OutageGetResponse +- OutageLocationsResponse + +Methods: + +- client.radar.annotations.outages.get({ ...params }) -> OutageGetResponse +- client.radar.annotations.outages.locations({ ...params }) -> OutageLocationsResponse + +## BGP Types: @@ -5145,1082 +6805,2861 @@ Types: Methods: -- client.radar.bgp.timeseries({ ...params }) -> BGPTimeseriesResponse +- client.radar.bgp.timeseries({ ...params }) -> BGPTimeseriesResponse + +### Leaks + +#### Events + +Types: + +- EventListResponse + +Methods: + +- client.radar.bgp.leaks.events.list({ ...params }) -> EventListResponsesV4PagePagination + +### Top + +Types: + +- TopPrefixesResponse + +Methods: + +- client.radar.bgp.top.prefixes({ ...params }) -> TopPrefixesResponse + +#### Ases + +Types: + +- AseGetResponse +- AsePrefixesResponse + +Methods: + +- client.radar.bgp.top.ases.get({ ...params }) -> AseGetResponse +- client.radar.bgp.top.ases.prefixes({ ...params }) -> AsePrefixesResponse + +### Hijacks + +#### Events + +Types: + +- EventListResponse + +Methods: + +- client.radar.bgp.hijacks.events.list({ ...params }) -> EventListResponsesV4PagePagination + +### Routes + +Types: + +- RouteAsesResponse +- RouteMoasResponse +- RoutePfx2asResponse +- RouteRealtimeResponse +- RouteStatsResponse + +Methods: + +- client.radar.bgp.routes.ases({ ...params }) -> RouteAsesResponse +- client.radar.bgp.routes.moas({ ...params }) -> RouteMoasResponse +- client.radar.bgp.routes.pfx2as({ ...params }) -> RoutePfx2asResponse +- client.radar.bgp.routes.realtime({ ...params }) -> RouteRealtimeResponse +- client.radar.bgp.routes.stats({ ...params }) -> RouteStatsResponse + +### IPs + +Types: + +- IPTimeseriesResponse + +Methods: + +- client.radar.bgp.ips.timeseries({ ...params }) -> IPTimeseriesResponse + +### RPKI + +#### ASPA + +Types: + +- ASPAChangesResponse +- ASPASnapshotResponse +- ASPATimeseriesResponse + +Methods: + +- client.radar.bgp.rpki.aspa.changes({ ...params }) -> ASPAChangesResponse +- client.radar.bgp.rpki.aspa.snapshot({ ...params }) -> ASPASnapshotResponse +- client.radar.bgp.rpki.aspa.timeseries({ ...params }) -> ASPATimeseriesResponse + +## Bots + +Types: + +- BotListResponse +- BotGetResponse +- BotSummaryResponse +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.bots.list({ ...params }) -> BotListResponse +- client.radar.bots.get(botSlug, { ...params }) -> BotGetResponse +- client.radar.bots.summary(dimension, { ...params }) -> BotSummaryResponse +- client.radar.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse + +### WebCrawlers + +Types: + +- WebCrawlerSummaryResponse +- WebCrawlerTimeseriesGroupsResponse + +Methods: + +- client.radar.bots.webCrawlers.summary(dimension, { ...params }) -> WebCrawlerSummaryResponse +- client.radar.bots.webCrawlers.timeseriesGroups(dimension, { ...params }) -> WebCrawlerTimeseriesGroupsResponse + +## Datasets + +Types: + +- DatasetListResponse +- DatasetDownloadResponse +- DatasetGetResponse + +Methods: + +- client.radar.datasets.list({ ...params }) -> DatasetListResponse +- client.radar.datasets.download({ ...params }) -> DatasetDownloadResponse +- client.radar.datasets.get(alias) -> string + +## DNS + +Types: + +- DNSSummaryV2Response +- DNSTimeseriesResponse +- DNSTimeseriesGroupsV2Response + +Methods: + +- client.radar.dns.summaryV2(dimension, { ...params }) -> DNSSummaryV2Response +- client.radar.dns.timeseries({ ...params }) -> DNSTimeseriesResponse +- client.radar.dns.timeseriesGroupsV2(dimension, { ...params }) -> DNSTimeseriesGroupsV2Response + +### Top + +Types: + +- TopAsesResponse +- TopLocationsResponse + +Methods: + +- client.radar.dns.top.ases({ ...params }) -> TopAsesResponse +- client.radar.dns.top.locations({ ...params }) -> TopLocationsResponse + +### Summary + +Types: + +- SummaryCacheHitResponse +- SummaryDNSSECResponse +- SummaryDNSSECAwareResponse +- SummaryDNSSECE2EResponse +- SummaryIPVersionResponse +- SummaryMatchingAnswerResponse +- SummaryProtocolResponse +- SummaryQueryTypeResponse +- SummaryResponseCodeResponse +- SummaryResponseTTLResponse + +Methods: + +- client.radar.dns.summary.cacheHit({ ...params }) -> SummaryCacheHitResponse +- client.radar.dns.summary.dnssec({ ...params }) -> SummaryDNSSECResponse +- client.radar.dns.summary.dnssecAware({ ...params }) -> SummaryDNSSECAwareResponse +- client.radar.dns.summary.dnssecE2E({ ...params }) -> SummaryDNSSECE2EResponse +- client.radar.dns.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.dns.summary.matchingAnswer({ ...params }) -> SummaryMatchingAnswerResponse +- client.radar.dns.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.dns.summary.queryType({ ...params }) -> SummaryQueryTypeResponse +- client.radar.dns.summary.responseCode({ ...params }) -> SummaryResponseCodeResponse +- client.radar.dns.summary.responseTTL({ ...params }) -> SummaryResponseTTLResponse + +### TimeseriesGroups + +Types: + +- TimeseriesGroupCacheHitResponse +- TimeseriesGroupDNSSECResponse +- TimeseriesGroupDNSSECAwareResponse +- TimeseriesGroupDNSSECE2EResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupMatchingAnswerResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupQueryTypeResponse +- TimeseriesGroupResponseCodeResponse +- TimeseriesGroupResponseTTLResponse + +Methods: + +- client.radar.dns.timeseriesGroups.cacheHit({ ...params }) -> TimeseriesGroupCacheHitResponse +- client.radar.dns.timeseriesGroups.dnssec({ ...params }) -> TimeseriesGroupDNSSECResponse +- client.radar.dns.timeseriesGroups.dnssecAware({ ...params }) -> TimeseriesGroupDNSSECAwareResponse +- client.radar.dns.timeseriesGroups.dnssecE2E({ ...params }) -> TimeseriesGroupDNSSECE2EResponse +- client.radar.dns.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.dns.timeseriesGroups.matchingAnswer({ ...params }) -> TimeseriesGroupMatchingAnswerResponse +- client.radar.dns.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.dns.timeseriesGroups.queryType({ ...params }) -> TimeseriesGroupQueryTypeResponse +- client.radar.dns.timeseriesGroups.responseCode({ ...params }) -> TimeseriesGroupResponseCodeResponse +- client.radar.dns.timeseriesGroups.responseTTL({ ...params }) -> TimeseriesGroupResponseTTLResponse + +## NetFlows + +Types: + +- NetFlowsSummaryResponse +- NetFlowsSummaryV2Response +- NetFlowsTimeseriesResponse +- NetFlowsTimeseriesGroupsResponse + +Methods: + +- client.radar.netFlows.summary({ ...params }) -> NetFlowsSummaryResponse +- client.radar.netFlows.summaryV2(dimension, { ...params }) -> NetFlowsSummaryV2Response +- client.radar.netFlows.timeseries({ ...params }) -> NetFlowsTimeseriesResponse +- client.radar.netFlows.timeseriesGroups(dimension, { ...params }) -> NetFlowsTimeseriesGroupsResponse + +### Top + +Types: + +- TopAsesResponse +- TopLocationsResponse + +Methods: + +- client.radar.netFlows.top.ases({ ...params }) -> TopAsesResponse +- client.radar.netFlows.top.locations({ ...params }) -> TopLocationsResponse + +## Search + +Types: + +- SearchGlobalResponse + +Methods: + +- client.radar.search.global({ ...params }) -> SearchGlobalResponse + +## VerifiedBots + +### Top + +Types: + +- TopBotsResponse +- TopCategoriesResponse + +Methods: + +- client.radar.verifiedBots.top.bots({ ...params }) -> TopBotsResponse +- client.radar.verifiedBots.top.categories({ ...params }) -> TopCategoriesResponse + +## AS112 + +Types: + +- AS112SummaryV2Response +- AS112TimeseriesResponse +- AS112TimeseriesGroupsV2Response + +Methods: + +- client.radar.as112.summaryV2(dimension, { ...params }) -> AS112SummaryV2Response +- client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse +- client.radar.as112.timeseriesGroupsV2(dimension, { ...params }) -> AS112TimeseriesGroupsV2Response + +### Summary + +Types: + +- SummaryDNSSECResponse +- SummaryEdnsResponse +- SummaryIPVersionResponse +- SummaryProtocolResponse +- SummaryQueryTypeResponse +- SummaryResponseCodesResponse + +Methods: + +- client.radar.as112.summary.dnssec({ ...params }) -> SummaryDNSSECResponse +- client.radar.as112.summary.edns({ ...params }) -> SummaryEdnsResponse +- client.radar.as112.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.as112.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.as112.summary.queryType({ ...params }) -> SummaryQueryTypeResponse +- client.radar.as112.summary.responseCodes({ ...params }) -> SummaryResponseCodesResponse + +### TimeseriesGroups + +Types: + +- TimeseriesGroupDNSSECResponse +- TimeseriesGroupEdnsResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupQueryTypeResponse +- TimeseriesGroupResponseCodesResponse + +Methods: + +- client.radar.as112.timeseriesGroups.dnssec({ ...params }) -> TimeseriesGroupDNSSECResponse +- client.radar.as112.timeseriesGroups.edns({ ...params }) -> TimeseriesGroupEdnsResponse +- client.radar.as112.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.as112.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.as112.timeseriesGroups.queryType({ ...params }) -> TimeseriesGroupQueryTypeResponse +- client.radar.as112.timeseriesGroups.responseCodes({ ...params }) -> TimeseriesGroupResponseCodesResponse + +### Top + +Types: + +- TopDNSSECResponse +- TopEdnsResponse +- TopIPVersionResponse +- TopLocationsResponse + +Methods: + +- client.radar.as112.top.dnssec(dnssec, { ...params }) -> TopDNSSECResponse +- client.radar.as112.top.edns(edns, { ...params }) -> TopEdnsResponse +- client.radar.as112.top.ipVersion(ipVersion, { ...params }) -> TopIPVersionResponse +- client.radar.as112.top.locations({ ...params }) -> TopLocationsResponse + +## Email + +Types: + +- RadarEmailSeries +- RadarEmailSummary + +### Routing + +Types: + +- RoutingSummaryV2Response +- RoutingTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.routing.summaryV2(dimension, { ...params }) -> RoutingSummaryV2Response +- client.radar.email.routing.timeseriesGroupsV2(dimension, { ...params }) -> RoutingTimeseriesGroupsV2Response + +#### Summary + +Types: + +- SummaryARCResponse +- SummaryDKIMResponse +- SummaryDMARCResponse +- SummaryEncryptedResponse +- SummaryIPVersionResponse +- SummarySPFResponse + +Methods: + +- client.radar.email.routing.summary.arc({ ...params }) -> SummaryARCResponse +- client.radar.email.routing.summary.dkim({ ...params }) -> SummaryDKIMResponse +- client.radar.email.routing.summary.dmarc({ ...params }) -> SummaryDMARCResponse +- client.radar.email.routing.summary.encrypted({ ...params }) -> SummaryEncryptedResponse +- client.radar.email.routing.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.email.routing.summary.spf({ ...params }) -> SummarySPFResponse + +#### TimeseriesGroups + +Types: + +- TimeseriesGroupARCResponse +- TimeseriesGroupDKIMResponse +- TimeseriesGroupDMARCResponse +- TimeseriesGroupEncryptedResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupSPFResponse + +Methods: + +- client.radar.email.routing.timeseriesGroups.arc({ ...params }) -> TimeseriesGroupARCResponse +- client.radar.email.routing.timeseriesGroups.dkim({ ...params }) -> TimeseriesGroupDKIMResponse +- client.radar.email.routing.timeseriesGroups.dmarc({ ...params }) -> TimeseriesGroupDMARCResponse +- client.radar.email.routing.timeseriesGroups.encrypted({ ...params }) -> TimeseriesGroupEncryptedResponse +- client.radar.email.routing.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.email.routing.timeseriesGroups.spf({ ...params }) -> TimeseriesGroupSPFResponse + +### Security + +Types: + +- SecuritySummaryV2Response +- SecurityTimeseriesGroupsV2Response + +Methods: + +- client.radar.email.security.summaryV2(dimension, { ...params }) -> SecuritySummaryV2Response +- client.radar.email.security.timeseriesGroupsV2(dimension, { ...params }) -> SecurityTimeseriesGroupsV2Response + +#### Top + +##### TLDs + +Types: + +- TLDGetResponse + +Methods: + +- client.radar.email.security.top.tlds.get({ ...params }) -> TLDGetResponse + +###### Malicious + +Types: + +- MaliciousGetResponse + +Methods: + +- client.radar.email.security.top.tlds.malicious.get(malicious, { ...params }) -> MaliciousGetResponse + +###### Spam + +Types: + +- SpamGetResponse + +Methods: + +- client.radar.email.security.top.tlds.spam.get(spam, { ...params }) -> SpamGetResponse + +###### Spoof + +Types: + +- SpoofGetResponse + +Methods: + +- client.radar.email.security.top.tlds.spoof.get(spoof, { ...params }) -> SpoofGetResponse + +#### Summary + +Types: + +- SummaryARCResponse +- SummaryDKIMResponse +- SummaryDMARCResponse +- SummaryMaliciousResponse +- SummarySpamResponse +- SummarySPFResponse +- SummarySpoofResponse +- SummaryThreatCategoryResponse +- SummaryTLSVersionResponse + +Methods: + +- client.radar.email.security.summary.arc({ ...params }) -> SummaryARCResponse +- client.radar.email.security.summary.dkim({ ...params }) -> SummaryDKIMResponse +- client.radar.email.security.summary.dmarc({ ...params }) -> SummaryDMARCResponse +- client.radar.email.security.summary.malicious({ ...params }) -> SummaryMaliciousResponse +- client.radar.email.security.summary.spam({ ...params }) -> SummarySpamResponse +- client.radar.email.security.summary.spf({ ...params }) -> SummarySPFResponse +- client.radar.email.security.summary.spoof({ ...params }) -> SummarySpoofResponse +- client.radar.email.security.summary.threatCategory({ ...params }) -> SummaryThreatCategoryResponse +- client.radar.email.security.summary.tlsVersion({ ...params }) -> SummaryTLSVersionResponse + +#### TimeseriesGroups + +Types: + +- TimeseriesGroupARCResponse +- TimeseriesGroupDKIMResponse +- TimeseriesGroupDMARCResponse +- TimeseriesGroupMaliciousResponse +- TimeseriesGroupSpamResponse +- TimeseriesGroupSPFResponse +- TimeseriesGroupSpoofResponse +- TimeseriesGroupThreatCategoryResponse +- TimeseriesGroupTLSVersionResponse + +Methods: + +- client.radar.email.security.timeseriesGroups.arc({ ...params }) -> TimeseriesGroupARCResponse +- client.radar.email.security.timeseriesGroups.dkim({ ...params }) -> TimeseriesGroupDKIMResponse +- client.radar.email.security.timeseriesGroups.dmarc({ ...params }) -> TimeseriesGroupDMARCResponse +- client.radar.email.security.timeseriesGroups.malicious({ ...params }) -> TimeseriesGroupMaliciousResponse +- client.radar.email.security.timeseriesGroups.spam({ ...params }) -> TimeseriesGroupSpamResponse +- client.radar.email.security.timeseriesGroups.spf({ ...params }) -> TimeseriesGroupSPFResponse +- client.radar.email.security.timeseriesGroups.spoof({ ...params }) -> TimeseriesGroupSpoofResponse +- client.radar.email.security.timeseriesGroups.threatCategory({ ...params }) -> TimeseriesGroupThreatCategoryResponse +- client.radar.email.security.timeseriesGroups.tlsVersion({ ...params }) -> TimeseriesGroupTLSVersionResponse + +## Attacks + +### Layer3 + +Types: + +- Layer3SummaryV2Response +- Layer3TimeseriesResponse +- Layer3TimeseriesGroupsV2Response + +Methods: + +- client.radar.attacks.layer3.summaryV2(dimension, { ...params }) -> Layer3SummaryV2Response +- client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse +- client.radar.attacks.layer3.timeseriesGroupsV2(dimension, { ...params }) -> Layer3TimeseriesGroupsV2Response + +#### Summary + +Types: + +- SummaryBitrateResponse +- SummaryDurationResponse +- SummaryIndustryResponse +- SummaryIPVersionResponse +- SummaryProtocolResponse +- SummaryVectorResponse +- SummaryVerticalResponse + +Methods: + +- client.radar.attacks.layer3.summary.bitrate({ ...params }) -> SummaryBitrateResponse +- client.radar.attacks.layer3.summary.duration({ ...params }) -> SummaryDurationResponse +- client.radar.attacks.layer3.summary.industry({ ...params }) -> SummaryIndustryResponse +- client.radar.attacks.layer3.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.attacks.layer3.summary.protocol({ ...params }) -> SummaryProtocolResponse +- client.radar.attacks.layer3.summary.vector({ ...params }) -> SummaryVectorResponse +- client.radar.attacks.layer3.summary.vertical({ ...params }) -> SummaryVerticalResponse + +#### TimeseriesGroups + +Types: + +- TimeseriesGroupBitrateResponse +- TimeseriesGroupDurationResponse +- TimeseriesGroupIndustryResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupProtocolResponse +- TimeseriesGroupVectorResponse +- TimeseriesGroupVerticalResponse + +Methods: + +- client.radar.attacks.layer3.timeseriesGroups.bitrate({ ...params }) -> TimeseriesGroupBitrateResponse +- client.radar.attacks.layer3.timeseriesGroups.duration({ ...params }) -> TimeseriesGroupDurationResponse +- client.radar.attacks.layer3.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse +- client.radar.attacks.layer3.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.attacks.layer3.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse +- client.radar.attacks.layer3.timeseriesGroups.vector({ ...params }) -> TimeseriesGroupVectorResponse +- client.radar.attacks.layer3.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse + +#### Top + +Types: + +- TopAttacksResponse +- TopIndustryResponse +- TopVerticalResponse + +Methods: + +- client.radar.attacks.layer3.top.attacks({ ...params }) -> TopAttacksResponse +- client.radar.attacks.layer3.top.industry({ ...params }) -> TopIndustryResponse +- client.radar.attacks.layer3.top.vertical({ ...params }) -> TopVerticalResponse + +##### Locations + +Types: + +- LocationOriginResponse +- LocationTargetResponse + +Methods: + +- client.radar.attacks.layer3.top.locations.origin({ ...params }) -> LocationOriginResponse +- client.radar.attacks.layer3.top.locations.target({ ...params }) -> LocationTargetResponse + +### Layer7 + +Types: + +- Layer7SummaryV2Response +- Layer7TimeseriesResponse +- Layer7TimeseriesGroupsV2Response + +Methods: + +- client.radar.attacks.layer7.summaryV2(dimension, { ...params }) -> Layer7SummaryV2Response +- client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.radar.attacks.layer7.timeseriesGroupsV2(dimension, { ...params }) -> Layer7TimeseriesGroupsV2Response + +#### Summary + +Types: + +- SummaryHTTPMethodResponse +- SummaryHTTPVersionResponse +- SummaryIndustryResponse +- SummaryIPVersionResponse +- SummaryManagedRulesResponse +- SummaryMitigationProductResponse +- SummaryVerticalResponse + +Methods: + +- client.radar.attacks.layer7.summary.httpMethod({ ...params }) -> SummaryHTTPMethodResponse +- client.radar.attacks.layer7.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse +- client.radar.attacks.layer7.summary.industry({ ...params }) -> SummaryIndustryResponse +- client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.attacks.layer7.summary.managedRules({ ...params }) -> SummaryManagedRulesResponse +- client.radar.attacks.layer7.summary.mitigationProduct({ ...params }) -> SummaryMitigationProductResponse +- client.radar.attacks.layer7.summary.vertical({ ...params }) -> SummaryVerticalResponse + +#### TimeseriesGroups + +Types: + +- TimeseriesGroupHTTPMethodResponse +- TimeseriesGroupHTTPVersionResponse +- TimeseriesGroupIndustryResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupManagedRulesResponse +- TimeseriesGroupMitigationProductResponse +- TimeseriesGroupVerticalResponse + +Methods: + +- client.radar.attacks.layer7.timeseriesGroups.httpMethod({ ...params }) -> TimeseriesGroupHTTPMethodResponse +- client.radar.attacks.layer7.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse +- client.radar.attacks.layer7.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse +- client.radar.attacks.layer7.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.attacks.layer7.timeseriesGroups.managedRules({ ...params }) -> TimeseriesGroupManagedRulesResponse +- client.radar.attacks.layer7.timeseriesGroups.mitigationProduct({ ...params }) -> TimeseriesGroupMitigationProductResponse +- client.radar.attacks.layer7.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse + +#### Top + +Types: + +- TopAttacksResponse +- TopIndustryResponse +- TopVerticalResponse + +Methods: + +- client.radar.attacks.layer7.top.attacks({ ...params }) -> TopAttacksResponse +- client.radar.attacks.layer7.top.industry({ ...params }) -> TopIndustryResponse +- client.radar.attacks.layer7.top.vertical({ ...params }) -> TopVerticalResponse + +##### Locations + +Types: + +- LocationOriginResponse +- LocationTargetResponse + +Methods: + +- client.radar.attacks.layer7.top.locations.origin({ ...params }) -> LocationOriginResponse +- client.radar.attacks.layer7.top.locations.target({ ...params }) -> LocationTargetResponse + +##### Ases + +Types: + +- AseOriginResponse + +Methods: + +- client.radar.attacks.layer7.top.ases.origin({ ...params }) -> AseOriginResponse + +## Entities + +Types: + +- EntityGetResponse + +Methods: + +- client.radar.entities.get({ ...params }) -> EntityGetResponse + +### ASNs + +Types: + +- ASNListResponse +- ASNAsSetResponse +- ASNGetResponse +- ASNIPResponse +- ASNRelResponse + +Methods: + +- client.radar.entities.asns.list({ ...params }) -> ASNListResponse +- client.radar.entities.asns.asSet(asn, { ...params }) -> ASNAsSetResponse +- client.radar.entities.asns.get(asn, { ...params }) -> ASNGetResponse +- client.radar.entities.asns.ip({ ...params }) -> ASNIPResponse +- client.radar.entities.asns.rel(asn, { ...params }) -> ASNRelResponse + +### Locations + +Types: + +- LocationListResponse +- LocationGetResponse + +Methods: + +- client.radar.entities.locations.list({ ...params }) -> LocationListResponse +- client.radar.entities.locations.get(location, { ...params }) -> LocationGetResponse + +## Geolocations + +Types: + +- GeolocationListResponse +- GeolocationGetResponse + +Methods: + +- client.radar.geolocations.list({ ...params }) -> GeolocationListResponse +- client.radar.geolocations.get(geoId, { ...params }) -> GeolocationGetResponse + +## HTTP + +Types: + +- HTTPSummaryV2Response +- HTTPTimeseriesResponse +- HTTPTimeseriesGroupsV2Response + +Methods: + +- client.radar.http.summaryV2(dimension, { ...params }) -> HTTPSummaryV2Response +- client.radar.http.timeseries({ ...params }) -> HTTPTimeseriesResponse +- client.radar.http.timeseriesGroupsV2(dimension, { ...params }) -> HTTPTimeseriesGroupsV2Response + +### Locations + +Types: + +- LocationGetResponse + +Methods: + +- client.radar.http.locations.get({ ...params }) -> LocationGetResponse + +#### BotClass + +Types: + +- BotClassGetResponse + +Methods: + +- client.radar.http.locations.botClass.get(botClass, { ...params }) -> BotClassGetResponse + +#### DeviceType + +Types: + +- DeviceTypeGetResponse + +Methods: + +- client.radar.http.locations.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse + +#### HTTPProtocol + +Types: + +- HTTPProtocolGetResponse + +Methods: + +- client.radar.http.locations.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse + +#### HTTPMethod + +Types: + +- HTTPMethodGetResponse + +Methods: + +- client.radar.http.locations.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse + +#### IPVersion + +Types: + +- IPVersionGetResponse + +Methods: + +- client.radar.http.locations.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse + +#### OS + +Types: + +- OSGetResponse + +Methods: + +- client.radar.http.locations.os.get(os, { ...params }) -> OSGetResponse + +#### TLSVersion + +Types: + +- TLSVersionGetResponse + +Methods: + +- client.radar.http.locations.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse + +#### BrowserFamily + +Types: + +- BrowserFamilyGetResponse + +Methods: + +- client.radar.http.locations.browserFamily.get(browserFamily, { ...params }) -> BrowserFamilyGetResponse + +### Ases + +Types: + +- AseGetResponse + +Methods: + +- client.radar.http.ases.get({ ...params }) -> AseGetResponse + +#### BotClass + +Types: + +- BotClassGetResponse + +Methods: + +- client.radar.http.ases.botClass.get(botClass, { ...params }) -> BotClassGetResponse + +#### DeviceType + +Types: + +- DeviceTypeGetResponse + +Methods: + +- client.radar.http.ases.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse + +#### HTTPProtocol + +Types: + +- HTTPProtocolGetResponse + +Methods: + +- client.radar.http.ases.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse + +#### HTTPMethod + +Types: + +- HTTPMethodGetResponse + +Methods: + +- client.radar.http.ases.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse + +#### IPVersion + +Types: + +- IPVersionGetResponse + +Methods: + +- client.radar.http.ases.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse + +#### OS + +Types: + +- OSGetResponse + +Methods: + +- client.radar.http.ases.os.get(os, { ...params }) -> OSGetResponse + +#### TLSVersion + +Types: + +- TLSVersionGetResponse + +Methods: + +- client.radar.http.ases.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse + +#### BrowserFamily + +Types: + +- BrowserFamilyGetResponse + +Methods: + +- client.radar.http.ases.browserFamily.get(browserFamily, { ...params }) -> BrowserFamilyGetResponse + +### Summary + +Types: + +- SummaryBotClassResponse +- SummaryDeviceTypeResponse +- SummaryHTTPProtocolResponse +- SummaryHTTPVersionResponse +- SummaryIPVersionResponse +- SummaryOSResponse +- SummaryPostQuantumResponse +- SummaryTLSVersionResponse + +Methods: + +- client.radar.http.summary.botClass({ ...params }) -> SummaryBotClassResponse +- client.radar.http.summary.deviceType({ ...params }) -> SummaryDeviceTypeResponse +- client.radar.http.summary.httpProtocol({ ...params }) -> SummaryHTTPProtocolResponse +- client.radar.http.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse +- client.radar.http.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse +- client.radar.http.summary.os({ ...params }) -> SummaryOSResponse +- client.radar.http.summary.postQuantum({ ...params }) -> SummaryPostQuantumResponse +- client.radar.http.summary.tlsVersion({ ...params }) -> SummaryTLSVersionResponse + +### TimeseriesGroups + +Types: + +- TimeseriesGroupBotClassResponse +- TimeseriesGroupBrowserResponse +- TimeseriesGroupBrowserFamilyResponse +- TimeseriesGroupDeviceTypeResponse +- TimeseriesGroupHTTPProtocolResponse +- TimeseriesGroupHTTPVersionResponse +- TimeseriesGroupIPVersionResponse +- TimeseriesGroupOSResponse +- TimeseriesGroupPostQuantumResponse +- TimeseriesGroupTLSVersionResponse + +Methods: + +- client.radar.http.timeseriesGroups.botClass({ ...params }) -> TimeseriesGroupBotClassResponse +- client.radar.http.timeseriesGroups.browser({ ...params }) -> TimeseriesGroupBrowserResponse +- client.radar.http.timeseriesGroups.browserFamily({ ...params }) -> TimeseriesGroupBrowserFamilyResponse +- client.radar.http.timeseriesGroups.deviceType({ ...params }) -> TimeseriesGroupDeviceTypeResponse +- client.radar.http.timeseriesGroups.httpProtocol({ ...params }) -> TimeseriesGroupHTTPProtocolResponse +- client.radar.http.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse +- client.radar.http.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse +- client.radar.http.timeseriesGroups.os({ ...params }) -> TimeseriesGroupOSResponse +- client.radar.http.timeseriesGroups.postQuantum({ ...params }) -> TimeseriesGroupPostQuantumResponse +- client.radar.http.timeseriesGroups.tlsVersion({ ...params }) -> TimeseriesGroupTLSVersionResponse + +### Top + +Types: + +- TopBrowserResponse +- TopBrowserFamilyResponse + +Methods: + +- client.radar.http.top.browser({ ...params }) -> TopBrowserResponse +- client.radar.http.top.browserFamily({ ...params }) -> TopBrowserFamilyResponse + +## Quality + +### IQI + +Types: + +- IQISummaryResponse +- IQITimeseriesGroupsResponse + +Methods: + +- client.radar.quality.iqi.summary({ ...params }) -> IQISummaryResponse +- client.radar.quality.iqi.timeseriesGroups({ ...params }) -> IQITimeseriesGroupsResponse + +### Speed + +Types: + +- SpeedHistogramResponse +- SpeedSummaryResponse + +Methods: + +- client.radar.quality.speed.histogram({ ...params }) -> SpeedHistogramResponse +- client.radar.quality.speed.summary({ ...params }) -> SpeedSummaryResponse + +#### Top + +Types: + +- TopAsesResponse +- TopLocationsResponse + +Methods: + +- client.radar.quality.speed.top.ases({ ...params }) -> TopAsesResponse +- client.radar.quality.speed.top.locations({ ...params }) -> TopLocationsResponse + +## Ranking + +Types: + +- RankingTimeseriesGroupsResponse +- RankingTopResponse + +Methods: + +- client.radar.ranking.timeseriesGroups({ ...params }) -> RankingTimeseriesGroupsResponse +- client.radar.ranking.top({ ...params }) -> RankingTopResponse + +### Domain + +Types: + +- DomainGetResponse + +Methods: + +- client.radar.ranking.domain.get(domain, { ...params }) -> DomainGetResponse + +### InternetServices + +Types: + +- InternetServiceCategoriesResponse +- InternetServiceTimeseriesGroupsResponse +- InternetServiceTopResponse + +Methods: + +- client.radar.ranking.internetServices.categories({ ...params }) -> InternetServiceCategoriesResponse +- client.radar.ranking.internetServices.timeseriesGroups({ ...params }) -> InternetServiceTimeseriesGroupsResponse +- client.radar.ranking.internetServices.top({ ...params }) -> InternetServiceTopResponse + +## TrafficAnomalies + +Types: + +- TrafficAnomalyGetResponse + +Methods: + +- client.radar.trafficAnomalies.get({ ...params }) -> TrafficAnomalyGetResponse + +### Locations + +Types: + +- LocationGetResponse + +Methods: + +- client.radar.trafficAnomalies.locations.get({ ...params }) -> LocationGetResponse + +## TCPResetsTimeouts + +Types: + +- TCPResetsTimeoutSummaryResponse +- TCPResetsTimeoutTimeseriesGroupsResponse + +Methods: + +- client.radar.tcpResetsTimeouts.summary({ ...params }) -> TCPResetsTimeoutSummaryResponse +- client.radar.tcpResetsTimeouts.timeseriesGroups({ ...params }) -> TCPResetsTimeoutTimeseriesGroupsResponse + +## RobotsTXT + +### Top + +Types: + +- TopDomainCategoriesResponse + +Methods: + +- client.radar.robotsTXT.top.domainCategories({ ...params }) -> TopDomainCategoriesResponse + +#### UserAgents + +Types: + +- UserAgentDirectiveResponse + +Methods: + +- client.radar.robotsTXT.top.userAgents.directive({ ...params }) -> UserAgentDirectiveResponse + +## LeakedCredentials + +Types: + +- LeakedCredentialSummaryV2Response +- LeakedCredentialTimeseriesGroupsV2Response + +Methods: + +- client.radar.leakedCredentials.summaryV2(dimension, { ...params }) -> LeakedCredentialSummaryV2Response +- client.radar.leakedCredentials.timeseriesGroupsV2(dimension, { ...params }) -> LeakedCredentialTimeseriesGroupsV2Response + +### Summary + +Types: + +- SummaryBotClassResponse +- SummaryCompromisedResponse + +Methods: + +- client.radar.leakedCredentials.summary.botClass({ ...params }) -> SummaryBotClassResponse +- client.radar.leakedCredentials.summary.compromised({ ...params }) -> SummaryCompromisedResponse + +### TimeseriesGroups + +Types: + +- TimeseriesGroupBotClassResponse +- TimeseriesGroupCompromisedResponse + +Methods: + +- client.radar.leakedCredentials.timeseriesGroups.botClass({ ...params }) -> TimeseriesGroupBotClassResponse +- client.radar.leakedCredentials.timeseriesGroups.compromised({ ...params }) -> TimeseriesGroupCompromisedResponse + +# BotManagement + +Types: + +- BotFightModeConfiguration +- SubscriptionConfiguration +- SuperBotFightModeDefinitelyConfiguration +- SuperBotFightModeLikelyConfiguration +- BotManagementUpdateResponse +- BotManagementGetResponse + +Methods: + +- client.botManagement.update({ ...params }) -> BotManagementUpdateResponse +- client.botManagement.get({ ...params }) -> BotManagementGetResponse + +# Fraud + +Types: + +- FraudSettings + +Methods: + +- client.fraud.update({ ...params }) -> FraudSettings +- client.fraud.get({ ...params }) -> FraudSettings + +# OriginPostQuantumEncryption + +Types: + +- OriginPostQuantumEncryptionUpdateResponse +- OriginPostQuantumEncryptionGetResponse + +Methods: + +- client.originPostQuantumEncryption.update({ ...params }) -> OriginPostQuantumEncryptionUpdateResponse +- client.originPostQuantumEncryption.get({ ...params }) -> OriginPostQuantumEncryptionGetResponse + +# Zaraz + +Types: + +- ButtonTextTranslation +- NeoEvent + +Methods: + +- client.zaraz.update({ ...params }) -> Workflow + +## Config + +Types: + +- Configuration + +Methods: + +- client.zaraz.config.update({ ...params }) -> Configuration +- client.zaraz.config.get({ ...params }) -> Configuration + +## Default + +Methods: + +- client.zaraz.default.get({ ...params }) -> Configuration + +## Export + +Methods: + +- client.zaraz.export.get({ ...params }) -> Configuration + +## History + +Types: + +- HistoryListResponse + +Methods: + +- client.zaraz.history.update({ ...params }) -> Configuration +- client.zaraz.history.list({ ...params }) -> HistoryListResponsesSinglePage + +### Configs + +Types: + +- ConfigGetResponse + +Methods: + +- client.zaraz.history.configs.get({ ...params }) -> ConfigGetResponse + +## Publish + +Types: + +- PublishCreateResponse + +Methods: + +- client.zaraz.publish.create({ ...params }) -> PublishCreateResponse + +## Workflow + +Types: + +- Workflow + +Methods: + +- client.zaraz.workflow.get({ ...params }) -> Workflow + +# Speed + +Types: + +- LabeledRegion +- LighthouseReport +- Trend + +## Schedule + +Types: + +- Schedule +- ScheduleCreateResponse +- ScheduleDeleteResponse + +Methods: + +- client.speed.schedule.create(url, { ...params }) -> ScheduleCreateResponse +- client.speed.schedule.delete(url, { ...params }) -> ScheduleDeleteResponse +- client.speed.schedule.get(url, { ...params }) -> Schedule + +## Availabilities + +Types: + +- Availability + +Methods: + +- client.speed.availabilities.list({ ...params }) -> Availability + +## Pages + +Types: + +- PageListResponse + +Methods: + +- client.speed.pages.list({ ...params }) -> PageListResponsesSinglePage +- client.speed.pages.trend(url, { ...params }) -> Trend + +### Tests + +Types: + +- Test +- TestDeleteResponse + +Methods: + +- client.speed.pages.tests.create(url, { ...params }) -> Test +- client.speed.pages.tests.list(url, { ...params }) -> TestsV4PagePaginationArray +- client.speed.pages.tests.delete(url, { ...params }) -> TestDeleteResponse +- client.speed.pages.tests.get(url, testId, { ...params }) -> Test + +# DCVDelegation + +Types: + +- DCVDelegationUUID + +Methods: + +- client.dcvDelegation.get({ ...params }) -> DCVDelegationUUID + +# Hostnames + +## Settings + +### TLS + +Types: + +- Setting +- SettingValue +- TLSDeleteResponse +- TLSGetResponse + +Methods: + +- client.hostnames.settings.tls.update(settingId, hostname, { ...params }) -> Setting +- client.hostnames.settings.tls.delete(settingId, hostname, { ...params }) -> TLSDeleteResponse +- client.hostnames.settings.tls.get(settingId, { ...params }) -> TLSGetResponsesSinglePage + +# Snippets + +Types: + +- SnippetUpdateResponse +- SnippetListResponse +- SnippetDeleteResponse +- SnippetGetResponse + +Methods: + +- client.snippets.update(snippetName, { ...params }) -> SnippetUpdateResponse +- client.snippets.list({ ...params }) -> SnippetListResponsesV4PagePaginationArray +- client.snippets.delete(snippetName, { ...params }) -> SnippetDeleteResponse | null +- client.snippets.get(snippetName, { ...params }) -> SnippetGetResponse + +## Content + +Methods: + +- client.snippets.content.get(snippetName, { ...params }) -> Response + +## Rules + +Types: + +- RuleUpdateResponse +- RuleListResponse +- RuleDeleteResponse + +Methods: + +- client.snippets.rules.update({ ...params }) -> RuleUpdateResponse +- client.snippets.rules.list({ ...params }) -> RuleListResponse +- client.snippets.rules.delete({ ...params }) -> RuleDeleteResponse + +# RealtimeKit + +## Apps + +Types: + +- AppGetResponse +- AppPostResponse + +Methods: + +- client.realtimeKit.apps.get({ ...params }) -> AppGetResponse +- client.realtimeKit.apps.post({ ...params }) -> AppPostResponse + +## Meetings + +Types: + +- MeetingCreateResponse +- MeetingAddParticipantResponse +- MeetingDeleteMeetingParticipantResponse +- MeetingEditParticipantResponse +- MeetingGetResponse +- MeetingGetMeetingByIDResponse +- MeetingGetMeetingParticipantResponse +- MeetingGetMeetingParticipantsResponse +- MeetingRefreshParticipantTokenResponse +- MeetingReplaceMeetingByIDResponse +- MeetingUpdateMeetingByIDResponse + +Methods: + +- client.realtimeKit.meetings.create(appId, { ...params }) -> MeetingCreateResponse +- client.realtimeKit.meetings.addParticipant(appId, meetingId, { ...params }) -> MeetingAddParticipantResponse +- client.realtimeKit.meetings.deleteMeetingParticipant(appId, meetingId, participantId, { ...params }) -> MeetingDeleteMeetingParticipantResponse +- client.realtimeKit.meetings.editParticipant(appId, meetingId, participantId, { ...params }) -> MeetingEditParticipantResponse +- client.realtimeKit.meetings.get(appId, { ...params }) -> MeetingGetResponse +- client.realtimeKit.meetings.getMeetingById(appId, meetingId, { ...params }) -> MeetingGetMeetingByIDResponse +- client.realtimeKit.meetings.getMeetingParticipant(appId, meetingId, participantId, { ...params }) -> MeetingGetMeetingParticipantResponse +- client.realtimeKit.meetings.getMeetingParticipants(appId, meetingId, { ...params }) -> MeetingGetMeetingParticipantsResponse +- client.realtimeKit.meetings.refreshParticipantToken(appId, meetingId, participantId, { ...params }) -> MeetingRefreshParticipantTokenResponse +- client.realtimeKit.meetings.replaceMeetingById(appId, meetingId, { ...params }) -> MeetingReplaceMeetingByIDResponse +- client.realtimeKit.meetings.updateMeetingById(appId, meetingId, { ...params }) -> MeetingUpdateMeetingByIDResponse + +## Presets + +Types: + +- PresetCreateResponse +- PresetUpdateResponse +- PresetDeleteResponse +- PresetGetResponse +- PresetGetPresetByIDResponse + +Methods: + +- client.realtimeKit.presets.create(appId, { ...params }) -> PresetCreateResponse +- client.realtimeKit.presets.update(appId, presetId, { ...params }) -> PresetUpdateResponse +- client.realtimeKit.presets.delete(appId, presetId, { ...params }) -> PresetDeleteResponse +- client.realtimeKit.presets.get(appId, { ...params }) -> PresetGetResponse +- client.realtimeKit.presets.getPresetById(appId, presetId, { ...params }) -> PresetGetPresetByIDResponse + +## Sessions + +Types: + +- SessionGetParticipantDataFromPeerIDResponse +- SessionGetSessionChatResponse +- SessionGetSessionDetailsResponse +- SessionGetSessionParticipantDetailsResponse +- SessionGetSessionParticipantsResponse +- SessionGetSessionSummaryResponse +- SessionGetSessionTranscriptsResponse +- SessionGetSessionsResponse + +Methods: + +- client.realtimeKit.sessions.generateSummaryOfTranscripts(appId, sessionId, { ...params }) -> void +- client.realtimeKit.sessions.getParticipantDataFromPeerId(appId, peerId, { ...params }) -> SessionGetParticipantDataFromPeerIDResponse +- client.realtimeKit.sessions.getSessionChat(appId, sessionId, { ...params }) -> SessionGetSessionChatResponse +- client.realtimeKit.sessions.getSessionDetails(appId, sessionId, { ...params }) -> SessionGetSessionDetailsResponse +- client.realtimeKit.sessions.getSessionParticipantDetails(appId, sessionId, participantId, { ...params }) -> SessionGetSessionParticipantDetailsResponse +- client.realtimeKit.sessions.getSessionParticipants(appId, sessionId, { ...params }) -> SessionGetSessionParticipantsResponse +- client.realtimeKit.sessions.getSessionSummary(appId, sessionId, { ...params }) -> SessionGetSessionSummaryResponse +- client.realtimeKit.sessions.getSessionTranscripts(appId, sessionId, { ...params }) -> SessionGetSessionTranscriptsResponse +- client.realtimeKit.sessions.getSessions(appId, { ...params }) -> SessionGetSessionsResponse + +## Recordings + +Types: + +- RecordingGetActiveRecordingsResponse +- RecordingGetOneRecordingResponse +- RecordingGetRecordingsResponse +- RecordingPauseResumeStopRecordingResponse +- RecordingStartRecordingsResponse + +Methods: + +- client.realtimeKit.recordings.getActiveRecordings(appId, meetingId, { ...params }) -> RecordingGetActiveRecordingsResponse +- client.realtimeKit.recordings.getOneRecording(appId, recordingId, { ...params }) -> RecordingGetOneRecordingResponse +- client.realtimeKit.recordings.getRecordings(appId, { ...params }) -> RecordingGetRecordingsResponse +- client.realtimeKit.recordings.pauseResumeStopRecording(appId, recordingId, { ...params }) -> RecordingPauseResumeStopRecordingResponse +- client.realtimeKit.recordings.startRecordings(appId, { ...params }) -> RecordingStartRecordingsResponse +- client.realtimeKit.recordings.startTrackRecording(appId, { ...params }) -> void + +## Webhooks + +Types: + +- WebhookCreateWebhookResponse +- WebhookDeleteWebhookResponse +- WebhookEditWebhookResponse +- WebhookGetWebhookByIDResponse +- WebhookGetWebhooksResponse +- WebhookReplaceWebhookResponse + +Methods: + +- client.realtimeKit.webhooks.createWebhook(appId, { ...params }) -> WebhookCreateWebhookResponse +- client.realtimeKit.webhooks.deleteWebhook(appId, webhookId, { ...params }) -> WebhookDeleteWebhookResponse +- client.realtimeKit.webhooks.editWebhook(appId, webhookId, { ...params }) -> WebhookEditWebhookResponse +- client.realtimeKit.webhooks.getWebhookById(appId, webhookId, { ...params }) -> WebhookGetWebhookByIDResponse +- client.realtimeKit.webhooks.getWebhooks(appId, { ...params }) -> WebhookGetWebhooksResponse +- client.realtimeKit.webhooks.replaceWebhook(appId, webhookId, { ...params }) -> WebhookReplaceWebhookResponse + +## ActiveSession + +Types: + +- ActiveSessionCreatePollResponse +- ActiveSessionGetActiveSessionResponse +- ActiveSessionKickAllParticipantsResponse +- ActiveSessionKickParticipantsResponse + +Methods: + +- client.realtimeKit.activeSession.createPoll(appId, meetingId, { ...params }) -> ActiveSessionCreatePollResponse +- client.realtimeKit.activeSession.getActiveSession(appId, meetingId, { ...params }) -> ActiveSessionGetActiveSessionResponse +- client.realtimeKit.activeSession.kickAllParticipants(appId, meetingId, { ...params }) -> ActiveSessionKickAllParticipantsResponse +- client.realtimeKit.activeSession.kickParticipants(appId, meetingId, { ...params }) -> ActiveSessionKickParticipantsResponse + +## Livestreams + +Types: + +- LivestreamCreateIndependentLivestreamResponse +- LivestreamGetActiveLivestreamsForLivestreamIDResponse +- LivestreamGetAllLivestreamsResponse +- LivestreamGetLivestreamAnalyticsCompleteResponse +- LivestreamGetLivestreamSessionDetailsForSessionIDResponse +- LivestreamGetLivestreamSessionForLivestreamIDResponse +- LivestreamGetMeetingActiveLivestreamsResponse +- LivestreamGetOrgAnalyticsResponse +- LivestreamStartLivestreamingAMeetingResponse +- LivestreamStopLivestreamingAMeetingResponse + +Methods: + +- client.realtimeKit.livestreams.createIndependentLivestream(appId, { ...params }) -> LivestreamCreateIndependentLivestreamResponse +- client.realtimeKit.livestreams.getActiveLivestreamsForLivestreamId(appId, livestreamId, { ...params }) -> LivestreamGetActiveLivestreamsForLivestreamIDResponse +- client.realtimeKit.livestreams.getAllLivestreams(appId, { ...params }) -> LivestreamGetAllLivestreamsResponse +- client.realtimeKit.livestreams.getLivestreamAnalyticsComplete(appId, { ...params }) -> LivestreamGetLivestreamAnalyticsCompleteResponse +- client.realtimeKit.livestreams.getLivestreamSessionDetailsForSessionId(appId, livestreamSessionId, { ...params }) -> LivestreamGetLivestreamSessionDetailsForSessionIDResponse +- client.realtimeKit.livestreams.getLivestreamSessionForLivestreamId(appId, livestreamId, { ...params }) -> LivestreamGetLivestreamSessionForLivestreamIDResponse +- client.realtimeKit.livestreams.getMeetingActiveLivestreams(appId, meetingId, { ...params }) -> LivestreamGetMeetingActiveLivestreamsResponse +- client.realtimeKit.livestreams.getOrgAnalytics(appId, { ...params }) -> LivestreamGetOrgAnalyticsResponse +- client.realtimeKit.livestreams.startLivestreamingAMeeting(appId, meetingId, { ...params }) -> LivestreamStartLivestreamingAMeetingResponse +- client.realtimeKit.livestreams.stopLivestreamingAMeeting(appId, meetingId, { ...params }) -> LivestreamStopLivestreamingAMeetingResponse + +## Analytics + +Types: + +- AnalyticsGetOrgAnalyticsResponse + +Methods: + +- client.realtimeKit.analytics.getOrgAnalytics(appId, { ...params }) -> AnalyticsGetOrgAnalyticsResponse + +# Calls + +## SFU + +Types: + +- SFUCreateResponse +- SFUUpdateResponse +- SFUListResponse +- SFUDeleteResponse +- SFUGetResponse + +Methods: + +- client.calls.sfu.create({ ...params }) -> SFUCreateResponse +- client.calls.sfu.update(appId, { ...params }) -> SFUUpdateResponse +- client.calls.sfu.list({ ...params }) -> SFUListResponsesSinglePage +- client.calls.sfu.delete(appId, { ...params }) -> SFUDeleteResponse +- client.calls.sfu.get(appId, { ...params }) -> SFUGetResponse -### Leaks +## TURN Types: -- LeakEventsResponse +- TURNCreateResponse +- TURNUpdateResponse +- TURNListResponse +- TURNDeleteResponse +- TURNGetResponse Methods: -- client.radar.bgp.leaks.events({ ...params }) -> LeakEventsResponse +- client.calls.turn.create({ ...params }) -> TURNCreateResponse +- client.calls.turn.update(keyId, { ...params }) -> TURNUpdateResponse +- client.calls.turn.list({ ...params }) -> TURNListResponsesSinglePage +- client.calls.turn.delete(keyId, { ...params }) -> TURNDeleteResponse +- client.calls.turn.get(keyId, { ...params }) -> TURNGetResponse -### Top +# CloudforceOne + +## Scans + +### Results Types: -- TopPrefixesResponse +- ScanResult +- ResultGetResponse Methods: -- client.radar.bgp.top.prefixes({ ...params }) -> TopPrefixesResponse +- client.cloudforceOne.scans.results.get(configId, { ...params }) -> ResultGetResponse -#### Ases +### Config Types: -- AseGetResponse -- AsePrefixesResponse +- ConfigCreateResponse +- ConfigListResponse +- ConfigDeleteResponse +- ConfigEditResponse Methods: -- client.radar.bgp.top.ases.get({ ...params }) -> AseGetResponse -- client.radar.bgp.top.ases.prefixes({ ...params }) -> AsePrefixesResponse +- client.cloudforceOne.scans.config.create({ ...params }) -> ConfigCreateResponse +- client.cloudforceOne.scans.config.list({ ...params }) -> ConfigListResponsesSinglePage +- client.cloudforceOne.scans.config.delete(configId, { ...params }) -> ConfigDeleteResponse +- client.cloudforceOne.scans.config.edit(configId, { ...params }) -> ConfigEditResponse -### Hijacks +## BinaryStorage Types: -- HijackEventsResponse +- BinaryStorageCreateResponse Methods: -- client.radar.bgp.hijacks.events({ ...params }) -> HijackEventsResponse +- client.cloudforceOne.binaryStorage.create({ ...params }) -> BinaryStorageCreateResponse +- client.cloudforceOne.binaryStorage.get(hash, { ...params }) -> void -### Routes +## Requests Types: -- RouteMoasResponse -- RoutePfx2asResponse -- RouteStatsResponse -- RouteTimeseriesResponse +- Item +- ListItem +- Quota +- RequestConstants +- RequestTypes +- RequestDeleteResponse +- RequestTypesResponse Methods: -- client.radar.bgp.routes.moas({ ...params }) -> RouteMoasResponse -- client.radar.bgp.routes.pfx2as({ ...params }) -> RoutePfx2asResponse -- client.radar.bgp.routes.stats({ ...params }) -> RouteStatsResponse -- client.radar.bgp.routes.timeseries({ ...params }) -> RouteTimeseriesResponse +- client.cloudforceOne.requests.create({ ...params }) -> Item +- client.cloudforceOne.requests.update(requestId, { ...params }) -> Item +- client.cloudforceOne.requests.list({ ...params }) -> ListItemsSinglePage +- client.cloudforceOne.requests.delete(requestId, { ...params }) -> RequestDeleteResponse +- client.cloudforceOne.requests.constants({ ...params }) -> RequestConstants +- client.cloudforceOne.requests.get(requestId, { ...params }) -> Item +- client.cloudforceOne.requests.quota({ ...params }) -> Quota +- client.cloudforceOne.requests.types({ ...params }) -> RequestTypesResponsesSinglePage -## Datasets +### Message Types: -- DatasetListResponse -- DatasetDownloadResponse -- DatasetGetResponse +- Message +- MessageDeleteResponse Methods: -- client.radar.datasets.list({ ...params }) -> DatasetListResponse -- client.radar.datasets.download({ ...params }) -> DatasetDownloadResponse -- client.radar.datasets.get(alias, { ...params }) -> string +- client.cloudforceOne.requests.message.create(requestId, { ...params }) -> Message +- client.cloudforceOne.requests.message.update(requestId, messageId, { ...params }) -> Message +- client.cloudforceOne.requests.message.delete(requestId, messageId, { ...params }) -> MessageDeleteResponse +- client.cloudforceOne.requests.message.get(requestId, { ...params }) -> MessagesSinglePage -## DNS +### Priority -### Top +Types: + +- Label +- Priority +- PriorityEdit +- PriorityDeleteResponse + +Methods: + +- client.cloudforceOne.requests.priority.create({ ...params }) -> Priority +- client.cloudforceOne.requests.priority.update(priorityId, { ...params }) -> Item +- client.cloudforceOne.requests.priority.delete(priorityId, { ...params }) -> PriorityDeleteResponse +- client.cloudforceOne.requests.priority.get(priorityId, { ...params }) -> Item +- client.cloudforceOne.requests.priority.quota({ ...params }) -> Quota + +### Assets Types: -- TopAsesResponse -- TopLocationsResponse +- AssetCreateResponse +- AssetUpdateResponse +- AssetDeleteResponse +- AssetGetResponse Methods: -- client.radar.dns.top.ases({ ...params }) -> TopAsesResponse -- client.radar.dns.top.locations({ ...params }) -> TopLocationsResponse +- client.cloudforceOne.requests.assets.create(requestId, { ...params }) -> AssetCreateResponsesSinglePage +- client.cloudforceOne.requests.assets.update(requestId, assetId, { ...params }) -> AssetUpdateResponse +- client.cloudforceOne.requests.assets.delete(requestId, assetId, { ...params }) -> AssetDeleteResponse +- client.cloudforceOne.requests.assets.get(requestId, assetId, { ...params }) -> AssetGetResponsesSinglePage -## Netflows +## ThreatEvents Types: -- NetflowTimeseriesResponse +- ThreatEventCreateResponse +- ThreatEventListResponse +- ThreatEventBulkCreateResponse +- ThreatEventEditResponse +- ThreatEventGetResponse Methods: -- client.radar.netflows.timeseries({ ...params }) -> NetflowTimeseriesResponse +- client.cloudforceOne.threatEvents.create({ ...params }) -> ThreatEventCreateResponse +- client.cloudforceOne.threatEvents.list({ ...params }) -> ThreatEventListResponse +- client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse +- client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse +- client.cloudforceOne.threatEvents.get(eventId, { ...params }) -> ThreatEventGetResponse -### Top +### Attackers Types: -- TopAsesResponse -- TopLocationsResponse +- AttackerListResponse Methods: -- client.radar.netflows.top.ases({ ...params }) -> TopAsesResponse -- client.radar.netflows.top.locations({ ...params }) -> TopLocationsResponse +- client.cloudforceOne.threatEvents.attackers.list({ ...params }) -> AttackerListResponse -## Search +### Categories Types: -- SearchGlobalResponse +- CategoryCreateResponse +- CategoryListResponse +- CategoryDeleteResponse +- CategoryEditResponse +- CategoryGetResponse Methods: -- client.radar.search.global({ ...params }) -> SearchGlobalResponse +- client.cloudforceOne.threatEvents.categories.create({ ...params }) -> CategoryCreateResponse +- client.cloudforceOne.threatEvents.categories.list({ ...params }) -> CategoryListResponse +- client.cloudforceOne.threatEvents.categories.delete(categoryId, { ...params }) -> CategoryDeleteResponse +- client.cloudforceOne.threatEvents.categories.edit(categoryId, { ...params }) -> CategoryEditResponse +- client.cloudforceOne.threatEvents.categories.get(categoryId, { ...params }) -> CategoryGetResponse -## VerifiedBots +### Countries -### Top +Types: + +- CountryListResponse + +Methods: + +- client.cloudforceOne.threatEvents.countries.list({ ...params }) -> CountryListResponse + +### Crons + +### Datasets Types: -- TopBotsResponse -- TopCategoriesResponse +- DatasetCreateResponse +- DatasetListResponse +- DatasetEditResponse +- DatasetGetResponse +- DatasetRawResponse Methods: -- client.radar.verifiedBots.top.bots({ ...params }) -> TopBotsResponse -- client.radar.verifiedBots.top.categories({ ...params }) -> TopCategoriesResponse +- client.cloudforceOne.threatEvents.datasets.create({ ...params }) -> DatasetCreateResponse +- client.cloudforceOne.threatEvents.datasets.list({ ...params }) -> DatasetListResponse +- client.cloudforceOne.threatEvents.datasets.edit(datasetId, { ...params }) -> DatasetEditResponse +- client.cloudforceOne.threatEvents.datasets.get(datasetId, { ...params }) -> DatasetGetResponse +- client.cloudforceOne.threatEvents.datasets.raw(datasetId, eventId, { ...params }) -> DatasetRawResponse -## AS112 +#### Health + +### IndicatorTypes Types: -- AS112TimeseriesResponse +- IndicatorTypeListResponse Methods: -- client.radar.as112.timeseries({ ...params }) -> AS112TimeseriesResponse +- client.cloudforceOne.threatEvents.indicatorTypes.list({ ...params }) -> IndicatorTypeListResponse -### Summary +### Raw Types: -- SummaryDNSSECResponse -- SummaryEdnsResponse -- SummaryIPVersionResponse -- SummaryProtocolResponse -- SummaryQueryTypeResponse -- SummaryResponseCodesResponse +- RawEditResponse +- RawGetResponse Methods: -- client.radar.as112.summary.dnssec({ ...params }) -> SummaryDNSSECResponse -- client.radar.as112.summary.edns({ ...params }) -> SummaryEdnsResponse -- client.radar.as112.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.as112.summary.protocol({ ...params }) -> SummaryProtocolResponse -- client.radar.as112.summary.queryType({ ...params }) -> SummaryQueryTypeResponse -- client.radar.as112.summary.responseCodes({ ...params }) -> SummaryResponseCodesResponse +- client.cloudforceOne.threatEvents.raw.edit(eventId, rawId, { ...params }) -> RawEditResponse +- client.cloudforceOne.threatEvents.raw.get(eventId, rawId, { ...params }) -> RawGetResponse -### TimeseriesGroups +### Relate Types: -- TimeseriesGroupDNSSECResponse -- TimeseriesGroupEdnsResponse -- TimeseriesGroupIPVersionResponse -- TimeseriesGroupProtocolResponse -- TimeseriesGroupQueryTypeResponse -- TimeseriesGroupResponseCodesResponse +- RelateDeleteResponse Methods: -- client.radar.as112.timeseriesGroups.dnssec({ ...params }) -> TimeseriesGroupDNSSECResponse -- client.radar.as112.timeseriesGroups.edns({ ...params }) -> TimeseriesGroupEdnsResponse -- client.radar.as112.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.as112.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse -- client.radar.as112.timeseriesGroups.queryType({ ...params }) -> TimeseriesGroupQueryTypeResponse -- client.radar.as112.timeseriesGroups.responseCodes({ ...params }) -> TimeseriesGroupResponseCodesResponse +- client.cloudforceOne.threatEvents.relate.delete(eventId, { ...params }) -> RelateDeleteResponse -### Top +### Tags Types: -- TopDNSSECResponse -- TopEdnsResponse -- TopIPVersionResponse -- TopLocationsResponse +- TagCreateResponse Methods: -- client.radar.as112.top.dnssec(dnssec, { ...params }) -> TopDNSSECResponse -- client.radar.as112.top.edns(edns, { ...params }) -> TopEdnsResponse -- client.radar.as112.top.ipVersion(ipVersion, { ...params }) -> TopIPVersionResponse -- client.radar.as112.top.locations({ ...params }) -> TopLocationsResponse +- client.cloudforceOne.threatEvents.tags.create({ ...params }) -> TagCreateResponse -## ConnectionTampering +### EventTags Types: -- ConnectionTamperingSummaryResponse -- ConnectionTamperingTimeseriesGroupsResponse +- EventTagCreateResponse +- EventTagDeleteResponse Methods: -- client.radar.connectionTampering.summary({ ...params }) -> ConnectionTamperingSummaryResponse -- client.radar.connectionTampering.timeseriesGroups({ ...params }) -> ConnectionTamperingTimeseriesGroupsResponse +- client.cloudforceOne.threatEvents.eventTags.create(eventId, { ...params }) -> EventTagCreateResponse +- client.cloudforceOne.threatEvents.eventTags.delete(eventId, { ...params }) -> EventTagDeleteResponse -## Email +### TargetIndustries -### Routing +Types: -#### Summary +- TargetIndustryListResponse + +Methods: + +- client.cloudforceOne.threatEvents.targetIndustries.list({ ...params }) -> TargetIndustryListResponse + +### Insights + +# AIGateway Types: -- SummaryARCResponse -- SummaryDKIMResponse -- SummaryDMARCResponse -- SummaryEncryptedResponse -- SummaryIPVersionResponse -- SummarySPFResponse +- AIGatewayCreateResponse +- AIGatewayUpdateResponse +- AIGatewayListResponse +- AIGatewayDeleteResponse +- AIGatewayGetResponse Methods: -- client.radar.email.routing.summary.arc({ ...params }) -> SummaryARCResponse -- client.radar.email.routing.summary.dkim({ ...params }) -> SummaryDKIMResponse -- client.radar.email.routing.summary.dmarc({ ...params }) -> SummaryDMARCResponse -- client.radar.email.routing.summary.encrypted({ ...params }) -> SummaryEncryptedResponse -- client.radar.email.routing.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.email.routing.summary.spf({ ...params }) -> SummarySPFResponse +- client.aiGateway.create({ ...params }) -> AIGatewayCreateResponse +- client.aiGateway.update(id, { ...params }) -> AIGatewayUpdateResponse +- client.aiGateway.list({ ...params }) -> AIGatewayListResponsesV4PagePaginationArray +- client.aiGateway.delete(id, { ...params }) -> AIGatewayDeleteResponse +- client.aiGateway.get(id, { ...params }) -> AIGatewayGetResponse -#### TimeseriesGroups +## EvaluationTypes Types: -- TimeseriesGroupARCResponse -- TimeseriesGroupDKIMResponse -- TimeseriesGroupDMARCResponse -- TimeseriesGroupEncryptedResponse -- TimeseriesGroupIPVersionResponse -- TimeseriesGroupSPFResponse +- EvaluationTypeListResponse Methods: -- client.radar.email.routing.timeseriesGroups.arc({ ...params }) -> TimeseriesGroupARCResponse -- client.radar.email.routing.timeseriesGroups.dkim({ ...params }) -> TimeseriesGroupDKIMResponse -- client.radar.email.routing.timeseriesGroups.dmarc({ ...params }) -> TimeseriesGroupDMARCResponse -- client.radar.email.routing.timeseriesGroups.encrypted({ ...params }) -> TimeseriesGroupEncryptedResponse -- client.radar.email.routing.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.email.routing.timeseriesGroups.spf({ ...params }) -> TimeseriesGroupSPFResponse +- client.aiGateway.evaluationTypes.list({ ...params }) -> EvaluationTypeListResponsesV4PagePaginationArray -### Security +## Logs -#### Top +Types: -##### Tlds +- LogListResponse +- LogDeleteResponse +- LogEditResponse +- LogGetResponse +- LogRequestResponse +- LogResponseResponse + +Methods: + +- client.aiGateway.logs.list(gatewayId, { ...params }) -> LogListResponsesV4PagePaginationArray +- client.aiGateway.logs.delete(gatewayId, { ...params }) -> LogDeleteResponse +- client.aiGateway.logs.edit(gatewayId, id, { ...params }) -> LogEditResponse +- client.aiGateway.logs.get(gatewayId, id, { ...params }) -> LogGetResponse +- client.aiGateway.logs.request(gatewayId, id, { ...params }) -> unknown +- client.aiGateway.logs.response(gatewayId, id, { ...params }) -> unknown + +## Datasets Types: -- TldGetResponse +- DatasetCreateResponse +- DatasetUpdateResponse +- DatasetListResponse +- DatasetDeleteResponse +- DatasetGetResponse Methods: -- client.radar.email.security.top.tlds.get({ ...params }) -> TldGetResponse +- client.aiGateway.datasets.create(gatewayId, { ...params }) -> DatasetCreateResponse +- client.aiGateway.datasets.update(gatewayId, id, { ...params }) -> DatasetUpdateResponse +- client.aiGateway.datasets.list(gatewayId, { ...params }) -> DatasetListResponsesV4PagePaginationArray +- client.aiGateway.datasets.delete(gatewayId, id, { ...params }) -> DatasetDeleteResponse +- client.aiGateway.datasets.get(gatewayId, id, { ...params }) -> DatasetGetResponse -###### Malicious +## Evaluations Types: -- MaliciousGetResponse +- EvaluationCreateResponse +- EvaluationListResponse +- EvaluationDeleteResponse +- EvaluationGetResponse Methods: -- client.radar.email.security.top.tlds.malicious.get(malicious, { ...params }) -> MaliciousGetResponse +- client.aiGateway.evaluations.create(gatewayId, { ...params }) -> EvaluationCreateResponse +- client.aiGateway.evaluations.list(gatewayId, { ...params }) -> EvaluationListResponsesV4PagePaginationArray +- client.aiGateway.evaluations.delete(gatewayId, id, { ...params }) -> EvaluationDeleteResponse +- client.aiGateway.evaluations.get(gatewayId, id, { ...params }) -> EvaluationGetResponse -###### Spam +## DynamicRouting Types: -- SpamGetResponse +- DynamicRoutingCreateResponse +- DynamicRoutingUpdateResponse +- DynamicRoutingListResponse +- DynamicRoutingDeleteResponse +- DynamicRoutingCreateDeploymentResponse +- DynamicRoutingCreateVersionResponse +- DynamicRoutingGetResponse +- DynamicRoutingGetVersionResponse +- DynamicRoutingListDeploymentsResponse +- DynamicRoutingListVersionsResponse Methods: -- client.radar.email.security.top.tlds.spam.get(spam, { ...params }) -> SpamGetResponse +- client.aiGateway.dynamicRouting.create(gatewayId, { ...params }) -> DynamicRoutingCreateResponse +- client.aiGateway.dynamicRouting.update(gatewayId, id, { ...params }) -> DynamicRoutingUpdateResponse +- client.aiGateway.dynamicRouting.list(gatewayId, { ...params }) -> DynamicRoutingListResponse +- client.aiGateway.dynamicRouting.delete(gatewayId, id, { ...params }) -> DynamicRoutingDeleteResponse +- client.aiGateway.dynamicRouting.createDeployment(gatewayId, id, { ...params }) -> DynamicRoutingCreateDeploymentResponse +- client.aiGateway.dynamicRouting.createVersion(gatewayId, id, { ...params }) -> DynamicRoutingCreateVersionResponse +- client.aiGateway.dynamicRouting.get(gatewayId, id, { ...params }) -> DynamicRoutingGetResponse +- client.aiGateway.dynamicRouting.getVersion(gatewayId, id, versionId, { ...params }) -> DynamicRoutingGetVersionResponse +- client.aiGateway.dynamicRouting.listDeployments(gatewayId, id, { ...params }) -> DynamicRoutingListDeploymentsResponse +- client.aiGateway.dynamicRouting.listVersions(gatewayId, id, { ...params }) -> DynamicRoutingListVersionsResponse -###### Spoof +## ProviderConfigs Types: -- SpoofGetResponse +- ProviderConfigCreateResponse +- ProviderConfigListResponse Methods: -- client.radar.email.security.top.tlds.spoof.get(spoof, { ...params }) -> SpoofGetResponse +- client.aiGateway.providerConfigs.create(gatewayId, { ...params }) -> ProviderConfigCreateResponse +- client.aiGateway.providerConfigs.list(gatewayId, { ...params }) -> ProviderConfigListResponsesV4PagePaginationArray -#### Summary +## URLs Types: -- SummaryARCResponse -- SummaryDKIMResponse -- SummaryDMARCResponse -- SummaryMaliciousResponse -- SummarySpamResponse -- SummarySPFResponse -- SummarySpoofResponse -- SummaryThreatCategoryResponse -- SummaryTLSVersionResponse +- URLGetResponse Methods: -- client.radar.email.security.summary.arc({ ...params }) -> SummaryARCResponse -- client.radar.email.security.summary.dkim({ ...params }) -> SummaryDKIMResponse -- client.radar.email.security.summary.dmarc({ ...params }) -> SummaryDMARCResponse -- client.radar.email.security.summary.malicious({ ...params }) -> SummaryMaliciousResponse -- client.radar.email.security.summary.spam({ ...params }) -> SummarySpamResponse -- client.radar.email.security.summary.spf({ ...params }) -> SummarySPFResponse -- client.radar.email.security.summary.spoof({ ...params }) -> SummarySpoofResponse -- client.radar.email.security.summary.threatCategory({ ...params }) -> SummaryThreatCategoryResponse -- client.radar.email.security.summary.tlsVersion({ ...params }) -> SummaryTLSVersionResponse +- client.aiGateway.urls.get(gatewayId, provider, { ...params }) -> URLGetResponse -#### TimeseriesGroups +# IAM + +## PermissionGroups Types: -- TimeseriesGroupARCResponse -- TimeseriesGroupDKIMResponse -- TimeseriesGroupDMARCResponse -- TimeseriesGroupMaliciousResponse -- TimeseriesGroupSpamResponse -- TimeseriesGroupSPFResponse -- TimeseriesGroupSpoofResponse -- TimeseriesGroupThreatCategoryResponse -- TimeseriesGroupTLSVersionResponse +- PermissionGroupListResponse +- PermissionGroupGetResponse Methods: -- client.radar.email.security.timeseriesGroups.arc({ ...params }) -> TimeseriesGroupARCResponse -- client.radar.email.security.timeseriesGroups.dkim({ ...params }) -> TimeseriesGroupDKIMResponse -- client.radar.email.security.timeseriesGroups.dmarc({ ...params }) -> TimeseriesGroupDMARCResponse -- client.radar.email.security.timeseriesGroups.malicious({ ...params }) -> TimeseriesGroupMaliciousResponse -- client.radar.email.security.timeseriesGroups.spam({ ...params }) -> TimeseriesGroupSpamResponse -- client.radar.email.security.timeseriesGroups.spf({ ...params }) -> TimeseriesGroupSPFResponse -- client.radar.email.security.timeseriesGroups.spoof({ ...params }) -> TimeseriesGroupSpoofResponse -- client.radar.email.security.timeseriesGroups.threatCategory({ ...params }) -> TimeseriesGroupThreatCategoryResponse -- client.radar.email.security.timeseriesGroups.tlsVersion({ ...params }) -> TimeseriesGroupTLSVersionResponse +- client.iam.permissionGroups.list({ ...params }) -> PermissionGroupListResponsesV4PagePaginationArray +- client.iam.permissionGroups.get(permissionGroupId, { ...params }) -> PermissionGroupGetResponse -## Attacks +## ResourceGroups -### Layer3 +Types: + +- ResourceGroupCreateResponse +- ResourceGroupUpdateResponse +- ResourceGroupListResponse +- ResourceGroupDeleteResponse +- ResourceGroupGetResponse + +Methods: + +- client.iam.resourceGroups.create({ ...params }) -> ResourceGroupCreateResponse +- client.iam.resourceGroups.update(resourceGroupId, { ...params }) -> ResourceGroupUpdateResponse +- client.iam.resourceGroups.list({ ...params }) -> ResourceGroupListResponsesSinglePage +- client.iam.resourceGroups.delete(resourceGroupId, { ...params }) -> ResourceGroupDeleteResponse | null +- client.iam.resourceGroups.get(resourceGroupId, { ...params }) -> ResourceGroupGetResponse + +## UserGroups Types: -- Layer3TimeseriesResponse +- UserGroupCreateResponse +- UserGroupUpdateResponse +- UserGroupListResponse +- UserGroupDeleteResponse +- UserGroupGetResponse Methods: -- client.radar.attacks.layer3.timeseries({ ...params }) -> Layer3TimeseriesResponse +- client.iam.userGroups.create({ ...params }) -> UserGroupCreateResponse +- client.iam.userGroups.update(userGroupId, { ...params }) -> UserGroupUpdateResponse +- client.iam.userGroups.list({ ...params }) -> UserGroupListResponsesV4PagePaginationArray +- client.iam.userGroups.delete(userGroupId, { ...params }) -> UserGroupDeleteResponse | null +- client.iam.userGroups.get(userGroupId, { ...params }) -> UserGroupGetResponse -#### Summary +### Members Types: -- SummaryBitrateResponse -- SummaryDurationResponse -- SummaryGetResponse -- SummaryIPVersionResponse -- SummaryProtocolResponse -- SummaryVectorResponse +- MemberCreateResponse +- MemberUpdateResponse +- MemberListResponse +- MemberDeleteResponse Methods: -- client.radar.attacks.layer3.summary.bitrate({ ...params }) -> SummaryBitrateResponse -- client.radar.attacks.layer3.summary.duration({ ...params }) -> SummaryDurationResponse -- client.radar.attacks.layer3.summary.get({ ...params }) -> SummaryGetResponse -- client.radar.attacks.layer3.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.attacks.layer3.summary.protocol({ ...params }) -> SummaryProtocolResponse -- client.radar.attacks.layer3.summary.vector({ ...params }) -> SummaryVectorResponse +- client.iam.userGroups.members.create(userGroupId, [ ...body ]) -> MemberCreateResponse +- client.iam.userGroups.members.update(userGroupId, [ ...body ]) -> MemberUpdateResponsesSinglePage +- client.iam.userGroups.members.list(userGroupId, { ...params }) -> MemberListResponsesV4PagePaginationArray +- client.iam.userGroups.members.delete(userGroupId, memberId, { ...params }) -> MemberDeleteResponse -#### TimeseriesGroups +## SSO Types: -- TimeseriesGroupBitrateResponse -- TimeseriesGroupDurationResponse -- TimeseriesGroupGetResponse -- TimeseriesGroupIndustryResponse -- TimeseriesGroupIPVersionResponse -- TimeseriesGroupProtocolResponse -- TimeseriesGroupVectorResponse -- TimeseriesGroupVerticalResponse +- SSOCreateResponse +- SSOUpdateResponse +- SSOListResponse +- SSODeleteResponse +- SSOBeginVerificationResponse +- SSOGetResponse Methods: -- client.radar.attacks.layer3.timeseriesGroups.bitrate({ ...params }) -> TimeseriesGroupBitrateResponse -- client.radar.attacks.layer3.timeseriesGroups.duration({ ...params }) -> TimeseriesGroupDurationResponse -- client.radar.attacks.layer3.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse -- client.radar.attacks.layer3.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse -- client.radar.attacks.layer3.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.attacks.layer3.timeseriesGroups.protocol({ ...params }) -> TimeseriesGroupProtocolResponse -- client.radar.attacks.layer3.timeseriesGroups.vector({ ...params }) -> TimeseriesGroupVectorResponse -- client.radar.attacks.layer3.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse +- client.iam.sso.create({ ...params }) -> SSOCreateResponse +- client.iam.sso.update(ssoConnectorId, { ...params }) -> SSOUpdateResponse +- client.iam.sso.list({ ...params }) -> SSOListResponsesSinglePage +- client.iam.sso.delete(ssoConnectorId, { ...params }) -> SSODeleteResponse | null +- client.iam.sso.beginVerification(ssoConnectorId, { ...params }) -> SSOBeginVerificationResponse +- client.iam.sso.get(ssoConnectorId, { ...params }) -> SSOGetResponse + +# CloudConnector + +## Rules + +Types: + +- RuleUpdateResponse +- RuleListResponse + +Methods: + +- client.cloudConnector.rules.update([ ...rules ]) -> RuleUpdateResponsesSinglePage +- client.cloudConnector.rules.list({ ...params }) -> RuleListResponsesSinglePage + +# BotnetFeed + +## ASN + +Types: + +- ASNDayReportResponse +- ASNFullReportResponse -#### Top +Methods: + +- client.botnetFeed.asn.dayReport(asnId, { ...params }) -> ASNDayReportResponse +- client.botnetFeed.asn.fullReport(asnId, { ...params }) -> ASNFullReportResponse + +## Configs + +### ASN Types: -- TopAttacksResponse -- TopIndustryResponse -- TopVerticalResponse +- ASNDeleteResponse +- ASNGetResponse Methods: -- client.radar.attacks.layer3.top.attacks({ ...params }) -> TopAttacksResponse -- client.radar.attacks.layer3.top.industry({ ...params }) -> TopIndustryResponse -- client.radar.attacks.layer3.top.vertical({ ...params }) -> TopVerticalResponse +- client.botnetFeed.configs.asn.delete(asnId, { ...params }) -> ASNDeleteResponse +- client.botnetFeed.configs.asn.get({ ...params }) -> ASNGetResponse -##### Locations +# SecurityTXT Types: -- LocationOriginResponse -- LocationTargetResponse +- SecurityTXTUpdateResponse +- SecurityTXTDeleteResponse +- SecurityTXTGetResponse Methods: -- client.radar.attacks.layer3.top.locations.origin({ ...params }) -> LocationOriginResponse -- client.radar.attacks.layer3.top.locations.target({ ...params }) -> LocationTargetResponse +- client.securityTXT.update({ ...params }) -> SecurityTXTUpdateResponse +- client.securityTXT.delete({ ...params }) -> SecurityTXTDeleteResponse +- client.securityTXT.get({ ...params }) -> SecurityTXTGetResponse -### Layer7 +# Workflows Types: -- Layer7TimeseriesResponse +- WorkflowUpdateResponse +- WorkflowListResponse +- WorkflowDeleteResponse +- WorkflowGetResponse Methods: -- client.radar.attacks.layer7.timeseries({ ...params }) -> Layer7TimeseriesResponse +- client.workflows.update(workflowName, { ...params }) -> WorkflowUpdateResponse +- client.workflows.list({ ...params }) -> WorkflowListResponsesV4PagePaginationArray +- client.workflows.delete(workflowName, { ...params }) -> WorkflowDeleteResponse +- client.workflows.get(workflowName, { ...params }) -> WorkflowGetResponse -#### Summary +## Instances Types: -- SummaryGetResponse -- SummaryHTTPMethodResponse -- SummaryHTTPVersionResponse -- SummaryIPVersionResponse -- SummaryManagedRulesResponse -- SummaryMitigationProductResponse +- InstanceCreateResponse +- InstanceListResponse +- InstanceBulkResponse +- InstanceGetResponse Methods: -- client.radar.attacks.layer7.summary.get({ ...params }) -> SummaryGetResponse -- client.radar.attacks.layer7.summary.httpMethod({ ...params }) -> SummaryHTTPMethodResponse -- client.radar.attacks.layer7.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse -- client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.attacks.layer7.summary.managedRules({ ...params }) -> SummaryManagedRulesResponse -- client.radar.attacks.layer7.summary.mitigationProduct({ ...params }) -> SummaryMitigationProductResponse +- client.workflows.instances.create(workflowName, { ...params }) -> InstanceCreateResponse +- client.workflows.instances.list(workflowName, { ...params }) -> InstanceListResponsesV4PagePaginationArray +- client.workflows.instances.bulk(workflowName, [ ...body ]) -> InstanceBulkResponsesSinglePage +- client.workflows.instances.get(workflowName, instanceId, { ...params }) -> InstanceGetResponse -#### TimeseriesGroups +### Status Types: -- TimeseriesGroupGetResponse -- TimeseriesGroupHTTPMethodResponse -- TimeseriesGroupHTTPVersionResponse -- TimeseriesGroupIndustryResponse -- TimeseriesGroupIPVersionResponse -- TimeseriesGroupManagedRulesResponse -- TimeseriesGroupMitigationProductResponse -- TimeseriesGroupVerticalResponse +- StatusEditResponse Methods: -- client.radar.attacks.layer7.timeseriesGroups.get({ ...params }) -> TimeseriesGroupGetResponse -- client.radar.attacks.layer7.timeseriesGroups.httpMethod({ ...params }) -> TimeseriesGroupHTTPMethodResponse -- client.radar.attacks.layer7.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse -- client.radar.attacks.layer7.timeseriesGroups.industry({ ...params }) -> TimeseriesGroupIndustryResponse -- client.radar.attacks.layer7.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.attacks.layer7.timeseriesGroups.managedRules({ ...params }) -> TimeseriesGroupManagedRulesResponse -- client.radar.attacks.layer7.timeseriesGroups.mitigationProduct({ ...params }) -> TimeseriesGroupMitigationProductResponse -- client.radar.attacks.layer7.timeseriesGroups.vertical({ ...params }) -> TimeseriesGroupVerticalResponse +- client.workflows.instances.status.edit(workflowName, instanceId, { ...params }) -> StatusEditResponse -#### Top +### Events Types: -- TopAttacksResponse -- TopIndustryResponse -- TopVerticalResponse +- EventCreateResponse Methods: -- client.radar.attacks.layer7.top.attacks({ ...params }) -> TopAttacksResponse -- client.radar.attacks.layer7.top.industry({ ...params }) -> TopIndustryResponse -- client.radar.attacks.layer7.top.vertical({ ...params }) -> TopVerticalResponse +- client.workflows.instances.events.create(workflowName, instanceId, eventType, { ...params }) -> EventCreateResponse -##### Locations +## Versions Types: -- LocationOriginResponse -- LocationTargetResponse +- VersionListResponse +- VersionGetResponse Methods: -- client.radar.attacks.layer7.top.locations.origin({ ...params }) -> LocationOriginResponse -- client.radar.attacks.layer7.top.locations.target({ ...params }) -> LocationTargetResponse +- client.workflows.versions.list(workflowName, { ...params }) -> VersionListResponsesV4PagePaginationArray +- client.workflows.versions.get(workflowName, versionId, { ...params }) -> VersionGetResponse -##### Ases +# ResourceSharing Types: -- AseOriginResponse +- ResourceSharingCreateResponse +- ResourceSharingUpdateResponse +- ResourceSharingListResponse +- ResourceSharingDeleteResponse +- ResourceSharingGetResponse Methods: -- client.radar.attacks.layer7.top.ases.origin({ ...params }) -> AseOriginResponse +- client.resourceSharing.create({ ...params }) -> ResourceSharingCreateResponse +- client.resourceSharing.update(shareId, { ...params }) -> ResourceSharingUpdateResponse +- client.resourceSharing.list({ ...params }) -> ResourceSharingListResponsesV4PagePaginationArray +- client.resourceSharing.delete(shareId, { ...params }) -> ResourceSharingDeleteResponse +- client.resourceSharing.get(shareId, { ...params }) -> ResourceSharingGetResponse -## Entities +## Recipients Types: -- EntityGetResponse +- RecipientCreateResponse +- RecipientListResponse +- RecipientDeleteResponse +- RecipientGetResponse Methods: -- client.radar.entities.get({ ...params }) -> EntityGetResponse +- client.resourceSharing.recipients.create(shareId, { ...params }) -> RecipientCreateResponse +- client.resourceSharing.recipients.list(shareId, { ...params }) -> RecipientListResponsesV4PagePaginationArray +- client.resourceSharing.recipients.delete(shareId, recipientId, { ...params }) -> RecipientDeleteResponse +- client.resourceSharing.recipients.get(shareId, recipientId, { ...params }) -> RecipientGetResponse -### ASNs +## Resources Types: -- ASNListResponse -- ASNGetResponse -- ASNIPResponse -- ASNRelResponse +- ResourceCreateResponse +- ResourceUpdateResponse +- ResourceListResponse +- ResourceDeleteResponse +- ResourceGetResponse Methods: -- client.radar.entities.asns.list({ ...params }) -> ASNListResponse -- client.radar.entities.asns.get(asn, { ...params }) -> ASNGetResponse -- client.radar.entities.asns.ip({ ...params }) -> ASNIPResponse -- client.radar.entities.asns.rel(asn, { ...params }) -> ASNRelResponse +- client.resourceSharing.resources.create(shareId, { ...params }) -> ResourceCreateResponse +- client.resourceSharing.resources.update(shareId, resourceId, { ...params }) -> ResourceUpdateResponse +- client.resourceSharing.resources.list(shareId, { ...params }) -> ResourceListResponsesV4PagePaginationArray +- client.resourceSharing.resources.delete(shareId, resourceId, { ...params }) -> ResourceDeleteResponse +- client.resourceSharing.resources.get(shareId, resourceId, { ...params }) -> ResourceGetResponse -### Locations +# LeakedCredentialChecks Types: -- LocationListResponse -- LocationGetResponse +- LeakedCredentialCheckCreateResponse +- LeakedCredentialCheckGetResponse Methods: -- client.radar.entities.locations.list({ ...params }) -> LocationListResponse -- client.radar.entities.locations.get(location, { ...params }) -> LocationGetResponse - -## HTTP +- client.leakedCredentialChecks.create({ ...params }) -> LeakedCredentialCheckCreateResponse +- client.leakedCredentialChecks.get({ ...params }) -> LeakedCredentialCheckGetResponse -### Top +## Detections Types: -- TopBrowserFamiliesResponse -- TopBrowsersResponse +- DetectionCreateResponse +- DetectionUpdateResponse +- DetectionListResponse +- DetectionDeleteResponse +- DetectionGetResponse Methods: -- client.radar.http.top.browserFamilies({ ...params }) -> TopBrowserFamiliesResponse -- client.radar.http.top.browsers({ ...params }) -> TopBrowsersResponse +- client.leakedCredentialChecks.detections.create({ ...params }) -> DetectionCreateResponse +- client.leakedCredentialChecks.detections.update(detectionId, { ...params }) -> DetectionUpdateResponse +- client.leakedCredentialChecks.detections.list({ ...params }) -> DetectionListResponsesSinglePage +- client.leakedCredentialChecks.detections.delete(detectionId, { ...params }) -> DetectionDeleteResponse +- client.leakedCredentialChecks.detections.get(detectionId, { ...params }) -> DetectionGetResponse -### Locations +# ContentScanning Types: -- LocationGetResponse +- ContentScanningCreateResponse +- ContentScanningUpdateResponse +- ContentScanningDisableResponse +- ContentScanningEnableResponse +- ContentScanningGetResponse Methods: -- client.radar.http.locations.get({ ...params }) -> LocationGetResponse +- client.contentScanning.create({ ...params }) -> ContentScanningCreateResponse +- client.contentScanning.update({ ...params }) -> ContentScanningUpdateResponse +- client.contentScanning.disable({ ...params }) -> ContentScanningDisableResponse +- client.contentScanning.enable({ ...params }) -> ContentScanningEnableResponse +- client.contentScanning.get({ ...params }) -> ContentScanningGetResponse -#### BotClass +## Payloads Types: -- BotClassGetResponse +- PayloadCreateResponse +- PayloadListResponse +- PayloadDeleteResponse Methods: -- client.radar.http.locations.botClass.get(botClass, { ...params }) -> BotClassGetResponse +- client.contentScanning.payloads.create([ ...body ]) -> PayloadCreateResponsesSinglePage +- client.contentScanning.payloads.list({ ...params }) -> PayloadListResponsesSinglePage +- client.contentScanning.payloads.delete(expressionId, { ...params }) -> PayloadDeleteResponsesSinglePage -#### DeviceType +## Settings Types: -- DeviceTypeGetResponse +- SettingGetResponse Methods: -- client.radar.http.locations.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse +- client.contentScanning.settings.get({ ...params }) -> SettingGetResponse -#### HTTPProtocol +# AbuseReports Types: -- HTTPProtocolGetResponse +- AbuseReportCreateResponse +- AbuseReportListResponse +- AbuseReportGetResponse Methods: -- client.radar.http.locations.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse +- client.abuseReports.create(reportParam, { ...params }) -> AbuseReportCreateResponse +- client.abuseReports.list({ ...params }) -> AbuseReportListResponsesV4PagePagination +- client.abuseReports.get(reportParam, { ...params }) -> AbuseReportGetResponse -#### HTTPMethod +## Mitigations Types: -- HTTPMethodGetResponse +- MitigationListResponse +- MitigationReviewResponse Methods: -- client.radar.http.locations.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse +- client.abuseReports.mitigations.list(reportId, { ...params }) -> MitigationListResponsesV4PagePagination +- client.abuseReports.mitigations.review(reportId, { ...params }) -> MitigationReviewResponsesSinglePage -#### IPVersion +# AI Types: -- IPVersionGetResponse +- AIRunResponse Methods: -- client.radar.http.locations.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse +- client.ai.run(modelName, { ...params }) -> AIRunResponse -#### OS +## Finetunes Types: -- OSGetResponse +- FinetuneCreateResponse +- FinetuneListResponse Methods: -- client.radar.http.locations.os.get(os, { ...params }) -> OSGetResponse +- client.ai.finetunes.create({ ...params }) -> FinetuneCreateResponse +- client.ai.finetunes.list({ ...params }) -> FinetuneListResponse -#### TLSVersion +### Assets Types: -- TLSVersionGetResponse +- AssetCreateResponse Methods: -- client.radar.http.locations.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse +- client.ai.finetunes.assets.create(finetuneId, { ...params }) -> AssetCreateResponse -### Ases +### Public Types: -- AseGetResponse +- PublicListResponse Methods: -- client.radar.http.ases.get({ ...params }) -> AseGetResponse +- client.ai.finetunes.public.list({ ...params }) -> PublicListResponsesSinglePage -#### BotClass +## Authors Types: -- BotClassGetResponse +- AuthorListResponse Methods: -- client.radar.http.ases.botClass.get(botClass, { ...params }) -> BotClassGetResponse +- client.ai.authors.list({ ...params }) -> AuthorListResponsesSinglePage -#### DeviceType +## Tasks Types: -- DeviceTypeGetResponse +- TaskListResponse Methods: -- client.radar.http.ases.deviceType.get(deviceType, { ...params }) -> DeviceTypeGetResponse +- client.ai.tasks.list({ ...params }) -> TaskListResponsesSinglePage -#### HTTPProtocol +## Models Types: -- HTTPProtocolGetResponse +- ModelListResponse Methods: -- client.radar.http.ases.httpProtocol.get(httpProtocol, { ...params }) -> HTTPProtocolGetResponse +- client.ai.models.list({ ...params }) -> ModelListResponsesV4PagePaginationArray -#### HTTPMethod +### Schema Types: -- HTTPMethodGetResponse +- SchemaGetResponse Methods: -- client.radar.http.ases.httpMethod.get(httpVersion, { ...params }) -> HTTPMethodGetResponse +- client.ai.models.schema.get({ ...params }) -> SchemaGetResponse -#### IPVersion +## ToMarkdown Types: -- IPVersionGetResponse +- ToMarkdownSupportedResponse +- ToMarkdownTransformResponse Methods: -- client.radar.http.ases.ipVersion.get(ipVersion, { ...params }) -> IPVersionGetResponse +- client.ai.toMarkdown.supported({ ...params }) -> ToMarkdownSupportedResponsesSinglePage +- client.ai.toMarkdown.transform({ ...params }) -> ToMarkdownTransformResponsesSinglePage -#### OS +# AISearch + +## Instances Types: -- OSGetResponse +- InstanceCreateResponse +- InstanceUpdateResponse +- InstanceListResponse +- InstanceDeleteResponse +- InstanceChatCompletionsResponse +- InstanceReadResponse +- InstanceSearchResponse +- InstanceStatsResponse Methods: -- client.radar.http.ases.os.get(os, { ...params }) -> OSGetResponse +- client.aiSearch.instances.create({ ...params }) -> InstanceCreateResponse +- client.aiSearch.instances.update(id, { ...params }) -> InstanceUpdateResponse +- client.aiSearch.instances.list({ ...params }) -> InstanceListResponsesV4PagePaginationArray +- client.aiSearch.instances.delete(id, { ...params }) -> InstanceDeleteResponse +- client.aiSearch.instances.chatCompletions(id, { ...params }) -> InstanceChatCompletionsResponse +- client.aiSearch.instances.read(id, { ...params }) -> InstanceReadResponse +- client.aiSearch.instances.search(id, { ...params }) -> InstanceSearchResponse +- client.aiSearch.instances.stats(id, { ...params }) -> InstanceStatsResponse -#### TLSVersion +### Items Types: -- TLSVersionGetResponse +- ItemListResponse +- ItemGetResponse Methods: -- client.radar.http.ases.tlsVersion.get(tlsVersion, { ...params }) -> TLSVersionGetResponse +- client.aiSearch.instances.items.list(id, { ...params }) -> ItemListResponsesV4PagePaginationArray +- client.aiSearch.instances.items.get(id, itemId, { ...params }) -> ItemGetResponse -### Summary +### Jobs Types: -- SummaryBotClassResponse -- SummaryDeviceTypeResponse -- SummaryHTTPProtocolResponse -- SummaryHTTPVersionResponse -- SummaryIPVersionResponse -- SummaryOSResponse -- SummaryTLSVersionResponse +- JobCreateResponse +- JobListResponse +- JobGetResponse +- JobLogsResponse Methods: -- client.radar.http.summary.botClass({ ...params }) -> SummaryBotClassResponse -- client.radar.http.summary.deviceType({ ...params }) -> SummaryDeviceTypeResponse -- client.radar.http.summary.httpProtocol({ ...params }) -> SummaryHTTPProtocolResponse -- client.radar.http.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse -- client.radar.http.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse -- client.radar.http.summary.os({ ...params }) -> SummaryOSResponse -- client.radar.http.summary.tlsVersion({ ...params }) -> SummaryTLSVersionResponse +- client.aiSearch.instances.jobs.create(id, { ...params }) -> JobCreateResponse +- client.aiSearch.instances.jobs.list(id, { ...params }) -> JobListResponsesV4PagePaginationArray +- client.aiSearch.instances.jobs.get(id, jobId, { ...params }) -> JobGetResponse +- client.aiSearch.instances.jobs.logs(id, jobId, { ...params }) -> JobLogsResponse -### TimeseriesGroups +## Tokens Types: -- TimeseriesGroupBotClassResponse -- TimeseriesGroupBrowserResponse -- TimeseriesGroupBrowserFamilyResponse -- TimeseriesGroupDeviceTypeResponse -- TimeseriesGroupHTTPProtocolResponse -- TimeseriesGroupHTTPVersionResponse -- TimeseriesGroupIPVersionResponse -- TimeseriesGroupOSResponse -- TimeseriesGroupTLSVersionResponse +- TokenCreateResponse +- TokenUpdateResponse +- TokenListResponse +- TokenDeleteResponse +- TokenReadResponse Methods: -- client.radar.http.timeseriesGroups.botClass({ ...params }) -> TimeseriesGroupBotClassResponse -- client.radar.http.timeseriesGroups.browser({ ...params }) -> TimeseriesGroupBrowserResponse -- client.radar.http.timeseriesGroups.browserFamily({ ...params }) -> TimeseriesGroupBrowserFamilyResponse -- client.radar.http.timeseriesGroups.deviceType({ ...params }) -> TimeseriesGroupDeviceTypeResponse -- client.radar.http.timeseriesGroups.httpProtocol({ ...params }) -> TimeseriesGroupHTTPProtocolResponse -- client.radar.http.timeseriesGroups.httpVersion({ ...params }) -> TimeseriesGroupHTTPVersionResponse -- client.radar.http.timeseriesGroups.ipVersion({ ...params }) -> TimeseriesGroupIPVersionResponse -- client.radar.http.timeseriesGroups.os({ ...params }) -> TimeseriesGroupOSResponse -- client.radar.http.timeseriesGroups.tlsVersion({ ...params }) -> TimeseriesGroupTLSVersionResponse +- client.aiSearch.tokens.create({ ...params }) -> TokenCreateResponse +- client.aiSearch.tokens.update(id, { ...params }) -> TokenUpdateResponse +- client.aiSearch.tokens.list({ ...params }) -> TokenListResponsesV4PagePaginationArray +- client.aiSearch.tokens.delete(id, { ...params }) -> TokenDeleteResponse +- client.aiSearch.tokens.read(id, { ...params }) -> TokenReadResponse -## Quality +# SecurityCenter -### IQI +## Insights Types: -- IQISummaryResponse -- IQITimeseriesGroupsResponse +- InsightListResponse +- InsightDismissResponse Methods: -- client.radar.quality.iqi.summary({ ...params }) -> IQISummaryResponse -- client.radar.quality.iqi.timeseriesGroups({ ...params }) -> IQITimeseriesGroupsResponse +- client.securityCenter.insights.list({ ...params }) -> InsightListResponsesV4PagePagination +- client.securityCenter.insights.dismiss(issueId, { ...params }) -> InsightDismissResponse -### Speed +### Class Types: -- SpeedHistogramResponse -- SpeedSummaryResponse +- ClassGetResponse Methods: -- client.radar.quality.speed.histogram({ ...params }) -> SpeedHistogramResponse -- client.radar.quality.speed.summary({ ...params }) -> SpeedSummaryResponse +- client.securityCenter.insights.class.get({ ...params }) -> ClassGetResponse -#### Top +### Severity Types: -- TopAsesResponse -- TopLocationsResponse +- SeverityGetResponse Methods: -- client.radar.quality.speed.top.ases({ ...params }) -> TopAsesResponse -- client.radar.quality.speed.top.locations({ ...params }) -> TopLocationsResponse +- client.securityCenter.insights.severity.get({ ...params }) -> SeverityGetResponse -## Ranking +### Type Types: -- RankingTimeseriesGroupsResponse -- RankingTopResponse +- TypeGetResponse Methods: -- client.radar.ranking.timeseriesGroups({ ...params }) -> RankingTimeseriesGroupsResponse -- client.radar.ranking.top({ ...params }) -> RankingTopResponse +- client.securityCenter.insights.type.get({ ...params }) -> TypeGetResponse -### Domain +# BrowserRendering + +## Content Types: -- DomainGetResponse +- ContentCreateResponse Methods: -- client.radar.ranking.domain.get(domain, { ...params }) -> DomainGetResponse +- client.browserRendering.content.create({ ...params }) -> ContentCreateResponse -## TrafficAnomalies +## PDF + +Methods: + +- client.browserRendering.pdf.create({ ...params }) -> Response + +## Scrape Types: -- TrafficAnomalyGetResponse +- ScrapeCreateResponse Methods: -- client.radar.trafficAnomalies.get({ ...params }) -> TrafficAnomalyGetResponse +- client.browserRendering.scrape.create({ ...params }) -> ScrapeCreateResponse -### Locations +## Screenshot Types: -- LocationGetResponse +- ScreenshotCreateResponse Methods: -- client.radar.trafficAnomalies.locations.get({ ...params }) -> LocationGetResponse +- client.browserRendering.screenshot.create({ ...params }) -> ScreenshotCreateResponse -# BotManagement +## Snapshot Types: -- BotManagementUpdateResponse -- BotManagementGetResponse +- SnapshotCreateResponse Methods: -- client.botManagement.update({ ...params }) -> BotManagementUpdateResponse -- client.botManagement.get({ ...params }) -> BotManagementGetResponse +- client.browserRendering.snapshot.create({ ...params }) -> SnapshotCreateResponse -# OriginPostQuantumEncryption +## Json Types: -- OriginPostQuantumEncryptionUpdateResponse -- OriginPostQuantumEncryptionGetResponse +- JsonCreateResponse Methods: -- client.originPostQuantumEncryption.update({ ...params }) -> OriginPostQuantumEncryptionUpdateResponse -- client.originPostQuantumEncryption.get({ ...params }) -> OriginPostQuantumEncryptionGetResponse +- client.browserRendering.json.create({ ...params }) -> JsonCreateResponse -# Speed +## Links Types: -- ObservatorySchedule -- ObservatoryTrend -- SpeedDeleteResponse +- LinkCreateResponse Methods: -- client.speed.delete(url, { ...params }) -> SpeedDeleteResponse -- client.speed.scheduleGet(url, { ...params }) -> ObservatorySchedule -- client.speed.trendsList(url, { ...params }) -> ObservatoryTrend +- client.browserRendering.links.create({ ...params }) -> LinkCreateResponse -## Tests +## Markdown Types: -- ObservatoryPageTest -- TestListResponse -- TestDeleteResponse +- MarkdownCreateResponse Methods: -- client.speed.tests.create(url, { ...params }) -> ObservatoryPageTest -- client.speed.tests.list(url, { ...params }) -> TestListResponse -- client.speed.tests.delete(url, { ...params }) -> TestDeleteResponse -- client.speed.tests.get(url, testId, { ...params }) -> ObservatoryPageTest +- client.browserRendering.markdown.create({ ...params }) -> MarkdownCreateResponse -## Schedule +# CustomPages Types: -- ScheduleCreateResponse +- CustomPageUpdateResponse +- CustomPageListResponse +- CustomPageGetResponse Methods: -- client.speed.schedule.create(url, { ...params }) -> ScheduleCreateResponse +- client.customPages.update(identifier, { ...params }) -> CustomPageUpdateResponse +- client.customPages.list({ ...params }) -> CustomPageListResponsesSinglePage +- client.customPages.get(identifier, { ...params }) -> CustomPageGetResponse -## Availabilities +# SecretsStore + +## Stores Types: -- ObservatoryAvailabilities +- StoreCreateResponse +- StoreListResponse +- StoreDeleteResponse Methods: -- client.speed.availabilities.list({ ...params }) -> ObservatoryAvailabilities +- client.secretsStore.stores.create([ ...body ]) -> StoreCreateResponsesSinglePage +- client.secretsStore.stores.list({ ...params }) -> StoreListResponsesV4PagePaginationArray +- client.secretsStore.stores.delete(storeId, { ...params }) -> StoreDeleteResponse -## Pages +### Secrets Types: -- PageListResponse +- SecretCreateResponse +- SecretListResponse +- SecretDeleteResponse +- SecretBulkDeleteResponse +- SecretDuplicateResponse +- SecretEditResponse +- SecretGetResponse Methods: -- client.speed.pages.list({ ...params }) -> PageListResponse +- client.secretsStore.stores.secrets.create(storeId, [ ...body ]) -> SecretCreateResponsesSinglePage +- client.secretsStore.stores.secrets.list(storeId, { ...params }) -> SecretListResponsesV4PagePaginationArray +- client.secretsStore.stores.secrets.delete(storeId, secretId, { ...params }) -> SecretDeleteResponse +- client.secretsStore.stores.secrets.bulkDelete(storeId, { ...params }) -> SecretBulkDeleteResponsesSinglePage +- client.secretsStore.stores.secrets.duplicate(storeId, secretId, { ...params }) -> SecretDuplicateResponse +- client.secretsStore.stores.secrets.edit(storeId, secretId, { ...params }) -> SecretEditResponse +- client.secretsStore.stores.secrets.get(storeId, secretId, { ...params }) -> SecretGetResponse -# DCVDelegation - -## UUID +## Quota Types: -- TLSCertificatesAndHostnamesUUIDObject +- QuotaGetResponse Methods: -- client.dcvDelegation.uuid.get({ ...params }) -> TLSCertificatesAndHostnamesUUIDObject +- client.secretsStore.quota.get({ ...params }) -> QuotaGetResponse -# Hostnames +# Pipelines -## Settings +Types: -### TLS +- PipelineCreateResponse +- PipelineUpdateResponse +- PipelineListResponse +- PipelineCreateV1Response +- PipelineGetResponse +- PipelineGetV1Response +- PipelineListV1Response +- PipelineValidateSqlResponse + +Methods: + +- client.pipelines.create({ ...params }) -> PipelineCreateResponse +- client.pipelines.update(pipelineName, { ...params }) -> PipelineUpdateResponse +- client.pipelines.list({ ...params }) -> PipelineListResponse +- client.pipelines.delete(pipelineName, { ...params }) -> void +- client.pipelines.createV1({ ...params }) -> PipelineCreateV1Response +- client.pipelines.deleteV1(pipelineId, { ...params }) -> void +- client.pipelines.get(pipelineName, { ...params }) -> PipelineGetResponse +- client.pipelines.getV1(pipelineId, { ...params }) -> PipelineGetV1Response +- client.pipelines.listV1({ ...params }) -> PipelineListV1ResponsesV4PagePaginationArray +- client.pipelines.validateSql({ ...params }) -> PipelineValidateSqlResponse + +## Sinks Types: -- TLSCertificatesAndHostnamesSettingObject -- TLSCertificatesAndHostnamesSettingObjectDelete -- TLSGetResponse +- SinkCreateResponse +- SinkListResponse +- SinkGetResponse Methods: -- client.hostnames.settings.tls.update(settingId, hostname, { ...params }) -> TLSCertificatesAndHostnamesSettingObject -- client.hostnames.settings.tls.delete(settingId, hostname, { ...params }) -> TLSCertificatesAndHostnamesSettingObjectDelete -- client.hostnames.settings.tls.get(settingId, { ...params }) -> TLSGetResponse | null +- client.pipelines.sinks.create({ ...params }) -> SinkCreateResponse +- client.pipelines.sinks.list({ ...params }) -> SinkListResponsesV4PagePaginationArray +- client.pipelines.sinks.delete(sinkId, { ...params }) -> void +- client.pipelines.sinks.get(sinkId, { ...params }) -> SinkGetResponse -# Snippets +## Streams Types: -- Snippet -- SnippetListResponse -- SnippetDeleteResponse +- StreamCreateResponse +- StreamUpdateResponse +- StreamListResponse +- StreamGetResponse Methods: -- client.snippets.update(zoneIdentifier, snippetName, { ...params }) -> Snippet -- client.snippets.list(zoneIdentifier) -> SnippetListResponse -- client.snippets.delete(zoneIdentifier, snippetName) -> SnippetDeleteResponse -- client.snippets.get(zoneIdentifier, snippetName) -> Snippet +- client.pipelines.streams.create({ ...params }) -> StreamCreateResponse +- client.pipelines.streams.update(streamId, { ...params }) -> StreamUpdateResponse +- client.pipelines.streams.list({ ...params }) -> StreamListResponsesV4PagePaginationArray +- client.pipelines.streams.delete(streamId, { ...params }) -> void +- client.pipelines.streams.get(streamId, { ...params }) -> StreamGetResponse -## Content +# SchemaValidation + +## Schemas + +Types: + +- PublicSchema +- SchemaDeleteResponse Methods: -- client.snippets.content.get(zoneIdentifier, snippetName) -> Response +- client.schemaValidation.schemas.create({ ...params }) -> PublicSchema +- client.schemaValidation.schemas.list({ ...params }) -> PublicSchemasV4PagePaginationArray +- client.schemaValidation.schemas.delete(schemaId, { ...params }) -> SchemaDeleteResponse +- client.schemaValidation.schemas.edit(schemaId, { ...params }) -> PublicSchema +- client.schemaValidation.schemas.get(schemaId, { ...params }) -> PublicSchema -## Rules +## Settings Types: -- RuleUpdateResponse -- RuleListResponse +- SettingUpdateResponse +- SettingEditResponse +- SettingGetResponse Methods: -- client.snippets.rules.update(zoneIdentifier, { ...params }) -> RuleUpdateResponse -- client.snippets.rules.list(zoneIdentifier) -> RuleListResponse +- client.schemaValidation.settings.update({ ...params }) -> SettingUpdateResponse +- client.schemaValidation.settings.edit({ ...params }) -> SettingEditResponse +- client.schemaValidation.settings.get({ ...params }) -> SettingGetResponse -# Calls +### Operations Types: -- CallsApp -- CallsAppWithSecret -- CallListResponse +- OperationUpdateResponse +- OperationListResponse +- OperationDeleteResponse +- OperationBulkEditResponse +- OperationGetResponse Methods: -- client.calls.create({ ...params }) -> CallsAppWithSecret -- client.calls.update(appId, { ...params }) -> CallsApp -- client.calls.list({ ...params }) -> CallListResponse -- client.calls.delete(appId, { ...params }) -> CallsApp -- client.calls.get(appId, { ...params }) -> CallsApp +- client.schemaValidation.settings.operations.update(operationId, { ...params }) -> OperationUpdateResponse +- client.schemaValidation.settings.operations.list({ ...params }) -> OperationListResponsesV4PagePaginationArray +- client.schemaValidation.settings.operations.delete(operationId, { ...params }) -> OperationDeleteResponse +- client.schemaValidation.settings.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse +- client.schemaValidation.settings.operations.get(operationId, { ...params }) -> OperationGetResponse -# CloudforceOne +# TokenValidation -## Requests +## Configuration Types: -- CloudforceOneQuota -- CloudforceOneRequestConstants -- CloudforceOneRequestItem -- CloudforceOneRequestListItem -- CloudforceOneRequestTypes -- RequestDeleteResponse +- TokenConfig +- ConfigurationDeleteResponse +- ConfigurationEditResponse Methods: -- client.cloudforceOne.requests.create(accountIdentifier, { ...params }) -> CloudforceOneRequestItem -- client.cloudforceOne.requests.update(accountIdentifier, requestIdentifier, { ...params }) -> CloudforceOneRequestItem -- client.cloudforceOne.requests.list(accountIdentifier, { ...params }) -> CloudforceOneRequestListItemsV4PagePaginationArray -- client.cloudforceOne.requests.delete(accountIdentifier, requestIdentifier) -> RequestDeleteResponse -- client.cloudforceOne.requests.constants(accountIdentifier) -> CloudforceOneRequestConstants -- client.cloudforceOne.requests.get(accountIdentifier, requestIdentifier) -> CloudforceOneRequestItem -- client.cloudforceOne.requests.quota(accountIdentifier) -> CloudforceOneQuota -- client.cloudforceOne.requests.types(accountIdentifier) -> CloudforceOneRequestTypes +- client.tokenValidation.configuration.create({ ...params }) -> TokenConfig +- client.tokenValidation.configuration.list({ ...params }) -> TokenConfigsV4PagePaginationArray +- client.tokenValidation.configuration.delete(configId, { ...params }) -> ConfigurationDeleteResponse +- client.tokenValidation.configuration.edit(configId, { ...params }) -> ConfigurationEditResponse +- client.tokenValidation.configuration.get(configId, { ...params }) -> TokenConfig -### Message +### Credentials Types: -- CloudforceOneRequestMessageItem -- MessageDeleteResponse -- MessageGetResponse +- CredentialUpdateResponse Methods: -- client.cloudforceOne.requests.message.create(accountIdentifier, requestIdentifier, { ...params }) -> CloudforceOneRequestMessageItem -- client.cloudforceOne.requests.message.update(accountIdentifier, requestIdentifier, messageIdentifer, { ...params }) -> CloudforceOneRequestMessageItem -- client.cloudforceOne.requests.message.delete(accountIdentifier, requestIdentifier, messageIdentifer) -> MessageDeleteResponse -- client.cloudforceOne.requests.message.get(accountIdentifier, requestIdentifier, { ...params }) -> MessageGetResponse +- client.tokenValidation.configuration.credentials.update(configId, { ...params }) -> CredentialUpdateResponse -### Priority +## Rules Types: -- CloudforceOnePriorityItem -- PriorityDeleteResponse +- TokenValidationRule +- RuleDeleteResponse Methods: -- client.cloudforceOne.requests.priority.create(accountIdentifier, { ...params }) -> CloudforceOnePriorityItem -- client.cloudforceOne.requests.priority.update(accountIdentifier, priorityIdentifer, { ...params }) -> CloudforceOneRequestItem -- client.cloudforceOne.requests.priority.delete(accountIdentifier, priorityIdentifer) -> PriorityDeleteResponse -- client.cloudforceOne.requests.priority.get(accountIdentifier, priorityIdentifer) -> CloudforceOneRequestItem -- client.cloudforceOne.requests.priority.quota(accountIdentifier) -> CloudforceOneQuota +- client.tokenValidation.rules.create({ ...params }) -> TokenValidationRule +- client.tokenValidation.rules.list({ ...params }) -> TokenValidationRulesV4PagePaginationArray +- client.tokenValidation.rules.delete(ruleId, { ...params }) -> RuleDeleteResponse +- client.tokenValidation.rules.bulkCreate([ ...body ]) -> TokenValidationRulesSinglePage +- client.tokenValidation.rules.bulkEdit([ ...body ]) -> TokenValidationRulesSinglePage +- client.tokenValidation.rules.edit(ruleId, { ...params }) -> TokenValidationRule +- client.tokenValidation.rules.get(ruleId, { ...params }) -> TokenValidationRule diff --git a/bin/check-release-environment b/bin/check-release-environment index 624db5612a..e4b6d58ead 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -3,7 +3,7 @@ errors=() if [ -z "${NPM_TOKEN}" ]; then - errors+=("The CLOUDFLARE_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") + errors+=("The NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi lenErrors=${#errors[@]} @@ -19,3 +19,4 @@ if [[ lenErrors -gt 0 ]]; then fi echo "The environment is ready to push releases!" + diff --git a/bin/check-test-server b/bin/check-test-server deleted file mode 100755 index a6fa34950d..0000000000 --- a/bin/check-test-server +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env bash - -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color - -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if is_overriding_api_base_url ; then - # If someone is running the tests against the live API, we can trust they know - # what they're doing and exit early. - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - - exit 0 -elif prism_is_running ; then - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo - - exit 0 -else - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "${YELLOW}To fix:${NC}" - echo - echo -e "1. Install Prism (requires Node 16+):" - echo - echo -e " With npm:" - echo -e " \$ ${YELLOW}npm install -g @stoplight/prism-cli${NC}" - echo - echo -e " With yarn:" - echo -e " \$ ${YELLOW}yarn global add @stoplight/prism-cli${NC}" - echo - echo -e "2. Run the mock server" - echo - echo -e " To run the server, pass in the path of your OpenAPI" - echo -e " spec to the prism command:" - echo - echo -e " \$ ${YELLOW}prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -fi diff --git a/bin/publish-npm b/bin/publish-npm index 4d6c9f3572..45e8aa8088 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -2,8 +2,60 @@ set -eux -npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN +npm config set '//registry.npmjs.org/:_authToken' "$NPM_TOKEN" yarn build cd dist -yarn publish --access public + +# Get package name and version from package.json +PACKAGE_NAME="$(jq -r -e '.name' ./package.json)" +VERSION="$(jq -r -e '.version' ./package.json)" + +# Get latest version from npm +# +# If the package doesn't exist, npm will return: +# { +# "error": { +# "code": "E404", +# "summary": "Unpublished on 2025-06-05T09:54:53.528Z", +# "detail": "'the_package' is not in this registry..." +# } +# } +NPM_INFO="$(npm view "$PACKAGE_NAME" version --json 2>/dev/null || true)" + +# Check if we got an E404 error +if echo "$NPM_INFO" | jq -e '.error.code == "E404"' > /dev/null 2>&1; then + # Package doesn't exist yet, no last version + LAST_VERSION="" +elif echo "$NPM_INFO" | jq -e '.error' > /dev/null 2>&1; then + # Report other errors + echo "ERROR: npm returned unexpected data:" + echo "$NPM_INFO" + exit 1 +else + # Success - get the version + LAST_VERSION=$(echo "$NPM_INFO" | jq -r '.') # strip quotes +fi + +# Check if current version is pre-release (e.g. alpha / beta / rc) +CURRENT_IS_PRERELEASE=false +if [[ "$VERSION" =~ -([a-zA-Z]+) ]]; then + CURRENT_IS_PRERELEASE=true + CURRENT_TAG="${BASH_REMATCH[1]}" +fi + +# Check if last version is a stable release +LAST_IS_STABLE_RELEASE=true +if [[ -z "$LAST_VERSION" || "$LAST_VERSION" =~ -([a-zA-Z]+) ]]; then + LAST_IS_STABLE_RELEASE=false +fi + +# Use a corresponding alpha/beta tag if there already is a stable release and we're publishing a prerelease. +if $CURRENT_IS_PRERELEASE && $LAST_IS_STABLE_RELEASE; then + TAG="$CURRENT_TAG" +else + TAG="latest" +fi + +# Publish with the appropriate tag +yarn publish --tag "$TAG" diff --git a/jest.config.ts b/jest.config.ts index 978c07f71c..c4d58c3d5d 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -3,6 +3,9 @@ import type { JestConfigWithTsJest } from 'ts-jest'; const config: JestConfigWithTsJest = { preset: 'ts-jest/presets/default-esm', testEnvironment: 'node', + transform: { + '^.+\\.(t|j)sx?$': ['@swc/jest', { sourceMaps: 'inline' }], + }, moduleNameMapper: { '^cloudflare$': '/src/index.ts', '^cloudflare/_shims/auto/(.*)$': '/src/_shims/auto/$1-node', @@ -14,6 +17,7 @@ const config: JestConfigWithTsJest = { '/deno/', '/deno_tests/', ], + testPathIgnorePatterns: ['scripts'], }; export default config; diff --git a/package.json b/package.json index e826925f04..5411d4d162 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "0.0.1", + "version": "6.0.0-beta.1", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", @@ -8,46 +8,46 @@ "type": "commonjs", "repository": "github:cloudflare/cloudflare-typescript", "license": "Apache-2.0", - "packageManager": "yarn@1.22.21", + "packageManager": "yarn@1.22.22", "files": [ - "*" + "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { - "test": "bin/check-test-server && yarn jest", - "build": "bash ./build", - "prepack": "echo 'to pack, run yarn build && (cd dist; yarn pack)' && exit 1", + "test": "./scripts/test", + "build": "./scripts/build", "prepublishOnly": "echo 'to publish, run yarn build && (cd dist; yarn publish)' && exit 1", "format": "prettier --write --cache --cache-strategy metadata . !dist", - "prepare": "if ./scripts/check-is-in-git-install.sh; then npm run build; fi", + "prepare": "if ./scripts/utils/check-is-in-git-install.sh; then ./scripts/build && ./scripts/utils/git-swap.sh; fi", "tsn": "ts-node -r tsconfig-paths/register", - "lint": "eslint --ext ts,js .", - "fix": "eslint --fix --ext ts,js ." + "lint": "./scripts/lint", + "fix": "./scripts/format" }, "dependencies": { "@types/node": "^18.11.18", "@types/node-fetch": "^2.6.4", - "@types/qs": "^6.9.7", "abort-controller": "^3.0.0", "agentkeepalive": "^4.2.1", - "digest-fetch": "^1.3.0", "form-data-encoder": "1.7.2", "formdata-node": "^4.3.2", - "node-fetch": "^2.6.7", - "qs": "^6.10.3", - "web-streams-polyfill": "^3.2.1" + "node-fetch": "^2.6.7" }, "devDependencies": { + "@swc/core": "^1.3.102", + "@swc/jest": "^0.2.29", "@types/jest": "^29.4.0", "@typescript-eslint/eslint-plugin": "^6.7.0", "@typescript-eslint/parser": "^6.7.0", "eslint": "^8.49.0", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-unused-imports": "^3.0.0", + "iconv-lite": "^0.6.3", "jest": "^29.4.0", "prettier": "^3.0.0", "ts-jest": "^29.1.0", - "ts-morph": "^19.0.0", "ts-node": "^10.5.0", "tsc-multi": "^1.1.0", "tsconfig-paths": "^4.0.0", @@ -61,10 +61,6 @@ "./shims/web.js", "./shims/web.mjs" ], - "imports": { - "cloudflare": ".", - "cloudflare/*": "./src/*" - }, "exports": { "./_shims/auto/*": { "deno": { diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 0000000000..f68bedacbf --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then + brew bundle check >/dev/null 2>&1 || { + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo + } +fi + +echo "==> Installing Node dependencies…" + +PACKAGE_MANAGER=$(command -v yarn >/dev/null 2>&1 && echo "yarn" || echo "npm") + +$PACKAGE_MANAGER install diff --git a/build b/scripts/build similarity index 81% rename from build rename to scripts/build index 226bb612a8..4b9d2438fe 100755 --- a/build +++ b/scripts/build @@ -1,7 +1,10 @@ #!/usr/bin/env bash + set -exuo pipefail -node scripts/check-version.cjs +cd "$(dirname "$0")/.." + +node scripts/utils/check-version.cjs # Build into dist and will publish the package from there, # so that src/resources/foo.ts becomes /resources/foo.js @@ -22,17 +25,17 @@ if [ -e "bin/cli" ]; then fi # this converts the export map paths for the dist directory # and does a few other minor things -node scripts/make-dist-package-json.cjs > dist/package.json +node scripts/utils/make-dist-package-json.cjs > dist/package.json # build to .js/.mjs/.d.ts files -npm exec tsc-multi +./node_modules/.bin/tsc-multi # copy over handwritten .js/.mjs/.d.ts files cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto -# we need to add exports = module.exports = Cloudflare Node to index.js; +# we need to add exports = module.exports = Cloudflare to index.js; # No way to get that from index.ts because it would cause compile errors # when building .mjs -node scripts/fix-index-exports.cjs +node scripts/utils/fix-index-exports.cjs # with "moduleResolution": "nodenext", if ESM resolves to index.d.ts, # it'll have TS errors on the default import. But if it resolves to # index.d.mts the default import will work (even though both files have @@ -40,14 +43,14 @@ node scripts/fix-index-exports.cjs cp dist/index.d.ts dist/index.d.mts cp tsconfig.dist-src.json dist/src/tsconfig.json -node scripts/postprocess-files.cjs +node scripts/utils/postprocess-files.cjs # make sure that nothing crashes when we require the output CJS or # import the output ESM (cd dist && node -e 'require("cloudflare")') (cd dist && node -e 'import("cloudflare")' --input-type=module) -if command -v deno &> /dev/null && [ -e ./build-deno ] +if [ -e ./scripts/build-deno ] then - ./build-deno + ./scripts/build-deno fi diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes new file mode 100755 index 0000000000..1daa713030 --- /dev/null +++ b/scripts/detect-breaking-changes @@ -0,0 +1,816 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Detecting breaking changes" + +TEST_PATHS=( + tests/api-resources/accounts/accounts.test.ts + tests/api-resources/accounts/members.test.ts + tests/api-resources/accounts/roles.test.ts + tests/api-resources/accounts/subscriptions.test.ts + tests/api-resources/accounts/tokens/tokens.test.ts + tests/api-resources/accounts/tokens/permission-groups.test.ts + tests/api-resources/accounts/tokens/value.test.ts + tests/api-resources/accounts/logs/logs.test.ts + tests/api-resources/accounts/logs/audit.test.ts + tests/api-resources/organizations/organizations.test.ts + tests/api-resources/organizations/organization-profile.test.ts + tests/api-resources/origin-ca-certificates.test.ts + tests/api-resources/ips.test.ts + tests/api-resources/memberships.test.ts + tests/api-resources/user/user.test.ts + tests/api-resources/user/audit-logs.test.ts + tests/api-resources/user/billing/billing.test.ts + tests/api-resources/user/billing/history.test.ts + tests/api-resources/user/billing/profile.test.ts + tests/api-resources/user/invites.test.ts + tests/api-resources/user/organizations.test.ts + tests/api-resources/user/subscriptions.test.ts + tests/api-resources/user/tokens/tokens.test.ts + tests/api-resources/user/tokens/permission-groups.test.ts + tests/api-resources/user/tokens/value.test.ts + tests/api-resources/zones/zones.test.ts + tests/api-resources/zones/activation-check.test.ts + tests/api-resources/zones/settings.test.ts + tests/api-resources/zones/custom-nameservers.test.ts + tests/api-resources/zones/holds.test.ts + tests/api-resources/zones/subscriptions.test.ts + tests/api-resources/zones/plans.test.ts + tests/api-resources/zones/rate-plans.test.ts + tests/api-resources/load-balancers/load-balancers.test.ts + tests/api-resources/load-balancers/monitors/monitors.test.ts + tests/api-resources/load-balancers/monitors/previews.test.ts + tests/api-resources/load-balancers/monitors/references.test.ts + tests/api-resources/load-balancers/monitor-groups.test.ts + tests/api-resources/load-balancers/pools/pools.test.ts + tests/api-resources/load-balancers/pools/health.test.ts + tests/api-resources/load-balancers/pools/references.test.ts + tests/api-resources/load-balancers/previews.test.ts + tests/api-resources/load-balancers/regions.test.ts + tests/api-resources/load-balancers/searches.test.ts + tests/api-resources/cache/cache.test.ts + tests/api-resources/cache/cache-reserve.test.ts + tests/api-resources/cache/smart-tiered-cache.test.ts + tests/api-resources/cache/variants.test.ts + tests/api-resources/cache/regional-tiered-cache.test.ts + tests/api-resources/ssl/ssl.test.ts + tests/api-resources/ssl/analyze.test.ts + tests/api-resources/ssl/certificate-packs/certificate-packs.test.ts + tests/api-resources/ssl/certificate-packs/quota.test.ts + tests/api-resources/ssl/recommendations.test.ts + tests/api-resources/ssl/universal/universal.test.ts + tests/api-resources/ssl/universal/settings.test.ts + tests/api-resources/ssl/verification.test.ts + tests/api-resources/acm/acm.test.ts + tests/api-resources/acm/total-tls.test.ts + tests/api-resources/argo/argo.test.ts + tests/api-resources/argo/smart-routing.test.ts + tests/api-resources/argo/tiered-caching.test.ts + tests/api-resources/certificate-authorities/certificate-authorities.test.ts + tests/api-resources/certificate-authorities/hostname-associations.test.ts + tests/api-resources/client-certificates.test.ts + tests/api-resources/custom-certificates/custom-certificates.test.ts + tests/api-resources/custom-certificates/prioritize.test.ts + tests/api-resources/custom-hostnames/custom-hostnames.test.ts + tests/api-resources/custom-hostnames/fallback-origin.test.ts + tests/api-resources/custom-hostnames/certificate-pack/certificate-pack.test.ts + tests/api-resources/custom-hostnames/certificate-pack/certificates.test.ts + tests/api-resources/custom-nameservers.test.ts + tests/api-resources/dns-firewall/dns-firewall.test.ts + tests/api-resources/dns-firewall/analytics/analytics.test.ts + tests/api-resources/dns-firewall/analytics/reports/reports.test.ts + tests/api-resources/dns-firewall/analytics/reports/bytimes.test.ts + tests/api-resources/dns-firewall/reverse-dns.test.ts + tests/api-resources/dns/dns.test.ts + tests/api-resources/dns/dnssec.test.ts + tests/api-resources/dns/records.test.ts + tests/api-resources/dns/settings/settings.test.ts + tests/api-resources/dns/settings/zone.test.ts + tests/api-resources/dns/settings/account/account.test.ts + tests/api-resources/dns/settings/account/views.test.ts + tests/api-resources/dns/analytics/analytics.test.ts + tests/api-resources/dns/analytics/reports/reports.test.ts + tests/api-resources/dns/analytics/reports/bytimes.test.ts + tests/api-resources/dns/zone-transfers/zone-transfers.test.ts + tests/api-resources/dns/zone-transfers/force-axfr.test.ts + tests/api-resources/dns/zone-transfers/incoming.test.ts + tests/api-resources/dns/zone-transfers/outgoing/outgoing.test.ts + tests/api-resources/dns/zone-transfers/outgoing/status.test.ts + tests/api-resources/dns/zone-transfers/acls.test.ts + tests/api-resources/dns/zone-transfers/peers.test.ts + tests/api-resources/dns/zone-transfers/tsigs.test.ts + tests/api-resources/email-security/email-security.test.ts + tests/api-resources/email-security/investigate/investigate.test.ts + tests/api-resources/email-security/investigate/detections.test.ts + tests/api-resources/email-security/investigate/preview.test.ts + tests/api-resources/email-security/investigate/raw.test.ts + tests/api-resources/email-security/investigate/trace.test.ts + tests/api-resources/email-security/investigate/move.test.ts + tests/api-resources/email-security/investigate/reclassify.test.ts + tests/api-resources/email-security/investigate/release.test.ts + tests/api-resources/email-security/settings/settings.test.ts + tests/api-resources/email-security/settings/allow-policies.test.ts + tests/api-resources/email-security/settings/block-senders.test.ts + tests/api-resources/email-security/settings/domains.test.ts + tests/api-resources/email-security/settings/impersonation-registry.test.ts + tests/api-resources/email-security/settings/trusted-domains.test.ts + tests/api-resources/email-security/submissions.test.ts + tests/api-resources/email-routing/email-routing.test.ts + tests/api-resources/email-routing/dns.test.ts + tests/api-resources/email-routing/rules/rules.test.ts + tests/api-resources/email-routing/rules/catch-alls.test.ts + tests/api-resources/email-routing/addresses.test.ts + tests/api-resources/filters.test.ts + tests/api-resources/firewall/firewall.test.ts + tests/api-resources/firewall/lockdowns.test.ts + tests/api-resources/firewall/rules.test.ts + tests/api-resources/firewall/access-rules.test.ts + tests/api-resources/firewall/ua-rules.test.ts + tests/api-resources/firewall/waf/waf.test.ts + tests/api-resources/firewall/waf/overrides.test.ts + tests/api-resources/firewall/waf/packages/packages.test.ts + tests/api-resources/firewall/waf/packages/groups.test.ts + tests/api-resources/firewall/waf/packages/rules.test.ts + tests/api-resources/healthchecks/healthchecks.test.ts + tests/api-resources/healthchecks/previews.test.ts + tests/api-resources/keyless-certificates.test.ts + tests/api-resources/logpush/logpush.test.ts + tests/api-resources/logpush/datasets/datasets.test.ts + tests/api-resources/logpush/datasets/fields.test.ts + tests/api-resources/logpush/datasets/jobs.test.ts + tests/api-resources/logpush/edge.test.ts + tests/api-resources/logpush/jobs.test.ts + tests/api-resources/logpush/ownership.test.ts + tests/api-resources/logpush/validate.test.ts + tests/api-resources/logs/logs.test.ts + tests/api-resources/logs/control/control.test.ts + tests/api-resources/logs/control/retention.test.ts + tests/api-resources/logs/control/cmb/cmb.test.ts + tests/api-resources/logs/control/cmb/config.test.ts + tests/api-resources/logs/rayid.test.ts + tests/api-resources/logs/received/received.test.ts + tests/api-resources/logs/received/fields.test.ts + tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts + tests/api-resources/origin-tls-client-auth/zone-certificates.test.ts + tests/api-resources/origin-tls-client-auth/hostnames.test.ts + tests/api-resources/origin-tls-client-auth/hostname-certificates.test.ts + tests/api-resources/origin-tls-client-auth/settings.test.ts + tests/api-resources/page-rules.test.ts + tests/api-resources/rate-limits.test.ts + tests/api-resources/waiting-rooms/waiting-rooms.test.ts + tests/api-resources/waiting-rooms/page.test.ts + tests/api-resources/waiting-rooms/events/events.test.ts + tests/api-resources/waiting-rooms/events/details.test.ts + tests/api-resources/waiting-rooms/rules.test.ts + tests/api-resources/waiting-rooms/statuses.test.ts + tests/api-resources/waiting-rooms/settings.test.ts + tests/api-resources/web3/web3.test.ts + tests/api-resources/web3/hostnames/hostnames.test.ts + tests/api-resources/web3/hostnames/ipfs-universal-paths/ipfs-universal-paths.test.ts + tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/content-lists.test.ts + tests/api-resources/web3/hostnames/ipfs-universal-paths/content-lists/entries.test.ts + tests/api-resources/workers/workers.test.ts + tests/api-resources/workers/beta/beta.test.ts + tests/api-resources/workers/beta/workers/workers.test.ts + tests/api-resources/workers/beta/workers/versions.test.ts + tests/api-resources/workers/routes.test.ts + tests/api-resources/workers/assets/assets.test.ts + tests/api-resources/workers/assets/upload.test.ts + tests/api-resources/workers/scripts/scripts.test.ts + tests/api-resources/workers/scripts/assets/assets.test.ts + tests/api-resources/workers/scripts/assets/upload.test.ts + tests/api-resources/workers/scripts/subdomain.test.ts + tests/api-resources/workers/scripts/schedules.test.ts + tests/api-resources/workers/scripts/tail.test.ts + tests/api-resources/workers/scripts/content.test.ts + tests/api-resources/workers/scripts/settings.test.ts + tests/api-resources/workers/scripts/deployments.test.ts + tests/api-resources/workers/scripts/versions.test.ts + tests/api-resources/workers/scripts/secrets.test.ts + tests/api-resources/workers/scripts/script-and-version-settings.test.ts + tests/api-resources/workers/account-settings.test.ts + tests/api-resources/workers/domains.test.ts + tests/api-resources/workers/subdomains.test.ts + tests/api-resources/workers/observability/observability.test.ts + tests/api-resources/workers/observability/telemetry.test.ts + tests/api-resources/kv/kv.test.ts + tests/api-resources/kv/namespaces/namespaces.test.ts + tests/api-resources/kv/namespaces/keys.test.ts + tests/api-resources/kv/namespaces/metadata.test.ts + tests/api-resources/kv/namespaces/values.test.ts + tests/api-resources/durable-objects/durable-objects.test.ts + tests/api-resources/durable-objects/namespaces/namespaces.test.ts + tests/api-resources/durable-objects/namespaces/objects.test.ts + tests/api-resources/queues/queues.test.ts + tests/api-resources/queues/messages.test.ts + tests/api-resources/queues/purge.test.ts + tests/api-resources/queues/consumers.test.ts + tests/api-resources/queues/subscriptions.test.ts + tests/api-resources/api-gateway/api-gateway.test.ts + tests/api-resources/api-gateway/configurations.test.ts + tests/api-resources/api-gateway/discovery/discovery.test.ts + tests/api-resources/api-gateway/discovery/operations.test.ts + tests/api-resources/api-gateway/operations/operations.test.ts + tests/api-resources/api-gateway/operations/schema-validation.test.ts + tests/api-resources/api-gateway/schemas.test.ts + tests/api-resources/api-gateway/settings/settings.test.ts + tests/api-resources/api-gateway/settings/schema-validation.test.ts + tests/api-resources/api-gateway/user-schemas/user-schemas.test.ts + tests/api-resources/api-gateway/user-schemas/operations.test.ts + tests/api-resources/api-gateway/user-schemas/hosts.test.ts + tests/api-resources/api-gateway/expression-template/expression-template.test.ts + tests/api-resources/api-gateway/expression-template/fallthrough.test.ts + tests/api-resources/managed-transforms.test.ts + tests/api-resources/page-shield/page-shield.test.ts + tests/api-resources/page-shield/policies.test.ts + tests/api-resources/page-shield/connections.test.ts + tests/api-resources/page-shield/scripts.test.ts + tests/api-resources/page-shield/cookies.test.ts + tests/api-resources/rulesets/rulesets.test.ts + tests/api-resources/rulesets/phases/phases.test.ts + tests/api-resources/rulesets/phases/versions.test.ts + tests/api-resources/rulesets/rules.test.ts + tests/api-resources/rulesets/versions.test.ts + tests/api-resources/url-normalization.test.ts + tests/api-resources/spectrum/spectrum.test.ts + tests/api-resources/spectrum/analytics/analytics.test.ts + tests/api-resources/spectrum/analytics/aggregates/aggregates.test.ts + tests/api-resources/spectrum/analytics/aggregates/currents.test.ts + tests/api-resources/spectrum/analytics/events/events.test.ts + tests/api-resources/spectrum/analytics/events/bytimes.test.ts + tests/api-resources/spectrum/analytics/events/summaries.test.ts + tests/api-resources/spectrum/apps.test.ts + tests/api-resources/addressing/addressing.test.ts + tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts + tests/api-resources/addressing/regional-hostnames/regions.test.ts + tests/api-resources/addressing/services.test.ts + tests/api-resources/addressing/address-maps/address-maps.test.ts + tests/api-resources/addressing/address-maps/accounts.test.ts + tests/api-resources/addressing/address-maps/ips.test.ts + tests/api-resources/addressing/address-maps/zones.test.ts + tests/api-resources/addressing/loa-documents.test.ts + tests/api-resources/addressing/prefixes/prefixes.test.ts + tests/api-resources/addressing/prefixes/service-bindings.test.ts + tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts + tests/api-resources/addressing/prefixes/advertisement-status.test.ts + tests/api-resources/addressing/prefixes/delegations.test.ts + tests/api-resources/audit-logs.test.ts + tests/api-resources/billing/billing.test.ts + tests/api-resources/billing/profiles.test.ts + tests/api-resources/brand-protection/brand-protection.test.ts + tests/api-resources/brand-protection/queries.test.ts + tests/api-resources/brand-protection/matches.test.ts + tests/api-resources/brand-protection/logos.test.ts + tests/api-resources/brand-protection/logo-matches.test.ts + tests/api-resources/diagnostics/diagnostics.test.ts + tests/api-resources/diagnostics/traceroutes.test.ts + tests/api-resources/diagnostics/endpoint-healthchecks.test.ts + tests/api-resources/images/images.test.ts + tests/api-resources/images/v1/v1.test.ts + tests/api-resources/images/v1/keys.test.ts + tests/api-resources/images/v1/stats.test.ts + tests/api-resources/images/v1/variants.test.ts + tests/api-resources/images/v1/blobs.test.ts + tests/api-resources/images/v2/v2.test.ts + tests/api-resources/images/v2/direct-uploads.test.ts + tests/api-resources/intel/intel.test.ts + tests/api-resources/intel/asn/asn.test.ts + tests/api-resources/intel/asn/subnets.test.ts + tests/api-resources/intel/dns.test.ts + tests/api-resources/intel/domains/domains.test.ts + tests/api-resources/intel/domains/bulks.test.ts + tests/api-resources/intel/domain-history.test.ts + tests/api-resources/intel/ips.test.ts + tests/api-resources/intel/miscategorizations.test.ts + tests/api-resources/intel/whois.test.ts + tests/api-resources/intel/indicator-feeds/indicator-feeds.test.ts + tests/api-resources/intel/indicator-feeds/snapshots.test.ts + tests/api-resources/intel/indicator-feeds/permissions.test.ts + tests/api-resources/intel/sinkholes.test.ts + tests/api-resources/intel/attack-surface-report/attack-surface-report.test.ts + tests/api-resources/intel/attack-surface-report/issue-types.test.ts + tests/api-resources/intel/attack-surface-report/issues.test.ts + tests/api-resources/magic-transit/magic-transit.test.ts + tests/api-resources/magic-transit/apps.test.ts + tests/api-resources/magic-transit/cf-interconnects.test.ts + tests/api-resources/magic-transit/gre-tunnels.test.ts + tests/api-resources/magic-transit/ipsec-tunnels.test.ts + tests/api-resources/magic-transit/routes.test.ts + tests/api-resources/magic-transit/sites/sites.test.ts + tests/api-resources/magic-transit/sites/acls.test.ts + tests/api-resources/magic-transit/sites/lans.test.ts + tests/api-resources/magic-transit/sites/wans.test.ts + tests/api-resources/magic-transit/connectors/connectors.test.ts + tests/api-resources/magic-transit/connectors/events/events.test.ts + tests/api-resources/magic-transit/connectors/events/latest.test.ts + tests/api-resources/magic-transit/connectors/snapshots/snapshots.test.ts + tests/api-resources/magic-transit/connectors/snapshots/latest.test.ts + tests/api-resources/magic-transit/pcaps/pcaps.test.ts + tests/api-resources/magic-transit/pcaps/ownership.test.ts + tests/api-resources/magic-transit/pcaps/download.test.ts + tests/api-resources/magic-network-monitoring/magic-network-monitoring.test.ts + tests/api-resources/magic-network-monitoring/vpc-flows/vpc-flows.test.ts + tests/api-resources/magic-network-monitoring/vpc-flows/tokens.test.ts + tests/api-resources/magic-network-monitoring/configs/configs.test.ts + tests/api-resources/magic-network-monitoring/configs/full.test.ts + tests/api-resources/magic-network-monitoring/rules/rules.test.ts + tests/api-resources/magic-network-monitoring/rules/advertisements.test.ts + tests/api-resources/magic-cloud-networking/magic-cloud-networking.test.ts + tests/api-resources/magic-cloud-networking/catalog-syncs/catalog-syncs.test.ts + tests/api-resources/magic-cloud-networking/catalog-syncs/prebuilt-policies.test.ts + tests/api-resources/magic-cloud-networking/on-ramps/on-ramps.test.ts + tests/api-resources/magic-cloud-networking/on-ramps/address-spaces.test.ts + tests/api-resources/magic-cloud-networking/cloud-integrations.test.ts + tests/api-resources/magic-cloud-networking/resources.test.ts + tests/api-resources/network-interconnects/network-interconnects.test.ts + tests/api-resources/network-interconnects/cnis.test.ts + tests/api-resources/network-interconnects/interconnects.test.ts + tests/api-resources/network-interconnects/settings.test.ts + tests/api-resources/network-interconnects/slots.test.ts + tests/api-resources/mtls-certificates/mtls-certificates.test.ts + tests/api-resources/mtls-certificates/associations.test.ts + tests/api-resources/pages/pages.test.ts + tests/api-resources/pages/projects/projects.test.ts + tests/api-resources/pages/projects/deployments/deployments.test.ts + tests/api-resources/pages/projects/deployments/history/history.test.ts + tests/api-resources/pages/projects/deployments/history/logs.test.ts + tests/api-resources/pages/projects/domains.test.ts + tests/api-resources/registrar/registrar.test.ts + tests/api-resources/registrar/domains.test.ts + tests/api-resources/request-tracers/request-tracers.test.ts + tests/api-resources/request-tracers/traces.test.ts + tests/api-resources/rules/rules.test.ts + tests/api-resources/rules/lists/lists.test.ts + tests/api-resources/rules/lists/bulk-operations.test.ts + tests/api-resources/rules/lists/items.test.ts + tests/api-resources/stream/stream.test.ts + tests/api-resources/stream/audio-tracks.test.ts + tests/api-resources/stream/videos.test.ts + tests/api-resources/stream/clip.test.ts + tests/api-resources/stream/copy.test.ts + tests/api-resources/stream/direct-upload.test.ts + tests/api-resources/stream/keys.test.ts + tests/api-resources/stream/live-inputs/live-inputs.test.ts + tests/api-resources/stream/live-inputs/outputs.test.ts + tests/api-resources/stream/watermarks.test.ts + tests/api-resources/stream/webhooks.test.ts + tests/api-resources/stream/captions/captions.test.ts + tests/api-resources/stream/captions/language/language.test.ts + tests/api-resources/stream/captions/language/vtt.test.ts + tests/api-resources/stream/downloads.test.ts + tests/api-resources/stream/embed.test.ts + tests/api-resources/stream/token.test.ts + tests/api-resources/alerting/alerting.test.ts + tests/api-resources/alerting/available-alerts.test.ts + tests/api-resources/alerting/destinations/destinations.test.ts + tests/api-resources/alerting/destinations/eligible.test.ts + tests/api-resources/alerting/destinations/pagerduty.test.ts + tests/api-resources/alerting/destinations/webhooks.test.ts + tests/api-resources/alerting/history.test.ts + tests/api-resources/alerting/policies.test.ts + tests/api-resources/alerting/silences.test.ts + tests/api-resources/d1/d1.test.ts + tests/api-resources/d1/database/database.test.ts + tests/api-resources/d1/database/time-travel.test.ts + tests/api-resources/r2/r2.test.ts + tests/api-resources/r2/buckets/buckets.test.ts + tests/api-resources/r2/buckets/lifecycle.test.ts + tests/api-resources/r2/buckets/cors.test.ts + tests/api-resources/r2/buckets/domains/domains.test.ts + tests/api-resources/r2/buckets/domains/custom.test.ts + tests/api-resources/r2/buckets/domains/managed.test.ts + tests/api-resources/r2/buckets/event-notifications.test.ts + tests/api-resources/r2/buckets/locks.test.ts + tests/api-resources/r2/buckets/metrics.test.ts + tests/api-resources/r2/buckets/sippy.test.ts + tests/api-resources/r2/temporary-credentials.test.ts + tests/api-resources/r2/super-slurper/super-slurper.test.ts + tests/api-resources/r2/super-slurper/jobs/jobs.test.ts + tests/api-resources/r2/super-slurper/jobs/logs.test.ts + tests/api-resources/r2/super-slurper/connectivity-precheck.test.ts + tests/api-resources/r2-data-catalog/r2-data-catalog.test.ts + tests/api-resources/r2-data-catalog/maintenance-configs.test.ts + tests/api-resources/r2-data-catalog/credentials.test.ts + tests/api-resources/r2-data-catalog/namespaces/namespaces.test.ts + tests/api-resources/r2-data-catalog/namespaces/tables/tables.test.ts + tests/api-resources/r2-data-catalog/namespaces/tables/maintenance-configs.test.ts + tests/api-resources/workers-for-platforms/workers-for-platforms.test.ts + tests/api-resources/workers-for-platforms/dispatch/dispatch.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/namespaces.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/settings.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.test.ts + tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/tags.test.ts + tests/api-resources/zero-trust/zero-trust.test.ts + tests/api-resources/zero-trust/devices/devices.test.ts + tests/api-resources/zero-trust/devices/devices_.test.ts + tests/api-resources/zero-trust/devices/resilience/resilience.test.ts + tests/api-resources/zero-trust/devices/resilience/global-warp-override.test.ts + tests/api-resources/zero-trust/devices/registrations.test.ts + tests/api-resources/zero-trust/devices/dex-tests.test.ts + tests/api-resources/zero-trust/devices/networks.test.ts + tests/api-resources/zero-trust/devices/fleet-status.test.ts + tests/api-resources/zero-trust/devices/policies/policies.test.ts + tests/api-resources/zero-trust/devices/policies/default/default.test.ts + tests/api-resources/zero-trust/devices/policies/default/excludes.test.ts + tests/api-resources/zero-trust/devices/policies/default/includes.test.ts + tests/api-resources/zero-trust/devices/policies/default/fallback-domains.test.ts + tests/api-resources/zero-trust/devices/policies/default/certificates.test.ts + tests/api-resources/zero-trust/devices/policies/custom/custom.test.ts + tests/api-resources/zero-trust/devices/policies/custom/excludes.test.ts + tests/api-resources/zero-trust/devices/policies/custom/includes.test.ts + tests/api-resources/zero-trust/devices/policies/custom/fallback-domains.test.ts + tests/api-resources/zero-trust/devices/posture/posture.test.ts + tests/api-resources/zero-trust/devices/posture/integrations.test.ts + tests/api-resources/zero-trust/devices/revoke.test.ts + tests/api-resources/zero-trust/devices/settings.test.ts + tests/api-resources/zero-trust/devices/unrevoke.test.ts + tests/api-resources/zero-trust/devices/override-codes.test.ts + tests/api-resources/zero-trust/identity-providers/identity-providers.test.ts + tests/api-resources/zero-trust/identity-providers/scim/scim.test.ts + tests/api-resources/zero-trust/identity-providers/scim/groups.test.ts + tests/api-resources/zero-trust/identity-providers/scim/users.test.ts + tests/api-resources/zero-trust/organizations/organizations.test.ts + tests/api-resources/zero-trust/organizations/doh.test.ts + tests/api-resources/zero-trust/seats.test.ts + tests/api-resources/zero-trust/access/access.test.ts + tests/api-resources/zero-trust/access/ai-controls/ai-controls.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/mcp.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/portals.test.ts + tests/api-resources/zero-trust/access/ai-controls/mcp/servers.test.ts + tests/api-resources/zero-trust/access/gateway-ca.test.ts + tests/api-resources/zero-trust/access/infrastructure/infrastructure.test.ts + tests/api-resources/zero-trust/access/infrastructure/targets.test.ts + tests/api-resources/zero-trust/access/applications/applications.test.ts + tests/api-resources/zero-trust/access/applications/cas.test.ts + tests/api-resources/zero-trust/access/applications/user-policy-checks.test.ts + tests/api-resources/zero-trust/access/applications/policies.test.ts + tests/api-resources/zero-trust/access/applications/policy-tests/policy-tests.test.ts + tests/api-resources/zero-trust/access/applications/policy-tests/users.test.ts + tests/api-resources/zero-trust/access/applications/settings.test.ts + tests/api-resources/zero-trust/access/certificates/certificates.test.ts + tests/api-resources/zero-trust/access/certificates/settings.test.ts + tests/api-resources/zero-trust/access/groups.test.ts + tests/api-resources/zero-trust/access/service-tokens.test.ts + tests/api-resources/zero-trust/access/bookmarks.test.ts + tests/api-resources/zero-trust/access/keys.test.ts + tests/api-resources/zero-trust/access/logs/logs.test.ts + tests/api-resources/zero-trust/access/logs/access-requests.test.ts + tests/api-resources/zero-trust/access/logs/scim/scim.test.ts + tests/api-resources/zero-trust/access/logs/scim/updates.test.ts + tests/api-resources/zero-trust/access/users/users.test.ts + tests/api-resources/zero-trust/access/users/active-sessions.test.ts + tests/api-resources/zero-trust/access/users/last-seen-identity.test.ts + tests/api-resources/zero-trust/access/users/failed-logins.test.ts + tests/api-resources/zero-trust/access/custom-pages.test.ts + tests/api-resources/zero-trust/access/tags.test.ts + tests/api-resources/zero-trust/access/policies.test.ts + tests/api-resources/zero-trust/dex/dex.test.ts + tests/api-resources/zero-trust/dex/warp-change-events.test.ts + tests/api-resources/zero-trust/dex/commands/commands.test.ts + tests/api-resources/zero-trust/dex/commands/devices.test.ts + tests/api-resources/zero-trust/dex/commands/downloads.test.ts + tests/api-resources/zero-trust/dex/commands/quota.test.ts + tests/api-resources/zero-trust/dex/colos.test.ts + tests/api-resources/zero-trust/dex/fleet-status/fleet-status.test.ts + tests/api-resources/zero-trust/dex/fleet-status/devices.test.ts + tests/api-resources/zero-trust/dex/http-tests/http-tests.test.ts + tests/api-resources/zero-trust/dex/http-tests/percentiles.test.ts + tests/api-resources/zero-trust/dex/tests/tests.test.ts + tests/api-resources/zero-trust/dex/tests/unique-devices.test.ts + tests/api-resources/zero-trust/dex/traceroute-test-results/traceroute-test-results.test.ts + tests/api-resources/zero-trust/dex/traceroute-test-results/network-path.test.ts + tests/api-resources/zero-trust/dex/traceroute-tests.test.ts + tests/api-resources/zero-trust/tunnels/tunnels.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/cloudflared.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/configurations.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/connections.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/token.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/connectors.test.ts + tests/api-resources/zero-trust/tunnels/cloudflared/management.test.ts + tests/api-resources/zero-trust/tunnels/warp-connector/warp-connector.test.ts + tests/api-resources/zero-trust/tunnels/warp-connector/token.test.ts + tests/api-resources/zero-trust/connectivity-settings.test.ts + tests/api-resources/zero-trust/dlp/dlp.test.ts + tests/api-resources/zero-trust/dlp/datasets/datasets.test.ts + tests/api-resources/zero-trust/dlp/datasets/upload.test.ts + tests/api-resources/zero-trust/dlp/datasets/versions/versions.test.ts + tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts + tests/api-resources/zero-trust/dlp/patterns.test.ts + tests/api-resources/zero-trust/dlp/payload-logs.test.ts + tests/api-resources/zero-trust/dlp/email/email.test.ts + tests/api-resources/zero-trust/dlp/email/account-mapping.test.ts + tests/api-resources/zero-trust/dlp/email/rules.test.ts + tests/api-resources/zero-trust/dlp/profiles/profiles.test.ts + tests/api-resources/zero-trust/dlp/profiles/custom.test.ts + tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts + tests/api-resources/zero-trust/dlp/limits.test.ts + tests/api-resources/zero-trust/dlp/entries/entries.test.ts + tests/api-resources/zero-trust/dlp/entries/custom.test.ts + tests/api-resources/zero-trust/dlp/entries/predefined.test.ts + tests/api-resources/zero-trust/dlp/entries/integration.test.ts + tests/api-resources/zero-trust/gateway/gateway.test.ts + tests/api-resources/zero-trust/gateway/audit-ssh-settings.test.ts + tests/api-resources/zero-trust/gateway/categories.test.ts + tests/api-resources/zero-trust/gateway/app-types.test.ts + tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts + tests/api-resources/zero-trust/gateway/configurations/custom-certificate.test.ts + tests/api-resources/zero-trust/gateway/lists/lists.test.ts + tests/api-resources/zero-trust/gateway/lists/items.test.ts + tests/api-resources/zero-trust/gateway/locations.test.ts + tests/api-resources/zero-trust/gateway/logging.test.ts + tests/api-resources/zero-trust/gateway/proxy-endpoints.test.ts + tests/api-resources/zero-trust/gateway/rules.test.ts + tests/api-resources/zero-trust/gateway/certificates.test.ts + tests/api-resources/zero-trust/networks/networks.test.ts + tests/api-resources/zero-trust/networks/routes/routes.test.ts + tests/api-resources/zero-trust/networks/routes/ips.test.ts + tests/api-resources/zero-trust/networks/routes/networks.test.ts + tests/api-resources/zero-trust/networks/virtual-networks.test.ts + tests/api-resources/zero-trust/networks/subnets/subnets.test.ts + tests/api-resources/zero-trust/networks/subnets/warp.test.ts + tests/api-resources/zero-trust/networks/subnets/cloudflare-source.test.ts + tests/api-resources/zero-trust/networks/hostname-routes.test.ts + tests/api-resources/zero-trust/risk-scoring/risk-scoring.test.ts + tests/api-resources/zero-trust/risk-scoring/behaviours.test.ts + tests/api-resources/zero-trust/risk-scoring/summary.test.ts + tests/api-resources/zero-trust/risk-scoring/integrations/integrations.test.ts + tests/api-resources/zero-trust/risk-scoring/integrations/references.test.ts + tests/api-resources/turnstile/turnstile.test.ts + tests/api-resources/turnstile/widgets.test.ts + tests/api-resources/connectivity/connectivity.test.ts + tests/api-resources/connectivity/directory/directory.test.ts + tests/api-resources/connectivity/directory/services.test.ts + tests/api-resources/hyperdrive/hyperdrive.test.ts + tests/api-resources/hyperdrive/configs.test.ts + tests/api-resources/rum/rum.test.ts + tests/api-resources/rum/site-info.test.ts + tests/api-resources/rum/rules.test.ts + tests/api-resources/vectorize/vectorize.test.ts + tests/api-resources/vectorize/indexes/indexes.test.ts + tests/api-resources/vectorize/indexes/metadata-index.test.ts + tests/api-resources/url-scanner/url-scanner.test.ts + tests/api-resources/url-scanner/responses.test.ts + tests/api-resources/url-scanner/scans.test.ts + tests/api-resources/radar/radar.test.ts + tests/api-resources/radar/ai/ai.test.ts + tests/api-resources/radar/ai/to-markdown.test.ts + tests/api-resources/radar/ai/inference/inference.test.ts + tests/api-resources/radar/ai/inference/summary.test.ts + tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts + tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts + tests/api-resources/radar/annotations/annotations.test.ts + tests/api-resources/radar/annotations/outages.test.ts + tests/api-resources/radar/bgp/bgp.test.ts + tests/api-resources/radar/bgp/leaks/leaks.test.ts + tests/api-resources/radar/bgp/leaks/events.test.ts + tests/api-resources/radar/bgp/top/top.test.ts + tests/api-resources/radar/bgp/top/ases.test.ts + tests/api-resources/radar/bgp/hijacks/hijacks.test.ts + tests/api-resources/radar/bgp/hijacks/events.test.ts + tests/api-resources/radar/bgp/routes.test.ts + tests/api-resources/radar/bgp/ips.test.ts + tests/api-resources/radar/bgp/rpki/rpki.test.ts + tests/api-resources/radar/bgp/rpki/aspa.test.ts + tests/api-resources/radar/bots/bots.test.ts + tests/api-resources/radar/bots/web-crawlers.test.ts + tests/api-resources/radar/datasets.test.ts + tests/api-resources/radar/dns/dns.test.ts + tests/api-resources/radar/dns/top.test.ts + tests/api-resources/radar/dns/summary.test.ts + tests/api-resources/radar/dns/timeseries-groups.test.ts + tests/api-resources/radar/netflows/netflows.test.ts + tests/api-resources/radar/netflows/top.test.ts + tests/api-resources/radar/search.test.ts + tests/api-resources/radar/verified-bots/verified-bots.test.ts + tests/api-resources/radar/verified-bots/top.test.ts + tests/api-resources/radar/as112/as112.test.ts + tests/api-resources/radar/as112/summary.test.ts + tests/api-resources/radar/as112/timeseries-groups.test.ts + tests/api-resources/radar/as112/top.test.ts + tests/api-resources/radar/email/email.test.ts + tests/api-resources/radar/email/routing/routing.test.ts + tests/api-resources/radar/email/routing/summary.test.ts + tests/api-resources/radar/email/routing/timeseries-groups.test.ts + tests/api-resources/radar/email/security/security.test.ts + tests/api-resources/radar/email/security/top/top.test.ts + tests/api-resources/radar/email/security/top/tlds/tlds.test.ts + tests/api-resources/radar/email/security/top/tlds/malicious.test.ts + tests/api-resources/radar/email/security/top/tlds/spam.test.ts + tests/api-resources/radar/email/security/top/tlds/spoof.test.ts + tests/api-resources/radar/email/security/summary.test.ts + tests/api-resources/radar/email/security/timeseries-groups.test.ts + tests/api-resources/radar/attacks/attacks.test.ts + tests/api-resources/radar/attacks/layer3/layer3.test.ts + tests/api-resources/radar/attacks/layer3/summary.test.ts + tests/api-resources/radar/attacks/layer3/timeseries-groups.test.ts + tests/api-resources/radar/attacks/layer3/top/top.test.ts + tests/api-resources/radar/attacks/layer3/top/locations.test.ts + tests/api-resources/radar/attacks/layer7/layer7.test.ts + tests/api-resources/radar/attacks/layer7/summary.test.ts + tests/api-resources/radar/attacks/layer7/timeseries-groups.test.ts + tests/api-resources/radar/attacks/layer7/top/top.test.ts + tests/api-resources/radar/attacks/layer7/top/locations.test.ts + tests/api-resources/radar/attacks/layer7/top/ases.test.ts + tests/api-resources/radar/entities/entities.test.ts + tests/api-resources/radar/entities/asns.test.ts + tests/api-resources/radar/entities/locations.test.ts + tests/api-resources/radar/geolocations.test.ts + tests/api-resources/radar/http/http.test.ts + tests/api-resources/radar/http/locations/locations.test.ts + tests/api-resources/radar/http/locations/bot-class.test.ts + tests/api-resources/radar/http/locations/device-type.test.ts + tests/api-resources/radar/http/locations/http-protocol.test.ts + tests/api-resources/radar/http/locations/http-method.test.ts + tests/api-resources/radar/http/locations/ip-version.test.ts + tests/api-resources/radar/http/locations/os.test.ts + tests/api-resources/radar/http/locations/tls-version.test.ts + tests/api-resources/radar/http/locations/browser-family.test.ts + tests/api-resources/radar/http/ases/ases.test.ts + tests/api-resources/radar/http/ases/bot-class.test.ts + tests/api-resources/radar/http/ases/device-type.test.ts + tests/api-resources/radar/http/ases/http-protocol.test.ts + tests/api-resources/radar/http/ases/http-method.test.ts + tests/api-resources/radar/http/ases/ip-version.test.ts + tests/api-resources/radar/http/ases/os.test.ts + tests/api-resources/radar/http/ases/tls-version.test.ts + tests/api-resources/radar/http/ases/browser-family.test.ts + tests/api-resources/radar/http/summary.test.ts + tests/api-resources/radar/http/timeseries-groups.test.ts + tests/api-resources/radar/http/top.test.ts + tests/api-resources/radar/quality/quality.test.ts + tests/api-resources/radar/quality/iqi.test.ts + tests/api-resources/radar/quality/speed/speed.test.ts + tests/api-resources/radar/quality/speed/top.test.ts + tests/api-resources/radar/ranking/ranking.test.ts + tests/api-resources/radar/ranking/domain.test.ts + tests/api-resources/radar/ranking/internet-services.test.ts + tests/api-resources/radar/traffic-anomalies/traffic-anomalies.test.ts + tests/api-resources/radar/traffic-anomalies/locations.test.ts + tests/api-resources/radar/tcp-resets-timeouts.test.ts + tests/api-resources/radar/robots-txt/robots-txt.test.ts + tests/api-resources/radar/robots-txt/top/top.test.ts + tests/api-resources/radar/robots-txt/top/user-agents.test.ts + tests/api-resources/radar/leaked-credentials/leaked-credentials.test.ts + tests/api-resources/radar/leaked-credentials/summary.test.ts + tests/api-resources/radar/leaked-credentials/timeseries-groups.test.ts + tests/api-resources/bot-management.test.ts + tests/api-resources/fraud.test.ts + tests/api-resources/origin-post-quantum-encryption.test.ts + tests/api-resources/zaraz/zaraz.test.ts + tests/api-resources/zaraz/config.test.ts + tests/api-resources/zaraz/default.test.ts + tests/api-resources/zaraz/export.test.ts + tests/api-resources/zaraz/history/history.test.ts + tests/api-resources/zaraz/history/configs.test.ts + tests/api-resources/zaraz/publish.test.ts + tests/api-resources/zaraz/workflow.test.ts + tests/api-resources/speed/speed.test.ts + tests/api-resources/speed/schedule.test.ts + tests/api-resources/speed/availabilities.test.ts + tests/api-resources/speed/pages/pages.test.ts + tests/api-resources/speed/pages/tests.test.ts + tests/api-resources/dcv-delegation.test.ts + tests/api-resources/hostnames/hostnames.test.ts + tests/api-resources/hostnames/settings/settings.test.ts + tests/api-resources/hostnames/settings/tls.test.ts + tests/api-resources/snippets/snippets.test.ts + tests/api-resources/snippets/content.test.ts + tests/api-resources/snippets/rules.test.ts + tests/api-resources/realtime-kit/realtime-kit.test.ts + tests/api-resources/realtime-kit/apps.test.ts + tests/api-resources/realtime-kit/meetings.test.ts + tests/api-resources/realtime-kit/presets.test.ts + tests/api-resources/realtime-kit/sessions.test.ts + tests/api-resources/realtime-kit/recordings.test.ts + tests/api-resources/realtime-kit/webhooks.test.ts + tests/api-resources/realtime-kit/active-session.test.ts + tests/api-resources/realtime-kit/livestreams.test.ts + tests/api-resources/realtime-kit/analytics.test.ts + tests/api-resources/calls/calls.test.ts + tests/api-resources/calls/sfu.test.ts + tests/api-resources/calls/turn.test.ts + tests/api-resources/cloudforce-one/cloudforce-one.test.ts + tests/api-resources/cloudforce-one/scans/scans.test.ts + tests/api-resources/cloudforce-one/scans/results.test.ts + tests/api-resources/cloudforce-one/scans/config.test.ts + tests/api-resources/cloudforce-one/binary-storage.test.ts + tests/api-resources/cloudforce-one/requests/requests.test.ts + tests/api-resources/cloudforce-one/requests/message.test.ts + tests/api-resources/cloudforce-one/requests/priority.test.ts + tests/api-resources/cloudforce-one/requests/assets.test.ts + tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts + tests/api-resources/cloudforce-one/threat-events/attackers.test.ts + tests/api-resources/cloudforce-one/threat-events/categories.test.ts + tests/api-resources/cloudforce-one/threat-events/countries.test.ts + tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/indicator-types.test.ts + tests/api-resources/cloudforce-one/threat-events/raw.test.ts + tests/api-resources/cloudforce-one/threat-events/relate.test.ts + tests/api-resources/cloudforce-one/threat-events/tags.test.ts + tests/api-resources/cloudforce-one/threat-events/event-tags.test.ts + tests/api-resources/cloudforce-one/threat-events/target-industries.test.ts + tests/api-resources/ai-gateway/ai-gateway.test.ts + tests/api-resources/ai-gateway/evaluation-types.test.ts + tests/api-resources/ai-gateway/logs.test.ts + tests/api-resources/ai-gateway/datasets.test.ts + tests/api-resources/ai-gateway/evaluations.test.ts + tests/api-resources/ai-gateway/dynamic-routing.test.ts + tests/api-resources/ai-gateway/provider-configs.test.ts + tests/api-resources/ai-gateway/urls.test.ts + tests/api-resources/iam/iam.test.ts + tests/api-resources/iam/permission-groups.test.ts + tests/api-resources/iam/resource-groups.test.ts + tests/api-resources/iam/user-groups/user-groups.test.ts + tests/api-resources/iam/user-groups/members.test.ts + tests/api-resources/iam/sso.test.ts + tests/api-resources/cloud-connector/cloud-connector.test.ts + tests/api-resources/cloud-connector/rules.test.ts + tests/api-resources/botnet-feed/botnet-feed.test.ts + tests/api-resources/botnet-feed/asn.test.ts + tests/api-resources/botnet-feed/configs/configs.test.ts + tests/api-resources/botnet-feed/configs/asn.test.ts + tests/api-resources/security-txt.test.ts + tests/api-resources/workflows/workflows.test.ts + tests/api-resources/workflows/instances/instances.test.ts + tests/api-resources/workflows/instances/status.test.ts + tests/api-resources/workflows/instances/events.test.ts + tests/api-resources/workflows/versions.test.ts + tests/api-resources/resource-sharing/resource-sharing.test.ts + tests/api-resources/resource-sharing/recipients.test.ts + tests/api-resources/resource-sharing/resources.test.ts + tests/api-resources/leaked-credential-checks/leaked-credential-checks.test.ts + tests/api-resources/leaked-credential-checks/detections.test.ts + tests/api-resources/content-scanning/content-scanning.test.ts + tests/api-resources/content-scanning/payloads.test.ts + tests/api-resources/content-scanning/settings.test.ts + tests/api-resources/abuse-reports/abuse-reports.test.ts + tests/api-resources/abuse-reports/mitigations.test.ts + tests/api-resources/ai/ai.test.ts + tests/api-resources/ai/finetunes/finetunes.test.ts + tests/api-resources/ai/finetunes/assets.test.ts + tests/api-resources/ai/finetunes/public.test.ts + tests/api-resources/ai/authors.test.ts + tests/api-resources/ai/tasks.test.ts + tests/api-resources/ai/models/models.test.ts + tests/api-resources/ai/models/schema.test.ts + tests/api-resources/ai/to-markdown.test.ts + tests/api-resources/aisearch/aisearch.test.ts + tests/api-resources/aisearch/instances/instances.test.ts + tests/api-resources/aisearch/instances/items.test.ts + tests/api-resources/aisearch/instances/jobs.test.ts + tests/api-resources/aisearch/tokens.test.ts + tests/api-resources/security-center/security-center.test.ts + tests/api-resources/security-center/insights/insights.test.ts + tests/api-resources/security-center/insights/class.test.ts + tests/api-resources/security-center/insights/severity.test.ts + tests/api-resources/security-center/insights/type.test.ts + tests/api-resources/browser-rendering/browser-rendering.test.ts + tests/api-resources/browser-rendering/content.test.ts + tests/api-resources/browser-rendering/pdf.test.ts + tests/api-resources/browser-rendering/scrape.test.ts + tests/api-resources/browser-rendering/screenshot.test.ts + tests/api-resources/browser-rendering/snapshot.test.ts + tests/api-resources/browser-rendering/json.test.ts + tests/api-resources/browser-rendering/links.test.ts + tests/api-resources/browser-rendering/markdown.test.ts + tests/api-resources/custom-pages.test.ts + tests/api-resources/secrets-store/secrets-store.test.ts + tests/api-resources/secrets-store/stores/stores.test.ts + tests/api-resources/secrets-store/stores/secrets.test.ts + tests/api-resources/secrets-store/quota.test.ts + tests/api-resources/pipelines/pipelines.test.ts + tests/api-resources/pipelines/sinks.test.ts + tests/api-resources/pipelines/streams.test.ts + tests/api-resources/schema-validation/schema-validation.test.ts + tests/api-resources/schema-validation/schemas.test.ts + tests/api-resources/schema-validation/settings/settings.test.ts + tests/api-resources/schema-validation/settings/operations.test.ts + tests/api-resources/token-validation/token-validation.test.ts + tests/api-resources/token-validation/configuration/configuration.test.ts + tests/api-resources/token-validation/configuration/credentials.test.ts + tests/api-resources/token-validation/rules.test.ts + tests/index.test.ts +) + +for PATHSPEC in "${TEST_PATHS[@]}"; do + # Try to check out previous versions of the test files + # with the current SDK. + git checkout "$1" -- "${PATHSPEC}" 2>/dev/null || true +done + +# Instead of running the tests, use the linter to check if an +# older test is no longer compatible with the latest SDK. +./scripts/lint diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000000..8a8e9d5906 --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | ESLINT_USE_FLAT_CONFIG="false" xargs ./node_modules/.bin/eslint --cache --fix +fi + +echo "==> Running prettier --write" +# format things eslint didn't +PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" +if ! [ -z "$PRETTIER_FILES" ]; then + echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ + '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +fi diff --git a/scripts/format b/scripts/format new file mode 100755 index 0000000000..a6bb9d03ae --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint --fix" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --fix --ext ts,js . diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 0000000000..6ba75dfb55 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Running eslint" +ESLINT_USE_FLAT_CONFIG="false" ./node_modules/.bin/eslint --ext ts,js . + +echo "==> Running tsc" +./node_modules/.bin/tsc --noEmit diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 0000000000..0b28f6ea23 --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 0000000000..7bce0516b5 --- /dev/null +++ b/scripts/test @@ -0,0 +1,56 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" >/dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running ; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url ; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running ; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +echo "==> Running tests" +./node_modules/.bin/jest "$@" diff --git a/scripts/check-is-in-git-install.sh b/scripts/utils/check-is-in-git-install.sh similarity index 95% rename from scripts/check-is-in-git-install.sh rename to scripts/utils/check-is-in-git-install.sh index 36bcedc206..1354eb4329 100755 --- a/scripts/check-is-in-git-install.sh +++ b/scripts/utils/check-is-in-git-install.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Check if you happen to call prepare for a repository that's already in node_modules. [ "$(basename "$(dirname "$PWD")")" = 'node_modules' ] || # The name of the containing directory that 'npm` uses, which looks like diff --git a/scripts/check-version.cjs b/scripts/utils/check-version.cjs similarity index 82% rename from scripts/check-version.cjs rename to scripts/utils/check-version.cjs index 50a85669e0..86c56dfd36 100644 --- a/scripts/check-version.cjs +++ b/scripts/utils/check-version.cjs @@ -2,14 +2,14 @@ const fs = require('fs'); const path = require('path'); const main = () => { - const pkg = require('../package.json'); + const pkg = require('../../package.json'); const version = pkg['version']; if (!version) throw 'The version property is not set in the package.json file'; if (typeof version !== 'string') { throw `Unexpected type for the package.json version field; got ${typeof version}, expected string`; } - const versionFile = path.resolve(__dirname, '..', 'src', 'version.ts'); + const versionFile = path.resolve(__dirname, '..', '..', 'src', 'version.ts'); const contents = fs.readFileSync(versionFile, 'utf8'); const output = contents.replace(/(export const VERSION = ')(.*)(')/g, `$1${version}$3`); fs.writeFileSync(versionFile, output); diff --git a/scripts/fix-index-exports.cjs b/scripts/utils/fix-index-exports.cjs similarity index 86% rename from scripts/fix-index-exports.cjs rename to scripts/utils/fix-index-exports.cjs index b61b2ea332..72b0b8fd04 100644 --- a/scripts/fix-index-exports.cjs +++ b/scripts/utils/fix-index-exports.cjs @@ -4,7 +4,7 @@ const path = require('path'); const indexJs = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH'], 'index.js') - : path.resolve(__dirname, '..', 'dist', 'index.js'); + : path.resolve(__dirname, '..', '..', 'dist', 'index.js'); let before = fs.readFileSync(indexJs, 'utf8'); let after = before.replace( diff --git a/scripts/utils/git-swap.sh b/scripts/utils/git-swap.sh new file mode 100755 index 0000000000..79d1888eb2 --- /dev/null +++ b/scripts/utils/git-swap.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -exuo pipefail +# the package is published to NPM from ./dist +# we want the final file structure for git installs to match the npm installs, so we + +# delete everything except ./dist and ./node_modules +find . -maxdepth 1 -mindepth 1 ! -name 'dist' ! -name 'node_modules' -exec rm -rf '{}' + + +# move everything from ./dist to . +mv dist/* . + +# delete the now-empty ./dist +rmdir dist diff --git a/scripts/make-dist-package-json.cjs b/scripts/utils/make-dist-package-json.cjs similarity index 87% rename from scripts/make-dist-package-json.cjs rename to scripts/utils/make-dist-package-json.cjs index d4a0a69b35..7c24f56e28 100644 --- a/scripts/make-dist-package-json.cjs +++ b/scripts/utils/make-dist-package-json.cjs @@ -1,4 +1,4 @@ -const pkgJson = require(process.env['PKG_JSON_PATH'] || '../package.json'); +const pkgJson = require(process.env['PKG_JSON_PATH'] || '../../package.json'); function processExportMap(m) { for (const key in m) { diff --git a/scripts/postprocess-files.cjs b/scripts/utils/postprocess-files.cjs similarity index 97% rename from scripts/postprocess-files.cjs rename to scripts/utils/postprocess-files.cjs index dd48ea5988..1786ac2199 100644 --- a/scripts/postprocess-files.cjs +++ b/scripts/utils/postprocess-files.cjs @@ -2,12 +2,12 @@ const fs = require('fs'); const path = require('path'); const { parse } = require('@typescript-eslint/parser'); -const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'cloudflare/' +const pkgImportPath = process.env['PKG_IMPORT_PATH'] ?? 'cloudflare/'; const distDir = process.env['DIST_PATH'] ? path.resolve(process.env['DIST_PATH']) - : path.resolve(__dirname, '..', 'dist'); + : path.resolve(__dirname, '..', '..', 'dist'); const distSrcDir = path.join(distDir, 'src'); /** @@ -103,7 +103,7 @@ async function* walk(dir) { } async function postprocess() { - for await (const file of walk(path.resolve(__dirname, '..', 'dist'))) { + for await (const file of walk(path.resolve(__dirname, '..', '..', 'dist'))) { if (!/\.([cm]?js|(\.d)?[cm]?ts)$/.test(file)) continue; const code = await fs.promises.readFile(file, 'utf8'); diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000000..b228a8dec5 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +TARBALL=$(cd dist && npm pack --silent) + +UPLOAD_RESPONSE=$(curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary "@dist/$TARBALL" "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/cloudflare-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index bb3c002433..30d6bd1631 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index a2107f4120..86f9ce6687 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index 1704568bcd..aa84d90a98 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('cloudflare/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 1fdfc626bf..792ace2a55 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from 'cloudflare/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/_shims/node-runtime.ts b/src/_shims/node-runtime.ts index a9c42ebeb6..ab9f2ab5c4 100644 --- a/src/_shims/node-runtime.ts +++ b/src/_shims/node-runtime.ts @@ -13,9 +13,7 @@ import { Readable } from 'node:stream'; import { type RequestOptions } from '../core'; import { MultipartBody } from './MultipartBody'; import { type Shims } from './registry'; - -// @ts-ignore (this package does not have proper export maps for this export) -import { ReadableStream } from 'web-streams-polyfill/dist/ponyfill.es2018.js'; +import { ReadableStream } from 'node:stream/web'; type FileFromPathOptions = Omit; diff --git a/src/_shims/node-types.d.ts b/src/_shims/node-types.d.ts index b31698f780..c159e5fa74 100644 --- a/src/_shims/node-types.d.ts +++ b/src/_shims/node-types.d.ts @@ -7,7 +7,7 @@ import * as fd from 'formdata-node'; export { type Agent } from 'node:http'; export { type Readable } from 'node:stream'; export { type ReadStream as FsReadStream } from 'node:fs'; -export { ReadableStream } from 'web-streams-polyfill'; +export { ReadableStream } from 'node:stream/web'; export const fetch: typeof nf.default; diff --git a/src/core.ts b/src/core.ts index 60e8093a41..30bdc0011d 100644 --- a/src/core.ts +++ b/src/core.ts @@ -16,9 +16,14 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; -import { isMultipartBody } from './uploads'; +import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { maybeMultipartFormRequestOptions, multipartFormRequestOptions, @@ -28,6 +33,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { @@ -48,8 +67,8 @@ async function defaultParseResponse(props: APIResponseProps): Promise { } const contentType = response.headers.get('content-type'); - const isJSON = - contentType?.includes('application/json') || contentType?.includes('application/vnd.api+json'); + const mediaType = contentType?.split(';')[0]?.trim(); + const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json'); if (isJSON) { const json = await response.json(); @@ -84,8 +103,10 @@ export class APIPromise extends Promise { }); } - _thenUnwrap(transform: (data: T) => U): APIPromise { - return new APIPromise(this.responsePromise, async (props) => transform(await this.parseResponse(props))); + _thenUnwrap(transform: (data: T, props: APIResponseProps) => U): APIPromise { + return new APIPromise(this.responsePromise, async (props) => + transform(await this.parseResponse(props), props), + ); } /** @@ -149,6 +170,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + #baseURLOverridden: boolean; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -158,23 +180,26 @@ export abstract class APIClient { constructor({ baseURL, + baseURLOverridden, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, - fetch: overridenFetch, + fetch: overriddenFetch, }: { baseURL: string; + baseURLOverridden: boolean; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.#baseURLOverridden = baseURLOverridden; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; - this.fetch = overridenFetch ?? fetch; + this.fetch = overriddenFetch ?? fetch; } protected authHeaders(opts: FinalRequestOptions): Headers { @@ -192,7 +217,7 @@ export abstract class APIClient { protected defaultHeaders(opts: FinalRequestOptions): Headers { return { Accept: 'application/json', - 'Content-Type': 'application/json', + ...(['head', 'get'].includes(opts.method) ? {} : { 'Content-Type': 'application/json' }), 'User-Agent': this.getUserAgent(), ...getPlatformHeaders(), ...this.authHeaders(opts), @@ -235,7 +260,17 @@ export abstract class APIClient { path: string, opts?: PromiseOrValue>, ): APIPromise { - return this.request(Promise.resolve(opts).then((opts) => ({ method, path, ...opts }))); + return this.request( + Promise.resolve(opts).then(async (opts) => { + const body = + opts && isBlobLike(opts?.body) ? new DataView(await opts.body.arrayBuffer()) + : opts?.body instanceof DataView ? opts.body + : opts?.body instanceof ArrayBuffer ? new DataView(opts.body) + : opts && ArrayBuffer.isView(opts?.body) ? new DataView(opts.body.buffer) + : opts?.body; + return { method, path, ...opts, body }; + }), + ); } getAPIList = AbstractPage>( @@ -257,25 +292,33 @@ export abstract class APIClient { const encoded = encoder.encode(body); return encoded.length.toString(); } + } else if (ArrayBuffer.isView(body)) { + return body.byteLength.toString(); } return null; } - buildRequest(options: FinalRequestOptions): { req: RequestInit; url: string; timeout: number } { - const { method, path, query, headers: headers = {} } = options; + async buildRequest( + inputOptions: FinalRequestOptions, + { retryCount = 0 }: { retryCount?: number } = {}, + ): Promise<{ req: RequestInit; url: string; timeout: number }> { + const options = { ...inputOptions }; + const { method, path, query, defaultBaseURL, headers: headers = {} } = options; const body = - isMultipartBody(options.body) ? options.body.body + ArrayBuffer.isView(options.body) || (options.__binaryRequest && typeof options.body === 'string') ? + options.body + : isMultipartBody(options.body) ? options.body.body : options.body ? JSON.stringify(options.body, null, 2) : null; const contentLength = this.calculateContentLength(body); - const url = this.buildURL(path!, query); + const url = this.buildURL(path!, query, defaultBaseURL); if ('timeout' in options) validatePositiveInteger('timeout', options.timeout); - const timeout = options.timeout ?? this.timeout; + options.timeout = options.timeout ?? this.timeout; const httpAgent = options.httpAgent ?? this.httpAgent ?? getDefaultAgent(url); - const minAgentTimeout = timeout + 1000; + const minAgentTimeout = options.timeout + 1000; if ( typeof (httpAgent as any)?.options?.timeout === 'number' && minAgentTimeout > ((httpAgent as any).options.timeout ?? 0) @@ -288,11 +331,11 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } - const reqHeaders = this.buildHeaders({ options, headers, contentLength }); + const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); const req: RequestInit = { method, @@ -304,17 +347,19 @@ export abstract class APIClient { signal: options.signal ?? null, }; - return { req, url, timeout }; + return { req, url, timeout: options.timeout }; } private buildHeaders({ options, headers, contentLength, + retryCount, }: { options: FinalRequestOptions; headers: Record; contentLength: string | null | undefined; + retryCount: number; }): Record { const reqHeaders: Record = {}; if (contentLength) { @@ -330,6 +375,23 @@ export abstract class APIClient { delete reqHeaders['content-type']; } + // Don't set theses headers if they were already set or removed through default headers or by the caller. + // We check `defaultHeaders` and `headers`, which can contain nulls, instead of `reqHeaders` to account + // for the removal case. + if ( + getHeader(defaultHeaders, 'x-stainless-retry-count') === undefined && + getHeader(headers, 'x-stainless-retry-count') === undefined + ) { + reqHeaders['x-stainless-retry-count'] = String(retryCount); + } + if ( + getHeader(defaultHeaders, 'x-stainless-timeout') === undefined && + getHeader(headers, 'x-stainless-timeout') === undefined && + options.timeout + ) { + reqHeaders['x-stainless-timeout'] = String(Math.trunc(options.timeout / 1000)); + } + this.validateHeaders(reqHeaders, headers); return reqHeaders; @@ -356,7 +418,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } @@ -365,7 +427,7 @@ export abstract class APIClient { error: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { + ): APIError { return APIError.generate(status, error, message, headers); } @@ -381,13 +443,16 @@ export abstract class APIClient { retriesRemaining: number | null, ): Promise { const options = await optionsInput; + const maxRetries = options.maxRetries ?? this.maxRetries; if (retriesRemaining == null) { - retriesRemaining = options.maxRetries ?? this.maxRetries; + retriesRemaining = maxRetries; } await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); @@ -444,11 +509,12 @@ export abstract class APIClient { return new PagePromise(this, request, Page); } - buildURL(path: string, query: Req | null | undefined): string { + buildURL(path: string, query: Req | null | undefined, defaultBaseURL?: string | undefined): string { + const baseURL = (!this.#baseURLOverridden && defaultBaseURL) || this.baseURL; const url = isAbsoluteURL(path) ? new URL(path) - : new URL(this.baseURL + (this.baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); + : new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path)); const defaultQuery = this.defaultQuery(); if (!isEmptyObj(defaultQuery)) { @@ -490,20 +556,24 @@ export abstract class APIClient { const timeout = setTimeout(() => controller.abort(), ms); + const fetchOptions = { + signal: controller.signal as any, + ...options, + }; + if (fetchOptions.method) { + // Custom methods like 'patch' need to be uppercased + // See https://github.com/nodejs/undici/issues/2294 + fetchOptions.method = fetchOptions.method.toUpperCase(); + } + return ( - this.getRequestClient() - // use undefined this binding; fetch errors if bound to something else in browser/cloudflare - .fetch.call(undefined, url, { signal: controller.signal as any, ...options }) - .finally(() => { - clearTimeout(timeout); - }) + // use undefined this binding; fetch errors if bound to something else in browser/cloudflare + this.fetch.call(undefined, url, fetchOptions).finally(() => { + clearTimeout(timeout); + }) ); } - protected getRequestClient(): RequestClient { - return { fetch: this.fetch }; - } - private shouldRetry(response: Response): boolean { // Note this is not a standard header. const shouldRetryHeader = response.headers.get('x-should-retry'); @@ -636,9 +706,9 @@ export abstract class AbstractPage implements AsyncIterable { return await this.#client.requestAPIList(this.constructor as any, nextOptions); } - async *iterPages() { + async *iterPages(): AsyncGenerator { // eslint-disable-next-line @typescript-eslint/no-this-alias - let page: AbstractPage = this; + let page: this = this; yield page; while (page.hasNextPage()) { page = await page.getNextPage(); @@ -646,7 +716,7 @@ export abstract class AbstractPage implements AsyncIterable { } } - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { for await (const page of this.iterPages()) { for (const item of page.getPaginatedItems()) { yield item; @@ -689,7 +759,7 @@ export class PagePromise< * console.log(item) * } */ - async *[Symbol.asyncIterator]() { + async *[Symbol.asyncIterator](): AsyncGenerator { const page = await this; for await (const item of page) { yield item; @@ -721,12 +791,15 @@ export type Headers = Record; export type DefaultQuery = Record; export type KeysEnum = { [P in keyof Required]: true }; -export type RequestOptions | Readable> = { +export type RequestOptions< + Req = unknown | Record | Readable | BlobLike | ArrayBufferView | ArrayBuffer, +> = { method?: HTTPMethod; path?: string; query?: Req | undefined; body?: Req | null | undefined; headers?: Headers | undefined; + defaultBaseURL?: string | undefined; maxRetries?: number; stream?: boolean | undefined; @@ -735,6 +808,7 @@ export type RequestOptions | Readable> = signal?: AbortSignal | undefined | null; idempotencyKey?: string; + __binaryRequest?: boolean | undefined; __binaryResponse?: boolean | undefined; }; @@ -747,6 +821,7 @@ const requestOptionsKeys: KeysEnum = { query: true, body: true, headers: true, + defaultBaseURL: true, maxRetries: true, stream: true, @@ -755,6 +830,7 @@ const requestOptionsKeys: KeysEnum = { signal: true, idempotencyKey: true, + __binaryRequest: true, __binaryResponse: true, }; @@ -767,10 +843,11 @@ export const isRequestOptions = (obj: unknown): obj is RequestOptions => { ); }; -export type FinalRequestOptions | Readable> = RequestOptions & { - method: HTTPMethod; - path: string; -}; +export type FinalRequestOptions | Readable | DataView> = + RequestOptions & { + method: HTTPMethod; + path: string; + }; declare const Deno: any; declare const EdgeRuntime: any; @@ -802,7 +879,8 @@ const getPlatformProperties = (): PlatformProperties => { 'X-Stainless-OS': normalizePlatform(Deno.build.os), 'X-Stainless-Arch': normalizeArch(Deno.build.arch), 'X-Stainless-Runtime': 'deno', - 'X-Stainless-Runtime-Version': Deno.version, + 'X-Stainless-Runtime-Version': + typeof Deno.version === 'string' ? Deno.version : Deno.version?.deno ?? 'unknown', }; } if (typeof EdgeRuntime !== 'undefined') { @@ -938,8 +1016,8 @@ export const safeJSON = (text: string) => { } }; -// https://stackoverflow.com/a/19709846 -const startsWithSchemeRegexp = new RegExp('^(?:[a-z]+:)?//', 'i'); +// https://url.spec.whatwg.org/#url-scheme-string +const startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i; const isAbsoluteURL = (url: string): boolean => { return startsWithSchemeRegexp.test(url); }; @@ -958,6 +1036,11 @@ const validatePositiveInteger = (name: string, n: unknown): number => { export const castToError = (err: any): Error => { if (err instanceof Error) return err; + if (typeof err === 'object' && err !== null) { + try { + return new Error(JSON.stringify(err)); + } catch {} + } return new Error(err); }; @@ -1004,21 +1087,21 @@ export const coerceBoolean = (value: unknown): boolean => { }; export const maybeCoerceInteger = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceInteger(value); }; export const maybeCoerceFloat = (value: unknown): number | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceFloat(value); }; export const maybeCoerceBoolean = (value: unknown): boolean | undefined => { - if (value === undefined) { + if (value == null) { return undefined; } return coerceBoolean(value); @@ -1059,7 +1142,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void { } export function debug(action: string, ...args: any[]) { - if (typeof process !== 'undefined' && process.env['DEBUG'] === 'true') { + if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') { console.log(`Cloudflare:DEBUG:${action}`, ...args); } } @@ -1095,7 +1178,15 @@ export const isHeadersProtocol = (headers: any): headers is HeadersProtocol => { return typeof headers?.get === 'function'; }; -export const getRequiredHeader = (headers: HeadersLike, header: string): string => { +export const getRequiredHeader = (headers: HeadersLike | Headers, header: string): string => { + const foundHeader = getHeader(headers, header); + if (foundHeader === undefined) { + throw new Error(`Could not find ${header} header`); + } + return foundHeader; +}; + +export const getHeader = (headers: HeadersLike | Headers, header: string): string | undefined => { const lowerCasedHeader = header.toLowerCase(); if (isHeadersProtocol(headers)) { // to deal with the case where the header looks like Stainless-Event-Id @@ -1121,7 +1212,7 @@ export const getRequiredHeader = (headers: HeadersLike, header: string): string } } - throw new Error(`Could not find ${header} header`); + return undefined; }; /** diff --git a/src/error.ts b/src/error.ts index 2d9cc31d29..2c74bf0342 100644 --- a/src/error.ts +++ b/src/error.ts @@ -1,24 +1,32 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { castToError, Headers } from './core'; +import * as Shared from './resources/shared'; export class CloudflareError extends Error {} -export class APIError extends CloudflareError { - readonly status: number | undefined; - readonly headers: Headers | undefined; - readonly error: Object | undefined; - - constructor( - status: number | undefined, - error: Object | undefined, - message: string | undefined, - headers: Headers | undefined, - ) { +export class APIError< + TStatus extends number | undefined = number | undefined, + THeaders extends Headers | undefined = Headers | undefined, + TError extends Object | undefined = Object | undefined, +> extends CloudflareError { + /** HTTP status for the response that caused the error */ + readonly status: TStatus; + /** HTTP headers for the response that caused the error */ + readonly headers: THeaders; + /** JSON body of the response that caused the error */ + readonly error: TError; + + readonly errors: Array; + + constructor(status: TStatus, error: TError, message: string | undefined, headers: THeaders) { super(`${APIError.makeMessage(status, error, message)}`); this.status = status; this.headers = headers; this.error = error; + + const data = error as Record; + this.errors = data?.['errors'] ?? []; } private static makeMessage(status: number | undefined, error: any, message: string | undefined) { @@ -47,9 +55,9 @@ export class APIError extends CloudflareError { errorResponse: Object | undefined, message: string | undefined, headers: Headers | undefined, - ) { - if (!status) { - return new APIConnectionError({ cause: castToError(errorResponse) }); + ): APIError { + if (!status || !headers) { + return new APIConnectionError({ message, cause: castToError(errorResponse) }); } const error = errorResponse as Record; @@ -90,18 +98,14 @@ export class APIError extends CloudflareError { } } -export class APIUserAbortError extends APIError { - override readonly status: undefined = undefined; - +export class APIUserAbortError extends APIError { constructor({ message }: { message?: string } = {}) { super(undefined, undefined, message || 'Request was aborted.', undefined); } } -export class APIConnectionError extends APIError { - override readonly status: undefined = undefined; - - constructor({ message, cause }: { message?: string; cause?: Error | undefined }) { +export class APIConnectionError extends APIError { + constructor({ message, cause }: { message?: string | undefined; cause?: Error | undefined }) { super(undefined, undefined, message || 'Connection error.', undefined); // in some environments the 'cause' property is already declared // @ts-ignore @@ -115,32 +119,18 @@ export class APIConnectionTimeoutError extends APIConnectionError { } } -export class BadRequestError extends APIError { - override readonly status: 400 = 400; -} +export class BadRequestError extends APIError<400, Headers> {} -export class AuthenticationError extends APIError { - override readonly status: 401 = 401; -} +export class AuthenticationError extends APIError<401, Headers> {} -export class PermissionDeniedError extends APIError { - override readonly status: 403 = 403; -} +export class PermissionDeniedError extends APIError<403, Headers> {} -export class NotFoundError extends APIError { - override readonly status: 404 = 404; -} +export class NotFoundError extends APIError<404, Headers> {} -export class ConflictError extends APIError { - override readonly status: 409 = 409; -} +export class ConflictError extends APIError<409, Headers> {} -export class UnprocessableEntityError extends APIError { - override readonly status: 422 = 422; -} +export class UnprocessableEntityError extends APIError<422, Headers> {} -export class RateLimitError extends APIError { - override readonly status: 429 = 429; -} +export class RateLimitError extends APIError<429, Headers> {} -export class InternalServerError extends APIError {} +export class InternalServerError extends APIError {} diff --git a/src/index.ts b/src/index.ts index 5fccc6c686..ceb9d223a4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,31 +1,146 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +import { type Agent } from './_shims/index'; +import * as qs from './internal/qs'; import * as Core from './core'; import * as Errors from './error'; -import { type Agent } from './_shims/index'; +import * as Pagination from './pagination'; +import { + type CursorLimitPaginationParams, + CursorLimitPaginationResponse, + type CursorPaginationAfterParams, + CursorPaginationAfterResponse, + type CursorPaginationParams, + CursorPaginationResponse, + SinglePageResponse, + type V4PagePaginationArrayParams, + V4PagePaginationArrayResponse, + type V4PagePaginationParams, + V4PagePaginationResponse, +} from './pagination'; import * as Uploads from './uploads'; -import * as qs from 'qs'; -import * as Pagination from 'cloudflare/pagination'; -import * as API from 'cloudflare/resources/index'; +import * as API from './resources/index'; +import { AuditLogs } from './resources/audit-logs'; +import { BotManagement } from './resources/bot-management'; +import { ClientCertificates } from './resources/client-certificates'; +import { CustomNameservers } from './resources/custom-nameservers'; +import { CustomPages } from './resources/custom-pages'; +import { DCVDelegation } from './resources/dcv-delegation'; +import { Filters } from './resources/filters'; +import { Fraud } from './resources/fraud'; +import { IPs } from './resources/ips'; +import { KeylessCertificates } from './resources/keyless-certificates'; +import { ManagedTransforms } from './resources/managed-transforms'; +import { Memberships } from './resources/memberships'; +import { OriginCACertificates } from './resources/origin-ca-certificates'; +import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-encryption'; +import { PageRules } from './resources/page-rules'; +import { RateLimits } from './resources/rate-limits'; +import { SecurityTXT } from './resources/security-txt'; +import { URLNormalization } from './resources/url-normalization'; +import { AbuseReports } from './resources/abuse-reports/abuse-reports'; +import { Accounts } from './resources/accounts/accounts'; +import { ACM } from './resources/acm/acm'; +import { Addressing } from './resources/addressing/addressing'; +import { AIGateway } from './resources/ai-gateway/ai-gateway'; +import { AI } from './resources/ai/ai'; +import { AISearch } from './resources/aisearch/aisearch'; +import { Alerting } from './resources/alerting/alerting'; +import { APIGateway } from './resources/api-gateway/api-gateway'; +import { Argo } from './resources/argo/argo'; +import { Billing } from './resources/billing/billing'; +import { BotnetFeed } from './resources/botnet-feed/botnet-feed'; +import { BrandProtection } from './resources/brand-protection/brand-protection'; +import { BrowserRendering } from './resources/browser-rendering/browser-rendering'; +import { Cache } from './resources/cache/cache'; +import { Calls } from './resources/calls/calls'; +import { CertificateAuthorities } from './resources/certificate-authorities/certificate-authorities'; +import { CloudConnector } from './resources/cloud-connector/cloud-connector'; +import { CloudforceOne } from './resources/cloudforce-one/cloudforce-one'; +import { Connectivity } from './resources/connectivity/connectivity'; +import { ContentScanning } from './resources/content-scanning/content-scanning'; +import { CustomCertificates } from './resources/custom-certificates/custom-certificates'; +import { CustomHostnames } from './resources/custom-hostnames/custom-hostnames'; +import { D1Resource } from './resources/d1/d1'; +import { Diagnostics } from './resources/diagnostics/diagnostics'; +import { DNSFirewall } from './resources/dns-firewall/dns-firewall'; +import { DNS } from './resources/dns/dns'; +import { DurableObjects } from './resources/durable-objects/durable-objects'; +import { EmailRouting } from './resources/email-routing/email-routing'; +import { EmailSecurity } from './resources/email-security/email-security'; +import { Firewall } from './resources/firewall/firewall'; +import { Healthchecks } from './resources/healthchecks/healthchecks'; +import { Hostnames } from './resources/hostnames/hostnames'; +import { HyperdriveResource } from './resources/hyperdrive/hyperdrive'; +import { IAM } from './resources/iam/iam'; +import { Images } from './resources/images/images'; +import { Intel } from './resources/intel/intel'; +import { KV } from './resources/kv/kv'; +import { LeakedCredentialChecks } from './resources/leaked-credential-checks/leaked-credential-checks'; +import { LoadBalancers } from './resources/load-balancers/load-balancers'; +import { Logpush } from './resources/logpush/logpush'; +import { Logs } from './resources/logs/logs'; +import { MagicCloudNetworking } from './resources/magic-cloud-networking/magic-cloud-networking'; +import { MagicNetworkMonitoring } from './resources/magic-network-monitoring/magic-network-monitoring'; +import { MagicTransit } from './resources/magic-transit/magic-transit'; +import { MTLSCertificates } from './resources/mtls-certificates/mtls-certificates'; +import { NetworkInterconnects } from './resources/network-interconnects/network-interconnects'; +import { Organizations } from './resources/organizations/organizations'; +import { OriginTLSClientAuth } from './resources/origin-tls-client-auth/origin-tls-client-auth'; +import { PageShield } from './resources/page-shield/page-shield'; +import { Pages } from './resources/pages/pages'; +import { Pipelines } from './resources/pipelines/pipelines'; +import { Queues } from './resources/queues/queues'; +import { R2DataCatalog } from './resources/r2-data-catalog/r2-data-catalog'; +import { R2 } from './resources/r2/r2'; +import { Radar } from './resources/radar/radar'; +import { RealtimeKit } from './resources/realtime-kit/realtime-kit'; +import { Registrar } from './resources/registrar/registrar'; +import { RequestTracers } from './resources/request-tracers/request-tracers'; +import { ResourceSharing } from './resources/resource-sharing/resource-sharing'; +import { Rules } from './resources/rules/rules'; +import { Rulesets } from './resources/rulesets/rulesets'; +import { RUM } from './resources/rum/rum'; +import { SchemaValidation } from './resources/schema-validation/schema-validation'; +import { SecretsStore } from './resources/secrets-store/secrets-store'; +import { SecurityCenter } from './resources/security-center/security-center'; +import { Snippets } from './resources/snippets/snippets'; +import { Spectrum } from './resources/spectrum/spectrum'; +import { Speed } from './resources/speed/speed'; +import { SSL } from './resources/ssl/ssl'; +import { Stream } from './resources/stream/stream'; +import { TokenValidation } from './resources/token-validation/token-validation'; +import { Turnstile } from './resources/turnstile/turnstile'; +import { URLScanner } from './resources/url-scanner/url-scanner'; +import { User } from './resources/user/user'; +import { Vectorize } from './resources/vectorize/vectorize'; +import { WaitingRooms } from './resources/waiting-rooms/waiting-rooms'; +import { Web3 } from './resources/web3/web3'; +import { WorkersForPlatforms } from './resources/workers-for-platforms/workers-for-platforms'; +import { Workers } from './resources/workers/workers'; +import { Workflows } from './resources/workflows/workflows'; +import { Zaraz } from './resources/zaraz/zaraz'; +import { ZeroTrust } from './resources/zero-trust/zero-trust'; +import { Zones } from './resources/zones/zones'; export interface ClientOptions { /** - * Defaults to process.env['CLOUDFLARE_API_KEY']. + * The preferred authorization scheme for interacting with the Cloudflare API. [Create a token](https://developers.cloudflare.com/fundamentals/api/get-started/create-token/). */ - apiKey?: string | null | undefined; + apiToken?: string | null | undefined; /** - * Defaults to process.env['CLOUDFLARE_EMAIL']. + * The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys. */ - apiEmail?: string | null | undefined; + apiKey?: string | null | undefined; /** - * Defaults to process.env['CLOUDFLARE_API_TOKEN']. + * The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key. */ - apiToken?: string | null | undefined; + apiEmail?: string | null | undefined; /** - * Defaults to process.env['CLOUDFLARE_API_USER_SERVICE_KEY']. + * Used when interacting with the Origin CA certificates API. [View/change your key](https://developers.cloudflare.com/fundamentals/api/get-started/ca-keys/#viewchange-your-origin-ca-keys). */ userServiceKey?: string | null | undefined; @@ -42,8 +157,10 @@ export interface ClientOptions { * * Note that request timeouts are retried by default, so in a worst-case scenario you may wait * much longer than this timeout before the promise succeeds or fails. + * + * @unit milliseconds */ - timeout?: number; + timeout?: number | undefined; /** * An HTTP agent used to manage HTTP(S) connections. @@ -51,7 +168,7 @@ export interface ClientOptions { * If not provided, an agent will be constructed by default in the Node.js environment, * otherwise no agent is used. */ - httpAgent?: Agent; + httpAgent?: Agent | undefined; /** * Specify a custom `fetch` function implementation. @@ -67,7 +184,7 @@ export interface ClientOptions { * * @default 2 */ - maxRetries?: number; + maxRetries?: number | undefined; /** * Default headers to include with every request to the API. @@ -75,7 +192,7 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * header to `undefined` or `null` in request options. */ - defaultHeaders?: Core.Headers; + defaultHeaders?: Core.Headers | undefined; /** * Default query parameters to include with every request to the API. @@ -83,14 +200,16 @@ export interface ClientOptions { * These can be removed in individual requests by explicitly setting the * param to `undefined` in request options. */ - defaultQuery?: Core.DefaultQuery; + defaultQuery?: Core.DefaultQuery | undefined; } -/** API Client for interfacing with the Cloudflare API. */ +/** + * API Client for interfacing with the Cloudflare API. + */ export class Cloudflare extends Core.APIClient { + apiToken: string | null; apiKey: string | null; apiEmail: string | null; - apiToken: string | null; userServiceKey: string | null; private _options: ClientOptions; @@ -98,9 +217,9 @@ export class Cloudflare extends Core.APIClient { /** * API Client for interfacing with the Cloudflare API. * + * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null] * @param {string | null | undefined} [opts.apiKey=process.env['CLOUDFLARE_API_KEY'] ?? null] * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null] - * @param {string | null | undefined} [opts.apiToken=process.env['CLOUDFLARE_API_TOKEN'] ?? null] * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null] * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API. * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. @@ -112,16 +231,16 @@ export class Cloudflare extends Core.APIClient { */ constructor({ baseURL = Core.readEnv('CLOUDFLARE_BASE_URL'), + apiToken = Core.readEnv('CLOUDFLARE_API_TOKEN') ?? null, apiKey = Core.readEnv('CLOUDFLARE_API_KEY') ?? null, apiEmail = Core.readEnv('CLOUDFLARE_EMAIL') ?? null, - apiToken = Core.readEnv('CLOUDFLARE_API_TOKEN') ?? null, userServiceKey = Core.readEnv('CLOUDFLARE_API_USER_SERVICE_KEY') ?? null, ...opts }: ClientOptions = {}) { const options: ClientOptions = { + apiToken, apiKey, apiEmail, - apiToken, userServiceKey, ...opts, baseURL: baseURL || `https://api.cloudflare.com/client/v4`, @@ -129,40 +248,41 @@ export class Cloudflare extends Core.APIClient { super({ baseURL: options.baseURL!, + baseURLOverridden: baseURL ? baseURL !== 'https://api.cloudflare.com/client/v4' : false, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, fetch: options.fetch, }); + this._options = options; + this.apiToken = apiToken; this.apiKey = apiKey; this.apiEmail = apiEmail; - this.apiToken = apiToken; this.userServiceKey = userServiceKey; } accounts: API.Accounts = new API.Accounts(this); + organizations: API.Organizations = new API.Organizations(this); originCACertificates: API.OriginCACertificates = new API.OriginCACertificates(this); ips: API.IPs = new API.IPs(this); memberships: API.Memberships = new API.Memberships(this); - user: API.UserResource = new API.UserResource(this); + user: API.User = new API.User(this); zones: API.Zones = new API.Zones(this); loadBalancers: API.LoadBalancers = new API.LoadBalancers(this); cache: API.Cache = new API.Cache(this); ssl: API.SSL = new API.SSL(this); - subscriptions: API.Subscriptions = new API.Subscriptions(this); acm: API.ACM = new API.ACM(this); argo: API.Argo = new API.Argo(this); - availablePlans: API.AvailablePlans = new API.AvailablePlans(this); - availableRatePlans: API.AvailableRatePlans = new API.AvailableRatePlans(this); certificateAuthorities: API.CertificateAuthorities = new API.CertificateAuthorities(this); clientCertificates: API.ClientCertificates = new API.ClientCertificates(this); customCertificates: API.CustomCertificates = new API.CustomCertificates(this); customHostnames: API.CustomHostnames = new API.CustomHostnames(this); customNameservers: API.CustomNameservers = new API.CustomNameservers(this); + dnsFirewall: API.DNSFirewall = new API.DNSFirewall(this); dns: API.DNS = new API.DNS(this); - dnssec: API.DNSSEC = new API.DNSSEC(this); + emailSecurity: API.EmailSecurity = new API.EmailSecurity(this); emailRouting: API.EmailRouting = new API.EmailRouting(this); filters: API.Filters = new API.Filters(this); firewall: API.Firewall = new API.Firewall(this); @@ -171,16 +291,16 @@ export class Cloudflare extends Core.APIClient { logpush: API.Logpush = new API.Logpush(this); logs: API.Logs = new API.Logs(this); originTLSClientAuth: API.OriginTLSClientAuth = new API.OriginTLSClientAuth(this); - pagerules: API.Pagerules = new API.Pagerules(this); + pageRules: API.PageRules = new API.PageRules(this); rateLimits: API.RateLimits = new API.RateLimits(this); - secondaryDNS: API.SecondaryDNS = new API.SecondaryDNS(this); waitingRooms: API.WaitingRooms = new API.WaitingRooms(this); web3: API.Web3 = new API.Web3(this); workers: API.Workers = new API.Workers(this); kv: API.KV = new API.KV(this); durableObjects: API.DurableObjects = new API.DurableObjects(this); queues: API.Queues = new API.Queues(this); - managedHeaders: API.ManagedHeaders = new API.ManagedHeaders(this); + apiGateway: API.APIGateway = new API.APIGateway(this); + managedTransforms: API.ManagedTransforms = new API.ManagedTransforms(this); pageShield: API.PageShield = new API.PageShield(this); rulesets: API.Rulesets = new API.Rulesets(this); urlNormalization: API.URLNormalization = new API.URLNormalization(this); @@ -194,34 +314,64 @@ export class Cloudflare extends Core.APIClient { intel: API.Intel = new API.Intel(this); magicTransit: API.MagicTransit = new API.MagicTransit(this); magicNetworkMonitoring: API.MagicNetworkMonitoring = new API.MagicNetworkMonitoring(this); + magicCloudNetworking: API.MagicCloudNetworking = new API.MagicCloudNetworking(this); + networkInterconnects: API.NetworkInterconnects = new API.NetworkInterconnects(this); mtlsCertificates: API.MTLSCertificates = new API.MTLSCertificates(this); pages: API.Pages = new API.Pages(this); - pcaps: API.PCAPs = new API.PCAPs(this); registrar: API.Registrar = new API.Registrar(this); requestTracers: API.RequestTracers = new API.RequestTracers(this); rules: API.Rules = new API.Rules(this); - storage: API.Storage = new API.Storage(this); stream: API.Stream = new API.Stream(this); alerting: API.Alerting = new API.Alerting(this); - d1: API.D1 = new API.D1(this); + d1: API.D1Resource = new API.D1Resource(this); r2: API.R2 = new API.R2(this); - warpConnector: API.WARPConnector = new API.WARPConnector(this); + r2DataCatalog: API.R2DataCatalog = new API.R2DataCatalog(this); workersForPlatforms: API.WorkersForPlatforms = new API.WorkersForPlatforms(this); zeroTrust: API.ZeroTrust = new API.ZeroTrust(this); - challenges: API.Challenges = new API.Challenges(this); - hyperdrive: API.Hyperdrive = new API.Hyperdrive(this); + turnstile: API.Turnstile = new API.Turnstile(this); + connectivity: API.Connectivity = new API.Connectivity(this); + hyperdrive: API.HyperdriveResource = new API.HyperdriveResource(this); rum: API.RUM = new API.RUM(this); vectorize: API.Vectorize = new API.Vectorize(this); urlScanner: API.URLScanner = new API.URLScanner(this); radar: API.Radar = new API.Radar(this); botManagement: API.BotManagement = new API.BotManagement(this); + fraud: API.Fraud = new API.Fraud(this); originPostQuantumEncryption: API.OriginPostQuantumEncryption = new API.OriginPostQuantumEncryption(this); + zaraz: API.Zaraz = new API.Zaraz(this); speed: API.Speed = new API.Speed(this); dcvDelegation: API.DCVDelegation = new API.DCVDelegation(this); hostnames: API.Hostnames = new API.Hostnames(this); snippets: API.Snippets = new API.Snippets(this); + realtimeKit: API.RealtimeKit = new API.RealtimeKit(this); calls: API.Calls = new API.Calls(this); cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this); + aiGateway: API.AIGateway = new API.AIGateway(this); + iam: API.IAM = new API.IAM(this); + cloudConnector: API.CloudConnector = new API.CloudConnector(this); + botnetFeed: API.BotnetFeed = new API.BotnetFeed(this); + securityTXT: API.SecurityTXT = new API.SecurityTXT(this); + workflows: API.Workflows = new API.Workflows(this); + resourceSharing: API.ResourceSharing = new API.ResourceSharing(this); + leakedCredentialChecks: API.LeakedCredentialChecks = new API.LeakedCredentialChecks(this); + contentScanning: API.ContentScanning = new API.ContentScanning(this); + abuseReports: API.AbuseReports = new API.AbuseReports(this); + ai: API.AI = new API.AI(this); + aiSearch: API.AISearch = new API.AISearch(this); + securityCenter: API.SecurityCenter = new API.SecurityCenter(this); + browserRendering: API.BrowserRendering = new API.BrowserRendering(this); + customPages: API.CustomPages = new API.CustomPages(this); + secretsStore: API.SecretsStore = new API.SecretsStore(this); + pipelines: API.Pipelines = new API.Pipelines(this); + schemaValidation: API.SchemaValidation = new API.SchemaValidation(this); + tokenValidation: API.TokenValidation = new API.TokenValidation(this); + + /** + * Check whether the base URL is set to its default. + */ + #baseURLOverridden(): boolean { + return this.baseURL !== 'https://api.cloudflare.com/client/v4'; + } protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; @@ -271,28 +421,12 @@ export class Cloudflare extends Core.APIClient { } protected override authHeaders(opts: Core.FinalRequestOptions): Core.Headers { - const apiEmailAuth = this.apiEmailAuth(opts); - const apiKeyAuth = this.apiKeyAuth(opts); - const apiTokenAuth = this.apiTokenAuth(opts); - const userServiceKeyAuth = this.userServiceKeyAuth(opts); - - if ( - apiEmailAuth != null && - !Core.isEmptyObj(apiEmailAuth) && - apiKeyAuth != null && - !Core.isEmptyObj(apiKeyAuth) - ) { - return { ...apiEmailAuth, ...apiKeyAuth }; - } - - if (apiTokenAuth != null && !Core.isEmptyObj(apiTokenAuth)) { - return apiTokenAuth; - } - - if (userServiceKeyAuth != null && !Core.isEmptyObj(userServiceKeyAuth)) { - return userServiceKeyAuth; - } - return {}; + return { + ...this.apiEmailAuth(opts), + ...this.apiKeyAuth(opts), + ...this.apiTokenAuth(opts), + ...this.userServiceKeyAuth(opts), + }; } protected apiEmailAuth(opts: Core.FinalRequestOptions): Core.Headers { @@ -324,10 +458,11 @@ export class Cloudflare extends Core.APIClient { } protected override stringifyQuery(query: Record): string { - return qs.stringify(query, { arrayFormat: 'comma' }); + return qs.stringify(query, { allowDots: true, arrayFormat: 'repeat' }); } static Cloudflare = this; + static DEFAULT_TIMEOUT = 60000; // 1 minute static CloudflareError = Errors.CloudflareError; static APIError = Errors.APIError; @@ -342,474 +477,395 @@ export class Cloudflare extends Core.APIClient { static InternalServerError = Errors.InternalServerError; static PermissionDeniedError = Errors.PermissionDeniedError; static UnprocessableEntityError = Errors.UnprocessableEntityError; -} -export const { - CloudflareError, - APIError, - APIConnectionError, - APIConnectionTimeoutError, - APIUserAbortError, - NotFoundError, - ConflictError, - RateLimitError, - BadRequestError, - AuthenticationError, - InternalServerError, - PermissionDeniedError, - UnprocessableEntityError, -} = Errors; - -export import toFile = Uploads.toFile; -export import fileFromPath = Uploads.fileFromPath; - -export namespace Cloudflare { - // Helper functions - export import toFile = Uploads.toFile; - export import fileFromPath = Uploads.fileFromPath; + static toFile = Uploads.toFile; + static fileFromPath = Uploads.fileFromPath; +} - export import RequestOptions = Core.RequestOptions; +Cloudflare.Accounts = Accounts; +Cloudflare.Organizations = Organizations; +Cloudflare.OriginCACertificates = OriginCACertificates; +Cloudflare.IPs = IPs; +Cloudflare.Memberships = Memberships; +Cloudflare.User = User; +Cloudflare.Zones = Zones; +Cloudflare.LoadBalancers = LoadBalancers; +Cloudflare.Cache = Cache; +Cloudflare.SSL = SSL; +Cloudflare.ACM = ACM; +Cloudflare.Argo = Argo; +Cloudflare.CertificateAuthorities = CertificateAuthorities; +Cloudflare.ClientCertificates = ClientCertificates; +Cloudflare.CustomCertificates = CustomCertificates; +Cloudflare.CustomHostnames = CustomHostnames; +Cloudflare.CustomNameservers = CustomNameservers; +Cloudflare.DNSFirewall = DNSFirewall; +Cloudflare.DNS = DNS; +Cloudflare.EmailSecurity = EmailSecurity; +Cloudflare.EmailRouting = EmailRouting; +Cloudflare.Filters = Filters; +Cloudflare.Firewall = Firewall; +Cloudflare.Healthchecks = Healthchecks; +Cloudflare.KeylessCertificates = KeylessCertificates; +Cloudflare.Logpush = Logpush; +Cloudflare.Logs = Logs; +Cloudflare.OriginTLSClientAuth = OriginTLSClientAuth; +Cloudflare.PageRules = PageRules; +Cloudflare.RateLimits = RateLimits; +Cloudflare.WaitingRooms = WaitingRooms; +Cloudflare.Web3 = Web3; +Cloudflare.Workers = Workers; +Cloudflare.KV = KV; +Cloudflare.DurableObjects = DurableObjects; +Cloudflare.Queues = Queues; +Cloudflare.APIGateway = APIGateway; +Cloudflare.ManagedTransforms = ManagedTransforms; +Cloudflare.PageShield = PageShield; +Cloudflare.Rulesets = Rulesets; +Cloudflare.URLNormalization = URLNormalization; +Cloudflare.Spectrum = Spectrum; +Cloudflare.Addressing = Addressing; +Cloudflare.AuditLogs = AuditLogs; +Cloudflare.Billing = Billing; +Cloudflare.BrandProtection = BrandProtection; +Cloudflare.Diagnostics = Diagnostics; +Cloudflare.Images = Images; +Cloudflare.Intel = Intel; +Cloudflare.MagicTransit = MagicTransit; +Cloudflare.MagicNetworkMonitoring = MagicNetworkMonitoring; +Cloudflare.MagicCloudNetworking = MagicCloudNetworking; +Cloudflare.NetworkInterconnects = NetworkInterconnects; +Cloudflare.MTLSCertificates = MTLSCertificates; +Cloudflare.Pages = Pages; +Cloudflare.Registrar = Registrar; +Cloudflare.RequestTracers = RequestTracers; +Cloudflare.Rules = Rules; +Cloudflare.Stream = Stream; +Cloudflare.Alerting = Alerting; +Cloudflare.D1Resource = D1Resource; +Cloudflare.R2 = R2; +Cloudflare.R2DataCatalog = R2DataCatalog; +Cloudflare.WorkersForPlatforms = WorkersForPlatforms; +Cloudflare.ZeroTrust = ZeroTrust; +Cloudflare.Turnstile = Turnstile; +Cloudflare.Connectivity = Connectivity; +Cloudflare.HyperdriveResource = HyperdriveResource; +Cloudflare.RUM = RUM; +Cloudflare.Vectorize = Vectorize; +Cloudflare.URLScanner = URLScanner; +Cloudflare.Radar = Radar; +Cloudflare.BotManagement = BotManagement; +Cloudflare.Fraud = Fraud; +Cloudflare.OriginPostQuantumEncryption = OriginPostQuantumEncryption; +Cloudflare.Zaraz = Zaraz; +Cloudflare.Speed = Speed; +Cloudflare.DCVDelegation = DCVDelegation; +Cloudflare.Hostnames = Hostnames; +Cloudflare.Snippets = Snippets; +Cloudflare.RealtimeKit = RealtimeKit; +Cloudflare.Calls = Calls; +Cloudflare.CloudforceOne = CloudforceOne; +Cloudflare.AIGateway = AIGateway; +Cloudflare.IAM = IAM; +Cloudflare.CloudConnector = CloudConnector; +Cloudflare.BotnetFeed = BotnetFeed; +Cloudflare.SecurityTXT = SecurityTXT; +Cloudflare.Workflows = Workflows; +Cloudflare.ResourceSharing = ResourceSharing; +Cloudflare.LeakedCredentialChecks = LeakedCredentialChecks; +Cloudflare.ContentScanning = ContentScanning; +Cloudflare.AbuseReports = AbuseReports; +Cloudflare.AI = AI; +Cloudflare.AISearch = AISearch; +Cloudflare.SecurityCenter = SecurityCenter; +Cloudflare.BrowserRendering = BrowserRendering; +Cloudflare.CustomPages = CustomPages; +Cloudflare.SecretsStore = SecretsStore; +Cloudflare.Pipelines = Pipelines; +Cloudflare.SchemaValidation = SchemaValidation; +Cloudflare.TokenValidation = TokenValidation; + +export declare namespace Cloudflare { + export type RequestOptions = Core.RequestOptions; export import V4PagePagination = Pagination.V4PagePagination; - export import V4PagePaginationParams = Pagination.V4PagePaginationParams; - export import V4PagePaginationResponse = Pagination.V4PagePaginationResponse; + export { + type V4PagePaginationParams as V4PagePaginationParams, + type V4PagePaginationResponse as V4PagePaginationResponse, + }; export import V4PagePaginationArray = Pagination.V4PagePaginationArray; - export import V4PagePaginationArrayParams = Pagination.V4PagePaginationArrayParams; - export import V4PagePaginationArrayResponse = Pagination.V4PagePaginationArrayResponse; + export { + type V4PagePaginationArrayParams as V4PagePaginationArrayParams, + type V4PagePaginationArrayResponse as V4PagePaginationArrayResponse, + }; export import CursorPagination = Pagination.CursorPagination; - export import CursorPaginationParams = Pagination.CursorPaginationParams; - export import CursorPaginationResponse = Pagination.CursorPaginationResponse; + export { + type CursorPaginationParams as CursorPaginationParams, + type CursorPaginationResponse as CursorPaginationResponse, + }; + + export import CursorPaginationAfter = Pagination.CursorPaginationAfter; + export { + type CursorPaginationAfterParams as CursorPaginationAfterParams, + type CursorPaginationAfterResponse as CursorPaginationAfterResponse, + }; export import CursorLimitPagination = Pagination.CursorLimitPagination; - export import CursorLimitPaginationParams = Pagination.CursorLimitPaginationParams; - export import CursorLimitPaginationResponse = Pagination.CursorLimitPaginationResponse; + export { + type CursorLimitPaginationParams as CursorLimitPaginationParams, + type CursorLimitPaginationResponse as CursorLimitPaginationResponse, + }; export import SinglePage = Pagination.SinglePage; - export import SinglePageResponse = Pagination.SinglePageResponse; - - export import Accounts = API.Accounts; - export import Account = API.Account; - export import AccountUpdateResponse = API.AccountUpdateResponse; - export import AccountListResponse = API.AccountListResponse; - export import AccountGetResponse = API.AccountGetResponse; - export import AccountListResponsesV4PagePaginationArray = API.AccountListResponsesV4PagePaginationArray; - export import AccountUpdateParams = API.AccountUpdateParams; - export import AccountListParams = API.AccountListParams; - export import AccountGetParams = API.AccountGetParams; - - export import OriginCACertificates = API.OriginCACertificates; - export import OriginCACertificate = API.OriginCACertificate; - export import OriginCACertificateCreateResponse = API.OriginCACertificateCreateResponse; - export import OriginCACertificateListResponse = API.OriginCACertificateListResponse; - export import OriginCACertificateDeleteResponse = API.OriginCACertificateDeleteResponse; - export import OriginCACertificateGetResponse = API.OriginCACertificateGetResponse; - export import OriginCACertificateCreateParams = API.OriginCACertificateCreateParams; - - export import IPs = API.IPs; - export import JdcloudIPs = API.JdcloudIPs; - export import IPListResponse = API.IPListResponse; - export import IPListParams = API.IPListParams; - - export import Memberships = API.Memberships; - export import Membership = API.Membership; - export import MembershipUpdateResponse = API.MembershipUpdateResponse; - export import MembershipDeleteResponse = API.MembershipDeleteResponse; - export import MembershipGetResponse = API.MembershipGetResponse; - export import MembershipsV4PagePaginationArray = API.MembershipsV4PagePaginationArray; - export import MembershipUpdateParams = API.MembershipUpdateParams; - export import MembershipListParams = API.MembershipListParams; - - export import UserResource = API.UserResource; - export import User = API.User; - export import UserEditResponse = API.UserEditResponse; - export import UserGetResponse = API.UserGetResponse; - export import UserEditParams = API.UserEditParams; - - export import Zones = API.Zones; - export import Zone = API.Zone; - export import ZoneCreateResponse = API.ZoneCreateResponse; - export import ZoneListResponse = API.ZoneListResponse; - export import ZoneDeleteResponse = API.ZoneDeleteResponse; - export import ZoneEditResponse = API.ZoneEditResponse; - export import ZoneGetResponse = API.ZoneGetResponse; - export import ZoneListResponsesV4PagePaginationArray = API.ZoneListResponsesV4PagePaginationArray; - export import ZoneCreateParams = API.ZoneCreateParams; - export import ZoneListParams = API.ZoneListParams; - export import ZoneDeleteParams = API.ZoneDeleteParams; - export import ZoneEditParams = API.ZoneEditParams; - export import ZoneGetParams = API.ZoneGetParams; - - export import LoadBalancers = API.LoadBalancers; - export import LoadBalancer = API.LoadBalancer; - export import LoadBalancerListResponse = API.LoadBalancerListResponse; - export import LoadBalancerDeleteResponse = API.LoadBalancerDeleteResponse; - export import LoadBalancerCreateParams = API.LoadBalancerCreateParams; - export import LoadBalancerUpdateParams = API.LoadBalancerUpdateParams; - export import LoadBalancerListParams = API.LoadBalancerListParams; - export import LoadBalancerDeleteParams = API.LoadBalancerDeleteParams; - export import LoadBalancerEditParams = API.LoadBalancerEditParams; - export import LoadBalancerGetParams = API.LoadBalancerGetParams; - - export import Cache = API.Cache; - export import CachePurgeResponse = API.CachePurgeResponse; - export import CachePurgeParams = API.CachePurgeParams; - - export import SSL = API.SSL; - - export import Subscriptions = API.Subscriptions; - export import SubscriptionCreateResponse = API.SubscriptionCreateResponse; - export import SubscriptionUpdateResponse = API.SubscriptionUpdateResponse; - export import SubscriptionListResponse = API.SubscriptionListResponse; - export import SubscriptionDeleteResponse = API.SubscriptionDeleteResponse; - export import SubscriptionGetResponse = API.SubscriptionGetResponse; - export import SubscriptionCreateParams = API.SubscriptionCreateParams; - export import SubscriptionUpdateParams = API.SubscriptionUpdateParams; - - export import ACM = API.ACM; - - export import Argo = API.Argo; - - export import AvailablePlans = API.AvailablePlans; - export import BillSubsAPIAvailableRatePlan = API.BillSubsAPIAvailableRatePlan; - export import AvailablePlanListResponse = API.AvailablePlanListResponse; - - export import AvailableRatePlans = API.AvailableRatePlans; - export import BillSubsRatePlan = API.BillSubsRatePlan; - export import AvailableRatePlanGetResponse = API.AvailableRatePlanGetResponse; - - export import CertificateAuthorities = API.CertificateAuthorities; - - export import ClientCertificates = API.ClientCertificates; - export import TLSCertificatesAndHostnamesClientCertificate = API.TLSCertificatesAndHostnamesClientCertificate; - export import TLSCertificatesAndHostnamesClientCertificatesV4PagePaginationArray = API.TLSCertificatesAndHostnamesClientCertificatesV4PagePaginationArray; - export import ClientCertificateCreateParams = API.ClientCertificateCreateParams; - export import ClientCertificateListParams = API.ClientCertificateListParams; - export import ClientCertificateDeleteParams = API.ClientCertificateDeleteParams; - export import ClientCertificateEditParams = API.ClientCertificateEditParams; - export import ClientCertificateGetParams = API.ClientCertificateGetParams; - - export import CustomCertificates = API.CustomCertificates; - export import TLSCertificatesAndHostnamesCustomCertificate = API.TLSCertificatesAndHostnamesCustomCertificate; - export import CustomCertificateCreateResponse = API.CustomCertificateCreateResponse; - export import CustomCertificateDeleteResponse = API.CustomCertificateDeleteResponse; - export import CustomCertificateEditResponse = API.CustomCertificateEditResponse; - export import CustomCertificateGetResponse = API.CustomCertificateGetResponse; - export import TLSCertificatesAndHostnamesCustomCertificatesV4PagePaginationArray = API.TLSCertificatesAndHostnamesCustomCertificatesV4PagePaginationArray; - export import CustomCertificateCreateParams = API.CustomCertificateCreateParams; - export import CustomCertificateListParams = API.CustomCertificateListParams; - export import CustomCertificateDeleteParams = API.CustomCertificateDeleteParams; - export import CustomCertificateEditParams = API.CustomCertificateEditParams; - export import CustomCertificateGetParams = API.CustomCertificateGetParams; - - export import CustomHostnames = API.CustomHostnames; - export import TLSCertificatesAndHostnamesCustomHostname = API.TLSCertificatesAndHostnamesCustomHostname; - export import CustomHostnameCreateResponse = API.CustomHostnameCreateResponse; - export import CustomHostnameListResponse = API.CustomHostnameListResponse; - export import CustomHostnameDeleteResponse = API.CustomHostnameDeleteResponse; - export import CustomHostnameEditResponse = API.CustomHostnameEditResponse; - export import CustomHostnameGetResponse = API.CustomHostnameGetResponse; - export import CustomHostnameListResponsesV4PagePaginationArray = API.CustomHostnameListResponsesV4PagePaginationArray; - export import CustomHostnameCreateParams = API.CustomHostnameCreateParams; - export import CustomHostnameListParams = API.CustomHostnameListParams; - export import CustomHostnameDeleteParams = API.CustomHostnameDeleteParams; - export import CustomHostnameEditParams = API.CustomHostnameEditParams; - export import CustomHostnameGetParams = API.CustomHostnameGetParams; - - export import CustomNameservers = API.CustomNameservers; - export import DNSCustomNameserversCustomNS = API.DNSCustomNameserversCustomNS; - export import CustomNameserverDeleteResponse = API.CustomNameserverDeleteResponse; - export import CustomNameserverAvailabiltyResponse = API.CustomNameserverAvailabiltyResponse; - export import CustomNameserverGetResponse = API.CustomNameserverGetResponse; - export import CustomNameserverVerifyResponse = API.CustomNameserverVerifyResponse; - export import CustomNameserverCreateParams = API.CustomNameserverCreateParams; - export import CustomNameserverDeleteParams = API.CustomNameserverDeleteParams; - export import CustomNameserverAvailabiltyParams = API.CustomNameserverAvailabiltyParams; - export import CustomNameserverGetParams = API.CustomNameserverGetParams; - export import CustomNameserverVerifyParams = API.CustomNameserverVerifyParams; - - export import DNS = API.DNS; - - export import DNSSEC = API.DNSSEC; - export import DNSSECDNSSEC = API.DNSSECDNSSEC; - export import DNSSECDeleteResponse = API.DNSSECDeleteResponse; - export import DNSSECDeleteParams = API.DNSSECDeleteParams; - export import DNSSECEditParams = API.DNSSECEditParams; - export import DNSSECGetParams = API.DNSSECGetParams; - - export import EmailRouting = API.EmailRouting; - - export import Filters = API.Filters; - export import LegacyJhsFilter = API.LegacyJhsFilter; - export import FilterCreateResponse = API.FilterCreateResponse; - export import LegacyJhsFiltersV4PagePaginationArray = API.LegacyJhsFiltersV4PagePaginationArray; - export import FilterCreateParams = API.FilterCreateParams; - export import FilterUpdateParams = API.FilterUpdateParams; - export import FilterListParams = API.FilterListParams; - - export import Firewall = API.Firewall; - - export import Healthchecks = API.Healthchecks; - export import HealthchecksHealthchecks = API.HealthchecksHealthchecks; - export import HealthcheckListResponse = API.HealthcheckListResponse; - export import HealthcheckDeleteResponse = API.HealthcheckDeleteResponse; - export import HealthcheckCreateParams = API.HealthcheckCreateParams; - export import HealthcheckUpdateParams = API.HealthcheckUpdateParams; - export import HealthcheckEditParams = API.HealthcheckEditParams; - - export import KeylessCertificates = API.KeylessCertificates; - export import TLSCertificatesAndHostnamesBase = API.TLSCertificatesAndHostnamesBase; - export import TLSCertificatesAndHostnamesKeylessCertificate = API.TLSCertificatesAndHostnamesKeylessCertificate; - export import KeylessCertificateListResponse = API.KeylessCertificateListResponse; - export import KeylessCertificateDeleteResponse = API.KeylessCertificateDeleteResponse; - export import KeylessCertificateCreateParams = API.KeylessCertificateCreateParams; - export import KeylessCertificateListParams = API.KeylessCertificateListParams; - export import KeylessCertificateDeleteParams = API.KeylessCertificateDeleteParams; - export import KeylessCertificateEditParams = API.KeylessCertificateEditParams; - export import KeylessCertificateGetParams = API.KeylessCertificateGetParams; - - export import Logpush = API.Logpush; - - export import Logs = API.Logs; - - export import OriginTLSClientAuth = API.OriginTLSClientAuth; - export import TLSCertificatesAndHostnamesZoneAuthenticatedOriginPull = API.TLSCertificatesAndHostnamesZoneAuthenticatedOriginPull; - export import OriginTLSClientAuthCreateResponse = API.OriginTLSClientAuthCreateResponse; - export import OriginTLSClientAuthListResponse = API.OriginTLSClientAuthListResponse; - export import OriginTLSClientAuthDeleteResponse = API.OriginTLSClientAuthDeleteResponse; - export import OriginTLSClientAuthGetResponse = API.OriginTLSClientAuthGetResponse; - export import OriginTLSClientAuthCreateParams = API.OriginTLSClientAuthCreateParams; - export import OriginTLSClientAuthListParams = API.OriginTLSClientAuthListParams; - export import OriginTLSClientAuthDeleteParams = API.OriginTLSClientAuthDeleteParams; - export import OriginTLSClientAuthGetParams = API.OriginTLSClientAuthGetParams; - - export import Pagerules = API.Pagerules; - export import ZonesPageRule = API.ZonesPageRule; - export import PageruleCreateResponse = API.PageruleCreateResponse; - export import PageruleUpdateResponse = API.PageruleUpdateResponse; - export import PageruleListResponse = API.PageruleListResponse; - export import PageruleDeleteResponse = API.PageruleDeleteResponse; - export import PageruleEditResponse = API.PageruleEditResponse; - export import PageruleGetResponse = API.PageruleGetResponse; - export import PageruleCreateParams = API.PageruleCreateParams; - export import PageruleUpdateParams = API.PageruleUpdateParams; - export import PageruleListParams = API.PageruleListParams; - export import PageruleDeleteParams = API.PageruleDeleteParams; - export import PageruleEditParams = API.PageruleEditParams; - export import PageruleGetParams = API.PageruleGetParams; - - export import RateLimits = API.RateLimits; - export import LegacyJhsRateLimits = API.LegacyJhsRateLimits; - export import RateLimitCreateResponse = API.RateLimitCreateResponse; - export import RateLimitListResponse = API.RateLimitListResponse; - export import RateLimitDeleteResponse = API.RateLimitDeleteResponse; - export import RateLimitEditResponse = API.RateLimitEditResponse; - export import RateLimitGetResponse = API.RateLimitGetResponse; - export import RateLimitListResponsesV4PagePaginationArray = API.RateLimitListResponsesV4PagePaginationArray; - export import RateLimitCreateParams = API.RateLimitCreateParams; - export import RateLimitListParams = API.RateLimitListParams; - export import RateLimitEditParams = API.RateLimitEditParams; - - export import SecondaryDNS = API.SecondaryDNS; - - export import WaitingRooms = API.WaitingRooms; - export import WaitingroomWaitingroom = API.WaitingroomWaitingroom; - export import WaitingRoomListResponse = API.WaitingRoomListResponse; - export import WaitingRoomDeleteResponse = API.WaitingRoomDeleteResponse; - export import WaitingRoomCreateParams = API.WaitingRoomCreateParams; - export import WaitingRoomUpdateParams = API.WaitingRoomUpdateParams; - export import WaitingRoomEditParams = API.WaitingRoomEditParams; - - export import Web3 = API.Web3; - - export import Workers = API.Workers; - - export import KV = API.KV; - - export import DurableObjects = API.DurableObjects; - - export import Queues = API.Queues; - export import WorkersQueue = API.WorkersQueue; - export import WorkersQueueCreated = API.WorkersQueueCreated; - export import WorkersQueueUpdated = API.WorkersQueueUpdated; - export import QueueListResponse = API.QueueListResponse; - export import QueueDeleteResponse = API.QueueDeleteResponse; - export import QueueCreateParams = API.QueueCreateParams; - export import QueueUpdateParams = API.QueueUpdateParams; - export import QueueListParams = API.QueueListParams; - export import QueueDeleteParams = API.QueueDeleteParams; - export import QueueGetParams = API.QueueGetParams; - - export import ManagedHeaders = API.ManagedHeaders; - export import ManagedHeaderListResponse = API.ManagedHeaderListResponse; - export import ManagedHeaderEditResponse = API.ManagedHeaderEditResponse; - export import ManagedHeaderListParams = API.ManagedHeaderListParams; - export import ManagedHeaderEditParams = API.ManagedHeaderEditParams; - - export import PageShield = API.PageShield; - export import PageShieldGetZoneSettings = API.PageShieldGetZoneSettings; - export import PageShieldUpdateZoneSettings = API.PageShieldUpdateZoneSettings; - export import PageShieldUpdateParams = API.PageShieldUpdateParams; - export import PageShieldGetParams = API.PageShieldGetParams; - - export import Rulesets = API.Rulesets; - export import RulesetsRulesetResponse = API.RulesetsRulesetResponse; - export import RulesetsRulesetsResponse = API.RulesetsRulesetsResponse; - export import RulesetCreateParams = API.RulesetCreateParams; - export import RulesetUpdateParams = API.RulesetUpdateParams; - export import RulesetListParams = API.RulesetListParams; - export import RulesetDeleteParams = API.RulesetDeleteParams; - export import RulesetGetParams = API.RulesetGetParams; - - export import URLNormalization = API.URLNormalization; - export import URLNormalizationUpdateResponse = API.URLNormalizationUpdateResponse; - export import URLNormalizationGetResponse = API.URLNormalizationGetResponse; - export import URLNormalizationUpdateParams = API.URLNormalizationUpdateParams; - export import URLNormalizationGetParams = API.URLNormalizationGetParams; - - export import Spectrum = API.Spectrum; - - export import Addressing = API.Addressing; - - export import AuditLogs = API.AuditLogs; - export import AuditLogListResponse = API.AuditLogListResponse; - export import AuditLogListResponsesV4PagePaginationArray = API.AuditLogListResponsesV4PagePaginationArray; - export import AuditLogListParams = API.AuditLogListParams; - - export import Billing = API.Billing; - - export import BrandProtection = API.BrandProtection; - export import IntelPhishingURLInfo = API.IntelPhishingURLInfo; - export import IntelPhishingURLSubmit = API.IntelPhishingURLSubmit; - export import BrandProtectionSubmitParams = API.BrandProtectionSubmitParams; - export import BrandProtectionURLInfoParams = API.BrandProtectionURLInfoParams; - - export import Diagnostics = API.Diagnostics; - - export import Images = API.Images; - - export import Intel = API.Intel; - - export import MagicTransit = API.MagicTransit; - - export import MagicNetworkMonitoring = API.MagicNetworkMonitoring; - - export import MTLSCertificates = API.MTLSCertificates; - export import TLSCertificatesAndHostnamesCertificateObjectPost = API.TLSCertificatesAndHostnamesCertificateObjectPost; - export import TLSCertificatesAndHostnamesComponentsSchemasCertificateObject = API.TLSCertificatesAndHostnamesComponentsSchemasCertificateObject; - export import MTLSCertificateListResponse = API.MTLSCertificateListResponse; - export import MTLSCertificateCreateParams = API.MTLSCertificateCreateParams; - export import MTLSCertificateListParams = API.MTLSCertificateListParams; - export import MTLSCertificateDeleteParams = API.MTLSCertificateDeleteParams; - export import MTLSCertificateGetParams = API.MTLSCertificateGetParams; - - export import Pages = API.Pages; - - export import PCAPs = API.PCAPs; - export import PCAPCreateResponse = API.PCAPCreateResponse; - export import PCAPListResponse = API.PCAPListResponse; - export import PCAPGetResponse = API.PCAPGetResponse; - export import PCAPCreateParams = API.PCAPCreateParams; - export import PCAPListParams = API.PCAPListParams; - export import PCAPGetParams = API.PCAPGetParams; - - export import Registrar = API.Registrar; - - export import RequestTracers = API.RequestTracers; - - export import Rules = API.Rules; + export { type SinglePageResponse as SinglePageResponse }; + + export { Accounts as Accounts }; + + export { Organizations as Organizations }; + + export { OriginCACertificates as OriginCACertificates }; + + export { IPs as IPs }; + + export { Memberships as Memberships }; + + export { User as User }; + + export { Zones as Zones }; + + export { LoadBalancers as LoadBalancers }; + + export { Cache as Cache }; + + export { SSL as SSL }; + + export { ACM as ACM }; + + export { Argo as Argo }; + + export { CertificateAuthorities as CertificateAuthorities }; + + export { ClientCertificates as ClientCertificates }; + + export { CustomCertificates as CustomCertificates }; + + export { CustomHostnames as CustomHostnames }; + + export { CustomNameservers as CustomNameservers }; + + export { DNSFirewall as DNSFirewall }; + + export { DNS as DNS }; + + export { EmailSecurity as EmailSecurity }; + + export { EmailRouting as EmailRouting }; + + export { Filters as Filters }; + + export { Firewall as Firewall }; + + export { Healthchecks as Healthchecks }; + + export { KeylessCertificates as KeylessCertificates }; + + export { Logpush as Logpush }; - export import Storage = API.Storage; - - export import Stream = API.Stream; - export import StreamVideos = API.StreamVideos; - export import StreamListResponse = API.StreamListResponse; - export import StreamCreateParams = API.StreamCreateParams; - export import StreamListParams = API.StreamListParams; - export import StreamDeleteParams = API.StreamDeleteParams; - export import StreamGetParams = API.StreamGetParams; - - export import Alerting = API.Alerting; - - export import D1 = API.D1; - - export import R2 = API.R2; - - export import WARPConnector = API.WARPConnector; - export import WARPConnectorCreateResponse = API.WARPConnectorCreateResponse; - export import WARPConnectorListResponse = API.WARPConnectorListResponse; - export import WARPConnectorDeleteResponse = API.WARPConnectorDeleteResponse; - export import WARPConnectorEditResponse = API.WARPConnectorEditResponse; - export import WARPConnectorGetResponse = API.WARPConnectorGetResponse; - export import WARPConnectorTokenResponse = API.WARPConnectorTokenResponse; - export import WARPConnectorListResponsesV4PagePaginationArray = API.WARPConnectorListResponsesV4PagePaginationArray; - export import WARPConnectorCreateParams = API.WARPConnectorCreateParams; - export import WARPConnectorListParams = API.WARPConnectorListParams; - export import WARPConnectorDeleteParams = API.WARPConnectorDeleteParams; - export import WARPConnectorEditParams = API.WARPConnectorEditParams; - export import WARPConnectorGetParams = API.WARPConnectorGetParams; - export import WARPConnectorTokenParams = API.WARPConnectorTokenParams; + export { Logs as Logs }; - export import WorkersForPlatforms = API.WorkersForPlatforms; + export { OriginTLSClientAuth as OriginTLSClientAuth }; - export import ZeroTrust = API.ZeroTrust; + export { PageRules as PageRules }; - export import Challenges = API.Challenges; + export { RateLimits as RateLimits }; - export import Hyperdrive = API.Hyperdrive; + export { WaitingRooms as WaitingRooms }; - export import RUM = API.RUM; + export { Web3 as Web3 }; - export import Vectorize = API.Vectorize; + export { Workers as Workers }; - export import URLScanner = API.URLScanner; - export import URLScannerScanResponse = API.URLScannerScanResponse; - export import URLScannerScanParams = API.URLScannerScanParams; + export { KV as KV }; - export import Radar = API.Radar; + export { DurableObjects as DurableObjects }; - export import BotManagement = API.BotManagement; - export import BotManagementUpdateResponse = API.BotManagementUpdateResponse; - export import BotManagementGetResponse = API.BotManagementGetResponse; - export import BotManagementUpdateParams = API.BotManagementUpdateParams; - export import BotManagementGetParams = API.BotManagementGetParams; + export { Queues as Queues }; - export import OriginPostQuantumEncryption = API.OriginPostQuantumEncryption; - export import OriginPostQuantumEncryptionUpdateResponse = API.OriginPostQuantumEncryptionUpdateResponse; - export import OriginPostQuantumEncryptionGetResponse = API.OriginPostQuantumEncryptionGetResponse; - export import OriginPostQuantumEncryptionUpdateParams = API.OriginPostQuantumEncryptionUpdateParams; - export import OriginPostQuantumEncryptionGetParams = API.OriginPostQuantumEncryptionGetParams; + export { APIGateway as APIGateway }; - export import Speed = API.Speed; - export import ObservatorySchedule = API.ObservatorySchedule; - export import ObservatoryTrend = API.ObservatoryTrend; - export import SpeedDeleteResponse = API.SpeedDeleteResponse; - export import SpeedDeleteParams = API.SpeedDeleteParams; - export import SpeedScheduleGetParams = API.SpeedScheduleGetParams; - export import SpeedTrendsListParams = API.SpeedTrendsListParams; + export { ManagedTransforms as ManagedTransforms }; - export import DCVDelegation = API.DCVDelegation; + export { PageShield as PageShield }; - export import Hostnames = API.Hostnames; + export { Rulesets as Rulesets }; - export import Snippets = API.Snippets; - export import Snippet = API.Snippet; - export import SnippetListResponse = API.SnippetListResponse; - export import SnippetDeleteResponse = API.SnippetDeleteResponse; - export import SnippetUpdateParams = API.SnippetUpdateParams; - - export import Calls = API.Calls; - export import CallsApp = API.CallsApp; - export import CallsAppWithSecret = API.CallsAppWithSecret; - export import CallListResponse = API.CallListResponse; - export import CallCreateParams = API.CallCreateParams; - export import CallUpdateParams = API.CallUpdateParams; - export import CallListParams = API.CallListParams; - export import CallDeleteParams = API.CallDeleteParams; - export import CallGetParams = API.CallGetParams; + export { URLNormalization as URLNormalization }; - export import CloudforceOne = API.CloudforceOne; + export { Spectrum as Spectrum }; + + export { Addressing as Addressing }; + + export { AuditLogs as AuditLogs }; + + export { Billing as Billing }; + + export { BrandProtection as BrandProtection }; + + export { Diagnostics as Diagnostics }; + + export { Images as Images }; + + export { Intel as Intel }; + + export { MagicTransit as MagicTransit }; + + export { MagicNetworkMonitoring as MagicNetworkMonitoring }; + + export { MagicCloudNetworking as MagicCloudNetworking }; + + export { NetworkInterconnects as NetworkInterconnects }; + + export { MTLSCertificates as MTLSCertificates }; + + export { Pages as Pages }; + + export { Registrar as Registrar }; + + export { RequestTracers as RequestTracers }; + + export { Rules as Rules }; + + export { Stream as Stream }; + + export { Alerting as Alerting }; + + export { D1Resource as D1Resource }; + + export { R2 as R2 }; + + export { R2DataCatalog as R2DataCatalog }; + + export { WorkersForPlatforms as WorkersForPlatforms }; + + export { ZeroTrust as ZeroTrust }; + + export { Turnstile as Turnstile }; + + export { Connectivity as Connectivity }; + + export { HyperdriveResource as HyperdriveResource }; + + export { RUM as RUM }; + + export { Vectorize as Vectorize }; + + export { URLScanner as URLScanner }; + + export { Radar as Radar }; + + export { BotManagement as BotManagement }; + + export { Fraud as Fraud }; + + export { OriginPostQuantumEncryption as OriginPostQuantumEncryption }; + + export { Zaraz as Zaraz }; + + export { Speed as Speed }; + + export { DCVDelegation as DCVDelegation }; + + export { Hostnames as Hostnames }; + + export { Snippets as Snippets }; + + export { RealtimeKit as RealtimeKit }; + + export { Calls as Calls }; + + export { CloudforceOne as CloudforceOne }; + + export { AIGateway as AIGateway }; + + export { IAM as IAM }; + + export { CloudConnector as CloudConnector }; + + export { BotnetFeed as BotnetFeed }; + + export { SecurityTXT as SecurityTXT }; + + export { Workflows as Workflows }; + + export { ResourceSharing as ResourceSharing }; + + export { LeakedCredentialChecks as LeakedCredentialChecks }; + + export { ContentScanning as ContentScanning }; + + export { AbuseReports as AbuseReports }; + + export { AI as AI }; + + export { AISearch as AISearch }; + + export { SecurityCenter as SecurityCenter }; + + export { BrowserRendering as BrowserRendering }; + + export { CustomPages as CustomPages }; + + export { SecretsStore as SecretsStore }; + + export { Pipelines as Pipelines }; + + export { SchemaValidation as SchemaValidation }; + + export { TokenValidation as TokenValidation }; + + export type ASN = API.ASN; + export type AuditLog = API.AuditLog; + export type CertificateCA = API.CertificateCA; + export type CertificateRequestType = API.CertificateRequestType; + export type CloudflareTunnel = API.CloudflareTunnel; + export type ErrorData = API.ErrorData; + export type Identifier = API.Identifier; + export type LoadBalancerPreview = API.LoadBalancerPreview; + export type Member = API.Member; + export type PaginationInfo = API.PaginationInfo; + export type Permission = API.Permission; + export type PermissionGrant = API.PermissionGrant; + export type RatePlan = API.RatePlan; + export type ResponseInfo = API.ResponseInfo; + export type Result = API.Result; + export type Role = API.Role; + export type SortDirection = API.SortDirection; + export type Subscription = API.Subscription; + export type SubscriptionComponent = API.SubscriptionComponent; + export type SubscriptionZone = API.SubscriptionZone; + export type Token = API.Token; + export type TokenConditionCIDRList = API.TokenConditionCIDRList; + export type TokenPolicy = API.TokenPolicy; + export type TokenValue = API.TokenValue; } +export { toFile, fileFromPath } from './uploads'; +export { + CloudflareError, + APIError, + APIConnectionError, + APIConnectionTimeoutError, + APIUserAbortError, + NotFoundError, + ConflictError, + RateLimitError, + BadRequestError, + AuthenticationError, + InternalServerError, + PermissionDeniedError, + UnprocessableEntityError, +} from './error'; + export default Cloudflare; diff --git a/src/internal/qs/LICENSE.md b/src/internal/qs/LICENSE.md new file mode 100644 index 0000000000..3fda1573bb --- /dev/null +++ b/src/internal/qs/LICENSE.md @@ -0,0 +1,13 @@ +BSD 3-Clause License + +Copyright (c) 2014, Nathan LaFreniere and other [contributors](https://github.com/puruvj/neoqs/graphs/contributors) All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/src/internal/qs/README.md b/src/internal/qs/README.md new file mode 100644 index 0000000000..67ae04ecd5 --- /dev/null +++ b/src/internal/qs/README.md @@ -0,0 +1,3 @@ +# qs + +This is a vendored version of [neoqs](https://github.com/PuruVJ/neoqs) which is a TypeScript rewrite of [qs](https://github.com/ljharb/qs), a query string library. diff --git a/src/internal/qs/formats.ts b/src/internal/qs/formats.ts new file mode 100644 index 0000000000..1cf9e2cde5 --- /dev/null +++ b/src/internal/qs/formats.ts @@ -0,0 +1,9 @@ +import type { Format } from './types'; + +export const default_format: Format = 'RFC3986'; +export const formatters: Record string> = { + RFC1738: (v: PropertyKey) => String(v).replace(/%20/g, '+'), + RFC3986: (v: PropertyKey) => String(v), +}; +export const RFC1738 = 'RFC1738'; +export const RFC3986 = 'RFC3986'; diff --git a/src/internal/qs/index.ts b/src/internal/qs/index.ts new file mode 100644 index 0000000000..c3a3620d01 --- /dev/null +++ b/src/internal/qs/index.ts @@ -0,0 +1,13 @@ +import { default_format, formatters, RFC1738, RFC3986 } from './formats'; + +const formats = { + formatters, + RFC1738, + RFC3986, + default: default_format, +}; + +export { stringify } from './stringify'; +export { formats }; + +export type { DefaultDecoder, DefaultEncoder, Format, ParseOptions, StringifyOptions } from './types'; diff --git a/src/internal/qs/stringify.ts b/src/internal/qs/stringify.ts new file mode 100644 index 0000000000..67497561a4 --- /dev/null +++ b/src/internal/qs/stringify.ts @@ -0,0 +1,388 @@ +import { encode, is_buffer, maybe_map } from './utils'; +import { default_format, formatters } from './formats'; +import type { NonNullableProperties, StringifyOptions } from './types'; + +const has = Object.prototype.hasOwnProperty; + +const array_prefix_generators = { + brackets(prefix: PropertyKey) { + return String(prefix) + '[]'; + }, + comma: 'comma', + indices(prefix: PropertyKey, key: string) { + return String(prefix) + '[' + key + ']'; + }, + repeat(prefix: PropertyKey) { + return String(prefix); + }, +}; + +const is_array = Array.isArray; +const push = Array.prototype.push; +const push_to_array = function (arr: any[], value_or_array: any) { + push.apply(arr, is_array(value_or_array) ? value_or_array : [value_or_array]); +}; + +const to_ISO = Date.prototype.toISOString; + +const defaults = { + addQueryPrefix: false, + allowDots: false, + allowEmptyArrays: false, + arrayFormat: 'indices', + charset: 'utf-8', + charsetSentinel: false, + delimiter: '&', + encode: true, + encodeDotInKeys: false, + encoder: encode, + encodeValuesOnly: false, + format: default_format, + formatter: formatters[default_format], + /** @deprecated */ + indices: false, + serializeDate(date) { + return to_ISO.call(date); + }, + skipNulls: false, + strictNullHandling: false, +} as NonNullableProperties; + +function is_non_nullish_primitive(v: unknown): v is string | number | boolean | symbol | bigint { + return ( + typeof v === 'string' || + typeof v === 'number' || + typeof v === 'boolean' || + typeof v === 'symbol' || + typeof v === 'bigint' + ); +} + +const sentinel = {}; + +function inner_stringify( + object: any, + prefix: PropertyKey, + generateArrayPrefix: StringifyOptions['arrayFormat'] | ((prefix: string, key: string) => string), + commaRoundTrip: boolean, + allowEmptyArrays: boolean, + strictNullHandling: boolean, + skipNulls: boolean, + encodeDotInKeys: boolean, + encoder: StringifyOptions['encoder'], + filter: StringifyOptions['filter'], + sort: StringifyOptions['sort'], + allowDots: StringifyOptions['allowDots'], + serializeDate: StringifyOptions['serializeDate'], + format: StringifyOptions['format'], + formatter: StringifyOptions['formatter'], + encodeValuesOnly: boolean, + charset: StringifyOptions['charset'], + sideChannel: WeakMap, +) { + let obj = object; + + let tmp_sc = sideChannel; + let step = 0; + let find_flag = false; + while ((tmp_sc = tmp_sc.get(sentinel)) !== void undefined && !find_flag) { + // Where object last appeared in the ref tree + const pos = tmp_sc.get(object); + step += 1; + if (typeof pos !== 'undefined') { + if (pos === step) { + throw new RangeError('Cyclic object value'); + } else { + find_flag = true; // Break while + } + } + if (typeof tmp_sc.get(sentinel) === 'undefined') { + step = 0; + } + } + + if (typeof filter === 'function') { + obj = filter(prefix, obj); + } else if (obj instanceof Date) { + obj = serializeDate?.(obj); + } else if (generateArrayPrefix === 'comma' && is_array(obj)) { + obj = maybe_map(obj, function (value) { + if (value instanceof Date) { + return serializeDate?.(value); + } + return value; + }); + } + + if (obj === null) { + if (strictNullHandling) { + return encoder && !encodeValuesOnly ? + // @ts-expect-error + encoder(prefix, defaults.encoder, charset, 'key', format) + : prefix; + } + + obj = ''; + } + + if (is_non_nullish_primitive(obj) || is_buffer(obj)) { + if (encoder) { + const key_value = + encodeValuesOnly ? prefix + // @ts-expect-error + : encoder(prefix, defaults.encoder, charset, 'key', format); + return [ + formatter?.(key_value) + + '=' + + // @ts-expect-error + formatter?.(encoder(obj, defaults.encoder, charset, 'value', format)), + ]; + } + return [formatter?.(prefix) + '=' + formatter?.(String(obj))]; + } + + const values: string[] = []; + + if (typeof obj === 'undefined') { + return values; + } + + let obj_keys; + if (generateArrayPrefix === 'comma' && is_array(obj)) { + // we need to join elements in + if (encodeValuesOnly && encoder) { + // @ts-expect-error values only + obj = maybe_map(obj, encoder); + } + obj_keys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }]; + } else if (is_array(filter)) { + obj_keys = filter; + } else { + const keys = Object.keys(obj); + obj_keys = sort ? keys.sort(sort) : keys; + } + + const encoded_prefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix); + + const adjusted_prefix = + commaRoundTrip && is_array(obj) && obj.length === 1 ? encoded_prefix + '[]' : encoded_prefix; + + if (allowEmptyArrays && is_array(obj) && obj.length === 0) { + return adjusted_prefix + '[]'; + } + + for (let j = 0; j < obj_keys.length; ++j) { + const key = obj_keys[j]; + const value = + // @ts-ignore + typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key as any]; + + if (skipNulls && value === null) { + continue; + } + + // @ts-ignore + const encoded_key = allowDots && encodeDotInKeys ? (key as any).replace(/\./g, '%2E') : key; + const key_prefix = + is_array(obj) ? + typeof generateArrayPrefix === 'function' ? + generateArrayPrefix(adjusted_prefix, encoded_key) + : adjusted_prefix + : adjusted_prefix + (allowDots ? '.' + encoded_key : '[' + encoded_key + ']'); + + sideChannel.set(object, step); + const valueSideChannel = new WeakMap(); + valueSideChannel.set(sentinel, sideChannel); + push_to_array( + values, + inner_stringify( + value, + key_prefix, + generateArrayPrefix, + commaRoundTrip, + allowEmptyArrays, + strictNullHandling, + skipNulls, + encodeDotInKeys, + // @ts-ignore + generateArrayPrefix === 'comma' && encodeValuesOnly && is_array(obj) ? null : encoder, + filter, + sort, + allowDots, + serializeDate, + format, + formatter, + encodeValuesOnly, + charset, + valueSideChannel, + ), + ); + } + + return values; +} + +function normalize_stringify_options( + opts: StringifyOptions = defaults, +): NonNullableProperties> & { indices?: boolean } { + if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') { + throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided'); + } + + if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') { + throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided'); + } + + if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + + const charset = opts.charset || defaults.charset; + if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') { + throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined'); + } + + let format = default_format; + if (typeof opts.format !== 'undefined') { + if (!has.call(formatters, opts.format)) { + throw new TypeError('Unknown format option provided.'); + } + format = opts.format; + } + const formatter = formatters[format]; + + let filter = defaults.filter; + if (typeof opts.filter === 'function' || is_array(opts.filter)) { + filter = opts.filter; + } + + let arrayFormat: StringifyOptions['arrayFormat']; + if (opts.arrayFormat && opts.arrayFormat in array_prefix_generators) { + arrayFormat = opts.arrayFormat; + } else if ('indices' in opts) { + arrayFormat = opts.indices ? 'indices' : 'repeat'; + } else { + arrayFormat = defaults.arrayFormat; + } + + if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') { + throw new TypeError('`commaRoundTrip` must be a boolean, or absent'); + } + + const allowDots = + typeof opts.allowDots === 'undefined' ? + !!opts.encodeDotInKeys === true ? + true + : defaults.allowDots + : !!opts.allowDots; + + return { + addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix, + // @ts-ignore + allowDots: allowDots, + allowEmptyArrays: + typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays, + arrayFormat: arrayFormat, + charset: charset, + charsetSentinel: + typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel, + commaRoundTrip: !!opts.commaRoundTrip, + delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter, + encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode, + encodeDotInKeys: + typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys, + encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder, + encodeValuesOnly: + typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly, + filter: filter, + format: format, + formatter: formatter, + serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate, + skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls, + // @ts-ignore + sort: typeof opts.sort === 'function' ? opts.sort : null, + strictNullHandling: + typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling, + }; +} + +export function stringify(object: any, opts: StringifyOptions = {}) { + let obj = object; + const options = normalize_stringify_options(opts); + + let obj_keys: PropertyKey[] | undefined; + let filter; + + if (typeof options.filter === 'function') { + filter = options.filter; + obj = filter('', obj); + } else if (is_array(options.filter)) { + filter = options.filter; + obj_keys = filter; + } + + const keys: string[] = []; + + if (typeof obj !== 'object' || obj === null) { + return ''; + } + + const generateArrayPrefix = array_prefix_generators[options.arrayFormat]; + const commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip; + + if (!obj_keys) { + obj_keys = Object.keys(obj); + } + + if (options.sort) { + obj_keys.sort(options.sort); + } + + const sideChannel = new WeakMap(); + for (let i = 0; i < obj_keys.length; ++i) { + const key = obj_keys[i]!; + + if (options.skipNulls && obj[key] === null) { + continue; + } + push_to_array( + keys, + inner_stringify( + obj[key], + key, + // @ts-expect-error + generateArrayPrefix, + commaRoundTrip, + options.allowEmptyArrays, + options.strictNullHandling, + options.skipNulls, + options.encodeDotInKeys, + options.encode ? options.encoder : null, + options.filter, + options.sort, + options.allowDots, + options.serializeDate, + options.format, + options.formatter, + options.encodeValuesOnly, + options.charset, + sideChannel, + ), + ); + } + + const joined = keys.join(options.delimiter); + let prefix = options.addQueryPrefix === true ? '?' : ''; + + if (options.charsetSentinel) { + if (options.charset === 'iso-8859-1') { + // encodeURIComponent('✓'), the "numeric entity" representation of a checkmark + prefix += 'utf8=%26%2310003%3B&'; + } else { + // encodeURIComponent('✓') + prefix += 'utf8=%E2%9C%93&'; + } + } + + return joined.length > 0 ? prefix + joined : ''; +} diff --git a/src/internal/qs/types.ts b/src/internal/qs/types.ts new file mode 100644 index 0000000000..7c28dbb46f --- /dev/null +++ b/src/internal/qs/types.ts @@ -0,0 +1,71 @@ +export type Format = 'RFC1738' | 'RFC3986'; + +export type DefaultEncoder = (str: any, defaultEncoder?: any, charset?: string) => string; +export type DefaultDecoder = (str: string, decoder?: any, charset?: string) => string; + +export type BooleanOptional = boolean | undefined; + +export type StringifyBaseOptions = { + delimiter?: string; + allowDots?: boolean; + encodeDotInKeys?: boolean; + strictNullHandling?: boolean; + skipNulls?: boolean; + encode?: boolean; + encoder?: ( + str: any, + defaultEncoder: DefaultEncoder, + charset: string, + type: 'key' | 'value', + format?: Format, + ) => string; + filter?: Array | ((prefix: PropertyKey, value: any) => any); + arrayFormat?: 'indices' | 'brackets' | 'repeat' | 'comma'; + indices?: boolean; + sort?: ((a: PropertyKey, b: PropertyKey) => number) | null; + serializeDate?: (d: Date) => string; + format?: 'RFC1738' | 'RFC3986'; + formatter?: (str: PropertyKey) => string; + encodeValuesOnly?: boolean; + addQueryPrefix?: boolean; + charset?: 'utf-8' | 'iso-8859-1'; + charsetSentinel?: boolean; + allowEmptyArrays?: boolean; + commaRoundTrip?: boolean; +}; + +export type StringifyOptions = StringifyBaseOptions; + +export type ParseBaseOptions = { + comma?: boolean; + delimiter?: string | RegExp; + depth?: number | false; + decoder?: (str: string, defaultDecoder: DefaultDecoder, charset: string, type: 'key' | 'value') => any; + arrayLimit?: number; + parseArrays?: boolean; + plainObjects?: boolean; + allowPrototypes?: boolean; + allowSparse?: boolean; + parameterLimit?: number; + strictDepth?: boolean; + strictNullHandling?: boolean; + ignoreQueryPrefix?: boolean; + charset?: 'utf-8' | 'iso-8859-1'; + charsetSentinel?: boolean; + interpretNumericEntities?: boolean; + allowEmptyArrays?: boolean; + duplicates?: 'combine' | 'first' | 'last'; + allowDots?: boolean; + decodeDotInKeys?: boolean; +}; + +export type ParseOptions = ParseBaseOptions; + +export type ParsedQs = { + [key: string]: undefined | string | string[] | ParsedQs | ParsedQs[]; +}; + +// Type to remove null or undefined union from each property +export type NonNullableProperties = { + [K in keyof T]-?: Exclude; +}; diff --git a/src/internal/qs/utils.ts b/src/internal/qs/utils.ts new file mode 100644 index 0000000000..113b18fb9b --- /dev/null +++ b/src/internal/qs/utils.ts @@ -0,0 +1,265 @@ +import { RFC1738 } from './formats'; +import type { DefaultEncoder, Format } from './types'; + +const has = Object.prototype.hasOwnProperty; +const is_array = Array.isArray; + +const hex_table = (() => { + const array = []; + for (let i = 0; i < 256; ++i) { + array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase()); + } + + return array; +})(); + +function compact_queue>(queue: Array<{ obj: T; prop: string }>) { + while (queue.length > 1) { + const item = queue.pop(); + if (!item) continue; + + const obj = item.obj[item.prop]; + + if (is_array(obj)) { + const compacted: unknown[] = []; + + for (let j = 0; j < obj.length; ++j) { + if (typeof obj[j] !== 'undefined') { + compacted.push(obj[j]); + } + } + + // @ts-ignore + item.obj[item.prop] = compacted; + } + } +} + +function array_to_object(source: any[], options: { plainObjects: boolean }) { + const obj = options && options.plainObjects ? Object.create(null) : {}; + for (let i = 0; i < source.length; ++i) { + if (typeof source[i] !== 'undefined') { + obj[i] = source[i]; + } + } + + return obj; +} + +export function merge( + target: any, + source: any, + options: { plainObjects?: boolean; allowPrototypes?: boolean } = {}, +) { + if (!source) { + return target; + } + + if (typeof source !== 'object') { + if (is_array(target)) { + target.push(source); + } else if (target && typeof target === 'object') { + if ( + (options && (options.plainObjects || options.allowPrototypes)) || + !has.call(Object.prototype, source) + ) { + target[source] = true; + } + } else { + return [target, source]; + } + + return target; + } + + if (!target || typeof target !== 'object') { + return [target].concat(source); + } + + let mergeTarget = target; + if (is_array(target) && !is_array(source)) { + // @ts-ignore + mergeTarget = array_to_object(target, options); + } + + if (is_array(target) && is_array(source)) { + source.forEach(function (item, i) { + if (has.call(target, i)) { + const targetItem = target[i]; + if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') { + target[i] = merge(targetItem, item, options); + } else { + target.push(item); + } + } else { + target[i] = item; + } + }); + return target; + } + + return Object.keys(source).reduce(function (acc, key) { + const value = source[key]; + + if (has.call(acc, key)) { + acc[key] = merge(acc[key], value, options); + } else { + acc[key] = value; + } + return acc; + }, mergeTarget); +} + +export function assign_single_source(target: any, source: any) { + return Object.keys(source).reduce(function (acc, key) { + acc[key] = source[key]; + return acc; + }, target); +} + +export function decode(str: string, _: any, charset: string) { + const strWithoutPlus = str.replace(/\+/g, ' '); + if (charset === 'iso-8859-1') { + // unescape never throws, no try...catch needed: + return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape); + } + // utf-8 + try { + return decodeURIComponent(strWithoutPlus); + } catch (e) { + return strWithoutPlus; + } +} + +const limit = 1024; + +export const encode: ( + str: any, + defaultEncoder: DefaultEncoder, + charset: string, + type: 'key' | 'value', + format: Format, +) => string = (str, _defaultEncoder, charset, _kind, format: Format) => { + // This code was originally written by Brian White for the io.js core querystring library. + // It has been adapted here for stricter adherence to RFC 3986 + if (str.length === 0) { + return str; + } + + let string = str; + if (typeof str === 'symbol') { + string = Symbol.prototype.toString.call(str); + } else if (typeof str !== 'string') { + string = String(str); + } + + if (charset === 'iso-8859-1') { + return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) { + return '%26%23' + parseInt($0.slice(2), 16) + '%3B'; + }); + } + + let out = ''; + for (let j = 0; j < string.length; j += limit) { + const segment = string.length >= limit ? string.slice(j, j + limit) : string; + const arr = []; + + for (let i = 0; i < segment.length; ++i) { + let c = segment.charCodeAt(i); + if ( + c === 0x2d || // - + c === 0x2e || // . + c === 0x5f || // _ + c === 0x7e || // ~ + (c >= 0x30 && c <= 0x39) || // 0-9 + (c >= 0x41 && c <= 0x5a) || // a-z + (c >= 0x61 && c <= 0x7a) || // A-Z + (format === RFC1738 && (c === 0x28 || c === 0x29)) // ( ) + ) { + arr[arr.length] = segment.charAt(i); + continue; + } + + if (c < 0x80) { + arr[arr.length] = hex_table[c]; + continue; + } + + if (c < 0x800) { + arr[arr.length] = hex_table[0xc0 | (c >> 6)]! + hex_table[0x80 | (c & 0x3f)]; + continue; + } + + if (c < 0xd800 || c >= 0xe000) { + arr[arr.length] = + hex_table[0xe0 | (c >> 12)]! + hex_table[0x80 | ((c >> 6) & 0x3f)] + hex_table[0x80 | (c & 0x3f)]; + continue; + } + + i += 1; + c = 0x10000 + (((c & 0x3ff) << 10) | (segment.charCodeAt(i) & 0x3ff)); + + arr[arr.length] = + hex_table[0xf0 | (c >> 18)]! + + hex_table[0x80 | ((c >> 12) & 0x3f)] + + hex_table[0x80 | ((c >> 6) & 0x3f)] + + hex_table[0x80 | (c & 0x3f)]; + } + + out += arr.join(''); + } + + return out; +}; + +export function compact(value: any) { + const queue = [{ obj: { o: value }, prop: 'o' }]; + const refs = []; + + for (let i = 0; i < queue.length; ++i) { + const item = queue[i]; + // @ts-ignore + const obj = item.obj[item.prop]; + + const keys = Object.keys(obj); + for (let j = 0; j < keys.length; ++j) { + const key = keys[j]!; + const val = obj[key]; + if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) { + queue.push({ obj: obj, prop: key }); + refs.push(val); + } + } + } + + compact_queue(queue); + + return value; +} + +export function is_regexp(obj: any) { + return Object.prototype.toString.call(obj) === '[object RegExp]'; +} + +export function is_buffer(obj: any) { + if (!obj || typeof obj !== 'object') { + return false; + } + + return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj)); +} + +export function combine(a: any, b: any) { + return [].concat(a, b); +} + +export function maybe_map(val: T[], fn: (v: T) => T) { + if (is_array(val)) { + const mapped = []; + for (let i = 0; i < val.length; i += 1) { + mapped.push(fn(val[i]!)); + } + return mapped; + } + return fn(val); +} diff --git a/src/pagination.ts b/src/pagination.ts index bb8739c1d3..a5d9d1c3ef 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; @@ -188,7 +188,77 @@ export class CursorPagination extends AbstractPage implements Cursor return { params: { - cursor: cursor, + cursor, + }, + }; + } +} + +export interface CursorPaginationAfterResponse { + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; +} + +export namespace CursorPaginationAfterResponse { + export interface ResultInfo { + cursors?: ResultInfo.Cursors; + } + + export namespace ResultInfo { + export interface Cursors { + after?: string; + } + } +} + +export interface CursorPaginationAfterParams { + cursor?: string; +} + +export class CursorPaginationAfter + extends AbstractPage + implements CursorPaginationAfterResponse +{ + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; + + constructor( + client: APIClient, + response: Response, + body: CursorPaginationAfterResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.result = body.result || []; + this.result_info = body.result_info || {}; + } + + getPaginatedItems(): Item[] { + return this.result ?? []; + } + + // @deprecated Please use `nextPageInfo()` instead + nextPageParams(): Partial | null { + const info = this.nextPageInfo(); + if (!info) return null; + if ('params' in info) return info.params; + const params = Object.fromEntries(info.url.searchParams); + if (!Object.keys(params).length) return null; + return params; + } + + nextPageInfo(): PageInfo | null { + const cursor = this.result_info?.cursors?.after; + if (!cursor) { + return null; + } + + return { + params: { + cursor, }, }; } @@ -258,16 +328,18 @@ export class CursorLimitPagination return { params: { - cursor: cursor, + cursor, }, }; } } -export type SinglePageResponse = Item[]; +export interface SinglePageResponse { + result: Array; +} -export class SinglePage extends AbstractPage { - items: Array; +export class SinglePage extends AbstractPage implements SinglePageResponse { + result: Array; constructor( client: APIClient, @@ -277,11 +349,11 @@ export class SinglePage extends AbstractPage { ) { super(client, response, body, options); - this.items = body || []; + this.result = body.result || []; } getPaginatedItems(): Item[] { - return this.items ?? []; + return this.result ?? []; } // @deprecated Please use `nextPageInfo()` instead diff --git a/src/resource.ts b/src/resource.ts index 9c15d51119..c39f509c9a 100644 --- a/src/resource.ts +++ b/src/resource.ts @@ -1,8 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import type { Cloudflare } from './index'; -export class APIResource { +export abstract class APIResource { protected _client: Cloudflare; constructor(client: Cloudflare) { diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000000..b283d5781d --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts new file mode 100644 index 0000000000..d99f32381a --- /dev/null +++ b/src/resources/abuse-reports.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './abuse-reports/index'; diff --git a/src/resources/abuse-reports/abuse-reports.ts b/src/resources/abuse-reports/abuse-reports.ts new file mode 100644 index 0000000000..74df855364 --- /dev/null +++ b/src/resources/abuse-reports/abuse-reports.ts @@ -0,0 +1,1201 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as MitigationsAPI from './mitigations'; +import { + MitigationListParams, + MitigationListResponse, + MitigationListResponsesV4PagePagination, + MitigationReviewParams, + MitigationReviewResponse, + MitigationReviewResponsesSinglePage, + Mitigations, +} from './mitigations'; +import { V4PagePagination, type V4PagePaginationParams } from '../../pagination'; + +export class AbuseReports extends APIResource { + mitigations: MitigationsAPI.Mitigations = new MitigationsAPI.Mitigations(this._client); + + /** + * Submit the Abuse Report of a particular type + */ + create( + reportParam: string, + params: AbuseReportCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/abuse-reports/${reportParam}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AbuseReportCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List the abuse reports for a given account + */ + list( + params: AbuseReportListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/abuse-reports`, + AbuseReportListResponsesV4PagePagination, + { query, ...options }, + ); + } + + /** + * Retrieve the details of an abuse report. + */ + get( + reportParam: string, + params: AbuseReportGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/abuse-reports/${reportParam}`, options) as Core.APIPromise<{ + result: AbuseReportGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class AbuseReportListResponsesV4PagePagination extends V4PagePagination {} + +/** + * The result should be 'success' for successful response + */ +export type AbuseReportCreateResponse = string; + +export interface AbuseReportListResponse { + reports: Array; +} + +export namespace AbuseReportListResponse { + export interface Report { + /** + * Public facing ID of abuse report, aka abuse_rand. + */ + id: string; + + /** + * Creation date of report. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + cdate: string; + + /** + * Domain that relates to the report. + */ + domain: string; + + /** + * A summary of the mitigations related to this report. + */ + mitigation_summary: Report.MitigationSummary; + + /** + * An enum value that represents the status of an abuse record + */ + status: 'accepted' | 'in_review'; + + /** + * The abuse report type + */ + type: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; + + /** + * Justification for the report. + */ + justification?: string; + + /** + * Original work / Targeted brand in the alleged abuse. + */ + original_work?: string; + + /** + * Information about the submitter of the report. + */ + submitter?: Report.Submitter; + + urls?: Array; + } + + export namespace Report { + /** + * A summary of the mitigations related to this report. + */ + export interface MitigationSummary { + /** + * How many of the reported URLs were confirmed as abusive. + */ + accepted_url_count: number; + + /** + * How many mitigations are active. + */ + active_count: number; + + /** + * Whether the report has been forwarded to an external hosting provider. + */ + external_host_notified: boolean; + + /** + * How many mitigations are under review. + */ + in_review_count: number; + + /** + * How many mitigations are pending their effective date. + */ + pending_count: number; + } + + /** + * Information about the submitter of the report. + */ + export interface Submitter { + company?: string; + + email?: string; + + name?: string; + + telephone?: string; + } + } +} + +export interface AbuseReportGetResponse { + /** + * Public facing ID of abuse report, aka abuse_rand. + */ + id: string; + + /** + * Creation date of report. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + cdate: string; + + /** + * Domain that relates to the report. + */ + domain: string; + + /** + * A summary of the mitigations related to this report. + */ + mitigation_summary: AbuseReportGetResponse.MitigationSummary; + + /** + * An enum value that represents the status of an abuse record + */ + status: 'accepted' | 'in_review'; + + /** + * The abuse report type + */ + type: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; + + /** + * Justification for the report. + */ + justification?: string; + + /** + * Original work / Targeted brand in the alleged abuse. + */ + original_work?: string; + + /** + * Information about the submitter of the report. + */ + submitter?: AbuseReportGetResponse.Submitter; + + urls?: Array; +} + +export namespace AbuseReportGetResponse { + /** + * A summary of the mitigations related to this report. + */ + export interface MitigationSummary { + /** + * How many of the reported URLs were confirmed as abusive. + */ + accepted_url_count: number; + + /** + * How many mitigations are active. + */ + active_count: number; + + /** + * Whether the report has been forwarded to an external hosting provider. + */ + external_host_notified: boolean; + + /** + * How many mitigations are under review. + */ + in_review_count: number; + + /** + * How many mitigations are pending their effective date. + */ + pending_count: number; + } + + /** + * Information about the submitter of the report. + */ + export interface Submitter { + company?: string; + + email?: string; + + name?: string; + + telephone?: string; + } +} + +export type AbuseReportCreateParams = + | AbuseReportCreateParams.AbuseReportsDmcaReport + | AbuseReportCreateParams.AbuseReportsTrademarkReport + | AbuseReportCreateParams.AbuseReportsGeneralReport + | AbuseReportCreateParams.AbuseReportsPhishingReport + | AbuseReportCreateParams.AbuseReportsCsamReport + | AbuseReportCreateParams.AbuseReportsThreatReport + | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport + | AbuseReportCreateParams.AbuseReportsNcseiReport; + +export declare namespace AbuseReportCreateParams { + export interface AbuseReportsDmcaReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_dmca'; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + address1: string; + + /** + * Body param: The name of the copyright holder. Text not exceeding 60 characters. + * This field may be released by Cloudflare to third parties such as the Lumen + * Database (https://lumendatabase.org/). + */ + agent_name: string; + + /** + * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA + * reports + */ + agree: 1; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + city: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country: string; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Required for DMCA reports, should be same as Name. An affirmation + * that all information in the report is true and accurate while agreeing to the + * policies of Cloudflare's abuse reports + */ + signature: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + state: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsTrademarkReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_trademark'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send'; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_number: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_office: string; + + /** + * Body param: Text not exceeding 1000 characters + */ + trademark_symbol: string; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsGeneralReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_general'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of destination IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + destination_ips?: string; + + /** + * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. + * The total size of the field should not exceed 2000 characters. Each individual + * port/protocol should not exceed 100 characters. The list should not have more + * than 30 unique ports and protocols. + */ + ports_protocols?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of source IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. + */ + source_ips?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsPhishingReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_phishing'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsCsamReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_children'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + ncmec_notification: 'send' | 'send-anon'; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsThreatReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_threat'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsRegistrarWhoisReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_registrar_whois'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } + + export interface AbuseReportsNcseiReport { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: The report type for submitted reports. + */ + act: 'abuse_ncsei'; + + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send' | 'send-anon'; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: If the submitter is the target of NCSEI in the URLs of the abuse + * report. + */ + ncsei_subject_representation: boolean; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification: 'send' | 'send-anon' | 'none'; + + /** + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + + /** + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + tele?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + title?: string; + } +} + +export interface AbuseReportListParams extends V4PagePaginationParams { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Query param: Returns reports created after the specified date + */ + created_after?: string; + + /** + * Query param: Returns reports created before the specified date + */ + created_before?: string; + + /** + * Query param: Filter by domain name related to the abuse report + */ + domain?: string; + + /** + * Query param: Filter reports that have any mitigations in the given status. + */ + mitigation_status?: 'pending' | 'active' | 'in_review' | 'cancelled' | 'removed'; + + /** + * Query param: A property to sort by, followed by the order (id, cdate, domain, + * type, status) + */ + sort?: string; + + /** + * Query param: Filter by the status of the report. + */ + status?: 'accepted' | 'in_review'; + + /** + * Query param: Filter by the type of the report. + */ + type?: 'PHISH' | 'GEN' | 'THREAT' | 'DMCA' | 'EMER' | 'TM' | 'REG_WHO' | 'NCSEI' | 'NETWORK'; +} + +export interface AbuseReportGetParams { + /** + * Cloudflare Account ID + */ + account_id: string; +} + +AbuseReports.AbuseReportListResponsesV4PagePagination = AbuseReportListResponsesV4PagePagination; +AbuseReports.Mitigations = Mitigations; +AbuseReports.MitigationListResponsesV4PagePagination = MitigationListResponsesV4PagePagination; +AbuseReports.MitigationReviewResponsesSinglePage = MitigationReviewResponsesSinglePage; + +export declare namespace AbuseReports { + export { + type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportListResponse as AbuseReportListResponse, + type AbuseReportGetResponse as AbuseReportGetResponse, + AbuseReportListResponsesV4PagePagination as AbuseReportListResponsesV4PagePagination, + type AbuseReportCreateParams as AbuseReportCreateParams, + type AbuseReportListParams as AbuseReportListParams, + type AbuseReportGetParams as AbuseReportGetParams, + }; + + export { + Mitigations as Mitigations, + type MitigationListResponse as MitigationListResponse, + type MitigationReviewResponse as MitigationReviewResponse, + MitigationListResponsesV4PagePagination as MitigationListResponsesV4PagePagination, + MitigationReviewResponsesSinglePage as MitigationReviewResponsesSinglePage, + type MitigationListParams as MitigationListParams, + type MitigationReviewParams as MitigationReviewParams, + }; +} diff --git a/src/resources/abuse-reports/index.ts b/src/resources/abuse-reports/index.ts new file mode 100644 index 0000000000..ea6893efe5 --- /dev/null +++ b/src/resources/abuse-reports/index.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AbuseReports } from './abuse-reports'; +export { + MitigationListResponsesV4PagePagination, + MitigationReviewResponsesSinglePage, + Mitigations, + type MitigationListResponse, + type MitigationReviewResponse, + type MitigationListParams, + type MitigationReviewParams, +} from './mitigations'; diff --git a/src/resources/abuse-reports/mitigations.ts b/src/resources/abuse-reports/mitigations.ts new file mode 100644 index 0000000000..eae497cc57 --- /dev/null +++ b/src/resources/abuse-reports/mitigations.ts @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage, V4PagePagination, type V4PagePaginationParams } from '../../pagination'; + +export class Mitigations extends APIResource { + /** + * List mitigations done to remediate the abuse report. + */ + list( + reportId: string, + params: MitigationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/abuse-reports/${reportId}/mitigations`, + MitigationListResponsesV4PagePagination, + { query, ...options }, + ); + } + + /** + * Request a review for mitigations on an account. + */ + review( + reportId: string, + params: MitigationReviewParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...body } = params; + return this._client.getAPIList( + `/accounts/${account_id}/abuse-reports/${reportId}/mitigations/appeal`, + MitigationReviewResponsesSinglePage, + { body, method: 'post', ...options }, + ); + } +} + +export class MitigationListResponsesV4PagePagination extends V4PagePagination {} + +export class MitigationReviewResponsesSinglePage extends SinglePage {} + +export interface MitigationListResponse { + mitigations: Array; +} + +export namespace MitigationListResponse { + export interface Mitigation { + /** + * ID of remediation. + */ + id: string; + + /** + * Date when the mitigation will become active. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + effective_date: string; + + entity_id: string; + + entity_type: 'url_pattern' | 'account' | 'zone'; + + /** + * The status of a mitigation + */ + status: 'pending' | 'active' | 'in_review' | 'cancelled' | 'removed'; + + /** + * The type of mitigation + */ + type: + | 'legal_block' + | 'phishing_interstitial' + | 'network_block' + | 'rate_limit_cache' + | 'account_suspend' + | 'redirect_video_stream'; + } +} + +export interface MitigationReviewResponse { + /** + * ID of remediation. + */ + id: string; + + /** + * Date when the mitigation will become active. Time in RFC 3339 format + * (https://www.rfc-editor.org/rfc/rfc3339.html) + */ + effective_date: string; + + entity_id: string; + + entity_type: 'url_pattern' | 'account' | 'zone'; + + /** + * The status of a mitigation + */ + status: 'pending' | 'active' | 'in_review' | 'cancelled' | 'removed'; + + /** + * The type of mitigation + */ + type: + | 'legal_block' + | 'phishing_interstitial' + | 'network_block' + | 'rate_limit_cache' + | 'account_suspend' + | 'redirect_video_stream'; +} + +export interface MitigationListParams extends V4PagePaginationParams { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Query param: Returns mitigation that were dispatched after the given date + */ + effective_after?: string; + + /** + * Query param: Returns mitigations that were dispatched before the given date + */ + effective_before?: string; + + /** + * Query param: Filter by the type of entity the mitigation impacts. + */ + entity_type?: 'url_pattern' | 'account' | 'zone'; + + /** + * Query param: A property to sort by, followed by the order + */ + sort?: + | 'type,asc' + | 'type,desc' + | 'effective_date,asc' + | 'effective_date,desc' + | 'status,asc' + | 'status,desc' + | 'entity_type,asc' + | 'entity_type,desc'; + + /** + * Query param: Filter by the status of the mitigation. + */ + status?: 'pending' | 'active' | 'in_review' | 'cancelled' | 'removed'; + + /** + * Query param: Filter by the type of mitigation. This filter parameter can be + * specified multiple times to include multiple types of mitigations in the result + * set, e.g. ?type=rate_limit_cache&type=legal_block. + */ + type?: + | 'legal_block' + | 'phishing_interstitial' + | 'network_block' + | 'rate_limit_cache' + | 'account_suspend' + | 'redirect_video_stream'; +} + +export interface MitigationReviewParams { + /** + * Path param: Cloudflare Account ID + */ + account_id: string; + + /** + * Body param: List of mitigations to appeal. + */ + appeals: Array; +} + +export namespace MitigationReviewParams { + export interface Appeal { + /** + * ID of the mitigation to appeal. + */ + id: string; + + /** + * Reason why the customer is appealing. + */ + reason: 'removed' | 'misclassified'; + } +} + +Mitigations.MitigationListResponsesV4PagePagination = MitigationListResponsesV4PagePagination; +Mitigations.MitigationReviewResponsesSinglePage = MitigationReviewResponsesSinglePage; + +export declare namespace Mitigations { + export { + type MitigationListResponse as MitigationListResponse, + type MitigationReviewResponse as MitigationReviewResponse, + MitigationListResponsesV4PagePagination as MitigationListResponsesV4PagePagination, + MitigationReviewResponsesSinglePage as MitigationReviewResponsesSinglePage, + type MitigationListParams as MitigationListParams, + type MitigationReviewParams as MitigationReviewParams, + }; +} diff --git a/src/resources/accounts.ts b/src/resources/accounts.ts new file mode 100644 index 0000000000..b9db299140 --- /dev/null +++ b/src/resources/accounts.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './accounts/index'; diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 5d6439aeb9..b0bd48a836 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -1,64 +1,161 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { isRequestOptions } from 'cloudflare/core'; -import * as AccountsAPI from 'cloudflare/resources/accounts/accounts'; -import * as MembersAPI from 'cloudflare/resources/accounts/members'; -import * as RolesAPI from 'cloudflare/resources/accounts/roles'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; +import { APIResource } from '../../resource'; +import { isRequestOptions } from '../../core'; +import * as Core from '../../core'; +import * as MembersAPI from './members'; +import { + MemberCreateParams, + MemberDeleteParams, + MemberDeleteResponse, + MemberGetParams, + MemberListParams, + MemberUpdateParams, + Members, + Status, +} from './members'; +import * as RolesAPI from './roles'; +import { RoleGetParams, RoleListParams, Roles } from './roles'; +import * as SubscriptionsAPI from './subscriptions'; +import { + SubscriptionCreateParams, + SubscriptionDeleteParams, + SubscriptionDeleteResponse, + SubscriptionGetParams, + SubscriptionUpdateParams, + Subscriptions, +} from './subscriptions'; +import * as LogsAPI from './logs/logs'; +import { Logs } from './logs/logs'; +import * as TokensAPI from './tokens/tokens'; +import { + TokenCreateParams, + TokenCreateResponse, + TokenDeleteParams, + TokenDeleteResponse, + TokenGetParams, + TokenListParams, + TokenUpdateParams, + TokenVerifyParams, + TokenVerifyResponse, + Tokens, +} from './tokens/tokens'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; export class Accounts extends APIResource { members: MembersAPI.Members = new MembersAPI.Members(this._client); roles: RolesAPI.Roles = new RolesAPI.Roles(this._client); + subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client); + tokens: TokensAPI.Tokens = new TokensAPI.Tokens(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Create an account (only available for tenant admins at this time) + * + * @example + * ```ts + * const account = await client.accounts.create({ + * name: 'name', + * }); + * ``` + */ + create(body: AccountCreateParams, options?: Core.RequestOptions): Core.APIPromise { + return ( + this._client.post('/accounts', { body, ...options }) as Core.APIPromise<{ result: Account }> + )._thenUnwrap((obj) => obj.result); + } /** * Update an existing account. + * + * @example + * ```ts + * const account = await client.accounts.update({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'Demo Account', + * type: 'standard', + * }); + * ``` */ - update(params: AccountUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + update(params: AccountUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}`, { body, ...options }) as Core.APIPromise<{ - result: AccountUpdateResponse; + result: Account; }> )._thenUnwrap((obj) => obj.result); } /** * List all accounts you have ownership or verified access to. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const account of client.accounts.list()) { + * // ... + * } + * ``` */ list( query?: AccountListParams, options?: Core.RequestOptions, - ): Core.PagePromise; - list( - options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( query: AccountListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(query)) { return this.list({}, query); } - return this._client.getAPIList('/accounts', AccountListResponsesV4PagePaginationArray, { - query, - ...options, - }); + return this._client.getAPIList('/accounts', AccountsV4PagePaginationArray, { query, ...options }); + } + + /** + * Delete a specific account (only available for tenant admins at this time). This + * is a permanent operation that will delete any zones or other resources under the + * account + * + * @example + * ```ts + * const account = await client.accounts.delete({ + * account_id: 'account_id', + * }); + * ``` + */ + delete( + params: AccountDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}`, options) as Core.APIPromise<{ + result: AccountDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); } /** * Get information about a specific account that you are a member of. + * + * @example + * ```ts + * const account = await client.accounts.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ - get(params: AccountGetParams, options?: Core.RequestOptions): Core.APIPromise { + get(params: AccountGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( - this._client.get(`/accounts/${account_id}`, options) as Core.APIPromise<{ result: AccountGetResponse }> + this._client.get(`/accounts/${account_id}`, options) as Core.APIPromise<{ result: Account }> )._thenUnwrap((obj) => obj.result); } } -export class AccountListResponsesV4PagePaginationArray extends V4PagePaginationArray {} +export class AccountsV4PagePaginationArray extends V4PagePaginationArray {} export interface Account { /** @@ -71,11 +168,18 @@ export interface Account { */ name: string; + type: 'standard' | 'enterprise'; + /** * Timestamp for the creation of the account */ created_on?: string; + /** + * Parent container details + */ + managed_by?: Account.ManagedBy; + /** * Account settings */ @@ -83,57 +187,101 @@ export interface Account { } export namespace Account { + /** + * Parent container details + */ + export interface ManagedBy { + /** + * ID of the parent Organization, if one exists + */ + parent_org_id?: string; + + /** + * Name of the parent Organization, if one exists + */ + parent_org_name?: string; + } + /** * Account settings */ export interface Settings { /** - * Specifies the default nameservers to be used for new zones added to this - * account. - * - * - `cloudflare.standard` for Cloudflare-branded nameservers - * - `custom.account` for account custom nameservers - * - `custom.tenant` for tenant custom nameservers - * - * See - * [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) - * for more information. + * Sets an abuse contact email to notify for abuse reports. */ - default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant'; + abuse_contact_email?: string; /** * Indicates whether membership in this account requires that Two-Factor * Authentication is enabled */ enforce_twofactor?: boolean; - - /** - * @deprecated: Indicates whether new zones should use the account-level custom - * nameservers by default. - * - * Deprecated in favor of `default_nameservers`. - */ - use_account_custom_ns_by_default?: boolean; } } -export type AccountUpdateResponse = unknown | string | null; +export interface AccountDeleteResponse { + /** + * Identifier + */ + id: string; +} + +export interface AccountCreateParams { + /** + * Account name + */ + name: string; + + type?: 'standard' | 'enterprise'; -export type AccountListResponse = unknown; + /** + * information related to the tenant unit, and optionally, an id of the unit to + * create the account on. see + * https://developers.cloudflare.com/tenant/how-to/manage-accounts/ + */ + unit?: AccountCreateParams.Unit; +} -export type AccountGetResponse = unknown | string | null; +export namespace AccountCreateParams { + /** + * information related to the tenant unit, and optionally, an id of the unit to + * create the account on. see + * https://developers.cloudflare.com/tenant/how-to/manage-accounts/ + */ + export interface Unit { + /** + * Tenant unit ID + */ + id?: string; + } +} export interface AccountUpdateParams { /** - * Path param: + * Path param: Account identifier tag. */ - account_id: unknown; + account_id: string; + + /** + * Body param: Identifier + */ + id: string; /** * Body param: Account name */ name: string; + /** + * Body param + */ + type: 'standard' | 'enterprise'; + + /** + * Body param: Parent container details + */ + managed_by?: AccountUpdateParams.ManagedBy; + /** * Body param: Account settings */ @@ -141,37 +289,25 @@ export interface AccountUpdateParams { } export namespace AccountUpdateParams { + /** + * Parent container details + */ + export interface ManagedBy {} + /** * Account settings */ export interface Settings { /** - * Specifies the default nameservers to be used for new zones added to this - * account. - * - * - `cloudflare.standard` for Cloudflare-branded nameservers - * - `custom.account` for account custom nameservers - * - `custom.tenant` for tenant custom nameservers - * - * See - * [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) - * for more information. + * Sets an abuse contact email to notify for abuse reports. */ - default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant'; + abuse_contact_email?: string; /** * Indicates whether membership in this account requires that Two-Factor * Authentication is enabled */ enforce_twofactor?: boolean; - - /** - * @deprecated: Indicates whether new zones should use the account-level custom - * nameservers by default. - * - * Deprecated in favor of `default_nameservers`. - */ - use_account_custom_ns_by_default?: boolean; } } @@ -180,36 +316,80 @@ export interface AccountListParams extends V4PagePaginationArrayParams { * Direction to order results. */ direction?: 'asc' | 'desc'; + + /** + * Name of the account. + */ + name?: string; +} + +export interface AccountDeleteParams { + /** + * The account ID of the account to be deleted + */ + account_id: string; } export interface AccountGetParams { - account_id: unknown; + /** + * Account identifier tag. + */ + account_id: string; } -export namespace Accounts { - export import Account = AccountsAPI.Account; - export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; - export import AccountListResponse = AccountsAPI.AccountListResponse; - export import AccountGetResponse = AccountsAPI.AccountGetResponse; - export import AccountListResponsesV4PagePaginationArray = AccountsAPI.AccountListResponsesV4PagePaginationArray; - export import AccountUpdateParams = AccountsAPI.AccountUpdateParams; - export import AccountListParams = AccountsAPI.AccountListParams; - export import AccountGetParams = AccountsAPI.AccountGetParams; - export import Members = MembersAPI.Members; - export import AccountMember = MembersAPI.AccountMember; - export import AccountMemberWithID = MembersAPI.AccountMemberWithID; - export import MemberListResponse = MembersAPI.MemberListResponse; - export import MemberDeleteResponse = MembersAPI.MemberDeleteResponse; - export import MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray; - export import MemberCreateParams = MembersAPI.MemberCreateParams; - export import MemberUpdateParams = MembersAPI.MemberUpdateParams; - export import MemberListParams = MembersAPI.MemberListParams; - export import MemberDeleteParams = MembersAPI.MemberDeleteParams; - export import MemberGetParams = MembersAPI.MemberGetParams; - export import Roles = RolesAPI.Roles; - export import IamSchemasRole = RolesAPI.IamSchemasRole; - export import RoleListResponse = RolesAPI.RoleListResponse; - export import RoleGetResponse = RolesAPI.RoleGetResponse; - export import RoleListParams = RolesAPI.RoleListParams; - export import RoleGetParams = RolesAPI.RoleGetParams; +Accounts.AccountsV4PagePaginationArray = AccountsV4PagePaginationArray; +Accounts.Members = Members; +Accounts.Roles = Roles; +Accounts.Subscriptions = Subscriptions; +Accounts.Tokens = Tokens; +Accounts.Logs = Logs; + +export declare namespace Accounts { + export { + type Account as Account, + type AccountDeleteResponse as AccountDeleteResponse, + AccountsV4PagePaginationArray as AccountsV4PagePaginationArray, + type AccountCreateParams as AccountCreateParams, + type AccountUpdateParams as AccountUpdateParams, + type AccountListParams as AccountListParams, + type AccountDeleteParams as AccountDeleteParams, + type AccountGetParams as AccountGetParams, + }; + + export { + Members as Members, + type Status as Status, + type MemberDeleteResponse as MemberDeleteResponse, + type MemberCreateParams as MemberCreateParams, + type MemberUpdateParams as MemberUpdateParams, + type MemberListParams as MemberListParams, + type MemberDeleteParams as MemberDeleteParams, + type MemberGetParams as MemberGetParams, + }; + + export { Roles as Roles, type RoleListParams as RoleListParams, type RoleGetParams as RoleGetParams }; + + export { + Subscriptions as Subscriptions, + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, + }; + + export { + Tokens as Tokens, + type TokenCreateResponse as TokenCreateResponse, + type TokenDeleteResponse as TokenDeleteResponse, + type TokenVerifyResponse as TokenVerifyResponse, + type TokenCreateParams as TokenCreateParams, + type TokenUpdateParams as TokenUpdateParams, + type TokenListParams as TokenListParams, + type TokenDeleteParams as TokenDeleteParams, + type TokenGetParams as TokenGetParams, + type TokenVerifyParams as TokenVerifyParams, + }; + + export { Logs as Logs }; } diff --git a/src/resources/accounts/index.ts b/src/resources/accounts/index.ts index e615e043ff..ed7b422339 100644 --- a/src/resources/accounts/index.ts +++ b/src/resources/accounts/index.ts @@ -1,34 +1,35 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { Accounts } from './accounts'; +export { Logs } from './logs/index'; export { - Account, - AccountUpdateResponse, - AccountListResponse, - AccountGetResponse, - AccountUpdateParams, - AccountListParams, - AccountGetParams, - AccountListResponsesV4PagePaginationArray, - Accounts, -} from './accounts'; -export { - AccountMember, - AccountMemberWithID, - MemberListResponse, - MemberDeleteResponse, - MemberCreateParams, - MemberUpdateParams, - MemberListParams, - MemberDeleteParams, - MemberGetParams, - MemberListResponsesV4PagePaginationArray, Members, + type Status, + type MemberDeleteResponse, + type MemberCreateParams, + type MemberUpdateParams, + type MemberListParams, + type MemberDeleteParams, + type MemberGetParams, } from './members'; +export { Roles, type RoleListParams, type RoleGetParams } from './roles'; +export { + Subscriptions, + type SubscriptionDeleteResponse, + type SubscriptionCreateParams, + type SubscriptionUpdateParams, + type SubscriptionDeleteParams, + type SubscriptionGetParams, +} from './subscriptions'; export { - IamSchemasRole, - RoleListResponse, - RoleGetResponse, - RoleListParams, - RoleGetParams, - Roles, -} from './roles'; + Tokens, + type TokenCreateResponse, + type TokenDeleteResponse, + type TokenVerifyResponse, + type TokenCreateParams, + type TokenUpdateParams, + type TokenListParams, + type TokenDeleteParams, + type TokenGetParams, + type TokenVerifyParams, +} from './tokens/index'; diff --git a/src/resources/accounts/logs.ts b/src/resources/accounts/logs.ts new file mode 100644 index 0000000000..9d295478f1 --- /dev/null +++ b/src/resources/accounts/logs.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './logs/index'; diff --git a/src/resources/accounts/logs/audit.ts b/src/resources/accounts/logs/audit.ts new file mode 100644 index 0000000000..985eff5625 --- /dev/null +++ b/src/resources/accounts/logs/audit.ts @@ -0,0 +1,548 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; + +export class Audit extends APIResource { + /** + * Gets a list of audit logs for an account.

This is the beta release + * of Audit Logs Version 2. Since this is a beta version, there may be gaps or + * missing entries in the available audit logs. Be aware of the following + * limitations.
  • Audit logs are available only for the past 30 days. + *
  • Error handling is not yet implemented.
+ * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const auditListResponse of client.accounts.logs.audit.list( + * { + * account_id: 'a67e14daa5f8dceeb91fe5449ba496ef', + * before: '2024-10-31', + * since: '2024-10-30', + * }, + * )) { + * // ... + * } + * ``` + */ + list( + params: AuditListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/logs/audit`, + AuditListResponsesCursorPaginationAfter, + { query, ...options }, + ); + } +} + +export class AuditListResponsesCursorPaginationAfter extends CursorPaginationAfter {} + +export interface AuditListResponse { + /** + * A unique identifier for the audit log entry. + */ + id?: string; + + /** + * Contains account related information. + */ + account?: AuditListResponse.Account; + + /** + * Provides information about the action performed. + */ + action?: AuditListResponse.Action; + + /** + * Provides details about the actor who performed the action. + */ + actor?: AuditListResponse.Actor; + + /** + * Provides raw information about the request and response. + */ + raw?: AuditListResponse.Raw; + + /** + * Provides details about the affected resource. + */ + resource?: AuditListResponse.Resource; + + /** + * Provides details about the zone affected by the action. + */ + zone?: AuditListResponse.Zone; +} + +export namespace AuditListResponse { + /** + * Contains account related information. + */ + export interface Account { + /** + * A unique identifier for the account. + */ + id?: string; + + /** + * A string that identifies the account name. + */ + name?: string; + } + + /** + * Provides information about the action performed. + */ + export interface Action { + /** + * A short description of the action performed. + */ + description?: string; + + /** + * The result of the action, indicating success or failure. + */ + result?: string; + + /** + * A timestamp indicating when the action was logged. + */ + time?: string; + + /** + * A short string that describes the action that was performed. + */ + type?: string; + } + + /** + * Provides details about the actor who performed the action. + */ + export interface Actor { + /** + * The ID of the actor who performed the action. If a user performed the action, + * this will be their User ID. + */ + id?: string; + + context?: 'api_key' | 'api_token' | 'dash' | 'oauth' | 'origin_ca_key'; + + /** + * The email of the actor who performed the action. + */ + email?: string; + + /** + * The IP address of the request that performed the action. + */ + ip_address?: string; + + /** + * Filters by the API token ID when the actor context is an api_token. + */ + token_id?: string; + + /** + * Filters by the API token name when the actor context is an api_token. + */ + token_name?: string; + + /** + * The type of actor. + */ + type?: 'account' | 'cloudflare_admin' | 'system' | 'user'; + } + + /** + * Provides raw information about the request and response. + */ + export interface Raw { + /** + * The Cloudflare Ray ID for the request. + */ + cf_ray_id?: string; + + /** + * The HTTP method of the request. + */ + method?: string; + + /** + * The HTTP response status code returned by the API. + */ + status_code?: number; + + /** + * The URI of the request. + */ + uri?: string; + + /** + * The client's user agent string sent with the request. + */ + user_agent?: string; + } + + /** + * Provides details about the affected resource. + */ + export interface Resource { + /** + * The unique identifier for the affected resource. + */ + id?: string; + + /** + * The Cloudflare product associated with the resource. + */ + product?: string; + + request?: unknown; + + response?: unknown; + + /** + * The scope of the resource. + */ + scope?: unknown; + + /** + * The type of the resource. + */ + type?: string; + } + + /** + * Provides details about the zone affected by the action. + */ + export interface Zone { + /** + * A string that identifies the zone id. + */ + id?: string; + + /** + * A string that identifies the zone name. + */ + name?: string; + } +} + +export interface AuditListParams extends CursorPaginationAfterParams { + /** + * Path param: The unique id that identifies the account. + */ + account_id: string; + + /** + * Query param: Limits the returned results to logs older than the specified date. + * This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + * timestamp that conforms to RFC3339. + */ + before: string; + + /** + * Query param: Limits the returned results to logs newer than the specified date. + * This can be a date string 2019-04-30 (interpreted in UTC) or an absolute + * timestamp that conforms to RFC3339. + */ + since: string; + + /** + * Query param + */ + id?: AuditListParams.ID; + + /** + * Query param + */ + account_name?: AuditListParams.AccountName; + + /** + * Query param + */ + action_result?: AuditListParams.ActionResult; + + /** + * Query param + */ + action_type?: AuditListParams.ActionType; + + /** + * Query param + */ + actor_context?: AuditListParams.ActorContext; + + /** + * Query param + */ + actor_email?: AuditListParams.ActorEmail; + + /** + * Query param + */ + actor_id?: AuditListParams.ActorID; + + /** + * Query param + */ + actor_ip_address?: AuditListParams.ActorIPAddress; + + /** + * Query param + */ + actor_token_id?: AuditListParams.ActorTokenID; + + /** + * Query param + */ + actor_token_name?: AuditListParams.ActorTokenName; + + /** + * Query param + */ + actor_type?: AuditListParams.ActorType; + + /** + * Query param + */ + audit_log_id?: AuditListParams.AuditLogID; + + /** + * Query param: Sets sorting order. + */ + direction?: 'desc' | 'asc'; + + /** + * Query param: The number limits the objects to return. The cursor attribute may + * be used to iterate over the next batch of objects if there are more than the + * limit. + */ + limit?: number; + + /** + * Query param + */ + raw_cf_ray_id?: AuditListParams.RawCfRayID; + + /** + * Query param + */ + raw_method?: AuditListParams.RawMethod; + + /** + * Query param + */ + raw_status_code?: AuditListParams.RawStatusCode; + + /** + * Query param + */ + raw_uri?: AuditListParams.RawURI; + + /** + * Query param + */ + resource_id?: AuditListParams.ResourceID; + + /** + * Query param + */ + resource_product?: AuditListParams.ResourceProduct; + + /** + * Query param + */ + resource_scope?: AuditListParams.ResourceScope; + + /** + * Query param + */ + resource_type?: AuditListParams.ResourceType; + + /** + * Query param + */ + zone_id?: AuditListParams.ZoneID; + + /** + * Query param + */ + zone_name?: AuditListParams.ZoneName; +} + +export namespace AuditListParams { + export interface ID { + /** + * Filters out audit logs by their IDs. + */ + not?: Array; + } + + export interface AccountName { + /** + * Filters out audit logs by the account name. + */ + not?: Array; + } + + export interface ActionResult { + /** + * Filters out audit logs by whether the action was successful or not. + */ + not?: Array<'success' | 'failure'>; + } + + export interface ActionType { + /** + * Filters out audit logs by the action type. + */ + not?: Array<'create' | 'delete' | 'view' | 'update'>; + } + + export interface ActorContext { + /** + * Filters out audit logs by the actor context. + */ + not?: Array<'api_key' | 'api_token' | 'dash' | 'oauth' | 'origin_ca_key'>; + } + + export interface ActorEmail { + /** + * Filters out audit logs by the actor's email address. + */ + not?: Array; + } + + export interface ActorID { + /** + * Filters out audit logs by the actor ID. This can be either the Account ID or + * User ID. + */ + not?: Array; + } + + export interface ActorIPAddress { + /** + * Filters out audit logs IP address where the action was initiated. + */ + not?: Array; + } + + export interface ActorTokenID { + /** + * Filters out audit logs by the API token ID when the actor context is an + * api_token or oauth. + */ + not?: Array; + } + + export interface ActorTokenName { + /** + * Filters out audit logs by the API token name when the actor context is an + * api_token or oauth. + */ + not?: Array; + } + + export interface ActorType { + /** + * Filters out audit logs by the actor type. + */ + not?: Array<'account' | 'cloudflare_admin' | 'system' | 'user'>; + } + + export interface AuditLogID { + /** + * @deprecated Filters out audit logs by their IDs. + */ + not?: Array; + } + + export interface RawCfRayID { + /** + * Filters out audit logs by the response CF Ray ID. + */ + not?: Array; + } + + export interface RawMethod { + /** + * Filters out audit logs by the HTTP method for the API call. + */ + not?: Array; + } + + export interface RawStatusCode { + /** + * Filters out audit logs by the response status code that was returned. + */ + not?: Array; + } + + export interface RawURI { + /** + * Filters out audit logs by the request URI. + */ + not?: Array; + } + + export interface ResourceID { + /** + * Filters out audit logs by the resource ID. + */ + not?: Array; + } + + export interface ResourceProduct { + /** + * Filters out audit logs by the Cloudflare product associated with the changed + * resource. + */ + not?: Array; + } + + export interface ResourceScope { + /** + * Filters out audit logs by the resource scope, specifying whether the resource is + * associated with an user, an account, or a zone. + */ + not?: Array<'accounts' | 'user' | 'zones'>; + } + + export interface ResourceType { + /** + * Filters out audit logs based on the unique type of resource changed by the + * action. + */ + not?: Array; + } + + export interface ZoneID { + /** + * Filters out audit logs by the zone ID. + */ + not?: Array; + } + + export interface ZoneName { + /** + * Filters out audit logs by the zone name associated with the change. + */ + not?: Array; + } +} + +Audit.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; + +export declare namespace Audit { + export { + type AuditListResponse as AuditListResponse, + AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, + type AuditListParams as AuditListParams, + }; +} diff --git a/src/resources/accounts/logs/index.ts b/src/resources/accounts/logs/index.ts new file mode 100644 index 0000000000..4252e744ab --- /dev/null +++ b/src/resources/accounts/logs/index.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + AuditListResponsesCursorPaginationAfter, + Audit, + type AuditListResponse, + type AuditListParams, +} from './audit'; +export { Logs } from './logs'; diff --git a/src/resources/accounts/logs/logs.ts b/src/resources/accounts/logs/logs.ts new file mode 100644 index 0000000000..ae9cf0f885 --- /dev/null +++ b/src/resources/accounts/logs/logs.ts @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as AuditAPI from './audit'; +import { Audit, AuditListParams, AuditListResponse, AuditListResponsesCursorPaginationAfter } from './audit'; + +export class Logs extends APIResource { + audit: AuditAPI.Audit = new AuditAPI.Audit(this._client); +} + +Logs.Audit = Audit; +Logs.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; + +export declare namespace Logs { + export { + Audit as Audit, + type AuditListResponse as AuditListResponse, + AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, + type AuditListParams as AuditListParams, + }; +} diff --git a/src/resources/accounts/members.ts b/src/resources/accounts/members.ts index 04e0511da6..0f459f02a5 100644 --- a/src/resources/accounts/members.ts +++ b/src/resources/accounts/members.ts @@ -1,58 +1,92 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as MembersAPI from 'cloudflare/resources/accounts/members'; -import * as RolesAPI from 'cloudflare/resources/accounts/roles'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import { MembersV4PagePaginationArray } from '../shared'; +import { type V4PagePaginationArrayParams } from '../../pagination'; export class Members extends APIResource { /** * Add a user to the list of members for this account. + * + * @example + * ```ts + * const member = await client.accounts.members.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * email: 'user@example.com', + * roles: ['3536bcfad5faccb999b47003c79917fb'], + * }); + * ``` */ - create(params: MemberCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: MemberCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/members`, { body, ...options }) as Core.APIPromise<{ - result: AccountMemberWithID; + result: Shared.Member; }> )._thenUnwrap((obj) => obj.result); } /** * Modify an account member. + * + * @example + * ```ts + * const member = await client.accounts.members.update( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ update( memberId: string, params: MemberUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/members/${memberId}`, { body, ...options, - }) as Core.APIPromise<{ result: AccountMember }> + }) as Core.APIPromise<{ result: Shared.Member }> )._thenUnwrap((obj) => obj.result); } /** * List all members of an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const member of client.accounts.members.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` */ list( params: MemberListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/members`, - MemberListResponsesV4PagePaginationArray, - { query, ...options }, - ); + return this._client.getAPIList(`/accounts/${account_id}/members`, MembersV4PagePaginationArray, { + query, + ...options, + }); } /** * Remove a member from an account. + * + * @example + * ```ts + * const member = await client.accounts.members.delete( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( memberId: string, @@ -69,444 +103,212 @@ export class Members extends APIResource { /** * Get information about a specific member of an account. + * + * @example + * ```ts + * const member = await client.accounts.members.get( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( memberId: string, params: MemberGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/members/${memberId}`, options) as Core.APIPromise<{ - result: AccountMember; + result: Shared.Member; }> )._thenUnwrap((obj) => obj.result); } } -export class MemberListResponsesV4PagePaginationArray extends V4PagePaginationArray {} +/** + * Whether the user is a member of the organization or has an invitation pending. + */ +export type Status = 'member' | 'invited'; -export interface AccountMember { +export interface MemberDeleteResponse { /** - * Membership identifier tag. + * Identifier */ id: string; - - /** - * Roles assigned to this member. - */ - roles: Array; - - status: unknown; - - user: AccountMember.User; } -export namespace AccountMember { - export interface Role { - /** - * Role identifier tag. - */ - id: string; +export type MemberCreateParams = + | MemberCreateParams.IAMCreateMemberWithRoles + | MemberCreateParams.IAMCreateMemberWithPolicies; +export declare namespace MemberCreateParams { + export interface IAMCreateMemberWithRoles { /** - * Description of role's permissions. + * Path param: Account identifier tag. */ - description: string; + account_id: string; /** - * Role name. - */ - name: string; - - permissions: Role.Permissions; - } - - export namespace Role { - export interface Permissions { - analytics?: Permissions.Analytics; - - billing?: Permissions.Billing; - - cache_purge?: Permissions.CachePurge; - - dns?: Permissions.DNS; - - dns_records?: Permissions.DNSRecords; - - lb?: Permissions.Lb; - - logs?: Permissions.Logs; - - organization?: Permissions.Organization; - - ssl?: Permissions.SSL; - - waf?: Permissions.WAF; - - zone_settings?: Permissions.ZoneSettings; - - zones?: Permissions.Zones; - } - - export namespace Permissions { - export interface Analytics { - read?: boolean; - - write?: boolean; - } - - export interface Billing { - read?: boolean; - - write?: boolean; - } - - export interface CachePurge { - read?: boolean; - - write?: boolean; - } - - export interface DNS { - read?: boolean; - - write?: boolean; - } - - export interface DNSRecords { - read?: boolean; - - write?: boolean; - } - - export interface Lb { - read?: boolean; - - write?: boolean; - } - - export interface Logs { - read?: boolean; - - write?: boolean; - } - - export interface Organization { - read?: boolean; - - write?: boolean; - } - - export interface SSL { - read?: boolean; - - write?: boolean; - } - - export interface WAF { - read?: boolean; - - write?: boolean; - } - - export interface ZoneSettings { - read?: boolean; - - write?: boolean; - } - - export interface Zones { - read?: boolean; - - write?: boolean; - } - } - } - - export interface User { - /** - * The contact email address of the user. + * Body param: The contact email address of the user. */ email: string; /** - * Identifier + * Body param: Array of roles associated with this member. */ - id?: string; + roles: Array; /** - * User's first name + * Body param: Status of the member invitation. If not provided during creation, + * defaults to 'pending'. Changing from 'accepted' back to 'pending' will trigger a + * replacement of the member resource in Terraform. */ - first_name?: string | null; + status?: 'accepted' | 'pending'; + } + export interface IAMCreateMemberWithPolicies { /** - * User's last name + * Path param: Account identifier tag. */ - last_name?: string | null; + account_id: string; /** - * Indicates whether two-factor authentication is enabled for the user account. - * Does not apply to API authentication. + * Body param: The contact email address of the user. */ - two_factor_authentication_enabled?: boolean; - } -} - -export interface AccountMemberWithID { - /** - * Membership identifier tag. - */ - id: string; - - /** - * Roles assigned to this member. - */ - roles: Array; - - status: unknown; - - user: AccountMemberWithID.User; - - /** - * The unique activation code for the account membership. - */ - code?: string; -} - -export namespace AccountMemberWithID { - export interface Role { - /** - * Role identifier tag. - */ - id: string; + email: string; /** - * Description of role's permissions. + * Body param: Array of policies associated with this member. */ - description: string; + policies: Array; /** - * Role name. + * Body param: Status of the member invitation. If not provided during creation, + * defaults to 'pending'. Changing from 'accepted' back to 'pending' will trigger a + * replacement of the member resource in Terraform. */ - name: string; - - permissions: Role.Permissions; + status?: 'accepted' | 'pending'; } - export namespace Role { - export interface Permissions { - analytics?: Permissions.Analytics; - - billing?: Permissions.Billing; - - cache_purge?: Permissions.CachePurge; - - dns?: Permissions.DNS; - - dns_records?: Permissions.DNSRecords; - - lb?: Permissions.Lb; - - logs?: Permissions.Logs; - - organization?: Permissions.Organization; - - ssl?: Permissions.SSL; - - waf?: Permissions.WAF; - - zone_settings?: Permissions.ZoneSettings; - - zones?: Permissions.Zones; + export namespace IAMCreateMemberWithPolicies { + export interface Policy { + /** + * Allow or deny operations against the resources. + */ + access: 'allow' | 'deny'; + + /** + * A set of permission groups that are specified to the policy. + */ + permission_groups: Array; + + /** + * A list of resource groups that the policy applies to. + */ + resource_groups: Array; } - export namespace Permissions { - export interface Analytics { - read?: boolean; - - write?: boolean; - } - - export interface Billing { - read?: boolean; - - write?: boolean; - } - - export interface CachePurge { - read?: boolean; - - write?: boolean; - } - - export interface DNS { - read?: boolean; - - write?: boolean; + export namespace Policy { + /** + * A group of permissions. + */ + export interface PermissionGroup { + /** + * Identifier of the group. + */ + id: string; } - export interface DNSRecords { - read?: boolean; - - write?: boolean; - } - - export interface Lb { - read?: boolean; - - write?: boolean; - } - - export interface Logs { - read?: boolean; - - write?: boolean; - } - - export interface Organization { - read?: boolean; - - write?: boolean; - } - - export interface SSL { - read?: boolean; - - write?: boolean; - } - - export interface WAF { - read?: boolean; - - write?: boolean; - } - - export interface ZoneSettings { - read?: boolean; - - write?: boolean; - } - - export interface Zones { - read?: boolean; - - write?: boolean; + /** + * A group of scoped resources. + */ + export interface ResourceGroup { + /** + * Identifier of the group. + */ + id: string; } } } +} - export interface User { - /** - * The contact email address of the user. - */ - email: string; +export type MemberUpdateParams = + | MemberUpdateParams.IAMUpdateMemberWithRoles + | MemberUpdateParams.IAMUpdateMemberWithPolicies; +export declare namespace MemberUpdateParams { + export interface IAMUpdateMemberWithRoles { /** - * Identifier + * Path param: Account identifier tag. */ - id?: string; + account_id: string; /** - * User's first name + * Body param: Roles assigned to this member. */ - first_name?: string | null; + roles?: Array; + } + export interface IAMUpdateMemberWithPolicies { /** - * User's last name + * Path param: Account identifier tag. */ - last_name?: string | null; + account_id: string; /** - * Indicates whether two-factor authentication is enabled for the user account. - * Does not apply to API authentication. + * Body param: Array of policies associated with this member. */ - two_factor_authentication_enabled?: boolean; + policies: Array; } -} - -export interface MemberListResponse { - /** - * Identifier - */ - id: string; - - /** - * The contact email address of the user. - */ - email: string; - - /** - * Member Name. - */ - name: string | null; - - /** - * Roles assigned to this Member. - */ - roles: Array; - - /** - * A member's status in the organization. - */ - status: 'accepted' | 'invited'; -} - -export interface MemberDeleteResponse { - /** - * Identifier - */ - id: string; -} - -export interface MemberCreateParams { - /** - * Path param: - */ - account_id: unknown; - - /** - * Body param: The contact email address of the user. - */ - email: string; - /** - * Body param: Array of roles associated with this member. - */ - roles: Array; - - /** - * Body param: - */ - status?: 'accepted' | 'pending'; -} - -export interface MemberUpdateParams { - /** - * Path param: - */ - account_id: unknown; + export namespace IAMUpdateMemberWithPolicies { + export interface Policy { + /** + * Allow or deny operations against the resources. + */ + access: 'allow' | 'deny'; + + /** + * A set of permission groups that are specified to the policy. + */ + permission_groups: Array; + + /** + * A list of resource groups that the policy applies to. + */ + resource_groups: Array; + } - /** - * Body param: Roles assigned to this member. - */ - roles: Array; -} + export namespace Policy { + /** + * A group of permissions. + */ + export interface PermissionGroup { + /** + * Identifier of the group. + */ + id: string; + } -export namespace MemberUpdateParams { - export interface Role { - /** - * Role identifier tag. - */ - id: string; + /** + * A group of scoped resources. + */ + export interface ResourceGroup { + /** + * Identifier of the group. + */ + id: string; + } + } } } export interface MemberListParams extends V4PagePaginationArrayParams { /** - * Path param: + * Path param: Account identifier tag. */ - account_id: unknown; + account_id: string; /** * Query param: Direction to order results. @@ -525,22 +327,29 @@ export interface MemberListParams extends V4PagePaginationArrayParams { } export interface MemberDeleteParams { - account_id: unknown; + /** + * Account identifier tag. + */ + account_id: string; } export interface MemberGetParams { - account_id: unknown; + /** + * Account identifier tag. + */ + account_id: string; } -export namespace Members { - export import AccountMember = MembersAPI.AccountMember; - export import AccountMemberWithID = MembersAPI.AccountMemberWithID; - export import MemberListResponse = MembersAPI.MemberListResponse; - export import MemberDeleteResponse = MembersAPI.MemberDeleteResponse; - export import MemberListResponsesV4PagePaginationArray = MembersAPI.MemberListResponsesV4PagePaginationArray; - export import MemberCreateParams = MembersAPI.MemberCreateParams; - export import MemberUpdateParams = MembersAPI.MemberUpdateParams; - export import MemberListParams = MembersAPI.MemberListParams; - export import MemberDeleteParams = MembersAPI.MemberDeleteParams; - export import MemberGetParams = MembersAPI.MemberGetParams; +export declare namespace Members { + export { + type Status as Status, + type MemberDeleteResponse as MemberDeleteResponse, + type MemberCreateParams as MemberCreateParams, + type MemberUpdateParams as MemberUpdateParams, + type MemberListParams as MemberListParams, + type MemberDeleteParams as MemberDeleteParams, + type MemberGetParams as MemberGetParams, + }; } + +export { MembersV4PagePaginationArray }; diff --git a/src/resources/accounts/roles.ts b/src/resources/accounts/roles.ts index e1fa24945c..c69d81fdd6 100644 --- a/src/resources/accounts/roles.ts +++ b/src/resources/accounts/roles.ts @@ -1,77 +1,73 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as RolesAPI from 'cloudflare/resources/accounts/roles'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import { RolesV4PagePaginationArray } from '../shared'; +import { type V4PagePaginationArrayParams } from '../../pagination'; export class Roles extends APIResource { /** * Get all available roles for an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const role of client.accounts.roles.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` */ - list(params: RoleListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/roles`, options) as Core.APIPromise<{ - result: RoleListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); + list( + params: RoleListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList(`/accounts/${account_id}/roles`, RolesV4PagePaginationArray, { + query, + ...options, + }); } /** * Get information about a specific role for an account. + * + * @example + * ```ts + * const role = await client.accounts.roles.get( + * '3536bcfad5faccb999b47003c79917fb', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ - get( - roleId: unknown, - params: RoleGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(roleId: string, params: RoleGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( this._client.get(`/accounts/${account_id}/roles/${roleId}`, options) as Core.APIPromise<{ - result: RoleGetResponse; + result: Shared.Role; }> )._thenUnwrap((obj) => obj.result); } } -export interface IamSchemasRole { - /** - * Role identifier tag. - */ - id: string; - - /** - * Description of role's permissions. - */ - description: string; - +export interface RoleListParams extends V4PagePaginationArrayParams { /** - * Role Name. + * Path param: Account identifier tag. */ - name: string; + account_id: string; +} +export interface RoleGetParams { /** - * Access permissions for this User. + * Account identifier tag. */ - permissions: Array; -} - -export type RoleListResponse = Array; - -export type RoleGetResponse = unknown | string | null; - -export interface RoleListParams { - account_id: unknown; + account_id: string; } -export interface RoleGetParams { - account_id: unknown; +export declare namespace Roles { + export { type RoleListParams as RoleListParams, type RoleGetParams as RoleGetParams }; } -export namespace Roles { - export import IamSchemasRole = RolesAPI.IamSchemasRole; - export import RoleListResponse = RolesAPI.RoleListResponse; - export import RoleGetResponse = RolesAPI.RoleGetResponse; - export import RoleListParams = RolesAPI.RoleListParams; - export import RoleGetParams = RolesAPI.RoleGetParams; -} +export { RolesV4PagePaginationArray }; diff --git a/src/resources/accounts/subscriptions.ts b/src/resources/accounts/subscriptions.ts new file mode 100644 index 0000000000..7ddeb5e440 --- /dev/null +++ b/src/resources/accounts/subscriptions.ts @@ -0,0 +1,171 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as Shared from '../shared'; +import { SubscriptionsSinglePage } from '../shared'; + +export class Subscriptions extends APIResource { + /** + * Creates an account subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: SubscriptionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/subscriptions`, { body, ...options }) as Core.APIPromise<{ + result: Shared.Subscription; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates an account subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.update( + * '506e3185e9c882d175a2d0cb0093d9f2', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + subscriptionIdentifier: string, + params: SubscriptionUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/subscriptions/${subscriptionIdentifier}`, { + body, + ...options, + }) as Core.APIPromise<{ result: Shared.Subscription }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Deletes an account's subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.delete( + * '506e3185e9c882d175a2d0cb0093d9f2', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + subscriptionIdentifier: string, + params: SubscriptionDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/subscriptions/${subscriptionIdentifier}`, + options, + ) as Core.APIPromise<{ result: SubscriptionDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Lists all of an account's subscriptions. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscription of client.accounts.subscriptions.get( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + get( + params: SubscriptionGetParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList(`/accounts/${account_id}/subscriptions`, SubscriptionsSinglePage, options); + } +} + +export interface SubscriptionDeleteResponse { + /** + * Subscription identifier tag. + */ + subscription_id?: string; +} + +export interface SubscriptionCreateParams { + /** + * Path param: Identifier + */ + account_id: string; + + /** + * Body param: How often the subscription is renewed automatically. + */ + frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; + + /** + * Body param: The rate plan applied to the subscription. + */ + rate_plan?: Shared.RatePlanParam; +} + +export interface SubscriptionUpdateParams { + /** + * Path param: Identifier + */ + account_id: string; + + /** + * Body param: How often the subscription is renewed automatically. + */ + frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; + + /** + * Body param: The rate plan applied to the subscription. + */ + rate_plan?: Shared.RatePlanParam; +} + +export interface SubscriptionDeleteParams { + /** + * Identifier + */ + account_id: string; +} + +export interface SubscriptionGetParams { + /** + * Identifier + */ + account_id: string; +} + +export declare namespace Subscriptions { + export { + type SubscriptionDeleteResponse as SubscriptionDeleteResponse, + type SubscriptionCreateParams as SubscriptionCreateParams, + type SubscriptionUpdateParams as SubscriptionUpdateParams, + type SubscriptionDeleteParams as SubscriptionDeleteParams, + type SubscriptionGetParams as SubscriptionGetParams, + }; +} + +export { SubscriptionsSinglePage }; diff --git a/src/resources/accounts/tokens.ts b/src/resources/accounts/tokens.ts new file mode 100644 index 0000000000..9363aa3c98 --- /dev/null +++ b/src/resources/accounts/tokens.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './tokens/index'; diff --git a/src/resources/accounts/tokens/index.ts b/src/resources/accounts/tokens/index.ts new file mode 100644 index 0000000000..e1bfa11013 --- /dev/null +++ b/src/resources/accounts/tokens/index.ts @@ -0,0 +1,23 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + PermissionGroupListResponsesSinglePage, + PermissionGroups, + type PermissionGroupListResponse, + type PermissionGroupGetResponse, + type PermissionGroupListParams, + type PermissionGroupGetParams, +} from './permission-groups'; +export { + Tokens, + type TokenCreateResponse, + type TokenDeleteResponse, + type TokenVerifyResponse, + type TokenCreateParams, + type TokenUpdateParams, + type TokenListParams, + type TokenDeleteParams, + type TokenGetParams, + type TokenVerifyParams, +} from './tokens'; +export { Value, type ValueUpdateParams } from './value'; diff --git a/src/resources/accounts/tokens/permission-groups.ts b/src/resources/accounts/tokens/permission-groups.ts new file mode 100644 index 0000000000..68df6328d8 --- /dev/null +++ b/src/resources/accounts/tokens/permission-groups.ts @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class PermissionGroups extends APIResource { + /** + * Find all available permission groups for Account Owned API Tokens + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const permissionGroupListResponse of client.accounts.tokens.permissionGroups.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: PermissionGroupListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/tokens/permission_groups`, + PermissionGroupListResponsesSinglePage, + { query, ...options }, + ); + } + + /** + * Find all available permission groups for Account Owned API Tokens + * + * @example + * ```ts + * const permissionGroups = + * await client.accounts.tokens.permissionGroups.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: PermissionGroupGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/tokens/permission_groups`, { + query, + ...options, + }) as Core.APIPromise<{ result: PermissionGroupGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class PermissionGroupListResponsesSinglePage extends SinglePage {} + +export interface PermissionGroupListResponse { + /** + * Public ID. + */ + id?: string; + + /** + * Permission Group Name + */ + name?: string; + + /** + * Resources to which the Permission Group is scoped + */ + scopes?: Array< + | 'com.cloudflare.api.account' + | 'com.cloudflare.api.account.zone' + | 'com.cloudflare.api.user' + | 'com.cloudflare.edge.r2.bucket' + >; +} + +export type PermissionGroupGetResponse = Array; + +export namespace PermissionGroupGetResponse { + export interface PermissionGroupGetResponseItem { + /** + * Public ID. + */ + id?: string; + + /** + * Permission Group Name + */ + name?: string; + + /** + * Resources to which the Permission Group is scoped + */ + scopes?: Array< + | 'com.cloudflare.api.account' + | 'com.cloudflare.api.account.zone' + | 'com.cloudflare.api.user' + | 'com.cloudflare.edge.r2.bucket' + >; + } +} + +export interface PermissionGroupListParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Query param: Filter by the name of the permission group. The value must be + * URL-encoded. + */ + name?: string; + + /** + * Query param: Filter by the scope of the permission group. The value must be + * URL-encoded. + */ + scope?: string; +} + +export interface PermissionGroupGetParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Query param: Filter by the name of the permission group. The value must be + * URL-encoded. + */ + name?: string; + + /** + * Query param: Filter by the scope of the permission group. The value must be + * URL-encoded. + */ + scope?: string; +} + +PermissionGroups.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage; + +export declare namespace PermissionGroups { + export { + type PermissionGroupListResponse as PermissionGroupListResponse, + type PermissionGroupGetResponse as PermissionGroupGetResponse, + PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, + type PermissionGroupListParams as PermissionGroupListParams, + type PermissionGroupGetParams as PermissionGroupGetParams, + }; +} diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts new file mode 100644 index 0000000000..f5d2cf3575 --- /dev/null +++ b/src/resources/accounts/tokens/tokens.ts @@ -0,0 +1,477 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as Shared from '../../shared'; +import { TokensV4PagePaginationArray } from '../../shared'; +import * as PermissionGroupsAPI from './permission-groups'; +import { + PermissionGroupGetParams, + PermissionGroupGetResponse, + PermissionGroupListParams, + PermissionGroupListResponse, + PermissionGroupListResponsesSinglePage, + PermissionGroups, +} from './permission-groups'; +import * as ValueAPI from './value'; +import { Value, ValueUpdateParams } from './value'; +import { type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Tokens extends APIResource { + permissionGroups: PermissionGroupsAPI.PermissionGroups = new PermissionGroupsAPI.PermissionGroups( + this._client, + ); + value: ValueAPI.Value = new ValueAPI.Value(this._client); + + /** + * Create a new Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'readonly token', + * policies: [ + * { + * effect: 'allow', + * permission_groups: [ + * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, + * { id: '82e64a83756745bbbb1c9c2701bf816b' }, + * ], + * resources: { foo: 'string' }, + * }, + * ], + * }); + * ``` + */ + create(params: TokenCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/tokens`, { body, ...options }) as Core.APIPromise<{ + result: TokenCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an existing token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.update( + * 'ed17574386854bf78a67040be0a770b0', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'readonly token', + * policies: [ + * { + * effect: 'allow', + * permission_groups: [ + * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, + * { id: '82e64a83756745bbbb1c9c2701bf816b' }, + * ], + * resources: { foo: 'string' }, + * }, + * ], + * }, + * ); + * ``` + */ + update( + tokenId: string, + params: TokenUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/tokens/${tokenId}`, { body, ...options }) as Core.APIPromise<{ + result: Shared.Token; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all Account Owned API tokens created for this account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const token of client.accounts.tokens.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` + */ + list( + params: TokenListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList(`/accounts/${account_id}/tokens`, TokensV4PagePaginationArray, { + query, + ...options, + }); + } + + /** + * Destroy an Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.delete( + * 'ed17574386854bf78a67040be0a770b0', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + tokenId: string, + params: TokenDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/tokens/${tokenId}`, options) as Core.APIPromise<{ + result: TokenDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get information about a specific Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.get( + * 'ed17574386854bf78a67040be0a770b0', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get(tokenId: string, params: TokenGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/tokens/${tokenId}`, options) as Core.APIPromise<{ + result: Shared.Token; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Test whether a token works. + * + * @example + * ```ts + * const response = await client.accounts.tokens.verify({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + verify(params: TokenVerifyParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/tokens/verify`, options) as Core.APIPromise<{ + result: TokenVerifyResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TokenCreateResponse { + /** + * Token identifier tag. + */ + id?: string; + + condition?: TokenCreateResponse.Condition; + + /** + * The expiration time on or after which the JWT MUST NOT be accepted for + * processing. + */ + expires_on?: string; + + /** + * The time on which the token was created. + */ + issued_on?: string; + + /** + * Last time the token was used. + */ + last_used_on?: string; + + /** + * Last time the token was modified. + */ + modified_on?: string; + + /** + * Token name. + */ + name?: string; + + /** + * The time before which the token MUST NOT be accepted for processing. + */ + not_before?: string; + + /** + * List of access policies assigned to the token. + */ + policies?: Array; + + /** + * Status of the token. + */ + status?: 'active' | 'disabled' | 'expired'; + + /** + * The token value. + */ + value?: Shared.TokenValue; +} + +export namespace TokenCreateResponse { + export interface Condition { + /** + * Client IP restrictions. + */ + request_ip?: Condition.RequestIP; + } + + export namespace Condition { + /** + * Client IP restrictions. + */ + export interface RequestIP { + /** + * List of IPv4/IPv6 CIDR addresses. + */ + in?: Array; + + /** + * List of IPv4/IPv6 CIDR addresses. + */ + not_in?: Array; + } + } +} + +export interface TokenDeleteResponse { + /** + * Identifier + */ + id: string; +} + +export interface TokenVerifyResponse { + /** + * Token identifier tag. + */ + id: string; + + /** + * Status of the token. + */ + status: 'active' | 'disabled' | 'expired'; + + /** + * The expiration time on or after which the JWT MUST NOT be accepted for + * processing. + */ + expires_on?: string; + + /** + * The time before which the token MUST NOT be accepted for processing. + */ + not_before?: string; +} + +export interface TokenCreateParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: Token name. + */ + name: string; + + /** + * Body param: List of access policies assigned to the token. + */ + policies: Array; + + /** + * Body param + */ + condition?: TokenCreateParams.Condition; + + /** + * Body param: The expiration time on or after which the JWT MUST NOT be accepted + * for processing. + */ + expires_on?: string; + + /** + * Body param: The time before which the token MUST NOT be accepted for processing. + */ + not_before?: string; +} + +export namespace TokenCreateParams { + export interface Condition { + /** + * Client IP restrictions. + */ + request_ip?: Condition.RequestIP; + } + + export namespace Condition { + /** + * Client IP restrictions. + */ + export interface RequestIP { + /** + * List of IPv4/IPv6 CIDR addresses. + */ + in?: Array; + + /** + * List of IPv4/IPv6 CIDR addresses. + */ + not_in?: Array; + } + } +} + +export interface TokenUpdateParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param: Token name. + */ + name: string; + + /** + * Body param: List of access policies assigned to the token. + */ + policies: Array; + + /** + * Body param + */ + condition?: TokenUpdateParams.Condition; + + /** + * Body param: The expiration time on or after which the JWT MUST NOT be accepted + * for processing. + */ + expires_on?: string; + + /** + * Body param: The time before which the token MUST NOT be accepted for processing. + */ + not_before?: string; + + /** + * Body param: Status of the token. + */ + status?: 'active' | 'disabled' | 'expired'; +} + +export namespace TokenUpdateParams { + export interface Condition { + /** + * Client IP restrictions. + */ + request_ip?: Condition.RequestIP; + } + + export namespace Condition { + /** + * Client IP restrictions. + */ + export interface RequestIP { + /** + * List of IPv4/IPv6 CIDR addresses. + */ + in?: Array; + + /** + * List of IPv4/IPv6 CIDR addresses. + */ + not_in?: Array; + } + } +} + +export interface TokenListParams extends V4PagePaginationArrayParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Query param: Direction to order results. + */ + direction?: 'asc' | 'desc'; +} + +export interface TokenDeleteParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +export interface TokenGetParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +export interface TokenVerifyParams { + /** + * Account identifier tag. + */ + account_id: string; +} + +Tokens.PermissionGroups = PermissionGroups; +Tokens.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage; +Tokens.Value = Value; + +export declare namespace Tokens { + export { + type TokenCreateResponse as TokenCreateResponse, + type TokenDeleteResponse as TokenDeleteResponse, + type TokenVerifyResponse as TokenVerifyResponse, + type TokenCreateParams as TokenCreateParams, + type TokenUpdateParams as TokenUpdateParams, + type TokenListParams as TokenListParams, + type TokenDeleteParams as TokenDeleteParams, + type TokenGetParams as TokenGetParams, + type TokenVerifyParams as TokenVerifyParams, + }; + + export { + PermissionGroups as PermissionGroups, + type PermissionGroupListResponse as PermissionGroupListResponse, + type PermissionGroupGetResponse as PermissionGroupGetResponse, + PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, + type PermissionGroupListParams as PermissionGroupListParams, + type PermissionGroupGetParams as PermissionGroupGetParams, + }; + + export { Value as Value, type ValueUpdateParams as ValueUpdateParams }; +} + +export { TokensV4PagePaginationArray }; diff --git a/src/resources/accounts/tokens/value.ts b/src/resources/accounts/tokens/value.ts new file mode 100644 index 0000000000..dc8d6d702d --- /dev/null +++ b/src/resources/accounts/tokens/value.ts @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as Shared from '../../shared'; + +export class Value extends APIResource { + /** + * Roll the Account Owned API token secret. + * + * @example + * ```ts + * const tokenValue = + * await client.accounts.tokens.value.update( + * 'ed17574386854bf78a67040be0a770b0', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: {}, + * }, + * ); + * ``` + */ + update( + tokenId: string, + params: ValueUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, body } = params; + return ( + this._client.put(`/accounts/${account_id}/tokens/${tokenId}/value`, { + body: body, + ...options, + }) as Core.APIPromise<{ result: Shared.TokenValue }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ValueUpdateParams { + /** + * Path param: Account identifier tag. + */ + account_id: string; + + /** + * Body param + */ + body: unknown; +} + +export declare namespace Value { + export { type ValueUpdateParams as ValueUpdateParams }; +} diff --git a/src/resources/acm.ts b/src/resources/acm.ts new file mode 100644 index 0000000000..fd643e8815 --- /dev/null +++ b/src/resources/acm.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './acm/index'; diff --git a/src/resources/acm/acm.ts b/src/resources/acm/acm.ts index e4dc8bd3ac..4ec88b8366 100644 --- a/src/resources/acm/acm.ts +++ b/src/resources/acm/acm.ts @@ -1,16 +1,33 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'cloudflare/resource'; -import * as TotalTLSAPI from 'cloudflare/resources/acm/total-tls'; +import { APIResource } from '../../resource'; +import * as TotalTLSAPI from './total-tls'; +import { + CertificateAuthority, + TotalTLS, + TotalTLSEditParams, + TotalTLSEditResponse, + TotalTLSGetParams, + TotalTLSGetResponse, + TotalTLSUpdateParams, + TotalTLSUpdateResponse, +} from './total-tls'; export class ACM extends APIResource { totalTLS: TotalTLSAPI.TotalTLS = new TotalTLSAPI.TotalTLS(this._client); } -export namespace ACM { - export import TotalTLS = TotalTLSAPI.TotalTLS; - export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse; - export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse; - export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams; - export import TotalTLSGetParams = TotalTLSAPI.TotalTLSGetParams; +ACM.TotalTLS = TotalTLS; + +export declare namespace ACM { + export { + TotalTLS as TotalTLS, + type CertificateAuthority as CertificateAuthority, + type TotalTLSUpdateResponse as TotalTLSUpdateResponse, + type TotalTLSEditResponse as TotalTLSEditResponse, + type TotalTLSGetResponse as TotalTLSGetResponse, + type TotalTLSUpdateParams as TotalTLSUpdateParams, + type TotalTLSEditParams as TotalTLSEditParams, + type TotalTLSGetParams as TotalTLSGetParams, + }; } diff --git a/src/resources/acm/index.ts b/src/resources/acm/index.ts index d8c987b5e4..81399fa4d5 100644 --- a/src/resources/acm/index.ts +++ b/src/resources/acm/index.ts @@ -1,10 +1,13 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { ACM } from './acm'; export { - TotalTLSCreateResponse, - TotalTLSGetResponse, - TotalTLSCreateParams, - TotalTLSGetParams, TotalTLS, + type CertificateAuthority, + type TotalTLSUpdateResponse, + type TotalTLSEditResponse, + type TotalTLSGetResponse, + type TotalTLSUpdateParams, + type TotalTLSEditParams, + type TotalTLSGetParams, } from './total-tls'; diff --git a/src/resources/acm/total-tls.ts b/src/resources/acm/total-tls.ts index 1865d5a537..b6f56a5423 100644 --- a/src/resources/acm/total-tls.ts +++ b/src/resources/acm/total-tls.ts @@ -1,27 +1,61 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as TotalTLSAPI from 'cloudflare/resources/acm/total-tls'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class TotalTLS extends APIResource { /** * Set Total TLS Settings or disable the feature for a Zone. + * + * @example + * ```ts + * const totalTLS = await client.acm.totalTLS.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * enabled: true, + * }); + * ``` */ - create( - params: TotalTLSCreateParams, + update( + params: TotalTLSUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{ - result: TotalTLSCreateResponse; + result: TotalTLSUpdateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Set Total TLS Settings or disable the feature for a Zone. + * + * @example + * ```ts + * const response = await client.acm.totalTLS.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * enabled: true, + * }); + * ``` + */ + edit(params: TotalTLSEditParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/acm/total_tls`, { body, ...options }) as Core.APIPromise<{ + result: TotalTLSEditResponse; }> )._thenUnwrap((obj) => obj.result); } /** * Get Total TLS Settings for a Zone. + * + * @example + * ```ts + * const totalTLS = await client.acm.totalTLS.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: TotalTLSGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; @@ -33,11 +67,21 @@ export class TotalTLS extends APIResource { } } -export interface TotalTLSCreateResponse { +/** + * The Certificate Authority that Total TLS certificates will be issued through. + */ +export type CertificateAuthority = 'google' | 'lets_encrypt' | 'ssl_com'; + +/** + * The Certificate Authority that Total TLS certificates will be issued through. + */ +export type CertificateAuthorityParam = 'google' | 'lets_encrypt' | 'ssl_com'; + +export interface TotalTLSUpdateResponse { /** * The Certificate Authority that Total TLS certificates will be issued through. */ - certificate_authority?: 'google' | 'lets_encrypt'; + certificate_authority?: CertificateAuthority; /** * If enabled, Total TLS will order a hostname specific TLS certificate for any @@ -48,14 +92,32 @@ export interface TotalTLSCreateResponse { /** * The validity period in days for the certificates ordered via Total TLS. */ - validity_days?: 90; + validity_period?: 90; +} + +export interface TotalTLSEditResponse { + /** + * The Certificate Authority that Total TLS certificates will be issued through. + */ + certificate_authority?: CertificateAuthority; + + /** + * If enabled, Total TLS will order a hostname specific TLS certificate for any + * proxied A, AAAA, or CNAME record in your zone. + */ + enabled?: boolean; + + /** + * The validity period in days for the certificates ordered via Total TLS. + */ + validity_period?: 90; } export interface TotalTLSGetResponse { /** * The Certificate Authority that Total TLS certificates will be issued through. */ - certificate_authority?: 'google' | 'lets_encrypt'; + certificate_authority?: CertificateAuthority; /** * If enabled, Total TLS will order a hostname specific TLS certificate for any @@ -66,12 +128,31 @@ export interface TotalTLSGetResponse { /** * The validity period in days for the certificates ordered via Total TLS. */ - validity_days?: 90; + validity_period?: 90; +} + +export interface TotalTLSUpdateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: If enabled, Total TLS will order a hostname specific TLS certificate + * for any proxied A, AAAA, or CNAME record in your zone. + */ + enabled: boolean; + + /** + * Body param: The Certificate Authority that Total TLS certificates will be issued + * through. + */ + certificate_authority?: CertificateAuthorityParam; } -export interface TotalTLSCreateParams { +export interface TotalTLSEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -85,19 +166,24 @@ export interface TotalTLSCreateParams { * Body param: The Certificate Authority that Total TLS certificates will be issued * through. */ - certificate_authority?: 'google' | 'lets_encrypt'; + certificate_authority?: CertificateAuthorityParam; } export interface TotalTLSGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } -export namespace TotalTLS { - export import TotalTLSCreateResponse = TotalTLSAPI.TotalTLSCreateResponse; - export import TotalTLSGetResponse = TotalTLSAPI.TotalTLSGetResponse; - export import TotalTLSCreateParams = TotalTLSAPI.TotalTLSCreateParams; - export import TotalTLSGetParams = TotalTLSAPI.TotalTLSGetParams; +export declare namespace TotalTLS { + export { + type CertificateAuthority as CertificateAuthority, + type TotalTLSUpdateResponse as TotalTLSUpdateResponse, + type TotalTLSEditResponse as TotalTLSEditResponse, + type TotalTLSGetResponse as TotalTLSGetResponse, + type TotalTLSUpdateParams as TotalTLSUpdateParams, + type TotalTLSEditParams as TotalTLSEditParams, + type TotalTLSGetParams as TotalTLSGetParams, + }; } diff --git a/src/resources/addressing.ts b/src/resources/addressing.ts new file mode 100644 index 0000000000..52692935a9 --- /dev/null +++ b/src/resources/addressing.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './addressing/index'; diff --git a/src/resources/addressing/address-maps.ts b/src/resources/addressing/address-maps.ts new file mode 100644 index 0000000000..e30ee999ae --- /dev/null +++ b/src/resources/addressing/address-maps.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './address-maps/index'; diff --git a/src/resources/addressing/address-maps/accounts.ts b/src/resources/addressing/address-maps/accounts.ts index bdfd6aad39..ba351be422 100644 --- a/src/resources/addressing/address-maps/accounts.ts +++ b/src/resources/addressing/address-maps/accounts.ts @@ -1,66 +1,223 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AccountsAPI from 'cloudflare/resources/addressing/address-maps/accounts'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; export class Accounts extends APIResource { /** * Add an account as a member of a particular address map. + * + * @example + * ```ts + * const account = + * await client.addressing.addressMaps.accounts.update( + * '055817b111884e0227e1be16a0be6ee0', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, params: AccountUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.put( - `/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, - options, - ) as Core.APIPromise<{ result: AccountUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); + ): Core.APIPromise { + const { account_id, body } = params; + return this._client.put( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, + { body: body, ...options }, + ); } /** * Remove an account as a member of a particular address map. + * + * @example + * ```ts + * const account = + * await client.addressing.addressMaps.accounts.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, params: AccountDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, - options, - ) as Core.APIPromise<{ result: AccountDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); + return this._client.delete( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/accounts/${account_id}`, + options, + ); + } +} + +export interface AccountUpdateResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: AccountUpdateResponse.ResultInfo; +} + +export namespace AccountUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; } } -export type AccountUpdateResponse = unknown | Array | string; +export interface AccountDeleteResponse { + errors: Array; -export type AccountDeleteResponse = unknown | Array | string; + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: AccountDeleteResponse.ResultInfo; +} + +export namespace AccountDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; + } +} export interface AccountUpdateParams { /** - * Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; + + /** + * Body param + */ + body: unknown; } export interface AccountDeleteParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace Accounts { - export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; - export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse; - export import AccountUpdateParams = AccountsAPI.AccountUpdateParams; - export import AccountDeleteParams = AccountsAPI.AccountDeleteParams; +export declare namespace Accounts { + export { + type AccountUpdateResponse as AccountUpdateResponse, + type AccountDeleteResponse as AccountDeleteResponse, + type AccountUpdateParams as AccountUpdateParams, + type AccountDeleteParams as AccountDeleteParams, + }; } diff --git a/src/resources/addressing/address-maps/address-maps.ts b/src/resources/addressing/address-maps/address-maps.ts index 58abaff996..4c868124c4 100644 --- a/src/resources/addressing/address-maps/address-maps.ts +++ b/src/resources/addressing/address-maps/address-maps.ts @@ -1,19 +1,38 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AddressMapsAPI from 'cloudflare/resources/addressing/address-maps/address-maps'; -import * as AccountsAPI from 'cloudflare/resources/addressing/address-maps/accounts'; -import * as IPsAPI from 'cloudflare/resources/addressing/address-maps/ips'; -import * as ZonesAPI from 'cloudflare/resources/addressing/address-maps/zones'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as AddressMapsAPI from './address-maps'; +import * as IPsAPI from '../../ips'; +import * as AccountsAPI from './accounts'; +import { + AccountDeleteParams, + AccountDeleteResponse, + AccountUpdateParams, + AccountUpdateResponse, + Accounts, +} from './accounts'; +import * as AddressMapsIPsAPI from './ips'; +import { IPDeleteParams, IPDeleteResponse, IPUpdateParams, IPUpdateResponse, IPs } from './ips'; +import * as ZonesAPI from './zones'; +import { ZoneDeleteParams, ZoneDeleteResponse, ZoneUpdateParams, ZoneUpdateResponse, Zones } from './zones'; +import { SinglePage } from '../../../pagination'; export class AddressMaps extends APIResource { accounts: AccountsAPI.Accounts = new AccountsAPI.Accounts(this._client); - ips: IPsAPI.IPs = new IPsAPI.IPs(this._client); + ips: AddressMapsIPsAPI.IPs = new AddressMapsIPsAPI.IPs(this._client); zones: ZonesAPI.Zones = new ZonesAPI.Zones(this._client); /** * Create a new address map under the account. + * + * @example + * ```ts + * const addressMap = + * await client.addressing.addressMaps.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * }); + * ``` */ create( params: AddressMapCreateParams, @@ -30,56 +49,86 @@ export class AddressMaps extends APIResource { /** * List all address maps owned by the account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const addressMap of client.addressing.addressMaps.list( + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( params: AddressMapListParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/addressing/address_maps`, options) as Core.APIPromise<{ - result: AddressMapListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/addressing/address_maps`, + AddressMapsSinglePage, + options, + ); } /** * Delete a particular address map owned by the account. An Address Map must be * disabled before it can be deleted. + * + * @example + * ```ts + * const addressMap = + * await client.addressing.addressMaps.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, params: AddressMapDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/addressing/address_maps/${addressMapId}`, - options, - ) as Core.APIPromise<{ result: AddressMapDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); + return this._client.delete(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, options); } /** * Modify properties of an address map owned by the account. + * + * @example + * ```ts + * const addressMap = await client.addressing.addressMaps.edit( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ edit( addressMapId: string, params: AddressMapEditParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.patch(`/accounts/${account_id}/addressing/address_maps/${addressMapId}`, { body, ...options, - }) as Core.APIPromise<{ result: AddressingAddressMaps }> + }) as Core.APIPromise<{ result: AddressMap }> )._thenUnwrap((obj) => obj.result); } /** * Show a particular address map owned by the account. + * + * @example + * ```ts + * const addressMap = await client.addressing.addressMaps.get( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get( addressMapId: string, @@ -96,9 +145,11 @@ export class AddressMaps extends APIResource { } } -export interface AddressingAddressMaps { +export class AddressMapsSinglePage extends SinglePage {} + +export interface AddressMap { /** - * Identifier + * Identifier of an Address Map. */ id?: string; @@ -140,9 +191,19 @@ export interface AddressingAddressMaps { modified_at?: string; } +/** + * The type of the membership. + */ +export type Kind = 'zone' | 'account'; + +/** + * The type of the membership. + */ +export type KindParam = 'zone' | 'account'; + export interface AddressMapCreateResponse { /** - * Identifier + * Identifier of an Address Map. */ id?: string; @@ -184,7 +245,7 @@ export interface AddressMapCreateResponse { /** * The set of IPs on the Address Map. */ - ips?: Array; + ips?: IPsAPI.IPsArray; /** * Zones and Accounts which will be assigned IPs on this Address Map. A zone @@ -196,15 +257,6 @@ export interface AddressMapCreateResponse { } export namespace AddressMapCreateResponse { - export interface IP { - created_at?: string; - - /** - * An IPv4 or IPv6 address. - */ - ip?: string; - } - export interface Membership { /** * Controls whether the membership can be deleted via the API or not. @@ -214,24 +266,89 @@ export namespace AddressMapCreateResponse { created_at?: string; /** - * Identifier + * The identifier for the membership (eg. a zone or account tag). */ identifier?: string; /** * The type of the membership. */ - kind?: 'zone' | 'account'; + kind?: AddressMapsAPI.Kind; } } -export type AddressMapListResponse = Array; +export interface AddressMapDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: AddressMapDeleteResponse.ResultInfo; +} + +export namespace AddressMapDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; -export type AddressMapDeleteResponse = unknown | Array | string; + /** + * Total results available without any search parameters. + */ + total_count?: number; + } +} export interface AddressMapGetResponse { /** - * Identifier + * Identifier of an Address Map. */ id?: string; @@ -273,7 +390,7 @@ export interface AddressMapGetResponse { /** * The set of IPs on the Address Map. */ - ips?: Array; + ips?: IPsAPI.IPsArray; /** * Zones and Accounts which will be assigned IPs on this Address Map. A zone @@ -285,15 +402,6 @@ export interface AddressMapGetResponse { } export namespace AddressMapGetResponse { - export interface IP { - created_at?: string; - - /** - * An IPv4 or IPv6 address. - */ - ip?: string; - } - export interface Membership { /** * Controls whether the membership can be deleted via the API or not. @@ -303,20 +411,20 @@ export namespace AddressMapGetResponse { created_at?: string; /** - * Identifier + * The identifier for the membership (eg. a zone or account tag). */ identifier?: string; /** * The type of the membership. */ - kind?: 'zone' | 'account'; + kind?: AddressMapsAPI.Kind; } } export interface AddressMapCreateParams { /** - * Path param: Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; @@ -331,25 +439,50 @@ export interface AddressMapCreateParams { * respond with IP addresses on an Address Map until the map is enabled. */ enabled?: boolean | null; + + /** + * Body param + */ + ips?: Array; + + /** + * Body param: Zones and Accounts which will be assigned IPs on this Address Map. A + * zone membership will take priority over an account membership. + */ + memberships?: Array; +} + +export namespace AddressMapCreateParams { + export interface Membership { + /** + * The identifier for the membership (eg. a zone or account tag). + */ + identifier?: string; + + /** + * The type of the membership. + */ + kind?: AddressMapsAPI.KindParam; + } } export interface AddressMapListParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } export interface AddressMapDeleteParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } export interface AddressMapEditParams { /** - * Path param: Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; @@ -377,35 +510,52 @@ export interface AddressMapEditParams { export interface AddressMapGetParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace AddressMaps { - export import AddressingAddressMaps = AddressMapsAPI.AddressingAddressMaps; - export import AddressMapCreateResponse = AddressMapsAPI.AddressMapCreateResponse; - export import AddressMapListResponse = AddressMapsAPI.AddressMapListResponse; - export import AddressMapDeleteResponse = AddressMapsAPI.AddressMapDeleteResponse; - export import AddressMapGetResponse = AddressMapsAPI.AddressMapGetResponse; - export import AddressMapCreateParams = AddressMapsAPI.AddressMapCreateParams; - export import AddressMapListParams = AddressMapsAPI.AddressMapListParams; - export import AddressMapDeleteParams = AddressMapsAPI.AddressMapDeleteParams; - export import AddressMapEditParams = AddressMapsAPI.AddressMapEditParams; - export import AddressMapGetParams = AddressMapsAPI.AddressMapGetParams; - export import Accounts = AccountsAPI.Accounts; - export import AccountUpdateResponse = AccountsAPI.AccountUpdateResponse; - export import AccountDeleteResponse = AccountsAPI.AccountDeleteResponse; - export import AccountUpdateParams = AccountsAPI.AccountUpdateParams; - export import AccountDeleteParams = AccountsAPI.AccountDeleteParams; - export import IPs = IPsAPI.IPs; - export import IPUpdateResponse = IPsAPI.IPUpdateResponse; - export import IPDeleteResponse = IPsAPI.IPDeleteResponse; - export import IPUpdateParams = IPsAPI.IPUpdateParams; - export import IPDeleteParams = IPsAPI.IPDeleteParams; - export import Zones = ZonesAPI.Zones; - export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse; - export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse; - export import ZoneUpdateParams = ZonesAPI.ZoneUpdateParams; - export import ZoneDeleteParams = ZonesAPI.ZoneDeleteParams; +AddressMaps.AddressMapsSinglePage = AddressMapsSinglePage; +AddressMaps.Accounts = Accounts; +AddressMaps.IPs = IPs; +AddressMaps.Zones = Zones; + +export declare namespace AddressMaps { + export { + type AddressMap as AddressMap, + type Kind as Kind, + type AddressMapCreateResponse as AddressMapCreateResponse, + type AddressMapDeleteResponse as AddressMapDeleteResponse, + type AddressMapGetResponse as AddressMapGetResponse, + AddressMapsSinglePage as AddressMapsSinglePage, + type AddressMapCreateParams as AddressMapCreateParams, + type AddressMapListParams as AddressMapListParams, + type AddressMapDeleteParams as AddressMapDeleteParams, + type AddressMapEditParams as AddressMapEditParams, + type AddressMapGetParams as AddressMapGetParams, + }; + + export { + Accounts as Accounts, + type AccountUpdateResponse as AccountUpdateResponse, + type AccountDeleteResponse as AccountDeleteResponse, + type AccountUpdateParams as AccountUpdateParams, + type AccountDeleteParams as AccountDeleteParams, + }; + + export { + IPs as IPs, + type IPUpdateResponse as IPUpdateResponse, + type IPDeleteResponse as IPDeleteResponse, + type IPUpdateParams as IPUpdateParams, + type IPDeleteParams as IPDeleteParams, + }; + + export { + Zones as Zones, + type ZoneUpdateResponse as ZoneUpdateResponse, + type ZoneDeleteResponse as ZoneDeleteResponse, + type ZoneUpdateParams as ZoneUpdateParams, + type ZoneDeleteParams as ZoneDeleteParams, + }; } diff --git a/src/resources/addressing/address-maps/index.ts b/src/resources/addressing/address-maps/index.ts index 087bf63253..091fdac225 100644 --- a/src/resources/addressing/address-maps/index.ts +++ b/src/resources/addressing/address-maps/index.ts @@ -1,24 +1,37 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AccountUpdateResponse, - AccountDeleteResponse, - AccountUpdateParams, - AccountDeleteParams, Accounts, + type AccountUpdateResponse, + type AccountDeleteResponse, + type AccountUpdateParams, + type AccountDeleteParams, } from './accounts'; export { - AddressingAddressMaps, - AddressMapCreateResponse, - AddressMapListResponse, - AddressMapDeleteResponse, - AddressMapGetResponse, - AddressMapCreateParams, - AddressMapListParams, - AddressMapDeleteParams, - AddressMapEditParams, - AddressMapGetParams, + AddressMapsSinglePage, AddressMaps, + type AddressMap, + type Kind, + type AddressMapCreateResponse, + type AddressMapDeleteResponse, + type AddressMapGetResponse, + type AddressMapCreateParams, + type AddressMapListParams, + type AddressMapDeleteParams, + type AddressMapEditParams, + type AddressMapGetParams, } from './address-maps'; -export { IPUpdateResponse, IPDeleteResponse, IPUpdateParams, IPDeleteParams, IPs } from './ips'; -export { ZoneUpdateResponse, ZoneDeleteResponse, ZoneUpdateParams, ZoneDeleteParams, Zones } from './zones'; +export { + IPs, + type IPUpdateResponse, + type IPDeleteResponse, + type IPUpdateParams, + type IPDeleteParams, +} from './ips'; +export { + Zones, + type ZoneUpdateResponse, + type ZoneDeleteResponse, + type ZoneUpdateParams, + type ZoneDeleteParams, +} from './zones'; diff --git a/src/resources/addressing/address-maps/ips.ts b/src/resources/addressing/address-maps/ips.ts index 699a447391..ec5c346e57 100644 --- a/src/resources/addressing/address-maps/ips.ts +++ b/src/resources/addressing/address-maps/ips.ts @@ -1,68 +1,225 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as IPsAPI from 'cloudflare/resources/addressing/address-maps/ips'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; export class IPs extends APIResource { /** * Add an IP from a prefix owned by the account to a particular address map. + * + * @example + * ```ts + * const ip = await client.addressing.addressMaps.ips.update( + * '055817b111884e0227e1be16a0be6ee0', + * '192.0.2.1', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, ipAddress: string, params: IPUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.put( - `/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, - options, - ) as Core.APIPromise<{ result: IPUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); + ): Core.APIPromise { + const { account_id, body } = params; + return this._client.put( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, + { body: body, ...options }, + ); } /** * Remove an IP from a particular address map. + * + * @example + * ```ts + * const ip = await client.addressing.addressMaps.ips.delete( + * '055817b111884e0227e1be16a0be6ee0', + * '192.0.2.1', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, ipAddress: string, params: IPDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, - options, - ) as Core.APIPromise<{ result: IPDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); + return this._client.delete( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/ips/${ipAddress}`, + options, + ); + } +} + +export interface IPUpdateResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: IPUpdateResponse.ResultInfo; +} + +export namespace IPUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; } } -export type IPUpdateResponse = unknown | Array | string; +export interface IPDeleteResponse { + errors: Array; -export type IPDeleteResponse = unknown | Array | string; + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: IPDeleteResponse.ResultInfo; +} + +export namespace IPDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; + } +} export interface IPUpdateParams { /** - * Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; + + /** + * Body param + */ + body: unknown; } export interface IPDeleteParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace IPs { - export import IPUpdateResponse = IPsAPI.IPUpdateResponse; - export import IPDeleteResponse = IPsAPI.IPDeleteResponse; - export import IPUpdateParams = IPsAPI.IPUpdateParams; - export import IPDeleteParams = IPsAPI.IPDeleteParams; +export declare namespace IPs { + export { + type IPUpdateResponse as IPUpdateResponse, + type IPDeleteResponse as IPDeleteResponse, + type IPUpdateParams as IPUpdateParams, + type IPDeleteParams as IPDeleteParams, + }; } diff --git a/src/resources/addressing/address-maps/zones.ts b/src/resources/addressing/address-maps/zones.ts index 077ab93f0f..9014688d83 100644 --- a/src/resources/addressing/address-maps/zones.ts +++ b/src/resources/addressing/address-maps/zones.ts @@ -1,109 +1,237 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import { CloudflareError } from 'cloudflare/error'; -import * as ZonesAPI from 'cloudflare/resources/addressing/address-maps/zones'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; export class Zones extends APIResource { /** * Add a zone as a member of a particular address map. + * + * @example + * ```ts + * const zone = + * await client.addressing.addressMaps.zones.update( + * '055817b111884e0227e1be16a0be6ee0', + * { + * zone_id: '8ac8489932db6327334c9b6d58544cfe', + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, params: ZoneUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, account_id } = params; - if (!account_id && !zone_id) { - throw new CloudflareError('You must provide either account_id or zone_id.'); - } - if (account_id && zone_id) { - throw new CloudflareError('You cannot provide both account_id and zone_id.'); - } - const { accountOrZone, accountOrZoneId } = - account_id ? - { - accountOrZone: 'accounts', - accountOrZoneId: account_id, - } - : { - accountOrZone: 'zones', - accountOrZoneId: zone_id, - }; - return ( - this._client.put( - `/accounts/${accountOrZone}/addressing/address_maps/${addressMapId}/zones/${accountOrZoneId}`, - options, - ) as Core.APIPromise<{ result: ZoneUpdateResponse | null }> - )._thenUnwrap((obj) => obj.result); + ): Core.APIPromise { + const { zone_id, account_id, body } = params; + return this._client.put( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`, + { body: body, ...options }, + ); } /** * Remove a zone as a member of a particular address map. + * + * @example + * ```ts + * const zone = + * await client.addressing.addressMaps.zones.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { + * zone_id: '8ac8489932db6327334c9b6d58544cfe', + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * }, + * ); + * ``` */ delete( addressMapId: string, params: ZoneDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, account_id } = params; - if (!account_id && !zone_id) { - throw new CloudflareError('You must provide either account_id or zone_id.'); + return this._client.delete( + `/accounts/${account_id}/addressing/address_maps/${addressMapId}/zones/${zone_id}`, + options, + ); + } +} + +export interface ZoneUpdateResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: ZoneUpdateResponse.ResultInfo; +} + +export namespace ZoneUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; } - if (account_id && zone_id) { - throw new CloudflareError('You cannot provide both account_id and zone_id.'); + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; } - const { accountOrZone, accountOrZoneId } = - account_id ? - { - accountOrZone: 'accounts', - accountOrZoneId: account_id, - } - : { - accountOrZone: 'zones', - accountOrZoneId: zone_id, - }; - return ( - this._client.delete( - `/accounts/${accountOrZone}/addressing/address_maps/${addressMapId}/zones/${accountOrZoneId}`, - options, - ) as Core.APIPromise<{ result: ZoneDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; } } -export type ZoneUpdateResponse = unknown | Array | string; +export interface ZoneDeleteResponse { + errors: Array; -export type ZoneDeleteResponse = unknown | Array | string; + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; + + result_info?: ZoneDeleteResponse.ResultInfo; +} + +export namespace ZoneDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + + export interface ResultInfo { + /** + * Total number of results for the requested service. + */ + count?: number; + + /** + * Current page within paginated list of results. + */ + page?: number; + + /** + * Number of results per page of results. + */ + per_page?: number; + + /** + * Total results available without any search parameters. + */ + total_count?: number; + } +} export interface ZoneUpdateParams { /** - * Identifier + * Path param: Identifier of a zone. */ zone_id: string; /** - * Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; + + /** + * Body param + */ + body: unknown; } export interface ZoneDeleteParams { /** - * Identifier + * Identifier of a zone. */ zone_id: string; /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace Zones { - export import ZoneUpdateResponse = ZonesAPI.ZoneUpdateResponse; - export import ZoneDeleteResponse = ZonesAPI.ZoneDeleteResponse; - export import ZoneUpdateParams = ZonesAPI.ZoneUpdateParams; - export import ZoneDeleteParams = ZonesAPI.ZoneDeleteParams; +export declare namespace Zones { + export { + type ZoneUpdateResponse as ZoneUpdateResponse, + type ZoneDeleteResponse as ZoneDeleteResponse, + type ZoneUpdateParams as ZoneUpdateParams, + type ZoneDeleteParams as ZoneDeleteParams, + }; } diff --git a/src/resources/addressing/addressing.ts b/src/resources/addressing/addressing.ts index 1df365b45a..06599a8421 100644 --- a/src/resources/addressing/addressing.ts +++ b/src/resources/addressing/addressing.ts @@ -1,43 +1,132 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'cloudflare/resource'; -import * as ServicesAPI from 'cloudflare/resources/addressing/services'; -import * as AddressMapsAPI from 'cloudflare/resources/addressing/address-maps/address-maps'; -import * as LOADocumentsAPI from 'cloudflare/resources/addressing/loa-documents/loa-documents'; -import * as PrefixesAPI from 'cloudflare/resources/addressing/prefixes/prefixes'; +import { APIResource } from '../../resource'; +import * as LOADocumentsAPI from './loa-documents'; +import { + LOADocumentCreateParams, + LOADocumentCreateResponse, + LOADocumentGetParams, + LOADocuments, +} from './loa-documents'; +import * as ServicesAPI from './services'; +import { ServiceListParams, ServiceListResponse, ServiceListResponsesSinglePage, Services } from './services'; +import * as AddressMapsAPI from './address-maps/address-maps'; +import { + AddressMap, + AddressMapCreateParams, + AddressMapCreateResponse, + AddressMapDeleteParams, + AddressMapDeleteResponse, + AddressMapEditParams, + AddressMapGetParams, + AddressMapGetResponse, + AddressMapListParams, + AddressMaps, + AddressMapsSinglePage, + Kind, +} from './address-maps/address-maps'; +import * as PrefixesAPI from './prefixes/prefixes'; +import { + Prefix, + PrefixCreateParams, + PrefixDeleteParams, + PrefixDeleteResponse, + PrefixEditParams, + PrefixGetParams, + PrefixListParams, + Prefixes, + PrefixesSinglePage, +} from './prefixes/prefixes'; +import * as RegionalHostnamesAPI from './regional-hostnames/regional-hostnames'; +import { + RegionalHostnameCreateParams, + RegionalHostnameCreateResponse, + RegionalHostnameDeleteParams, + RegionalHostnameDeleteResponse, + RegionalHostnameEditParams, + RegionalHostnameEditResponse, + RegionalHostnameGetParams, + RegionalHostnameGetResponse, + RegionalHostnameListParams, + RegionalHostnameListResponse, + RegionalHostnameListResponsesSinglePage, + RegionalHostnames, +} from './regional-hostnames/regional-hostnames'; export class Addressing extends APIResource { + regionalHostnames: RegionalHostnamesAPI.RegionalHostnames = new RegionalHostnamesAPI.RegionalHostnames( + this._client, + ); services: ServicesAPI.Services = new ServicesAPI.Services(this._client); addressMaps: AddressMapsAPI.AddressMaps = new AddressMapsAPI.AddressMaps(this._client); loaDocuments: LOADocumentsAPI.LOADocuments = new LOADocumentsAPI.LOADocuments(this._client); prefixes: PrefixesAPI.Prefixes = new PrefixesAPI.Prefixes(this._client); } -export namespace Addressing { - export import Services = ServicesAPI.Services; - export import ServiceListResponse = ServicesAPI.ServiceListResponse; - export import ServiceListParams = ServicesAPI.ServiceListParams; - export import AddressMaps = AddressMapsAPI.AddressMaps; - export import AddressingAddressMaps = AddressMapsAPI.AddressingAddressMaps; - export import AddressMapCreateResponse = AddressMapsAPI.AddressMapCreateResponse; - export import AddressMapListResponse = AddressMapsAPI.AddressMapListResponse; - export import AddressMapDeleteResponse = AddressMapsAPI.AddressMapDeleteResponse; - export import AddressMapGetResponse = AddressMapsAPI.AddressMapGetResponse; - export import AddressMapCreateParams = AddressMapsAPI.AddressMapCreateParams; - export import AddressMapListParams = AddressMapsAPI.AddressMapListParams; - export import AddressMapDeleteParams = AddressMapsAPI.AddressMapDeleteParams; - export import AddressMapEditParams = AddressMapsAPI.AddressMapEditParams; - export import AddressMapGetParams = AddressMapsAPI.AddressMapGetParams; - export import LOADocuments = LOADocumentsAPI.LOADocuments; - export import LOADocumentCreateResponse = LOADocumentsAPI.LOADocumentCreateResponse; - export import LOADocumentCreateParams = LOADocumentsAPI.LOADocumentCreateParams; - export import Prefixes = PrefixesAPI.Prefixes; - export import AddressingIpamPrefixes = PrefixesAPI.AddressingIpamPrefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse; - export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams; - export import PrefixListParams = PrefixesAPI.PrefixListParams; - export import PrefixDeleteParams = PrefixesAPI.PrefixDeleteParams; - export import PrefixEditParams = PrefixesAPI.PrefixEditParams; - export import PrefixGetParams = PrefixesAPI.PrefixGetParams; +Addressing.RegionalHostnames = RegionalHostnames; +Addressing.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage; +Addressing.Services = Services; +Addressing.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage; +Addressing.AddressMaps = AddressMaps; +Addressing.AddressMapsSinglePage = AddressMapsSinglePage; +Addressing.LOADocuments = LOADocuments; +Addressing.Prefixes = Prefixes; +Addressing.PrefixesSinglePage = PrefixesSinglePage; + +export declare namespace Addressing { + export { + RegionalHostnames as RegionalHostnames, + type RegionalHostnameCreateResponse as RegionalHostnameCreateResponse, + type RegionalHostnameListResponse as RegionalHostnameListResponse, + type RegionalHostnameDeleteResponse as RegionalHostnameDeleteResponse, + type RegionalHostnameEditResponse as RegionalHostnameEditResponse, + type RegionalHostnameGetResponse as RegionalHostnameGetResponse, + RegionalHostnameListResponsesSinglePage as RegionalHostnameListResponsesSinglePage, + type RegionalHostnameCreateParams as RegionalHostnameCreateParams, + type RegionalHostnameListParams as RegionalHostnameListParams, + type RegionalHostnameDeleteParams as RegionalHostnameDeleteParams, + type RegionalHostnameEditParams as RegionalHostnameEditParams, + type RegionalHostnameGetParams as RegionalHostnameGetParams, + }; + + export { + Services as Services, + type ServiceListResponse as ServiceListResponse, + ServiceListResponsesSinglePage as ServiceListResponsesSinglePage, + type ServiceListParams as ServiceListParams, + }; + + export { + AddressMaps as AddressMaps, + type AddressMap as AddressMap, + type Kind as Kind, + type AddressMapCreateResponse as AddressMapCreateResponse, + type AddressMapDeleteResponse as AddressMapDeleteResponse, + type AddressMapGetResponse as AddressMapGetResponse, + AddressMapsSinglePage as AddressMapsSinglePage, + type AddressMapCreateParams as AddressMapCreateParams, + type AddressMapListParams as AddressMapListParams, + type AddressMapDeleteParams as AddressMapDeleteParams, + type AddressMapEditParams as AddressMapEditParams, + type AddressMapGetParams as AddressMapGetParams, + }; + + export { + LOADocuments as LOADocuments, + type LOADocumentCreateResponse as LOADocumentCreateResponse, + type LOADocumentCreateParams as LOADocumentCreateParams, + type LOADocumentGetParams as LOADocumentGetParams, + }; + + export { + Prefixes as Prefixes, + type Prefix as Prefix, + type PrefixDeleteResponse as PrefixDeleteResponse, + PrefixesSinglePage as PrefixesSinglePage, + type PrefixCreateParams as PrefixCreateParams, + type PrefixListParams as PrefixListParams, + type PrefixDeleteParams as PrefixDeleteParams, + type PrefixEditParams as PrefixEditParams, + type PrefixGetParams as PrefixGetParams, + }; } diff --git a/src/resources/addressing/index.ts b/src/resources/addressing/index.ts index 2211db0acd..6b64a96cdf 100644 --- a/src/resources/addressing/index.ts +++ b/src/resources/addressing/index.ts @@ -1,29 +1,54 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Addressing } from './addressing'; export { - AddressingAddressMaps, - AddressMapCreateResponse, - AddressMapListResponse, - AddressMapDeleteResponse, - AddressMapGetResponse, - AddressMapCreateParams, - AddressMapListParams, - AddressMapDeleteParams, - AddressMapEditParams, - AddressMapGetParams, + AddressMapsSinglePage, AddressMaps, + type AddressMap, + type Kind, + type AddressMapCreateResponse, + type AddressMapDeleteResponse, + type AddressMapGetResponse, + type AddressMapCreateParams, + type AddressMapListParams, + type AddressMapDeleteParams, + type AddressMapEditParams, + type AddressMapGetParams, } from './address-maps/index'; +export { Addressing } from './addressing'; +export { + LOADocuments, + type LOADocumentCreateResponse, + type LOADocumentCreateParams, + type LOADocumentGetParams, +} from './loa-documents'; export { - AddressingIpamPrefixes, - PrefixListResponse, - PrefixDeleteResponse, - PrefixCreateParams, - PrefixListParams, - PrefixDeleteParams, - PrefixEditParams, - PrefixGetParams, + PrefixesSinglePage, Prefixes, + type Prefix, + type PrefixDeleteResponse, + type PrefixCreateParams, + type PrefixListParams, + type PrefixDeleteParams, + type PrefixEditParams, + type PrefixGetParams, } from './prefixes/index'; -export { LOADocumentCreateResponse, LOADocumentCreateParams, LOADocuments } from './loa-documents/index'; -export { ServiceListResponse, ServiceListParams, Services } from './services'; +export { + RegionalHostnameListResponsesSinglePage, + RegionalHostnames, + type RegionalHostnameCreateResponse, + type RegionalHostnameListResponse, + type RegionalHostnameDeleteResponse, + type RegionalHostnameEditResponse, + type RegionalHostnameGetResponse, + type RegionalHostnameCreateParams, + type RegionalHostnameListParams, + type RegionalHostnameDeleteParams, + type RegionalHostnameEditParams, + type RegionalHostnameGetParams, +} from './regional-hostnames/index'; +export { + ServiceListResponsesSinglePage, + Services, + type ServiceListResponse, + type ServiceListParams, +} from './services'; diff --git a/src/resources/addressing/loa-documents.ts b/src/resources/addressing/loa-documents.ts new file mode 100644 index 0000000000..43fd5385e3 --- /dev/null +++ b/src/resources/addressing/loa-documents.ts @@ -0,0 +1,126 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { type Response } from '../../_shims/index'; + +export class LOADocuments extends APIResource { + /** + * Submit LOA document (pdf format) under the account. + * + * @example + * ```ts + * const loaDocument = + * await client.addressing.loaDocuments.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * loa_document: '@document.pdf', + * }); + * ``` + */ + create( + params: LOADocumentCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post( + `/accounts/${account_id}/addressing/loa_documents`, + Core.multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: LOADocumentCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Download specified LOA document under the account. + * + * @example + * ```ts + * const loaDocument = + * await client.addressing.loaDocuments.get( + * 'd933b1530bc56c9953cf8ce166da8004', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * + * const content = await loaDocument.blob(); + * console.log(content); + * ``` + */ + get( + loaDocumentId: string | null, + params: LOADocumentGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, { + ...options, + headers: { Accept: 'application/pdf', ...options?.headers }, + __binaryResponse: true, + }); + } +} + +export interface LOADocumentCreateResponse { + /** + * Identifier for the uploaded LOA document. + */ + id?: string | null; + + /** + * Identifier of a Cloudflare account. + */ + account_id?: string; + + /** + * Whether the LOA has been auto-generated for the prefix owner by Cloudflare. + */ + auto_generated?: boolean; + + created?: string; + + /** + * Name of LOA document. Max file size 10MB, and supported filetype is pdf. + */ + filename?: string; + + /** + * File size of the uploaded LOA document. + */ + size_bytes?: number; + + /** + * Whether the LOA has been verified by Cloudflare staff. + */ + verified?: boolean; + + /** + * Timestamp of the moment the LOA was marked as validated. + */ + verified_at?: string | null; +} + +export interface LOADocumentCreateParams { + /** + * Path param: Identifier of a Cloudflare account. + */ + account_id: string; + + /** + * Body param: LOA document to upload. + */ + loa_document: string; +} + +export interface LOADocumentGetParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +export declare namespace LOADocuments { + export { + type LOADocumentCreateResponse as LOADocumentCreateResponse, + type LOADocumentCreateParams as LOADocumentCreateParams, + type LOADocumentGetParams as LOADocumentGetParams, + }; +} diff --git a/src/resources/addressing/loa-documents/downloads.ts b/src/resources/addressing/loa-documents/downloads.ts deleted file mode 100644 index e717f9cc58..0000000000 --- a/src/resources/addressing/loa-documents/downloads.ts +++ /dev/null @@ -1,36 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as DownloadsAPI from 'cloudflare/resources/addressing/loa-documents/downloads'; - -export class Downloads extends APIResource { - /** - * Download specified LOA document under the account. - */ - get( - loaDocumentId: string | null, - params: DownloadGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get( - `/accounts/${account_id}/addressing/loa_documents/${loaDocumentId}/download`, - options, - ); - } -} - -export type DownloadGetResponse = unknown; - -export interface DownloadGetParams { - /** - * Identifier - */ - account_id: string; -} - -export namespace Downloads { - export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse; - export import DownloadGetParams = DownloadsAPI.DownloadGetParams; -} diff --git a/src/resources/addressing/loa-documents/index.ts b/src/resources/addressing/loa-documents/index.ts deleted file mode 100644 index ec90529594..0000000000 --- a/src/resources/addressing/loa-documents/index.ts +++ /dev/null @@ -1,4 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { DownloadGetResponse, DownloadGetParams, Downloads } from './downloads'; -export { LOADocumentCreateResponse, LOADocumentCreateParams, LOADocuments } from './loa-documents'; diff --git a/src/resources/addressing/loa-documents/loa-documents.ts b/src/resources/addressing/loa-documents/loa-documents.ts deleted file mode 100644 index d82e796a28..0000000000 --- a/src/resources/addressing/loa-documents/loa-documents.ts +++ /dev/null @@ -1,54 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as LOADocumentsAPI from 'cloudflare/resources/addressing/loa-documents/loa-documents'; -import * as DownloadsAPI from 'cloudflare/resources/addressing/loa-documents/downloads'; -import { multipartFormRequestOptions } from 'cloudflare/core'; - -export class LOADocuments extends APIResource { - downloads: DownloadsAPI.Downloads = new DownloadsAPI.Downloads(this._client); - - /** - * Submit LOA document (pdf format) under the account. - */ - create( - params: LOADocumentCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post( - `/accounts/${account_id}/addressing/loa_documents`, - multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: LOADocumentCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LOADocumentCreateResponse { - /** - * Name of LOA document. - */ - filename?: string; -} - -export interface LOADocumentCreateParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Body param: LOA document to upload. - */ - loa_document: string; -} - -export namespace LOADocuments { - export import LOADocumentCreateResponse = LOADocumentsAPI.LOADocumentCreateResponse; - export import LOADocumentCreateParams = LOADocumentsAPI.LOADocumentCreateParams; - export import Downloads = DownloadsAPI.Downloads; - export import DownloadGetResponse = DownloadsAPI.DownloadGetResponse; - export import DownloadGetParams = DownloadsAPI.DownloadGetParams; -} diff --git a/src/resources/addressing/prefixes.ts b/src/resources/addressing/prefixes.ts new file mode 100644 index 0000000000..68828b7e91 --- /dev/null +++ b/src/resources/addressing/prefixes.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './prefixes/index'; diff --git a/src/resources/addressing/prefixes/advertisement-status.ts b/src/resources/addressing/prefixes/advertisement-status.ts new file mode 100644 index 0000000000..b4c4e80c3d --- /dev/null +++ b/src/resources/addressing/prefixes/advertisement-status.ts @@ -0,0 +1,107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class AdvertisementStatus extends APIResource { + /** + * Advertise or withdraw the BGP route for a prefix. + * + * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + * advertising and withdrawing subnets of an IP prefix. + * + * @deprecated + */ + edit( + prefixId: string, + params: AdvertisementStatusEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, { + body, + ...options, + }) as Core.APIPromise<{ result: AdvertisementStatusEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * View the current advertisement state for a prefix. + * + * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for + * advertising and withdrawing subnets of an IP prefix. + * + * @deprecated + */ + get( + prefixId: string, + params: AdvertisementStatusGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, + options, + ) as Core.APIPromise<{ result: AdvertisementStatusGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AdvertisementStatusEditResponse { + /** + * Advertisement status of the prefix. If `true`, the BGP route for the prefix is + * advertised to the Internet. If `false`, the BGP route is withdrawn. + */ + advertised?: boolean; + + /** + * Last time the advertisement status was changed. This field is only not 'null' if + * on demand is enabled. + */ + advertised_modified_at?: string | null; +} + +export interface AdvertisementStatusGetResponse { + /** + * Advertisement status of the prefix. If `true`, the BGP route for the prefix is + * advertised to the Internet. If `false`, the BGP route is withdrawn. + */ + advertised?: boolean; + + /** + * Last time the advertisement status was changed. This field is only not 'null' if + * on demand is enabled. + */ + advertised_modified_at?: string | null; +} + +export interface AdvertisementStatusEditParams { + /** + * Path param: Identifier of a Cloudflare account. + */ + account_id: string; + + /** + * Body param: Advertisement status of the prefix. If `true`, the BGP route for the + * prefix is advertised to the Internet. If `false`, the BGP route is withdrawn. + */ + advertised: boolean; +} + +export interface AdvertisementStatusGetParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +export declare namespace AdvertisementStatus { + export { + type AdvertisementStatusEditResponse as AdvertisementStatusEditResponse, + type AdvertisementStatusGetResponse as AdvertisementStatusGetResponse, + type AdvertisementStatusEditParams as AdvertisementStatusEditParams, + type AdvertisementStatusGetParams as AdvertisementStatusGetParams, + }; +} diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts new file mode 100644 index 0000000000..feef99102e --- /dev/null +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -0,0 +1,279 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class BGPPrefixes extends APIResource { + /** + * Create a BGP prefix, controlling the BGP advertisement status of a specific + * subnet. When created, BGP prefixes are initially withdrawn, and can be + * advertised with the Update BGP Prefix API. + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.create( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * }, + * ); + * ``` + */ + create( + prefixId: string, + params: BGPPrefixCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, { + body, + ...options, + }) as Core.APIPromise<{ result: BGPPrefix }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to + * control which specific subnets are advertised to the Internet. It is possible to + * advertise subnets more specific than an IP Prefix by creating more specific BGP + * Prefixes. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const bgpPrefix of client.addressing.prefixes.bgpPrefixes.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` + */ + list( + prefixId: string, + params: BGPPrefixListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, + BGPPrefixesSinglePage, + options, + ); + } + + /** + * Update the properties of a BGP Prefix, such as the on demand advertisement + * status (advertised or withdrawn). + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.edit( + * '2af39739cc4e3b5910c918468bb89828', + * '7009ba364c7a5760798ceb430e603b74', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` + */ + edit( + prefixId: string, + bgpPrefixId: string, + params: BGPPrefixEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, + { body, ...options }, + ) as Core.APIPromise<{ result: BGPPrefix }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve a single BGP Prefix according to its identifier + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.get( + * '2af39739cc4e3b5910c918468bb89828', + * '7009ba364c7a5760798ceb430e603b74', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` + */ + get( + prefixId: string, + bgpPrefixId: string, + params: BGPPrefixGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, + options, + ) as Core.APIPromise<{ result: BGPPrefix }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class BGPPrefixesSinglePage extends SinglePage {} + +export interface BGPPrefix { + /** + * Identifier of BGP Prefix. + */ + id?: string; + + /** + * Autonomous System Number (ASN) the prefix will be advertised under. + */ + asn?: number | null; + + /** + * Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute + */ + asn_prepend_count?: number; + + /** + * Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + * matching BGP prefix in the Magic routing table. When true, Cloudflare will + * automatically withdraw the BGP prefix when there are no matching BGP routes, and + * will resume advertising when there is at least one matching BGP route. + */ + auto_advertise_withdraw?: boolean; + + bgp_signal_opts?: BGPPrefix.BGPSignalOpts; + + /** + * IP Prefix in Classless Inter-Domain Routing format. + */ + cidr?: string; + + created_at?: string; + + modified_at?: string; + + on_demand?: BGPPrefix.OnDemand; +} + +export namespace BGPPrefix { + export interface BGPSignalOpts { + /** + * Whether control of advertisement of the prefix to the Internet is enabled to be + * performed via BGP signal + */ + enabled?: boolean; + + /** + * Last time BGP signaling control was toggled. This field is null if BGP signaling + * has never been enabled. + */ + modified_at?: string | null; + } + + export interface OnDemand { + /** + * Prefix advertisement status to the Internet. This field is only not 'null' if on + * demand is enabled. + */ + advertised?: boolean | null; + + /** + * Last time the advertisement status was changed. This field is only not 'null' if + * on demand is enabled. + */ + advertised_modified_at?: string | null; + + /** + * Whether advertisement of the prefix to the Internet may be dynamically enabled + * or disabled. + */ + on_demand_enabled?: boolean; + + /** + * Whether the advertisement status of the prefix is locked, meaning it cannot be + * changed. + */ + on_demand_locked?: boolean; + } +} + +export interface BGPPrefixCreateParams { + /** + * Path param: Identifier of a Cloudflare account. + */ + account_id: string; + + /** + * Body param: IP Prefix in Classless Inter-Domain Routing format. + */ + cidr: string; +} + +export interface BGPPrefixListParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +export interface BGPPrefixEditParams { + /** + * Path param: Identifier of a Cloudflare account. + */ + account_id: string; + + /** + * Body param: Number of times to prepend the Cloudflare ASN to the BGP AS-Path + * attribute + */ + asn_prepend_count?: number; + + /** + * Body param: Determines if Cloudflare advertises a BYOIP BGP prefix even when + * there is no matching BGP prefix in the Magic routing table. When true, + * Cloudflare will automatically withdraw the BGP prefix when there are no matching + * BGP routes, and will resume advertising when there is at least one matching BGP + * route. + */ + auto_advertise_withdraw?: boolean; + + /** + * Body param + */ + on_demand?: BGPPrefixEditParams.OnDemand; +} + +export namespace BGPPrefixEditParams { + export interface OnDemand { + advertised?: boolean; + } +} + +export interface BGPPrefixGetParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +BGPPrefixes.BGPPrefixesSinglePage = BGPPrefixesSinglePage; + +export declare namespace BGPPrefixes { + export { + type BGPPrefix as BGPPrefix, + BGPPrefixesSinglePage as BGPPrefixesSinglePage, + type BGPPrefixCreateParams as BGPPrefixCreateParams, + type BGPPrefixListParams as BGPPrefixListParams, + type BGPPrefixEditParams as BGPPrefixEditParams, + type BGPPrefixGetParams as BGPPrefixGetParams, + }; +} diff --git a/src/resources/addressing/prefixes/bgp/bgp.ts b/src/resources/addressing/prefixes/bgp/bgp.ts deleted file mode 100644 index 4ed20ee98c..0000000000 --- a/src/resources/addressing/prefixes/bgp/bgp.ts +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as BindingsAPI from 'cloudflare/resources/addressing/prefixes/bgp/bindings'; -import * as PrefixesAPI from 'cloudflare/resources/addressing/prefixes/bgp/prefixes'; -import * as StatusesAPI from 'cloudflare/resources/addressing/prefixes/bgp/statuses'; - -export class BGP extends APIResource { - bindings: BindingsAPI.Bindings = new BindingsAPI.Bindings(this._client); - prefixes: PrefixesAPI.Prefixes = new PrefixesAPI.Prefixes(this._client); - statuses: StatusesAPI.Statuses = new StatusesAPI.Statuses(this._client); -} - -export namespace BGP { - export import Bindings = BindingsAPI.Bindings; - export import AddressingServiceBinding = BindingsAPI.AddressingServiceBinding; - export import BindingListResponse = BindingsAPI.BindingListResponse; - export import BindingDeleteResponse = BindingsAPI.BindingDeleteResponse; - export import BindingCreateParams = BindingsAPI.BindingCreateParams; - export import BindingListParams = BindingsAPI.BindingListParams; - export import BindingDeleteParams = BindingsAPI.BindingDeleteParams; - export import BindingGetParams = BindingsAPI.BindingGetParams; - export import Prefixes = PrefixesAPI.Prefixes; - export import AddressingIpamBGPPrefixes = PrefixesAPI.AddressingIpamBGPPrefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; - export import PrefixEditParams = PrefixesAPI.PrefixEditParams; - export import PrefixGetParams = PrefixesAPI.PrefixGetParams; - export import Statuses = StatusesAPI.Statuses; - export import StatusEditResponse = StatusesAPI.StatusEditResponse; - export import StatusGetResponse = StatusesAPI.StatusGetResponse; - export import StatusEditParams = StatusesAPI.StatusEditParams; - export import StatusGetParams = StatusesAPI.StatusGetParams; -} diff --git a/src/resources/addressing/prefixes/bgp/bindings.ts b/src/resources/addressing/prefixes/bgp/bindings.ts deleted file mode 100644 index 92b09b4a03..0000000000 --- a/src/resources/addressing/prefixes/bgp/bindings.ts +++ /dev/null @@ -1,177 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as BindingsAPI from 'cloudflare/resources/addressing/prefixes/bgp/bindings'; - -export class Bindings extends APIResource { - /** - * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a - * service running on Cloudflare's network. **Note:** This API may only be used on - * prefixes currently configured with a Magic Transit service binding, and only - * allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. - */ - create( - prefixId: string, - params: BindingCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, { - body, - ...options, - }) as Core.APIPromise<{ result: AddressingServiceBinding }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List the Cloudflare services this prefix is currently bound to. Traffic sent to - * an address within an IP prefix will be routed to the Cloudflare service of the - * most-specific Service Binding matching the address. **Example:** binding - * `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare - * CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other - * IPs in the prefix to Cloudflare Magic Transit. - */ - list( - prefixId: string, - params: BindingListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, - options, - ) as Core.APIPromise<{ result: BindingListResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Delete a Service Binding - */ - delete( - prefixId: string, - bindingId: string, - params: BindingDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, - options, - ) as Core.APIPromise<{ result: BindingDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Fetch a single Service Binding - */ - get( - prefixId: string, - bindingId: string, - params: BindingGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, - options, - ) as Core.APIPromise<{ result: AddressingServiceBinding }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AddressingServiceBinding { - /** - * Identifier - */ - id?: string; - - /** - * IP Prefix in Classless Inter-Domain Routing format. - */ - cidr?: string; - - /** - * Status of a Service Binding's deployment to the Cloudflare network - */ - provisioning?: AddressingServiceBinding.Provisioning; - - /** - * Identifier - */ - service_id?: string; - - /** - * Name of a service running on the Cloudflare network - */ - service_name?: string; -} - -export namespace AddressingServiceBinding { - /** - * Status of a Service Binding's deployment to the Cloudflare network - */ - export interface Provisioning { - /** - * When a binding has been deployed to a majority of Cloudflare datacenters, the - * binding will become active and can be used with its associated service. - */ - state?: 'provisioning' | 'active'; - } -} - -export type BindingListResponse = Array; - -export type BindingDeleteResponse = unknown | Array | string; - -export interface BindingCreateParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Body param: IP Prefix in Classless Inter-Domain Routing format. - */ - cidr?: string; - - /** - * Body param: Identifier - */ - service_id?: string; -} - -export interface BindingListParams { - /** - * Identifier - */ - account_id: string; -} - -export interface BindingDeleteParams { - /** - * Identifier - */ - account_id: string; -} - -export interface BindingGetParams { - /** - * Identifier - */ - account_id: string; -} - -export namespace Bindings { - export import AddressingServiceBinding = BindingsAPI.AddressingServiceBinding; - export import BindingListResponse = BindingsAPI.BindingListResponse; - export import BindingDeleteResponse = BindingsAPI.BindingDeleteResponse; - export import BindingCreateParams = BindingsAPI.BindingCreateParams; - export import BindingListParams = BindingsAPI.BindingListParams; - export import BindingDeleteParams = BindingsAPI.BindingDeleteParams; - export import BindingGetParams = BindingsAPI.BindingGetParams; -} diff --git a/src/resources/addressing/prefixes/bgp/index.ts b/src/resources/addressing/prefixes/bgp/index.ts deleted file mode 100644 index e055357b95..0000000000 --- a/src/resources/addressing/prefixes/bgp/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { - AddressingIpamBGPPrefixes, - PrefixListResponse, - PrefixListParams, - PrefixEditParams, - PrefixGetParams, - Prefixes, -} from './prefixes'; -export { - AddressingServiceBinding, - BindingListResponse, - BindingDeleteResponse, - BindingCreateParams, - BindingListParams, - BindingDeleteParams, - BindingGetParams, - Bindings, -} from './bindings'; -export { BGP } from './bgp'; -export { - StatusEditResponse, - StatusGetResponse, - StatusEditParams, - StatusGetParams, - Statuses, -} from './statuses'; diff --git a/src/resources/addressing/prefixes/bgp/prefixes.ts b/src/resources/addressing/prefixes/bgp/prefixes.ts deleted file mode 100644 index 0538c4d1c7..0000000000 --- a/src/resources/addressing/prefixes/bgp/prefixes.ts +++ /dev/null @@ -1,173 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as PrefixesAPI from 'cloudflare/resources/addressing/prefixes/bgp/prefixes'; - -export class Prefixes extends APIResource { - /** - * List all BGP Prefixes within the specified IP Prefix. BGP Prefixes are used to - * control which specific subnets are advertised to the Internet. It is possible to - * advertise subnets more specific than an IP Prefix by creating more specific BGP - * Prefixes. - */ - list( - prefixId: string, - params: PrefixListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes`, - options, - ) as Core.APIPromise<{ result: PrefixListResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update the properties of a BGP Prefix, such as the on demand advertisement - * status (advertised or withdrawn). - */ - edit( - prefixId: string, - bgpPrefixId: string, - params: PrefixEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, - { body, ...options }, - ) as Core.APIPromise<{ result: AddressingIpamBGPPrefixes }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieve a single BGP Prefix according to its identifier - */ - get( - prefixId: string, - bgpPrefixId: string, - params: PrefixGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/prefixes/${bgpPrefixId}`, - options, - ) as Core.APIPromise<{ result: AddressingIpamBGPPrefixes }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AddressingIpamBGPPrefixes { - /** - * Identifier - */ - id?: string; - - /** - * Autonomous System Number (ASN) the prefix will be advertised under. - */ - asn?: number | null; - - bgp_signal_opts?: AddressingIpamBGPPrefixes.BGPSignalOpts; - - /** - * IP Prefix in Classless Inter-Domain Routing format. - */ - cidr?: string; - - created_at?: string; - - modified_at?: string; - - on_demand?: AddressingIpamBGPPrefixes.OnDemand; -} - -export namespace AddressingIpamBGPPrefixes { - export interface BGPSignalOpts { - /** - * Whether control of advertisement of the prefix to the Internet is enabled to be - * performed via BGP signal - */ - enabled?: boolean; - - /** - * Last time BGP signaling control was toggled. This field is null if BGP signaling - * has never been enabled. - */ - modified_at?: string | null; - } - - export interface OnDemand { - /** - * Prefix advertisement status to the Internet. This field is only not 'null' if on - * demand is enabled. - */ - advertised?: boolean | null; - - /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. - */ - advertised_modified_at?: string | null; - - /** - * Whether advertisement of the prefix to the Internet may be dynamically enabled - * or disabled. - */ - on_demand_enabled?: boolean; - - /** - * Whether advertisement status of the prefix is locked, meaning it cannot be - * changed. - */ - on_demand_locked?: boolean; - } -} - -export type PrefixListResponse = Array; - -export interface PrefixListParams { - /** - * Identifier - */ - account_id: string; -} - -export interface PrefixEditParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Body param: - */ - on_demand?: PrefixEditParams.OnDemand; -} - -export namespace PrefixEditParams { - export interface OnDemand { - advertised?: boolean; - } -} - -export interface PrefixGetParams { - /** - * Identifier - */ - account_id: string; -} - -export namespace Prefixes { - export import AddressingIpamBGPPrefixes = PrefixesAPI.AddressingIpamBGPPrefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixListParams = PrefixesAPI.PrefixListParams; - export import PrefixEditParams = PrefixesAPI.PrefixEditParams; - export import PrefixGetParams = PrefixesAPI.PrefixGetParams; -} diff --git a/src/resources/addressing/prefixes/bgp/statuses.ts b/src/resources/addressing/prefixes/bgp/statuses.ts deleted file mode 100644 index 3c357586de..0000000000 --- a/src/resources/addressing/prefixes/bgp/statuses.ts +++ /dev/null @@ -1,93 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as StatusesAPI from 'cloudflare/resources/addressing/prefixes/bgp/statuses'; - -export class Statuses extends APIResource { - /** - * Advertise or withdraw BGP route for a prefix. - */ - edit( - prefixId: string, - params: StatusEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, { - body, - ...options, - }) as Core.APIPromise<{ result: StatusEditResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List the current advertisement state for a prefix. - */ - get( - prefixId: string, - params: StatusGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/bgp/status`, - options, - ) as Core.APIPromise<{ result: StatusGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface StatusEditResponse { - /** - * Enablement of prefix advertisement to the Internet. - */ - advertised?: boolean; - - /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. - */ - advertised_modified_at?: string | null; -} - -export interface StatusGetResponse { - /** - * Enablement of prefix advertisement to the Internet. - */ - advertised?: boolean; - - /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. - */ - advertised_modified_at?: string | null; -} - -export interface StatusEditParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Body param: Enablement of prefix advertisement to the Internet. - */ - advertised: boolean; -} - -export interface StatusGetParams { - /** - * Identifier - */ - account_id: string; -} - -export namespace Statuses { - export import StatusEditResponse = StatusesAPI.StatusEditResponse; - export import StatusGetResponse = StatusesAPI.StatusGetResponse; - export import StatusEditParams = StatusesAPI.StatusEditParams; - export import StatusGetParams = StatusesAPI.StatusGetParams; -} diff --git a/src/resources/addressing/prefixes/delegations.ts b/src/resources/addressing/prefixes/delegations.ts index 6adf17f770..ae0bc86716 100644 --- a/src/resources/addressing/prefixes/delegations.ts +++ b/src/resources/addressing/prefixes/delegations.ts @@ -1,46 +1,80 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as DelegationsAPI from 'cloudflare/resources/addressing/prefixes/delegations'; +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; export class Delegations extends APIResource { /** * Create a new account delegation for a given IP prefix. + * + * @example + * ```ts + * const delegations = + * await client.addressing.prefixes.delegations.create( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * delegated_account_id: + * 'b1946ac92492d2347c6235b4d2611184', + * }, + * ); + * ``` */ create( prefixId: string, params: DelegationCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, { body, ...options, - }) as Core.APIPromise<{ result: AddressingIpamDelegations }> + }) as Core.APIPromise<{ result: Delegations }> )._thenUnwrap((obj) => obj.result); } /** * List all delegations for a given account IP prefix. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const delegations of client.addressing.prefixes.delegations.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( prefixId: string, params: DelegationListParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, - options, - ) as Core.APIPromise<{ result: DelegationListResponse | null }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/delegations`, + DelegationsSinglePage, + options, + ); } /** * Delete an account delegation for a given IP prefix. + * + * @example + * ```ts + * const delegation = + * await client.addressing.prefixes.delegations.delete( + * '2af39739cc4e3b5910c918468bb89828', + * 'd933b1530bc56c9953cf8ce166da8004', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( prefixId: string, @@ -58,9 +92,11 @@ export class Delegations extends APIResource { } } -export interface AddressingIpamDelegations { +export class DelegationsSinglePage extends SinglePage {} + +export interface Delegations { /** - * Delegation identifier tag. + * Identifier of a Delegation. */ id?: string; @@ -79,23 +115,21 @@ export interface AddressingIpamDelegations { modified_at?: string; /** - * Identifier + * Identifier of an IP Prefix. */ parent_prefix_id?: string; } -export type DelegationListResponse = Array; - export interface DelegationDeleteResponse { /** - * Delegation identifier tag. + * Identifier of a Delegation. */ id?: string; } export interface DelegationCreateParams { /** - * Path param: Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; @@ -113,23 +147,27 @@ export interface DelegationCreateParams { export interface DelegationListParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } export interface DelegationDeleteParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace Delegations { - export import AddressingIpamDelegations = DelegationsAPI.AddressingIpamDelegations; - export import DelegationListResponse = DelegationsAPI.DelegationListResponse; - export import DelegationDeleteResponse = DelegationsAPI.DelegationDeleteResponse; - export import DelegationCreateParams = DelegationsAPI.DelegationCreateParams; - export import DelegationListParams = DelegationsAPI.DelegationListParams; - export import DelegationDeleteParams = DelegationsAPI.DelegationDeleteParams; +Delegations.DelegationsSinglePage = DelegationsSinglePage; + +export declare namespace Delegations { + export { + type Delegations as Delegations, + type DelegationDeleteResponse as DelegationDeleteResponse, + DelegationsSinglePage as DelegationsSinglePage, + type DelegationCreateParams as DelegationCreateParams, + type DelegationListParams as DelegationListParams, + type DelegationDeleteParams as DelegationDeleteParams, + }; } diff --git a/src/resources/addressing/prefixes/index.ts b/src/resources/addressing/prefixes/index.ts index 1fb2fc07b3..1448718c77 100644 --- a/src/resources/addressing/prefixes/index.ts +++ b/src/resources/addressing/prefixes/index.ts @@ -1,23 +1,47 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AddressingIpamDelegations, - DelegationListResponse, - DelegationDeleteResponse, - DelegationCreateParams, - DelegationListParams, - DelegationDeleteParams, + AdvertisementStatus, + type AdvertisementStatusEditResponse, + type AdvertisementStatusGetResponse, + type AdvertisementStatusEditParams, + type AdvertisementStatusGetParams, +} from './advertisement-status'; +export { + BGPPrefixesSinglePage, + BGPPrefixes, + type BGPPrefix, + type BGPPrefixCreateParams, + type BGPPrefixListParams, + type BGPPrefixEditParams, + type BGPPrefixGetParams, +} from './bgp-prefixes'; +export { + DelegationsSinglePage, Delegations, + type DelegationDeleteResponse, + type DelegationCreateParams, + type DelegationListParams, + type DelegationDeleteParams, } from './delegations'; export { - AddressingIpamPrefixes, - PrefixListResponse, - PrefixDeleteResponse, - PrefixCreateParams, - PrefixListParams, - PrefixDeleteParams, - PrefixEditParams, - PrefixGetParams, + PrefixesSinglePage, Prefixes, + type Prefix, + type PrefixDeleteResponse, + type PrefixCreateParams, + type PrefixListParams, + type PrefixDeleteParams, + type PrefixEditParams, + type PrefixGetParams, } from './prefixes'; -export { BGP } from './bgp/index'; +export { + ServiceBindingsSinglePage, + ServiceBindings, + type ServiceBinding, + type ServiceBindingDeleteResponse, + type ServiceBindingCreateParams, + type ServiceBindingListParams, + type ServiceBindingDeleteParams, + type ServiceBindingGetParams, +} from './service-bindings'; diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index 9a0d1bcb13..a30767d55d 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -1,112 +1,193 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as PrefixesAPI from 'cloudflare/resources/addressing/prefixes/prefixes'; -import * as DelegationsAPI from 'cloudflare/resources/addressing/prefixes/delegations'; -import * as BGPAPI from 'cloudflare/resources/addressing/prefixes/bgp/bgp'; +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as AdvertisementStatusAPI from './advertisement-status'; +import { + AdvertisementStatus, + AdvertisementStatusEditParams, + AdvertisementStatusEditResponse, + AdvertisementStatusGetParams, + AdvertisementStatusGetResponse, +} from './advertisement-status'; +import * as BGPPrefixesAPI from './bgp-prefixes'; +import { + BGPPrefix, + BGPPrefixCreateParams, + BGPPrefixEditParams, + BGPPrefixGetParams, + BGPPrefixListParams, + BGPPrefixes, + BGPPrefixesSinglePage, +} from './bgp-prefixes'; +import * as DelegationsAPI from './delegations'; +import { + DelegationCreateParams, + DelegationDeleteParams, + DelegationDeleteResponse, + DelegationListParams, + Delegations, + DelegationsSinglePage, +} from './delegations'; +import * as ServiceBindingsAPI from './service-bindings'; +import { + ServiceBinding, + ServiceBindingCreateParams, + ServiceBindingDeleteParams, + ServiceBindingDeleteResponse, + ServiceBindingGetParams, + ServiceBindingListParams, + ServiceBindings, + ServiceBindingsSinglePage, +} from './service-bindings'; +import { SinglePage } from '../../../pagination'; export class Prefixes extends APIResource { - bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); + serviceBindings: ServiceBindingsAPI.ServiceBindings = new ServiceBindingsAPI.ServiceBindings(this._client); + bgpPrefixes: BGPPrefixesAPI.BGPPrefixes = new BGPPrefixesAPI.BGPPrefixes(this._client); + advertisementStatus: AdvertisementStatusAPI.AdvertisementStatus = + new AdvertisementStatusAPI.AdvertisementStatus(this._client); delegations: DelegationsAPI.Delegations = new DelegationsAPI.Delegations(this._client); /** * Add a new prefix under the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * asn: 13335, + * cidr: '192.0.2.0/24', + * }); + * ``` */ - create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise { + create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.post(`/accounts/${account_id}/addressing/prefixes`, { body, ...options, - }) as Core.APIPromise<{ result: AddressingIpamPrefixes }> + }) as Core.APIPromise<{ result: Prefix }> )._thenUnwrap((obj) => obj.result); } /** * List all prefixes owned by the account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const prefix of client.addressing.prefixes.list({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * })) { + * // ... + * } + * ``` */ - list(params: PrefixListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: PrefixListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/addressing/prefixes`, options) as Core.APIPromise<{ - result: PrefixListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/addressing/prefixes`, + PrefixesSinglePage, + options, + ); } /** * Delete an unapproved prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.delete( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( prefixId: string, params: PrefixDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/addressing/prefixes/${prefixId}`, - options, - ) as Core.APIPromise<{ result: PrefixDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); + return this._client.delete(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, options); } /** * Modify the description for a prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.edit( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * description: 'Internal test prefix', + * }, + * ); + * ``` */ - edit( - prefixId: string, - params: PrefixEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + edit(prefixId: string, params: PrefixEditParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.patch(`/accounts/${account_id}/addressing/prefixes/${prefixId}`, { body, ...options, - }) as Core.APIPromise<{ result: AddressingIpamPrefixes }> + }) as Core.APIPromise<{ result: Prefix }> )._thenUnwrap((obj) => obj.result); } /** * List a particular prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.get( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ - get( - prefixId: string, - params: PrefixGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { + get(prefixId: string, params: PrefixGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/addressing/prefixes/${prefixId}`, options, - ) as Core.APIPromise<{ result: AddressingIpamPrefixes }> + ) as Core.APIPromise<{ result: Prefix }> )._thenUnwrap((obj) => obj.result); } } -export interface AddressingIpamPrefixes { +export class PrefixesSinglePage extends SinglePage {} + +export interface Prefix { /** - * Identifier + * Identifier of an IP Prefix. */ id?: string; /** - * Identifier + * Identifier of a Cloudflare account. */ account_id?: string; /** - * Prefix advertisement status to the Internet. This field is only not 'null' if on - * demand is enabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ advertised?: boolean | null; /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ advertised_modified_at?: string | null; @@ -118,7 +199,7 @@ export interface AddressingIpamPrefixes { /** * Autonomous System Number (ASN) the prefix will be advertised under. */ - asn?: number | null; + asn?: number; /** * IP Prefix in Classless Inter-Domain Routing format. @@ -127,11 +208,22 @@ export interface AddressingIpamPrefixes { created_at?: string; + /** + * Whether Cloudflare is allowed to generate the LOA document on behalf of the + * prefix owner. + */ + delegate_loa_creation?: boolean; + /** * Description of the prefix. */ description?: string; + /** + * State of one kind of validation for an IP prefix. + */ + irr_validation_state?: string; + /** * Identifier for the uploaded LOA document. */ @@ -140,61 +232,132 @@ export interface AddressingIpamPrefixes { modified_at?: string; /** - * Whether advertisement of the prefix to the Internet may be dynamically enabled - * or disabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ on_demand_enabled?: boolean; /** - * Whether advertisement status of the prefix is locked, meaning it cannot be - * changed. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ on_demand_locked?: boolean; + + /** + * State of one kind of validation for an IP prefix. + */ + ownership_validation_state?: string; + + /** + * Token provided to demonstrate ownership of the prefix. + */ + ownership_validation_token?: string; + + /** + * State of one kind of validation for an IP prefix. + */ + rpki_validation_state?: string; } -export type PrefixListResponse = Array; +export interface PrefixDeleteResponse { + errors: Array; -export type PrefixDeleteResponse = unknown | Array | string; + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace PrefixDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} export interface PrefixCreateParams { /** - * Path param: Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; /** * Body param: Autonomous System Number (ASN) the prefix will be advertised under. */ - asn: number | null; + asn: number; /** * Body param: IP Prefix in Classless Inter-Domain Routing format. */ cidr: string; + /** + * Body param: Whether Cloudflare is allowed to generate the LOA document on behalf + * of the prefix owner. + */ + delegate_loa_creation?: boolean; + + /** + * Body param: Description of the prefix. + */ + description?: string; + /** * Body param: Identifier for the uploaded LOA document. */ - loa_document_id: string | null; + loa_document_id?: string | null; } export interface PrefixListParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } export interface PrefixDeleteParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } export interface PrefixEditParams { /** - * Path param: Identifier + * Path param: Identifier of a Cloudflare account. */ account_id: string; @@ -206,26 +369,66 @@ export interface PrefixEditParams { export interface PrefixGetParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace Prefixes { - export import AddressingIpamPrefixes = PrefixesAPI.AddressingIpamPrefixes; - export import PrefixListResponse = PrefixesAPI.PrefixListResponse; - export import PrefixDeleteResponse = PrefixesAPI.PrefixDeleteResponse; - export import PrefixCreateParams = PrefixesAPI.PrefixCreateParams; - export import PrefixListParams = PrefixesAPI.PrefixListParams; - export import PrefixDeleteParams = PrefixesAPI.PrefixDeleteParams; - export import PrefixEditParams = PrefixesAPI.PrefixEditParams; - export import PrefixGetParams = PrefixesAPI.PrefixGetParams; - export import BGP = BGPAPI.BGP; - export import Delegations = DelegationsAPI.Delegations; - export import AddressingIpamDelegations = DelegationsAPI.AddressingIpamDelegations; - export import DelegationListResponse = DelegationsAPI.DelegationListResponse; - export import DelegationDeleteResponse = DelegationsAPI.DelegationDeleteResponse; - export import DelegationCreateParams = DelegationsAPI.DelegationCreateParams; - export import DelegationListParams = DelegationsAPI.DelegationListParams; - export import DelegationDeleteParams = DelegationsAPI.DelegationDeleteParams; +Prefixes.PrefixesSinglePage = PrefixesSinglePage; +Prefixes.ServiceBindings = ServiceBindings; +Prefixes.ServiceBindingsSinglePage = ServiceBindingsSinglePage; +Prefixes.BGPPrefixes = BGPPrefixes; +Prefixes.BGPPrefixesSinglePage = BGPPrefixesSinglePage; +Prefixes.AdvertisementStatus = AdvertisementStatus; +Prefixes.DelegationsSinglePage = DelegationsSinglePage; + +export declare namespace Prefixes { + export { + type Prefix as Prefix, + type PrefixDeleteResponse as PrefixDeleteResponse, + PrefixesSinglePage as PrefixesSinglePage, + type PrefixCreateParams as PrefixCreateParams, + type PrefixListParams as PrefixListParams, + type PrefixDeleteParams as PrefixDeleteParams, + type PrefixEditParams as PrefixEditParams, + type PrefixGetParams as PrefixGetParams, + }; + + export { + ServiceBindings as ServiceBindings, + type ServiceBinding as ServiceBinding, + type ServiceBindingDeleteResponse as ServiceBindingDeleteResponse, + ServiceBindingsSinglePage as ServiceBindingsSinglePage, + type ServiceBindingCreateParams as ServiceBindingCreateParams, + type ServiceBindingListParams as ServiceBindingListParams, + type ServiceBindingDeleteParams as ServiceBindingDeleteParams, + type ServiceBindingGetParams as ServiceBindingGetParams, + }; + + export { + BGPPrefixes as BGPPrefixes, + type BGPPrefix as BGPPrefix, + BGPPrefixesSinglePage as BGPPrefixesSinglePage, + type BGPPrefixCreateParams as BGPPrefixCreateParams, + type BGPPrefixListParams as BGPPrefixListParams, + type BGPPrefixEditParams as BGPPrefixEditParams, + type BGPPrefixGetParams as BGPPrefixGetParams, + }; + + export { + AdvertisementStatus as AdvertisementStatus, + type AdvertisementStatusEditResponse as AdvertisementStatusEditResponse, + type AdvertisementStatusGetResponse as AdvertisementStatusGetResponse, + type AdvertisementStatusEditParams as AdvertisementStatusEditParams, + type AdvertisementStatusGetParams as AdvertisementStatusGetParams, + }; + + export { + type Delegations as Delegations, + type DelegationDeleteResponse as DelegationDeleteResponse, + DelegationsSinglePage as DelegationsSinglePage, + type DelegationCreateParams as DelegationCreateParams, + type DelegationListParams as DelegationListParams, + type DelegationDeleteParams as DelegationDeleteParams, + }; } diff --git a/src/resources/addressing/prefixes/service-bindings.ts b/src/resources/addressing/prefixes/service-bindings.ts new file mode 100644 index 0000000000..a12783f519 --- /dev/null +++ b/src/resources/addressing/prefixes/service-bindings.ts @@ -0,0 +1,269 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class ServiceBindings extends APIResource { + /** + * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a + * service running on Cloudflare's network. **NOTE:** The first Service Binding + * created for an IP Prefix must exactly match the IP Prefix's CIDR. Subsequent + * Service Bindings may be created with a more-specific CIDR. Refer to the + * [Service Bindings Documentation](https://developers.cloudflare.com/byoip/service-bindings/) + * for compatibility details. + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.create( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * service_id: '2db684ee7ca04e159946fd05b99e1bcd', + * }, + * ); + * ``` + */ + create( + prefixId: string, + params: ServiceBindingCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, { + body, + ...options, + }) as Core.APIPromise<{ result: ServiceBinding }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List the Cloudflare services this prefix is currently bound to. Traffic sent to + * an address within an IP prefix will be routed to the Cloudflare service of the + * most-specific Service Binding matching the address. **Example:** binding + * `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare + * CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other + * IPs in the prefix to Cloudflare Magic Transit. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const serviceBinding of client.addressing.prefixes.serviceBindings.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` + */ + list( + prefixId: string, + params: ServiceBindingListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings`, + ServiceBindingsSinglePage, + options, + ); + } + + /** + * Delete a Service Binding + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.delete( + * '2af39739cc4e3b5910c918468bb89828', + * '0429b49b6a5155297b78e75a44b09e14', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` + */ + delete( + prefixId: string, + bindingId: string, + params: ServiceBindingDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, + options, + ); + } + + /** + * Fetch a single Service Binding + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.get( + * '2af39739cc4e3b5910c918468bb89828', + * '0429b49b6a5155297b78e75a44b09e14', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` + */ + get( + prefixId: string, + bindingId: string, + params: ServiceBindingGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/addressing/prefixes/${prefixId}/bindings/${bindingId}`, + options, + ) as Core.APIPromise<{ result: ServiceBinding }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ServiceBindingsSinglePage extends SinglePage {} + +export interface ServiceBinding { + /** + * Identifier of a Service Binding. + */ + id?: string; + + /** + * IP Prefix in Classless Inter-Domain Routing format. + */ + cidr?: string; + + /** + * Status of a Service Binding's deployment to the Cloudflare network + */ + provisioning?: ServiceBinding.Provisioning; + + /** + * Identifier of a Service on the Cloudflare network. Available services and their + * IDs may be found in the **List Services** endpoint. + */ + service_id?: string; + + /** + * Name of a service running on the Cloudflare network + */ + service_name?: string; +} + +export namespace ServiceBinding { + /** + * Status of a Service Binding's deployment to the Cloudflare network + */ + export interface Provisioning { + /** + * When a binding has been deployed to a majority of Cloudflare datacenters, the + * binding will become active and can be used with its associated service. + */ + state?: 'provisioning' | 'active'; + } +} + +export interface ServiceBindingDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace ServiceBindingDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} + +export interface ServiceBindingCreateParams { + /** + * Path param: Identifier of a Cloudflare account. + */ + account_id: string; + + /** + * Body param: IP Prefix in Classless Inter-Domain Routing format. + */ + cidr: string; + + /** + * Body param: Identifier of a Service on the Cloudflare network. Available + * services and their IDs may be found in the **List Services** endpoint. + */ + service_id: string; +} + +export interface ServiceBindingListParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +export interface ServiceBindingDeleteParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +export interface ServiceBindingGetParams { + /** + * Identifier of a Cloudflare account. + */ + account_id: string; +} + +ServiceBindings.ServiceBindingsSinglePage = ServiceBindingsSinglePage; + +export declare namespace ServiceBindings { + export { + type ServiceBinding as ServiceBinding, + type ServiceBindingDeleteResponse as ServiceBindingDeleteResponse, + ServiceBindingsSinglePage as ServiceBindingsSinglePage, + type ServiceBindingCreateParams as ServiceBindingCreateParams, + type ServiceBindingListParams as ServiceBindingListParams, + type ServiceBindingDeleteParams as ServiceBindingDeleteParams, + type ServiceBindingGetParams as ServiceBindingGetParams, + }; +} diff --git a/src/resources/addressing/regional-hostnames.ts b/src/resources/addressing/regional-hostnames.ts new file mode 100644 index 0000000000..db6639dd27 --- /dev/null +++ b/src/resources/addressing/regional-hostnames.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './regional-hostnames/index'; diff --git a/src/resources/addressing/regional-hostnames/index.ts b/src/resources/addressing/regional-hostnames/index.ts new file mode 100644 index 0000000000..527ec41ccf --- /dev/null +++ b/src/resources/addressing/regional-hostnames/index.ts @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + RegionListResponsesSinglePage, + Regions, + type RegionListResponse, + type RegionListParams, +} from './regions'; +export { + RegionalHostnameListResponsesSinglePage, + RegionalHostnames, + type RegionalHostnameCreateResponse, + type RegionalHostnameListResponse, + type RegionalHostnameDeleteResponse, + type RegionalHostnameEditResponse, + type RegionalHostnameGetResponse, + type RegionalHostnameCreateParams, + type RegionalHostnameListParams, + type RegionalHostnameDeleteParams, + type RegionalHostnameEditParams, + type RegionalHostnameGetParams, +} from './regional-hostnames'; diff --git a/src/resources/addressing/regional-hostnames/regional-hostnames.ts b/src/resources/addressing/regional-hostnames/regional-hostnames.ts new file mode 100644 index 0000000000..53c5c9a505 --- /dev/null +++ b/src/resources/addressing/regional-hostnames/regional-hostnames.ts @@ -0,0 +1,364 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as RegionsAPI from './regions'; +import { RegionListParams, RegionListResponse, RegionListResponsesSinglePage, Regions } from './regions'; +import { SinglePage } from '../../../pagination'; + +export class RegionalHostnames extends APIResource { + regions: RegionsAPI.Regions = new RegionsAPI.Regions(this._client); + + /** + * Create a new Regional Hostname entry. Cloudflare will only use data centers that + * are physically located within the chosen region to decrypt and service HTTPS + * traffic. Learn more about + * [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/). + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * hostname: 'foo.example.com', + * region_key: 'ca', + * }); + * ``` + */ + create( + params: RegionalHostnameCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/addressing/regional_hostnames`, { + body, + ...options, + }) as Core.APIPromise<{ result: RegionalHostnameCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all Regional Hostnames within a zone. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: RegionalHostnameListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/addressing/regional_hostnames`, + RegionalHostnameListResponsesSinglePage, + options, + ); + } + + /** + * Delete the region configuration for a specific Regional Hostname. + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.delete( + * 'foo.example.com', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + hostname: string, + params: RegionalHostnameDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.delete(`/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, options); + } + + /** + * Update the configuration for a specific Regional Hostname. Only the region_key + * of a hostname is mutable. + * + * @example + * ```ts + * const response = + * await client.addressing.regionalHostnames.edit( + * 'foo.example.com', + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * region_key: 'ca', + * }, + * ); + * ``` + */ + edit( + hostname: string, + params: RegionalHostnameEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.patch(`/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, { + body, + ...options, + }) as Core.APIPromise<{ result: RegionalHostnameEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetch the configuration for a specific Regional Hostname, within a zone. + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.get( + * 'foo.example.com', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + hostname: string, + params: RegionalHostnameGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get( + `/zones/${zone_id}/addressing/regional_hostnames/${hostname}`, + options, + ) as Core.APIPromise<{ result: RegionalHostnameGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class RegionalHostnameListResponsesSinglePage extends SinglePage {} + +export interface RegionalHostnameCreateResponse { + /** + * When the regional hostname was created + */ + created_on: string; + + /** + * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are + * supported for one level, e.g `*.example.com` + */ + hostname: string; + + /** + * Identifying key for the region + */ + region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; +} + +export interface RegionalHostnameListResponse { + /** + * When the regional hostname was created + */ + created_on: string; + + /** + * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are + * supported for one level, e.g `*.example.com` + */ + hostname: string; + + /** + * Identifying key for the region + */ + region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; +} + +export interface RegionalHostnameDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace RegionalHostnameDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} + +export interface RegionalHostnameEditResponse { + /** + * When the regional hostname was created + */ + created_on: string; + + /** + * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are + * supported for one level, e.g `*.example.com` + */ + hostname: string; + + /** + * Identifying key for the region + */ + region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; +} + +export interface RegionalHostnameGetResponse { + /** + * When the regional hostname was created + */ + created_on: string; + + /** + * DNS hostname to be regionalized, must be a subdomain of the zone. Wildcards are + * supported for one level, e.g `*.example.com` + */ + hostname: string; + + /** + * Identifying key for the region + */ + region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; +} + +export interface RegionalHostnameCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: DNS hostname to be regionalized, must be a subdomain of the zone. + * Wildcards are supported for one level, e.g `*.example.com` + */ + hostname: string; + + /** + * Body param: Identifying key for the region + */ + region_key: string; + + /** + * Body param: Configure which routing method to use for the regional hostname + */ + routing?: string; +} + +export interface RegionalHostnameListParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface RegionalHostnameDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface RegionalHostnameEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Identifying key for the region + */ + region_key: string; +} + +export interface RegionalHostnameGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +RegionalHostnames.RegionalHostnameListResponsesSinglePage = RegionalHostnameListResponsesSinglePage; +RegionalHostnames.Regions = Regions; +RegionalHostnames.RegionListResponsesSinglePage = RegionListResponsesSinglePage; + +export declare namespace RegionalHostnames { + export { + type RegionalHostnameCreateResponse as RegionalHostnameCreateResponse, + type RegionalHostnameListResponse as RegionalHostnameListResponse, + type RegionalHostnameDeleteResponse as RegionalHostnameDeleteResponse, + type RegionalHostnameEditResponse as RegionalHostnameEditResponse, + type RegionalHostnameGetResponse as RegionalHostnameGetResponse, + RegionalHostnameListResponsesSinglePage as RegionalHostnameListResponsesSinglePage, + type RegionalHostnameCreateParams as RegionalHostnameCreateParams, + type RegionalHostnameListParams as RegionalHostnameListParams, + type RegionalHostnameDeleteParams as RegionalHostnameDeleteParams, + type RegionalHostnameEditParams as RegionalHostnameEditParams, + type RegionalHostnameGetParams as RegionalHostnameGetParams, + }; + + export { + Regions as Regions, + type RegionListResponse as RegionListResponse, + RegionListResponsesSinglePage as RegionListResponsesSinglePage, + type RegionListParams as RegionListParams, + }; +} diff --git a/src/resources/addressing/regional-hostnames/regions.ts b/src/resources/addressing/regional-hostnames/regions.ts new file mode 100644 index 0000000000..0f11942e41 --- /dev/null +++ b/src/resources/addressing/regional-hostnames/regions.ts @@ -0,0 +1,63 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class Regions extends APIResource { + /** + * List all Regional Services regions available for use by this account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const regionListResponse of client.addressing.regionalHostnames.regions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: RegionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/addressing/regional_hostnames/regions`, + RegionListResponsesSinglePage, + options, + ); + } +} + +export class RegionListResponsesSinglePage extends SinglePage {} + +export interface RegionListResponse { + /** + * Identifying key for the region + */ + key?: string; + + /** + * Human-readable text label for the region + */ + label?: string; +} + +export interface RegionListParams { + /** + * Identifier. + */ + account_id: string; +} + +Regions.RegionListResponsesSinglePage = RegionListResponsesSinglePage; + +export declare namespace Regions { + export { + type RegionListResponse as RegionListResponse, + RegionListResponsesSinglePage as RegionListResponsesSinglePage, + type RegionListParams as RegionListParams, + }; +} diff --git a/src/resources/addressing/services.ts b/src/resources/addressing/services.ts index 1ad85dd4a1..ab947c31d3 100644 --- a/src/resources/addressing/services.ts +++ b/src/resources/addressing/services.ts @@ -1,8 +1,8 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as ServicesAPI from 'cloudflare/resources/addressing/services'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; export class Services extends APIResource { /** @@ -10,41 +10,58 @@ export class Services extends APIResource { * service running on the Cloudflare network to enable a Cloudflare product on the * IP addresses. This endpoint can be used as a reference of available services on * the Cloudflare network, and their service IDs. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.addressing.services.list( + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ - list(params: ServiceListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: ServiceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/addressing/services`, options) as Core.APIPromise<{ - result: ServiceListResponse; - }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/addressing/services`, + ServiceListResponsesSinglePage, + options, + ); } } -export type ServiceListResponse = Array; +export class ServiceListResponsesSinglePage extends SinglePage {} -export namespace ServiceListResponse { - export interface ServiceListResponseItem { - /** - * Identifier - */ - id?: string; +export interface ServiceListResponse { + /** + * Identifier of a Service on the Cloudflare network. Available services and their + * IDs may be found in the **List Services** endpoint. + */ + id?: string; - /** - * Name of a service running on the Cloudflare network - */ - name?: string; - } + /** + * Name of a service running on the Cloudflare network + */ + name?: string; } export interface ServiceListParams { /** - * Identifier + * Identifier of a Cloudflare account. */ account_id: string; } -export namespace Services { - export import ServiceListResponse = ServicesAPI.ServiceListResponse; - export import ServiceListParams = ServicesAPI.ServiceListParams; +Services.ServiceListResponsesSinglePage = ServiceListResponsesSinglePage; + +export declare namespace Services { + export { + type ServiceListResponse as ServiceListResponse, + ServiceListResponsesSinglePage as ServiceListResponsesSinglePage, + type ServiceListParams as ServiceListParams, + }; } diff --git a/src/resources/ai-gateway.ts b/src/resources/ai-gateway.ts new file mode 100644 index 0000000000..bb4a5985f1 --- /dev/null +++ b/src/resources/ai-gateway.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ai-gateway/index'; diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts new file mode 100644 index 0000000000..a283b2e8bd --- /dev/null +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -0,0 +1,1100 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as DatasetsAPI from './datasets'; +import { + DatasetCreateParams, + DatasetCreateResponse, + DatasetDeleteParams, + DatasetDeleteResponse, + DatasetGetParams, + DatasetGetResponse, + DatasetListParams, + DatasetListResponse, + DatasetListResponsesV4PagePaginationArray, + DatasetUpdateParams, + DatasetUpdateResponse, + Datasets, +} from './datasets'; +import * as DynamicRoutingAPI from './dynamic-routing'; +import { + DynamicRouting, + DynamicRoutingCreateDeploymentParams, + DynamicRoutingCreateDeploymentResponse, + DynamicRoutingCreateParams, + DynamicRoutingCreateResponse, + DynamicRoutingCreateVersionParams, + DynamicRoutingCreateVersionResponse, + DynamicRoutingDeleteParams, + DynamicRoutingDeleteResponse, + DynamicRoutingGetParams, + DynamicRoutingGetResponse, + DynamicRoutingGetVersionParams, + DynamicRoutingGetVersionResponse, + DynamicRoutingListDeploymentsParams, + DynamicRoutingListDeploymentsResponse, + DynamicRoutingListParams, + DynamicRoutingListResponse, + DynamicRoutingListVersionsParams, + DynamicRoutingListVersionsResponse, + DynamicRoutingUpdateParams, + DynamicRoutingUpdateResponse, +} from './dynamic-routing'; +import * as EvaluationTypesAPI from './evaluation-types'; +import { + EvaluationTypeListParams, + EvaluationTypeListResponse, + EvaluationTypeListResponsesV4PagePaginationArray, + EvaluationTypes, +} from './evaluation-types'; +import * as EvaluationsAPI from './evaluations'; +import { + EvaluationCreateParams, + EvaluationCreateResponse, + EvaluationDeleteParams, + EvaluationDeleteResponse, + EvaluationGetParams, + EvaluationGetResponse, + EvaluationListParams, + EvaluationListResponse, + EvaluationListResponsesV4PagePaginationArray, + Evaluations, +} from './evaluations'; +import * as LogsAPI from './logs'; +import { + LogDeleteParams, + LogDeleteResponse, + LogEditParams, + LogEditResponse, + LogGetParams, + LogGetResponse, + LogListParams, + LogListResponse, + LogListResponsesV4PagePaginationArray, + LogRequestParams, + LogRequestResponse, + LogResponseParams, + LogResponseResponse, + Logs, +} from './logs'; +import * as ProviderConfigsAPI from './provider-configs'; +import { + ProviderConfigCreateParams, + ProviderConfigCreateResponse, + ProviderConfigListParams, + ProviderConfigListResponse, + ProviderConfigListResponsesV4PagePaginationArray, + ProviderConfigs, +} from './provider-configs'; +import * as URLsAPI from './urls'; +import { URLGetParams, URLGetResponse, URLs } from './urls'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class AIGateway extends APIResource { + evaluationTypes: EvaluationTypesAPI.EvaluationTypes = new EvaluationTypesAPI.EvaluationTypes(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); + evaluations: EvaluationsAPI.Evaluations = new EvaluationsAPI.Evaluations(this._client); + dynamicRouting: DynamicRoutingAPI.DynamicRouting = new DynamicRoutingAPI.DynamicRouting(this._client); + providerConfigs: ProviderConfigsAPI.ProviderConfigs = new ProviderConfigsAPI.ProviderConfigs(this._client); + urls: URLsAPI.URLs = new URLsAPI.URLs(this._client); + + /** + * Create a new Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.create({ + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * id: 'my-gateway', + * cache_invalidate_on_update: true, + * cache_ttl: 0, + * collect_logs: true, + * rate_limiting_interval: 0, + * rate_limiting_limit: 0, + * rate_limiting_technique: 'fixed', + * }); + * ``` + */ + create( + params: AIGatewayCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways`, { + body, + ...options, + }) as Core.APIPromise<{ result: AIGatewayCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.update( + * 'my-gateway', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * cache_invalidate_on_update: true, + * cache_ttl: 0, + * collect_logs: true, + * rate_limiting_interval: 0, + * rate_limiting_limit: 0, + * rate_limiting_technique: 'fixed', + * }, + * ); + * ``` + */ + update( + id: string, + params: AIGatewayUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AIGatewayUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Gateways + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const aiGatewayListResponse of client.aiGateway.list( + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: AIGatewayListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/gateways`, + AIGatewayListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.delete( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` + */ + delete( + id: string, + params: AIGatewayDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{ + result: AIGatewayDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetch a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.get('my-gateway', { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * }); + * ``` + */ + get( + id: string, + params: AIGatewayGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${id}`, options) as Core.APIPromise<{ + result: AIGatewayGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class AIGatewayListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface AIGatewayCreateResponse { + /** + * gateway id + */ + id: string; + + account_id: string; + + account_tag: string; + + cache_invalidate_on_update: boolean; + + cache_ttl: number | null; + + collect_logs: boolean; + + created_at: string; + + internal_id: string; + + modified_at: string; + + rate_limiting_interval: number | null; + + rate_limiting_limit: number | null; + + rate_limiting_technique: 'fixed' | 'sliding'; + + authentication?: boolean; + + dlp?: AIGatewayCreateResponse.UnionMember0 | AIGatewayCreateResponse.UnionMember1; + + is_default?: boolean; + + log_management?: number | null; + + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + logpush?: boolean; + + logpush_public_key?: string | null; + + otel?: Array | null; + + store_id?: string | null; + + stripe?: AIGatewayCreateResponse.Stripe | null; + + zdr?: boolean; +} + +export namespace AIGatewayCreateResponse { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayUpdateResponse { + /** + * gateway id + */ + id: string; + + account_id: string; + + account_tag: string; + + cache_invalidate_on_update: boolean; + + cache_ttl: number | null; + + collect_logs: boolean; + + created_at: string; + + internal_id: string; + + modified_at: string; + + rate_limiting_interval: number | null; + + rate_limiting_limit: number | null; + + rate_limiting_technique: 'fixed' | 'sliding'; + + authentication?: boolean; + + dlp?: AIGatewayUpdateResponse.UnionMember0 | AIGatewayUpdateResponse.UnionMember1; + + is_default?: boolean; + + log_management?: number | null; + + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + logpush?: boolean; + + logpush_public_key?: string | null; + + otel?: Array | null; + + store_id?: string | null; + + stripe?: AIGatewayUpdateResponse.Stripe | null; + + zdr?: boolean; +} + +export namespace AIGatewayUpdateResponse { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayListResponse { + /** + * gateway id + */ + id: string; + + account_id: string; + + account_tag: string; + + cache_invalidate_on_update: boolean; + + cache_ttl: number | null; + + collect_logs: boolean; + + created_at: string; + + internal_id: string; + + modified_at: string; + + rate_limiting_interval: number | null; + + rate_limiting_limit: number | null; + + rate_limiting_technique: 'fixed' | 'sliding'; + + authentication?: boolean; + + dlp?: AIGatewayListResponse.UnionMember0 | AIGatewayListResponse.UnionMember1; + + is_default?: boolean; + + log_management?: number | null; + + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + logpush?: boolean; + + logpush_public_key?: string | null; + + otel?: Array | null; + + store_id?: string | null; + + stripe?: AIGatewayListResponse.Stripe | null; + + zdr?: boolean; +} + +export namespace AIGatewayListResponse { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayDeleteResponse { + /** + * gateway id + */ + id: string; + + account_id: string; + + account_tag: string; + + cache_invalidate_on_update: boolean; + + cache_ttl: number | null; + + collect_logs: boolean; + + created_at: string; + + internal_id: string; + + modified_at: string; + + rate_limiting_interval: number | null; + + rate_limiting_limit: number | null; + + rate_limiting_technique: 'fixed' | 'sliding'; + + authentication?: boolean; + + dlp?: AIGatewayDeleteResponse.UnionMember0 | AIGatewayDeleteResponse.UnionMember1; + + is_default?: boolean; + + log_management?: number | null; + + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + logpush?: boolean; + + logpush_public_key?: string | null; + + otel?: Array | null; + + store_id?: string | null; + + stripe?: AIGatewayDeleteResponse.Stripe | null; + + zdr?: boolean; +} + +export namespace AIGatewayDeleteResponse { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayGetResponse { + /** + * gateway id + */ + id: string; + + account_id: string; + + account_tag: string; + + cache_invalidate_on_update: boolean; + + cache_ttl: number | null; + + collect_logs: boolean; + + created_at: string; + + internal_id: string; + + modified_at: string; + + rate_limiting_interval: number | null; + + rate_limiting_limit: number | null; + + rate_limiting_technique: 'fixed' | 'sliding'; + + authentication?: boolean; + + dlp?: AIGatewayGetResponse.UnionMember0 | AIGatewayGetResponse.UnionMember1; + + is_default?: boolean; + + log_management?: number | null; + + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + logpush?: boolean; + + logpush_public_key?: string | null; + + otel?: Array | null; + + store_id?: string | null; + + stripe?: AIGatewayGetResponse.Stripe | null; + + zdr?: boolean; +} + +export namespace AIGatewayGetResponse { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param: gateway id + */ + id: string; + + /** + * Body param + */ + cache_invalidate_on_update: boolean; + + /** + * Body param + */ + cache_ttl: number | null; + + /** + * Body param + */ + collect_logs: boolean; + + /** + * Body param + */ + rate_limiting_interval: number | null; + + /** + * Body param + */ + rate_limiting_limit: number | null; + + /** + * Body param + */ + rate_limiting_technique: 'fixed' | 'sliding'; + + /** + * Body param + */ + authentication?: boolean; + + /** + * Body param + */ + is_default?: boolean; + + /** + * Body param + */ + log_management?: number | null; + + /** + * Body param + */ + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + /** + * Body param + */ + logpush?: boolean; + + /** + * Body param + */ + logpush_public_key?: string | null; + + /** + * Body param + */ + zdr?: boolean; +} + +export interface AIGatewayUpdateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + cache_invalidate_on_update: boolean; + + /** + * Body param + */ + cache_ttl: number | null; + + /** + * Body param + */ + collect_logs: boolean; + + /** + * Body param + */ + rate_limiting_interval: number | null; + + /** + * Body param + */ + rate_limiting_limit: number | null; + + /** + * Body param + */ + rate_limiting_technique: 'fixed' | 'sliding'; + + /** + * Body param + */ + authentication?: boolean; + + /** + * Body param + */ + dlp?: AIGatewayUpdateParams.UnionMember0 | AIGatewayUpdateParams.UnionMember1; + + /** + * Body param + */ + is_default?: boolean; + + /** + * Body param + */ + log_management?: number | null; + + /** + * Body param + */ + log_management_strategy?: 'STOP_INSERTING' | 'DELETE_OLDEST' | null; + + /** + * Body param + */ + logpush?: boolean; + + /** + * Body param + */ + logpush_public_key?: string | null; + + /** + * Body param + */ + otel?: Array | null; + + /** + * Body param + */ + store_id?: string | null; + + /** + * Body param + */ + stripe?: AIGatewayUpdateParams.Stripe | null; + + /** + * Body param + */ + zdr?: boolean; +} + +export namespace AIGatewayUpdateParams { + export interface UnionMember0 { + action: 'BLOCK' | 'FLAG'; + + enabled: boolean; + + profiles: Array; + } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } +} + +export interface AIGatewayListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param: Search by id + */ + search?: string; +} + +export interface AIGatewayDeleteParams { + account_id: string; +} + +export interface AIGatewayGetParams { + account_id: string; +} + +AIGateway.AIGatewayListResponsesV4PagePaginationArray = AIGatewayListResponsesV4PagePaginationArray; +AIGateway.EvaluationTypes = EvaluationTypes; +AIGateway.EvaluationTypeListResponsesV4PagePaginationArray = EvaluationTypeListResponsesV4PagePaginationArray; +AIGateway.Logs = Logs; +AIGateway.LogListResponsesV4PagePaginationArray = LogListResponsesV4PagePaginationArray; +AIGateway.Datasets = Datasets; +AIGateway.DatasetListResponsesV4PagePaginationArray = DatasetListResponsesV4PagePaginationArray; +AIGateway.Evaluations = Evaluations; +AIGateway.EvaluationListResponsesV4PagePaginationArray = EvaluationListResponsesV4PagePaginationArray; +AIGateway.DynamicRouting = DynamicRouting; +AIGateway.ProviderConfigs = ProviderConfigs; +AIGateway.ProviderConfigListResponsesV4PagePaginationArray = ProviderConfigListResponsesV4PagePaginationArray; +AIGateway.URLs = URLs; + +export declare namespace AIGateway { + export { + type AIGatewayCreateResponse as AIGatewayCreateResponse, + type AIGatewayUpdateResponse as AIGatewayUpdateResponse, + type AIGatewayListResponse as AIGatewayListResponse, + type AIGatewayDeleteResponse as AIGatewayDeleteResponse, + type AIGatewayGetResponse as AIGatewayGetResponse, + AIGatewayListResponsesV4PagePaginationArray as AIGatewayListResponsesV4PagePaginationArray, + type AIGatewayCreateParams as AIGatewayCreateParams, + type AIGatewayUpdateParams as AIGatewayUpdateParams, + type AIGatewayListParams as AIGatewayListParams, + type AIGatewayDeleteParams as AIGatewayDeleteParams, + type AIGatewayGetParams as AIGatewayGetParams, + }; + + export { + EvaluationTypes as EvaluationTypes, + type EvaluationTypeListResponse as EvaluationTypeListResponse, + EvaluationTypeListResponsesV4PagePaginationArray as EvaluationTypeListResponsesV4PagePaginationArray, + type EvaluationTypeListParams as EvaluationTypeListParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogDeleteResponse as LogDeleteResponse, + type LogEditResponse as LogEditResponse, + type LogGetResponse as LogGetResponse, + type LogRequestResponse as LogRequestResponse, + type LogResponseResponse as LogResponseResponse, + LogListResponsesV4PagePaginationArray as LogListResponsesV4PagePaginationArray, + type LogListParams as LogListParams, + type LogDeleteParams as LogDeleteParams, + type LogEditParams as LogEditParams, + type LogGetParams as LogGetParams, + type LogRequestParams as LogRequestParams, + type LogResponseParams as LogResponseParams, + }; + + export { + Datasets as Datasets, + type DatasetCreateResponse as DatasetCreateResponse, + type DatasetUpdateResponse as DatasetUpdateResponse, + type DatasetListResponse as DatasetListResponse, + type DatasetDeleteResponse as DatasetDeleteResponse, + type DatasetGetResponse as DatasetGetResponse, + DatasetListResponsesV4PagePaginationArray as DatasetListResponsesV4PagePaginationArray, + type DatasetCreateParams as DatasetCreateParams, + type DatasetUpdateParams as DatasetUpdateParams, + type DatasetListParams as DatasetListParams, + type DatasetDeleteParams as DatasetDeleteParams, + type DatasetGetParams as DatasetGetParams, + }; + + export { + Evaluations as Evaluations, + type EvaluationCreateResponse as EvaluationCreateResponse, + type EvaluationListResponse as EvaluationListResponse, + type EvaluationDeleteResponse as EvaluationDeleteResponse, + type EvaluationGetResponse as EvaluationGetResponse, + EvaluationListResponsesV4PagePaginationArray as EvaluationListResponsesV4PagePaginationArray, + type EvaluationCreateParams as EvaluationCreateParams, + type EvaluationListParams as EvaluationListParams, + type EvaluationDeleteParams as EvaluationDeleteParams, + type EvaluationGetParams as EvaluationGetParams, + }; + + export { + DynamicRouting as DynamicRouting, + type DynamicRoutingCreateResponse as DynamicRoutingCreateResponse, + type DynamicRoutingUpdateResponse as DynamicRoutingUpdateResponse, + type DynamicRoutingListResponse as DynamicRoutingListResponse, + type DynamicRoutingDeleteResponse as DynamicRoutingDeleteResponse, + type DynamicRoutingCreateDeploymentResponse as DynamicRoutingCreateDeploymentResponse, + type DynamicRoutingCreateVersionResponse as DynamicRoutingCreateVersionResponse, + type DynamicRoutingGetResponse as DynamicRoutingGetResponse, + type DynamicRoutingGetVersionResponse as DynamicRoutingGetVersionResponse, + type DynamicRoutingListDeploymentsResponse as DynamicRoutingListDeploymentsResponse, + type DynamicRoutingListVersionsResponse as DynamicRoutingListVersionsResponse, + type DynamicRoutingCreateParams as DynamicRoutingCreateParams, + type DynamicRoutingUpdateParams as DynamicRoutingUpdateParams, + type DynamicRoutingListParams as DynamicRoutingListParams, + type DynamicRoutingDeleteParams as DynamicRoutingDeleteParams, + type DynamicRoutingCreateDeploymentParams as DynamicRoutingCreateDeploymentParams, + type DynamicRoutingCreateVersionParams as DynamicRoutingCreateVersionParams, + type DynamicRoutingGetParams as DynamicRoutingGetParams, + type DynamicRoutingGetVersionParams as DynamicRoutingGetVersionParams, + type DynamicRoutingListDeploymentsParams as DynamicRoutingListDeploymentsParams, + type DynamicRoutingListVersionsParams as DynamicRoutingListVersionsParams, + }; + + export { + ProviderConfigs as ProviderConfigs, + type ProviderConfigCreateResponse as ProviderConfigCreateResponse, + type ProviderConfigListResponse as ProviderConfigListResponse, + ProviderConfigListResponsesV4PagePaginationArray as ProviderConfigListResponsesV4PagePaginationArray, + type ProviderConfigCreateParams as ProviderConfigCreateParams, + type ProviderConfigListParams as ProviderConfigListParams, + }; + + export { URLs as URLs, type URLGetResponse as URLGetResponse, type URLGetParams as URLGetParams }; +} diff --git a/src/resources/ai-gateway/datasets.ts b/src/resources/ai-gateway/datasets.ts new file mode 100644 index 0000000000..3b9f2b71b1 --- /dev/null +++ b/src/resources/ai-gateway/datasets.ts @@ -0,0 +1,532 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class Datasets extends APIResource { + /** + * Create a new Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.create( + * 'my-gateway', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * enable: true, + * filters: [ + * { + * key: 'created_at', + * operator: 'eq', + * value: ['string'], + * }, + * ], + * name: 'name', + * }, + * ); + * ``` + */ + create( + gatewayId: string, + params: DatasetCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets`, { + body, + ...options, + }) as Core.APIPromise<{ result: DatasetCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.update( + * 'my-gateway', + * 'id', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * enable: true, + * filters: [ + * { + * key: 'created_at', + * operator: 'eq', + * value: ['string'], + * }, + * ], + * name: 'name', + * }, + * ); + * ``` + */ + update( + gatewayId: string, + id: string, + params: DatasetUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: DatasetUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Datasets + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const datasetListResponse of client.aiGateway.datasets.list( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` + */ + list( + gatewayId: string, + params: DatasetListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets`, + DatasetListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.delete( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` + */ + delete( + gatewayId: string, + id: string, + params: DatasetDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, + options, + ) as Core.APIPromise<{ result: DatasetDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetch a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.get( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` + */ + get( + gatewayId: string, + id: string, + params: DatasetGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/datasets/${id}`, + options, + ) as Core.APIPromise<{ result: DatasetGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DatasetListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface DatasetCreateResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DatasetCreateResponse { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetUpdateResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DatasetUpdateResponse { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetListResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DatasetListResponse { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetDeleteResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DatasetDeleteResponse { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetGetResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DatasetGetResponse { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + enable: boolean; + + /** + * Body param + */ + filters: Array; + + /** + * Body param + */ + name: string; +} + +export namespace DatasetCreateParams { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetUpdateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + enable: boolean; + + /** + * Body param + */ + filters: Array; + + /** + * Body param + */ + name: string; +} + +export namespace DatasetUpdateParams { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface DatasetListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + enable?: boolean; + + /** + * Query param + */ + name?: string; + + /** + * Query param: Search by id, name, filters + */ + search?: string; +} + +export interface DatasetDeleteParams { + account_id: string; +} + +export interface DatasetGetParams { + account_id: string; +} + +Datasets.DatasetListResponsesV4PagePaginationArray = DatasetListResponsesV4PagePaginationArray; + +export declare namespace Datasets { + export { + type DatasetCreateResponse as DatasetCreateResponse, + type DatasetUpdateResponse as DatasetUpdateResponse, + type DatasetListResponse as DatasetListResponse, + type DatasetDeleteResponse as DatasetDeleteResponse, + type DatasetGetResponse as DatasetGetResponse, + DatasetListResponsesV4PagePaginationArray as DatasetListResponsesV4PagePaginationArray, + type DatasetCreateParams as DatasetCreateParams, + type DatasetUpdateParams as DatasetUpdateParams, + type DatasetListParams as DatasetListParams, + type DatasetDeleteParams as DatasetDeleteParams, + type DatasetGetParams as DatasetGetParams, + }; +} diff --git a/src/resources/ai-gateway/dynamic-routing.ts b/src/resources/ai-gateway/dynamic-routing.ts new file mode 100644 index 0000000000..ce08dfe018 --- /dev/null +++ b/src/resources/ai-gateway/dynamic-routing.ts @@ -0,0 +1,2394 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class DynamicRouting extends APIResource { + /** + * Create a new AI Gateway Dynamic Route. + * + * @example + * ```ts + * const dynamicRouting = + * await client.aiGateway.dynamicRouting.create('54442216', { + * account_id: '0d37909e38d3e99c29fa2cd343ac421a', + * elements: [ + * { + * id: 'id', + * outputs: { next: { elementId: 'elementId' } }, + * type: 'start', + * }, + * ], + * name: 'name', + * }); + * ``` + */ + create( + gatewayId: string, + params: DynamicRoutingCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, { + body, + ...options, + }) as Core.APIPromise<{ result: DynamicRoutingCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update an AI Gateway Dynamic Route. + * + * @example + * ```ts + * const dynamicRouting = + * await client.aiGateway.dynamicRouting.update( + * '54442216', + * '54442216', + * { + * account_id: '0d37909e38d3e99c29fa2cd343ac421a', + * name: 'Route Name', + * }, + * ); + * ``` + */ + update( + gatewayId: string, + id: string, + params: DynamicRoutingUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.patch(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`, { + body, + ...options, + }); + } + + /** + * List all AI Gateway Dynamic Routes. + * + * @example + * ```ts + * const dynamicRoutings = + * await client.aiGateway.dynamicRouting.list('54442216', { + * account_id: '0d37909e38d3e99c29fa2cd343ac421a', + * }); + * ``` + */ + list( + gatewayId: string, + params: DynamicRoutingListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes`, options); + } + + /** + * Delete an AI Gateway Dynamic Route. + * + * @example + * ```ts + * const dynamicRouting = + * await client.aiGateway.dynamicRouting.delete( + * '54442216', + * '54442216', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + delete( + gatewayId: string, + id: string, + params: DynamicRoutingDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`, + options, + ) as Core.APIPromise<{ result: DynamicRoutingDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Create a new AI Gateway Dynamic Route Deployment. + * + * @example + * ```ts + * const response = + * await client.aiGateway.dynamicRouting.createDeployment( + * '54442216', + * '54442216', + * { + * account_id: '0d37909e38d3e99c29fa2cd343ac421a', + * comment: 'Route Deployment Comment', + * version_id: '54442216', + * }, + * ); + * ``` + */ + createDeployment( + gatewayId: string, + id: string, + params: DynamicRoutingCreateDeploymentParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/deployments`, { + body, + ...options, + }) as Core.APIPromise<{ result: DynamicRoutingCreateDeploymentResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Create a new AI Gateway Dynamic Route Version. + * + * @example + * ```ts + * const response = + * await client.aiGateway.dynamicRouting.createVersion( + * '54442216', + * '54442216', + * { + * account_id: '0d37909e38d3e99c29fa2cd343ac421a', + * comment: 'Route Version Comment', + * elements: [ + * { + * id: 'id', + * outputs: { next: { elementId: 'elementId' } }, + * type: 'start', + * }, + * ], + * }, + * ); + * ``` + */ + createVersion( + gatewayId: string, + id: string, + params: DynamicRoutingCreateVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions`, { + body, + ...options, + }) as Core.APIPromise<{ result: DynamicRoutingCreateVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get an AI Gateway Dynamic Route. + * + * @example + * ```ts + * const dynamicRouting = + * await client.aiGateway.dynamicRouting.get( + * '54442216', + * '54442216', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + get( + gatewayId: string, + id: string, + params: DynamicRoutingGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}`, + options, + ) as Core.APIPromise<{ result: DynamicRoutingGetResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get an AI Gateway Dynamic Route Version. + * + * @example + * ```ts + * const response = + * await client.aiGateway.dynamicRouting.getVersion( + * '54442216', + * '54442216', + * '54442216', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + getVersion( + gatewayId: string, + id: string, + versionId: string, + params: DynamicRoutingGetVersionParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions/${versionId}`, + options, + ) as Core.APIPromise<{ result: DynamicRoutingGetVersionResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all AI Gateway Dynamic Route Deployments. + * + * @example + * ```ts + * const response = + * await client.aiGateway.dynamicRouting.listDeployments( + * '54442216', + * '54442216', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + listDeployments( + gatewayId: string, + id: string, + params: DynamicRoutingListDeploymentsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/deployments`, + options, + ); + } + + /** + * List all AI Gateway Dynamic Route Versions. + * + * @example + * ```ts + * const response = + * await client.aiGateway.dynamicRouting.listVersions( + * '54442216', + * '54442216', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + listVersions( + gatewayId: string, + id: string, + params: DynamicRoutingListVersionsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/routes/${id}/versions`, + options, + ); + } +} + +export interface DynamicRoutingCreateResponse { + id: string; + + account_tag: string; + + created_at: string; + + deployment: DynamicRoutingCreateResponse.Deployment; + + elements: Array< + | DynamicRoutingCreateResponse.UnionMember0 + | DynamicRoutingCreateResponse.UnionMember1 + | DynamicRoutingCreateResponse.UnionMember2 + | DynamicRoutingCreateResponse.UnionMember3 + | DynamicRoutingCreateResponse.UnionMember4 + | DynamicRoutingCreateResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; + + version: DynamicRoutingCreateResponse.Version; +} + +export namespace DynamicRoutingCreateResponse { + export interface Deployment { + created_at: string; + + deployment_id: string; + + version_id: string; + + comment?: string | null; + } + + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } + + export interface Version { + active: 'true' | 'false'; + + created_at: string; + + data: string; + + version_id: string; + + comment?: string | null; + } +} + +export interface DynamicRoutingUpdateResponse { + route: DynamicRoutingUpdateResponse.Route; + + success: boolean; +} + +export namespace DynamicRoutingUpdateResponse { + export interface Route { + id: string; + + account_tag: string; + + created_at: string; + + deployment: Route.Deployment; + + elements: Array< + | Route.UnionMember0 + | Route.UnionMember1 + | Route.UnionMember2 + | Route.UnionMember3 + | Route.UnionMember4 + | Route.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; + + version: Route.Version; + } + + export namespace Route { + export interface Deployment { + created_at: string; + + deployment_id: string; + + version_id: string; + + comment?: string | null; + } + + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } + + export interface Version { + active: 'true' | 'false'; + + created_at: string; + + data: string; + + version_id: string; + + comment?: string | null; + } + } +} + +export interface DynamicRoutingListResponse { + data: DynamicRoutingListResponse.Data; + + success: boolean; +} + +export namespace DynamicRoutingListResponse { + export interface Data { + order_by: string; + + order_by_direction: string; + + page: number; + + per_page: number; + + routes: Array; + } + + export namespace Data { + export interface Route { + id: string; + + account_tag: string; + + created_at: string; + + deployment: Route.Deployment; + + elements: Array< + | Route.UnionMember0 + | Route.UnionMember1 + | Route.UnionMember2 + | Route.UnionMember3 + | Route.UnionMember4 + | Route.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; + + version: Route.Version; + } + + export namespace Route { + export interface Deployment { + created_at: string; + + deployment_id: string; + + version_id: string; + + comment?: string | null; + } + + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } + + export interface Version { + active: 'true' | 'false'; + + created_at: string; + + data: string; + + version_id: string; + + comment?: string | null; + } + } + } +} + +export interface DynamicRoutingDeleteResponse { + id: string; + + account_tag: string; + + created_at: string; + + elements: Array< + | DynamicRoutingDeleteResponse.UnionMember0 + | DynamicRoutingDeleteResponse.UnionMember1 + | DynamicRoutingDeleteResponse.UnionMember2 + | DynamicRoutingDeleteResponse.UnionMember3 + | DynamicRoutingDeleteResponse.UnionMember4 + | DynamicRoutingDeleteResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DynamicRoutingDeleteResponse { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingCreateDeploymentResponse { + id: string; + + account_tag: string; + + created_at: string; + + elements: Array< + | DynamicRoutingCreateDeploymentResponse.UnionMember0 + | DynamicRoutingCreateDeploymentResponse.UnionMember1 + | DynamicRoutingCreateDeploymentResponse.UnionMember2 + | DynamicRoutingCreateDeploymentResponse.UnionMember3 + | DynamicRoutingCreateDeploymentResponse.UnionMember4 + | DynamicRoutingCreateDeploymentResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DynamicRoutingCreateDeploymentResponse { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingCreateVersionResponse { + id: string; + + account_tag: string; + + created_at: string; + + elements: Array< + | DynamicRoutingCreateVersionResponse.UnionMember0 + | DynamicRoutingCreateVersionResponse.UnionMember1 + | DynamicRoutingCreateVersionResponse.UnionMember2 + | DynamicRoutingCreateVersionResponse.UnionMember3 + | DynamicRoutingCreateVersionResponse.UnionMember4 + | DynamicRoutingCreateVersionResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; +} + +export namespace DynamicRoutingCreateVersionResponse { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingGetResponse { + id: string; + + account_tag: string; + + created_at: string; + + deployment: DynamicRoutingGetResponse.Deployment; + + elements: Array< + | DynamicRoutingGetResponse.UnionMember0 + | DynamicRoutingGetResponse.UnionMember1 + | DynamicRoutingGetResponse.UnionMember2 + | DynamicRoutingGetResponse.UnionMember3 + | DynamicRoutingGetResponse.UnionMember4 + | DynamicRoutingGetResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; + + version: DynamicRoutingGetResponse.Version; +} + +export namespace DynamicRoutingGetResponse { + export interface Deployment { + created_at: string; + + deployment_id: string; + + version_id: string; + + comment?: string | null; + } + + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } + + export interface Version { + active: 'true' | 'false'; + + created_at: string; + + data: string; + + version_id: string; + + comment?: string | null; + } +} + +export interface DynamicRoutingGetVersionResponse { + id: string; + + account_tag: string; + + active: 'true' | 'false'; + + created_at: string; + + data: string; + + elements: Array< + | DynamicRoutingGetVersionResponse.UnionMember0 + | DynamicRoutingGetVersionResponse.UnionMember1 + | DynamicRoutingGetVersionResponse.UnionMember2 + | DynamicRoutingGetVersionResponse.UnionMember3 + | DynamicRoutingGetVersionResponse.UnionMember4 + | DynamicRoutingGetVersionResponse.UnionMember5 + >; + + gateway_id: string; + + modified_at: string; + + name: string; + + version_id: string; + + comment?: string | null; +} + +export namespace DynamicRoutingGetVersionResponse { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingListDeploymentsResponse { + data: DynamicRoutingListDeploymentsResponse.Data; + + success: boolean; +} + +export namespace DynamicRoutingListDeploymentsResponse { + export interface Data { + deployments: Array; + + order_by: string; + + order_by_direction: string; + + page: number; + + per_page: number; + } + + export namespace Data { + export interface Deployment { + created_at: string; + + deployment_id: string; + + version_id: string; + + comment?: string | null; + } + } +} + +export interface DynamicRoutingListVersionsResponse { + data: DynamicRoutingListVersionsResponse.Data; + + success: boolean; +} + +export namespace DynamicRoutingListVersionsResponse { + export interface Data { + order_by: string; + + order_by_direction: string; + + page: number; + + per_page: number; + + versions: Array; + } + + export namespace Data { + export interface Version { + active: 'true' | 'false'; + + created_at: string; + + data: string; + + version_id: string; + + comment?: string | null; + } + } +} + +export interface DynamicRoutingCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + elements: Array< + | DynamicRoutingCreateParams.UnionMember0 + | DynamicRoutingCreateParams.UnionMember1 + | DynamicRoutingCreateParams.UnionMember2 + | DynamicRoutingCreateParams.UnionMember3 + | DynamicRoutingCreateParams.UnionMember4 + | DynamicRoutingCreateParams.UnionMember5 + >; + + /** + * Body param + */ + name: string; +} + +export namespace DynamicRoutingCreateParams { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingUpdateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + name: string; +} + +export interface DynamicRoutingListParams { + account_id: string; +} + +export interface DynamicRoutingDeleteParams { + account_id: string; +} + +export interface DynamicRoutingCreateDeploymentParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + comment: string; + + /** + * Body param + */ + version_id: string; +} + +export interface DynamicRoutingCreateVersionParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + comment: string; + + /** + * Body param + */ + elements: Array< + | DynamicRoutingCreateVersionParams.UnionMember0 + | DynamicRoutingCreateVersionParams.UnionMember1 + | DynamicRoutingCreateVersionParams.UnionMember2 + | DynamicRoutingCreateVersionParams.UnionMember3 + | DynamicRoutingCreateVersionParams.UnionMember4 + | DynamicRoutingCreateVersionParams.UnionMember5 + >; +} + +export namespace DynamicRoutingCreateVersionParams { + export interface UnionMember0 { + id: string; + + outputs: UnionMember0.Outputs; + + type: 'start'; + } + + export namespace UnionMember0 { + export interface Outputs { + next: Outputs.Next; + } + + export namespace Outputs { + export interface Next { + elementId: string; + } + } + } + + export interface UnionMember1 { + id: string; + + outputs: UnionMember1.Outputs; + + properties: UnionMember1.Properties; + + type: 'conditional'; + } + + export namespace UnionMember1 { + export interface Outputs { + false: Outputs.False; + + true: Outputs.True; + } + + export namespace Outputs { + export interface False { + elementId: string; + } + + export interface True { + elementId: string; + } + } + + export interface Properties { + conditions?: unknown; + } + } + + export interface UnionMember2 { + id: string; + + outputs: { [key: string]: UnionMember2.Outputs }; + + type: 'percentage'; + } + + export namespace UnionMember2 { + export interface Outputs { + elementId: string; + } + } + + export interface UnionMember3 { + id: string; + + outputs: UnionMember3.Outputs; + + properties: UnionMember3.Properties; + + type: 'rate'; + } + + export namespace UnionMember3 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + key: string; + + limit: number; + + limitType: 'count' | 'cost'; + + window: number; + } + } + + export interface UnionMember4 { + id: string; + + outputs: UnionMember4.Outputs; + + properties: UnionMember4.Properties; + + type: 'model'; + } + + export namespace UnionMember4 { + export interface Outputs { + fallback: Outputs.Fallback; + + success: Outputs.Success; + } + + export namespace Outputs { + export interface Fallback { + elementId: string; + } + + export interface Success { + elementId: string; + } + } + + export interface Properties { + model: string; + + provider: string; + + retries: number; + + timeout: number; + } + } + + export interface UnionMember5 { + id: string; + + outputs: { [key: string]: UnionMember5.Outputs }; + + type: 'end'; + } + + export namespace UnionMember5 { + export interface Outputs { + elementId: string; + } + } +} + +export interface DynamicRoutingGetParams { + account_id: string; +} + +export interface DynamicRoutingGetVersionParams { + account_id: string; +} + +export interface DynamicRoutingListDeploymentsParams { + account_id: string; +} + +export interface DynamicRoutingListVersionsParams { + account_id: string; +} + +export declare namespace DynamicRouting { + export { + type DynamicRoutingCreateResponse as DynamicRoutingCreateResponse, + type DynamicRoutingUpdateResponse as DynamicRoutingUpdateResponse, + type DynamicRoutingListResponse as DynamicRoutingListResponse, + type DynamicRoutingDeleteResponse as DynamicRoutingDeleteResponse, + type DynamicRoutingCreateDeploymentResponse as DynamicRoutingCreateDeploymentResponse, + type DynamicRoutingCreateVersionResponse as DynamicRoutingCreateVersionResponse, + type DynamicRoutingGetResponse as DynamicRoutingGetResponse, + type DynamicRoutingGetVersionResponse as DynamicRoutingGetVersionResponse, + type DynamicRoutingListDeploymentsResponse as DynamicRoutingListDeploymentsResponse, + type DynamicRoutingListVersionsResponse as DynamicRoutingListVersionsResponse, + type DynamicRoutingCreateParams as DynamicRoutingCreateParams, + type DynamicRoutingUpdateParams as DynamicRoutingUpdateParams, + type DynamicRoutingListParams as DynamicRoutingListParams, + type DynamicRoutingDeleteParams as DynamicRoutingDeleteParams, + type DynamicRoutingCreateDeploymentParams as DynamicRoutingCreateDeploymentParams, + type DynamicRoutingCreateVersionParams as DynamicRoutingCreateVersionParams, + type DynamicRoutingGetParams as DynamicRoutingGetParams, + type DynamicRoutingGetVersionParams as DynamicRoutingGetVersionParams, + type DynamicRoutingListDeploymentsParams as DynamicRoutingListDeploymentsParams, + type DynamicRoutingListVersionsParams as DynamicRoutingListVersionsParams, + }; +} diff --git a/src/resources/ai-gateway/evaluation-types.ts b/src/resources/ai-gateway/evaluation-types.ts new file mode 100644 index 0000000000..6749f9d312 --- /dev/null +++ b/src/resources/ai-gateway/evaluation-types.ts @@ -0,0 +1,80 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class EvaluationTypes extends APIResource { + /** + * List Evaluators + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const evaluationTypeListResponse of client.aiGateway.evaluationTypes.list( + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: EvaluationTypeListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/evaluation-types`, + EvaluationTypeListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class EvaluationTypeListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface EvaluationTypeListResponse { + id: string; + + created_at: string; + + description: string; + + enable: boolean; + + mandatory: boolean; + + modified_at: string; + + name: string; + + type: string; +} + +export interface EvaluationTypeListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + order_by?: string; + + /** + * Query param + */ + order_by_direction?: 'asc' | 'desc'; +} + +EvaluationTypes.EvaluationTypeListResponsesV4PagePaginationArray = + EvaluationTypeListResponsesV4PagePaginationArray; + +export declare namespace EvaluationTypes { + export { + type EvaluationTypeListResponse as EvaluationTypeListResponse, + EvaluationTypeListResponsesV4PagePaginationArray as EvaluationTypeListResponsesV4PagePaginationArray, + type EvaluationTypeListParams as EvaluationTypeListParams, + }; +} diff --git a/src/resources/ai-gateway/evaluations.ts b/src/resources/ai-gateway/evaluations.ts new file mode 100644 index 0000000000..57f7df5241 --- /dev/null +++ b/src/resources/ai-gateway/evaluations.ts @@ -0,0 +1,567 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class Evaluations extends APIResource { + /** + * Create a new Evaluation + * + * @example + * ```ts + * const evaluation = + * await client.aiGateway.evaluations.create('my-gateway', { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * dataset_ids: ['string'], + * evaluation_type_ids: ['string'], + * name: 'name', + * }); + * ``` + */ + create( + gatewayId: string, + params: EvaluationCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations`, { + body, + ...options, + }) as Core.APIPromise<{ result: EvaluationCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Evaluations + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const evaluationListResponse of client.aiGateway.evaluations.list( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` + */ + list( + gatewayId: string, + params: EvaluationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations`, + EvaluationListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a Evaluation + * + * @example + * ```ts + * const evaluation = + * await client.aiGateway.evaluations.delete( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` + */ + delete( + gatewayId: string, + id: string, + params: EvaluationDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations/${id}`, + options, + ) as Core.APIPromise<{ result: EvaluationDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetch a Evaluation + * + * @example + * ```ts + * const evaluation = await client.aiGateway.evaluations.get( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` + */ + get( + gatewayId: string, + id: string, + params: EvaluationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/evaluations/${id}`, + options, + ) as Core.APIPromise<{ result: EvaluationGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class EvaluationListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface EvaluationCreateResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + datasets: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + + processed: boolean; + + results: Array; + + total_logs: number; +} + +export namespace EvaluationCreateResponse { + export interface Dataset { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + } + + export namespace Dataset { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } + } + + export interface Result { + id: string; + + created_at: string; + + evaluation_id: string; + + evaluation_type_id: string; + + modified_at: string; + + result: string; + + status: number; + + status_description: string; + + total_logs: number; + } +} + +export interface EvaluationListResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + datasets: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + + processed: boolean; + + results: Array; + + total_logs: number; +} + +export namespace EvaluationListResponse { + export interface Dataset { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + } + + export namespace Dataset { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } + } + + export interface Result { + id: string; + + created_at: string; + + evaluation_id: string; + + evaluation_type_id: string; + + modified_at: string; + + result: string; + + status: number; + + status_description: string; + + total_logs: number; + } +} + +export interface EvaluationDeleteResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + datasets: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + + processed: boolean; + + results: Array; + + total_logs: number; +} + +export namespace EvaluationDeleteResponse { + export interface Dataset { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + } + + export namespace Dataset { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } + } + + export interface Result { + id: string; + + created_at: string; + + evaluation_id: string; + + evaluation_type_id: string; + + modified_at: string; + + result: string; + + status: number; + + status_description: string; + + total_logs: number; + } +} + +export interface EvaluationGetResponse { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + datasets: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + + processed: boolean; + + results: Array; + + total_logs: number; +} + +export namespace EvaluationGetResponse { + export interface Dataset { + id: string; + + account_id: string; + + account_tag: string; + + created_at: string; + + enable: boolean; + + filters: Array; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + name: string; + } + + export namespace Dataset { + export interface Filter { + key: + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + operator: 'eq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } + } + + export interface Result { + id: string; + + created_at: string; + + evaluation_id: string; + + evaluation_type_id: string; + + modified_at: string; + + result: string; + + status: number; + + status_description: string; + + total_logs: number; + } +} + +export interface EvaluationCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + dataset_ids: Array; + + /** + * Body param + */ + evaluation_type_ids: Array; + + /** + * Body param + */ + name: string; +} + +export interface EvaluationListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + name?: string; + + /** + * Query param + */ + processed?: boolean; + + /** + * Query param: Search by id, name + */ + search?: string; +} + +export interface EvaluationDeleteParams { + account_id: string; +} + +export interface EvaluationGetParams { + account_id: string; +} + +Evaluations.EvaluationListResponsesV4PagePaginationArray = EvaluationListResponsesV4PagePaginationArray; + +export declare namespace Evaluations { + export { + type EvaluationCreateResponse as EvaluationCreateResponse, + type EvaluationListResponse as EvaluationListResponse, + type EvaluationDeleteResponse as EvaluationDeleteResponse, + type EvaluationGetResponse as EvaluationGetResponse, + EvaluationListResponsesV4PagePaginationArray as EvaluationListResponsesV4PagePaginationArray, + type EvaluationCreateParams as EvaluationCreateParams, + type EvaluationListParams as EvaluationListParams, + type EvaluationDeleteParams as EvaluationDeleteParams, + type EvaluationGetParams as EvaluationGetParams, + }; +} diff --git a/src/resources/ai-gateway/index.ts b/src/resources/ai-gateway/index.ts new file mode 100644 index 0000000000..682de9f76b --- /dev/null +++ b/src/resources/ai-gateway/index.ts @@ -0,0 +1,83 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AIGateway } from './ai-gateway'; +export { + DatasetListResponsesV4PagePaginationArray, + Datasets, + type DatasetCreateResponse, + type DatasetUpdateResponse, + type DatasetListResponse, + type DatasetDeleteResponse, + type DatasetGetResponse, + type DatasetCreateParams, + type DatasetUpdateParams, + type DatasetListParams, + type DatasetDeleteParams, + type DatasetGetParams, +} from './datasets'; +export { + DynamicRouting, + type DynamicRoutingCreateResponse, + type DynamicRoutingUpdateResponse, + type DynamicRoutingListResponse, + type DynamicRoutingDeleteResponse, + type DynamicRoutingCreateDeploymentResponse, + type DynamicRoutingCreateVersionResponse, + type DynamicRoutingGetResponse, + type DynamicRoutingGetVersionResponse, + type DynamicRoutingListDeploymentsResponse, + type DynamicRoutingListVersionsResponse, + type DynamicRoutingCreateParams, + type DynamicRoutingUpdateParams, + type DynamicRoutingListParams, + type DynamicRoutingDeleteParams, + type DynamicRoutingCreateDeploymentParams, + type DynamicRoutingCreateVersionParams, + type DynamicRoutingGetParams, + type DynamicRoutingGetVersionParams, + type DynamicRoutingListDeploymentsParams, + type DynamicRoutingListVersionsParams, +} from './dynamic-routing'; +export { + EvaluationListResponsesV4PagePaginationArray, + Evaluations, + type EvaluationCreateResponse, + type EvaluationListResponse, + type EvaluationDeleteResponse, + type EvaluationGetResponse, + type EvaluationCreateParams, + type EvaluationListParams, + type EvaluationDeleteParams, + type EvaluationGetParams, +} from './evaluations'; +export { + EvaluationTypeListResponsesV4PagePaginationArray, + EvaluationTypes, + type EvaluationTypeListResponse, + type EvaluationTypeListParams, +} from './evaluation-types'; +export { + LogListResponsesV4PagePaginationArray, + Logs, + type LogListResponse, + type LogDeleteResponse, + type LogEditResponse, + type LogGetResponse, + type LogRequestResponse, + type LogResponseResponse, + type LogListParams, + type LogDeleteParams, + type LogEditParams, + type LogGetParams, + type LogRequestParams, + type LogResponseParams, +} from './logs'; +export { + ProviderConfigListResponsesV4PagePaginationArray, + ProviderConfigs, + type ProviderConfigCreateResponse, + type ProviderConfigListResponse, + type ProviderConfigCreateParams, + type ProviderConfigListParams, +} from './provider-configs'; +export { URLs, type URLGetResponse, type URLGetParams } from './urls'; diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts new file mode 100644 index 0000000000..ac67d83cb0 --- /dev/null +++ b/src/resources/ai-gateway/logs.ts @@ -0,0 +1,564 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class Logs extends APIResource { + /** + * List Gateway Logs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const logListResponse of client.aiGateway.logs.list( + * 'my-gateway', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * )) { + * // ... + * } + * ``` + */ + list( + gatewayId: string, + params: LogListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs`, + LogListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete Gateway Logs + * + * @example + * ```ts + * const log = await client.aiGateway.logs.delete( + * 'my-gateway', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + delete( + gatewayId: string, + params: LogDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, filters, limit, order_by, order_by_direction } = params; + return this._client.delete(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs`, { + query: { filters, limit, order_by, order_by_direction }, + ...options, + }); + } + + /** + * Patch Gateway Log + * + * @example + * ```ts + * const response = await client.aiGateway.logs.edit( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + edit( + gatewayId: string, + id: string, + params: LogEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: LogEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get Gateway Log Detail + * + * @example + * ```ts + * const log = await client.aiGateway.logs.get( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + get( + gatewayId: string, + id: string, + params: LogGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}`, + options, + ) as Core.APIPromise<{ result: LogGetResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get Gateway Log Request + * + * @example + * ```ts + * const response = await client.aiGateway.logs.request( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + request( + gatewayId: string, + id: string, + params: LogRequestParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}/request`, + options, + ); + } + + /** + * Get Gateway Log Response + * + * @example + * ```ts + * const response = await client.aiGateway.logs.response( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + response( + gatewayId: string, + id: string, + params: LogResponseParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/logs/${id}/response`, + options, + ); + } +} + +export class LogListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface LogListResponse { + id: string; + + cached: boolean; + + created_at: string; + + duration: number; + + model: string; + + path: string; + + provider: string; + + success: boolean; + + tokens_in: number | null; + + tokens_out: number | null; + + cost?: number; + + custom_cost?: boolean; + + metadata?: string; + + model_type?: string; + + request_content_type?: string; + + request_type?: string; + + response_content_type?: string; + + status_code?: number; + + step?: number; +} + +export interface LogDeleteResponse { + success: boolean; +} + +export type LogEditResponse = unknown; + +export interface LogGetResponse { + id: string; + + cached: boolean; + + created_at: string; + + duration: number; + + model: string; + + path: string; + + provider: string; + + success: boolean; + + tokens_in: number | null; + + tokens_out: number | null; + + cost?: number; + + custom_cost?: boolean; + + metadata?: string; + + model_type?: string; + + request_content_type?: string; + + request_head?: string; + + request_head_complete?: boolean; + + request_size?: number; + + request_type?: string; + + response_content_type?: string; + + response_head?: string; + + response_head_complete?: boolean; + + response_size?: number; + + status_code?: number; + + step?: number; +} + +export type LogRequestResponse = unknown; + +export type LogResponseResponse = unknown; + +export interface LogListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * @deprecated Query param + */ + cached?: boolean; + + /** + * @deprecated Query param + */ + direction?: 'asc' | 'desc'; + + /** + * @deprecated Query param + */ + end_date?: string; + + /** + * @deprecated Query param + */ + feedback?: 0 | 1; + + /** + * Query param + */ + filters?: Array; + + /** + * @deprecated Query param + */ + max_cost?: number; + + /** + * @deprecated Query param + */ + max_duration?: number; + + /** + * @deprecated Query param + */ + max_tokens_in?: number; + + /** + * @deprecated Query param + */ + max_tokens_out?: number; + + /** + * @deprecated Query param + */ + max_total_tokens?: number; + + /** + * Query param + */ + meta_info?: boolean; + + /** + * @deprecated Query param + */ + min_cost?: number; + + /** + * @deprecated Query param + */ + min_duration?: number; + + /** + * @deprecated Query param + */ + min_tokens_in?: number; + + /** + * @deprecated Query param + */ + min_tokens_out?: number; + + /** + * @deprecated Query param + */ + min_total_tokens?: number; + + /** + * @deprecated Query param + */ + model?: string; + + /** + * @deprecated Query param + */ + model_type?: string; + + /** + * Query param + */ + order_by?: 'created_at' | 'provider' | 'model' | 'model_type' | 'success' | 'cached'; + + /** + * Query param + */ + order_by_direction?: 'asc' | 'desc'; + + /** + * @deprecated Query param + */ + provider?: string; + + /** + * @deprecated Query param + */ + request_content_type?: string; + + /** + * @deprecated Query param + */ + response_content_type?: string; + + /** + * Query param + */ + search?: string; + + /** + * @deprecated Query param + */ + start_date?: string; + + /** + * @deprecated Query param + */ + success?: boolean; +} + +export namespace LogListParams { + export interface Filter { + key: + | 'id' + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'request_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'model_type' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback' + | 'event_id' + | 'metadata.key' + | 'metadata.value' + | 'prompts.prompt_id' + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode' + | 'dlp_action'; + + operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface LogDeleteParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + filters?: Array; + + /** + * Query param + */ + limit?: number; + + /** + * Query param + */ + order_by?: + | 'created_at' + | 'provider' + | 'model' + | 'model_type' + | 'success' + | 'cached' + | 'cost' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback'; + + /** + * Query param + */ + order_by_direction?: 'asc' | 'desc'; +} + +export namespace LogDeleteParams { + export interface Filter { + key: + | 'id' + | 'created_at' + | 'request_content_type' + | 'response_content_type' + | 'request_type' + | 'success' + | 'cached' + | 'provider' + | 'model' + | 'model_type' + | 'cost' + | 'tokens' + | 'tokens_in' + | 'tokens_out' + | 'duration' + | 'feedback' + | 'event_id' + | 'metadata.key' + | 'metadata.value' + | 'prompts.prompt_id' + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode' + | 'dlp_action'; + + operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; + + value: Array; + } +} + +export interface LogEditParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + feedback?: number | null; + + /** + * Body param + */ + metadata?: { [key: string]: string | number | boolean } | null; + + /** + * Body param + */ + score?: number | null; +} + +export interface LogGetParams { + account_id: string; +} + +export interface LogRequestParams { + account_id: string; +} + +export interface LogResponseParams { + account_id: string; +} + +Logs.LogListResponsesV4PagePaginationArray = LogListResponsesV4PagePaginationArray; + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogDeleteResponse as LogDeleteResponse, + type LogEditResponse as LogEditResponse, + type LogGetResponse as LogGetResponse, + type LogRequestResponse as LogRequestResponse, + type LogResponseResponse as LogResponseResponse, + LogListResponsesV4PagePaginationArray as LogListResponsesV4PagePaginationArray, + type LogListParams as LogListParams, + type LogDeleteParams as LogDeleteParams, + type LogEditParams as LogEditParams, + type LogGetParams as LogGetParams, + type LogRequestParams as LogRequestParams, + type LogResponseParams as LogResponseParams, + }; +} diff --git a/src/resources/ai-gateway/provider-configs.ts b/src/resources/ai-gateway/provider-configs.ts new file mode 100644 index 0000000000..c7e58e9de8 --- /dev/null +++ b/src/resources/ai-gateway/provider-configs.ts @@ -0,0 +1,189 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class ProviderConfigs extends APIResource { + /** + * Create a new Provider Configs + * + * @example + * ```ts + * const providerConfig = + * await client.aiGateway.providerConfigs.create( + * 'my-gateway', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * alias: 'alias', + * default_config: true, + * provider_slug: 'provider_slug', + * secret: 'secret', + * secret_id: 'secret_id', + * }, + * ); + * ``` + */ + create( + gatewayId: string, + params: ProviderConfigCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/provider_configs`, { + body, + ...options, + }) as Core.APIPromise<{ result: ProviderConfigCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Provider Configs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const providerConfigListResponse of client.aiGateway.providerConfigs.list( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` + */ + list( + gatewayId: string, + params: ProviderConfigListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/provider_configs`, + ProviderConfigListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class ProviderConfigListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ProviderConfigCreateResponse { + id: string; + + account_id: string; + + account_tag: string; + + alias: string; + + default_config: boolean; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + provider_slug: string; + + secret_id: string; + + secret_preview: string; + + rate_limit?: number; + + rate_limit_period?: number; +} + +export interface ProviderConfigListResponse { + id: string; + + account_id: string; + + account_tag: string; + + alias: string; + + default_config: boolean; + + /** + * gateway id + */ + gateway_id: string; + + modified_at: string; + + provider_slug: string; + + secret_id: string; + + secret_preview: string; + + rate_limit?: number; + + rate_limit_period?: number; +} + +export interface ProviderConfigCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + alias: string; + + /** + * Body param + */ + default_config: boolean; + + /** + * Body param + */ + provider_slug: string; + + /** + * Body param + */ + secret: string; + + /** + * Body param + */ + secret_id: string; + + /** + * Body param + */ + rate_limit?: number; + + /** + * Body param + */ + rate_limit_period?: number; +} + +export interface ProviderConfigListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; +} + +ProviderConfigs.ProviderConfigListResponsesV4PagePaginationArray = + ProviderConfigListResponsesV4PagePaginationArray; + +export declare namespace ProviderConfigs { + export { + type ProviderConfigCreateResponse as ProviderConfigCreateResponse, + type ProviderConfigListResponse as ProviderConfigListResponse, + ProviderConfigListResponsesV4PagePaginationArray as ProviderConfigListResponsesV4PagePaginationArray, + type ProviderConfigCreateParams as ProviderConfigCreateParams, + type ProviderConfigListParams as ProviderConfigListParams, + }; +} diff --git a/src/resources/ai-gateway/urls.ts b/src/resources/ai-gateway/urls.ts new file mode 100644 index 0000000000..1d4313fa24 --- /dev/null +++ b/src/resources/ai-gateway/urls.ts @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class URLs extends APIResource { + /** + * Get Gateway URL + * + * @example + * ```ts + * const url = await client.aiGateway.urls.get( + * 'my-gateway', + * 'workers-ai', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` + */ + get( + gatewayId: string, + provider: string, + params: URLGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-gateway/gateways/${gatewayId}/url/${provider}`, + options, + ) as Core.APIPromise<{ result: URLGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type URLGetResponse = string; + +export interface URLGetParams { + account_id: string; +} + +export declare namespace URLs { + export { type URLGetResponse as URLGetResponse, type URLGetParams as URLGetParams }; +} diff --git a/src/resources/ai.ts b/src/resources/ai.ts new file mode 100644 index 0000000000..6bea0b91f3 --- /dev/null +++ b/src/resources/ai.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ai/index'; diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts new file mode 100644 index 0000000000..0904e705ec --- /dev/null +++ b/src/resources/ai/ai.ts @@ -0,0 +1,1129 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as AuthorsAPI from './authors'; +import { AuthorListParams, AuthorListResponse, AuthorListResponsesSinglePage, Authors } from './authors'; +import * as TasksAPI from './tasks'; +import { TaskListParams, TaskListResponse, TaskListResponsesSinglePage, Tasks } from './tasks'; +import * as ToMarkdownAPI from './to-markdown'; +import { + ToMarkdown, + ToMarkdownSupportedParams, + ToMarkdownSupportedResponse, + ToMarkdownSupportedResponsesSinglePage, + ToMarkdownTransformParams, + ToMarkdownTransformResponse, + ToMarkdownTransformResponsesSinglePage, +} from './to-markdown'; +import * as FinetunesAPI from './finetunes/finetunes'; +import { + FinetuneCreateParams, + FinetuneCreateResponse, + FinetuneListParams, + FinetuneListResponse, + Finetunes, +} from './finetunes/finetunes'; +import * as ModelsAPI from './models/models'; +import { + ModelListParams, + ModelListResponse, + ModelListResponsesV4PagePaginationArray, + Models, +} from './models/models'; + +export class AI extends APIResource { + finetunes: FinetunesAPI.Finetunes = new FinetunesAPI.Finetunes(this._client); + authors: AuthorsAPI.Authors = new AuthorsAPI.Authors(this._client); + tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client); + models: ModelsAPI.Models = new ModelsAPI.Models(this._client); + toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); + + /** + * This endpoint provides users with the capability to run specific AI models + * on-demand. + * + * By submitting the required input data, users can receive real-time predictions + * or results generated by the chosen AI model. The endpoint supports various AI + * model types, ensuring flexibility and adaptability for diverse use cases. + * + * Model specific inputs available in + * [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/). + */ + run(modelName: string, params: AIRunParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai/run/${modelName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: AIRunResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * An array of classification results for the input text + */ +export type AIRunResponse = + | Array + | Core.Uploadable + | AIRunResponse.Audio + | Core.Uploadable + | AIRunResponse.TextEmbeddings + | AIRunResponse.AutomaticSpeechRecognition + | Array + | Array + | AIRunResponse.UnionMember8 + | Core.Uploadable + | AIRunResponse.Translation + | AIRunResponse.Summarization + | AIRunResponse.ImageToText + | AIRunResponse.ImageTextToText + | AIRunResponse.MultimodalEmbeddings; + +export namespace AIRunResponse { + export interface TextClassification { + /** + * The classification label assigned to the text (e.g., 'POSITIVE' or 'NEGATIVE') + */ + label?: string; + + /** + * Confidence score indicating the likelihood that the text belongs to the + * specified label + */ + score?: number; + } + + export interface Audio { + /** + * The generated audio in MP3 format, base64-encoded + */ + audio?: string; + } + + export interface TextEmbeddings { + /** + * Embeddings of the requested text values + */ + data?: Array>; + + shape?: Array; + } + + export interface AutomaticSpeechRecognition { + /** + * The transcription + */ + text: string; + + vtt?: string; + + word_count?: number; + + words?: Array; + } + + export namespace AutomaticSpeechRecognition { + export interface Word { + /** + * The ending second when the word completes + */ + end?: number; + + /** + * The second this word begins in the recording + */ + start?: number; + + word?: string; + } + } + + export interface ImageClassification { + /** + * The predicted category or class for the input image based on analysis + */ + label?: string; + + /** + * A confidence value, between 0 and 1, indicating how certain the model is about + * the predicted label + */ + score?: number; + } + + export interface ObjectDetection { + /** + * Coordinates defining the bounding box around the detected object + */ + box?: ObjectDetection.Box; + + /** + * The class label or name of the detected object + */ + label?: string; + + /** + * Confidence score indicating the likelihood that the detection is correct + */ + score?: number; + } + + export namespace ObjectDetection { + /** + * Coordinates defining the bounding box around the detected object + */ + export interface Box { + /** + * The x-coordinate of the bottom-right corner of the bounding box + */ + xmax?: number; + + /** + * The x-coordinate of the top-left corner of the bounding box + */ + xmin?: number; + + /** + * The y-coordinate of the bottom-right corner of the bounding box + */ + ymax?: number; + + /** + * The y-coordinate of the top-left corner of the bounding box + */ + ymin?: number; + } + } + + export interface UnionMember8 { + /** + * The generated text response from the model + */ + response: string; + + /** + * An array of tool calls requests made during the response generation + */ + tool_calls?: Array; + + /** + * Usage statistics for the inference request + */ + usage?: UnionMember8.Usage; + } + + export namespace UnionMember8 { + export interface ToolCall { + /** + * The arguments passed to be passed to the tool call request + */ + arguments?: unknown; + + /** + * The name of the tool to be called + */ + name?: string; + } + + /** + * Usage statistics for the inference request + */ + export interface Usage { + /** + * Total number of tokens in output + */ + completion_tokens?: number; + + /** + * Total number of tokens in input + */ + prompt_tokens?: number; + + /** + * Total number of input and output tokens + */ + total_tokens?: number; + } + } + + export interface Translation { + /** + * The translated text in the target language + */ + translated_text?: string; + } + + export interface Summarization { + /** + * The summarized version of the input text + */ + summary?: string; + } + + export interface ImageToText { + description?: string; + } + + export interface ImageTextToText { + description?: string; + } + + export interface MultimodalEmbeddings { + data?: Array>; + + shape?: Array; + } +} + +export type AIRunParams = + | AIRunParams.TextClassification + | AIRunParams.TextToImage + | AIRunParams.TextToSpeech + | AIRunParams.TextEmbeddings + | AIRunParams.AutomaticSpeechRecognition + | AIRunParams.ImageClassification + | AIRunParams.ObjectDetection + | AIRunParams.Prompt + | AIRunParams.Messages + | AIRunParams.Translation + | AIRunParams.Summarization + | AIRunParams.ImageToText + | AIRunParams.Variant12 + | AIRunParams.Variant13 + | AIRunParams.MultimodalEmbeddings; + +export declare namespace AIRunParams { + export interface TextClassification { + /** + * Path param + */ + account_id: string; + + /** + * Body param: The text that you want to classify + */ + text: string; + } + + export interface TextToImage { + /** + * Path param + */ + account_id: string; + + /** + * Body param: A text description of the image you want to generate + */ + prompt: string; + + /** + * Body param: Controls how closely the generated image should adhere to the + * prompt; higher values make the image more aligned with the prompt + */ + guidance?: number; + + /** + * Body param: The height of the generated image in pixels + */ + height?: number; + + /** + * Body param: For use with img2img tasks. An array of integers that represent the + * image data constrained to 8-bit unsigned integer values + */ + image?: Array; + + /** + * Body param: For use with img2img tasks. A base64-encoded string of the input + * image + */ + image_b64?: string; + + /** + * Body param: An array representing An array of integers that represent mask image + * data for inpainting constrained to 8-bit unsigned integer values + */ + mask?: Array; + + /** + * Body param: Text describing elements to avoid in the generated image + */ + negative_prompt?: string; + + /** + * Body param: The number of diffusion steps; higher values can improve quality but + * take longer + */ + num_steps?: number; + + /** + * Body param: Random seed for reproducibility of the image generation + */ + seed?: number; + + /** + * Body param: A value between 0 and 1 indicating how strongly to apply the + * transformation during img2img tasks; lower values make the output closer to the + * input image + */ + strength?: number; + + /** + * Body param: The width of the generated image in pixels + */ + width?: number; + } + + export interface TextToSpeech { + /** + * Path param + */ + account_id: string; + + /** + * Body param: A text description of the audio you want to generate + */ + prompt: string; + + /** + * Body param: The speech language (e.g., 'en' for English, 'fr' for French). + * Defaults to 'en' if not specified + */ + lang?: string; + } + + export interface TextEmbeddings { + /** + * Path param + */ + account_id: string; + + /** + * Body param: The text to embed + */ + text: string | Array; + } + + export interface AutomaticSpeechRecognition { + /** + * Path param + */ + account_id: string; + + /** + * Body param: An array of integers that represent the audio data constrained to + * 8-bit unsigned integer values + */ + audio: Array; + + /** + * Body param: The language of the recorded audio + */ + source_lang?: string; + + /** + * Body param: The language to translate the transcription into. Currently only + * English is supported. + */ + target_lang?: string; + } + + export interface ImageClassification { + /** + * Path param + */ + account_id: string; + + /** + * Body param: An array of integers that represent the image data constrained to + * 8-bit unsigned integer values + */ + image: Array; + } + + export interface ObjectDetection { + /** + * Path param + */ + account_id: string; + + /** + * Body param: An array of integers that represent the image data constrained to + * 8-bit unsigned integer values + */ + image?: Array; + } + + export interface Prompt { + /** + * Path param + */ + account_id: string; + + /** + * Body param: The input text prompt for the model to generate a response. + */ + prompt: string; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: Name of the LoRA (Low-Rank Adaptation) model to fine-tune the base + * model. + */ + lora?: string; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: If true, a chat template is not applied and you must adhere to the + * specific model's expected formatting. + */ + raw?: boolean; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param + */ + response_format?: Prompt.ResponseFormat; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: If true, the response will be streamed back incrementally using SSE, + * Server Sent Events. + */ + stream?: boolean; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Adjusts the creativity of the AI's responses by controlling how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export namespace Prompt { + export interface ResponseFormat { + json_schema?: unknown; + + type?: 'json_object' | 'json_schema'; + } + } + + export interface Messages { + /** + * Path param + */ + account_id: string; + + /** + * Body param: An array of message objects representing the conversation history. + */ + messages: Array; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param + */ + functions?: Array; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: If true, a chat template is not applied and you must adhere to the + * specific model's expected formatting. + */ + raw?: boolean; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param + */ + response_format?: Messages.ResponseFormat; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: If true, the response will be streamed back incrementally using SSE, + * Server Sent Events. + */ + stream?: boolean; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: A list of tools available for the assistant to use. + */ + tools?: Array; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Adjusts the creativity of the AI's responses by controlling how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export namespace Messages { + export interface Message { + /** + * The content of the message as a string. + */ + content: string | Array; + + /** + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). + */ + role: string; + } + + export namespace Message { + export interface UnionMember1 { + /** + * Text content + */ + text?: string; + + /** + * Type of the content (text) + */ + type?: string; + } + } + + export interface Function { + code: string; + + name: string; + } + + export interface ResponseFormat { + json_schema?: unknown; + + type?: 'json_object' | 'json_schema'; + } + + export interface UnionMember0 { + /** + * A brief description of what the tool does. + */ + description: string; + + /** + * The name of the tool. More descriptive the better. + */ + name: string; + + /** + * Schema defining the parameters accepted by the tool. + */ + parameters: UnionMember0.Parameters; + } + + export namespace UnionMember0 { + /** + * Schema defining the parameters accepted by the tool. + */ + export interface Parameters { + /** + * Definitions of each parameter. + */ + properties: { [key: string]: Parameters.Properties }; + + /** + * The type of the parameters object (usually 'object'). + */ + type: string; + + /** + * List of required parameter names. + */ + required?: Array; + } + + export namespace Parameters { + export interface Properties { + /** + * A description of the expected parameter. + */ + description: string; + + /** + * The data type of the parameter. + */ + type: string; + } + } + } + + export interface Function { + /** + * Details of the function tool. + */ + function: Function.Function; + + /** + * Specifies the type of tool (e.g., 'function'). + */ + type: string; + } + + export namespace Function { + /** + * Details of the function tool. + */ + export interface Function { + /** + * A brief description of what the function does. + */ + description: string; + + /** + * The name of the function. + */ + name: string; + + /** + * Schema defining the parameters accepted by the function. + */ + parameters: Function.Parameters; + } + + export namespace Function { + /** + * Schema defining the parameters accepted by the function. + */ + export interface Parameters { + /** + * Definitions of each parameter. + */ + properties: { [key: string]: Parameters.Properties }; + + /** + * The type of the parameters object (usually 'object'). + */ + type: string; + + /** + * List of required parameter names. + */ + required?: Array; + } + + export namespace Parameters { + export interface Properties { + /** + * A description of the expected parameter. + */ + description: string; + + /** + * The data type of the parameter. + */ + type: string; + } + } + } + } + } + + export interface Translation { + /** + * Path param + */ + account_id: string; + + /** + * Body param: The language code to translate the text into (e.g., 'es' for + * Spanish) + */ + target_lang: string; + + /** + * Body param: The text to be translated + */ + text: string; + + /** + * Body param: The language code of the source text (e.g., 'en' for English). + * Defaults to 'en' if not specified + */ + source_lang?: string; + } + + export interface Summarization { + /** + * Path param + */ + account_id: string; + + /** + * Body param: The text that you want the model to summarize + */ + input_text: string; + + /** + * Body param: The maximum length of the generated summary in tokens + */ + max_length?: number; + } + + export interface ImageToText { + /** + * Path param + */ + account_id: string; + + /** + * Body param: An array of integers that represent the image data constrained to + * 8-bit unsigned integer values + */ + image: Array; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: The input text prompt for the model to generate a response. + */ + prompt?: string; + + /** + * Body param: If true, a chat template is not applied and you must adhere to the + * specific model's expected formatting. + */ + raw?: boolean; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Controls the creativity of the AI's responses by adjusting how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export interface Variant12 { + /** + * Path param + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image: string; + + /** + * Body param: The input text prompt for the model to generate a response. + */ + prompt: string; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: Whether to ignore the EOS token and continue generating tokens after + * the EOS token is generated. + */ + ignore_eos?: boolean; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Controls the creativity of the AI's responses by adjusting how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export interface Variant13 { + /** + * Path param + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image: string; + + /** + * Body param: An array of message objects representing the conversation history. + */ + messages: Array; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: Whether to ignore the EOS token and continue generating tokens after + * the EOS token is generated. + */ + ignore_eos?: boolean; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Controls the creativity of the AI's responses by adjusting how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export namespace Variant13 { + export interface Message { + /** + * The content of the message as a string. + */ + content: string; + + /** + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). + */ + role: string; + } + } + + export interface MultimodalEmbeddings { + /** + * Path param + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image?: string; + + /** + * Body param + */ + text?: Array; + } +} + +AI.Finetunes = Finetunes; +AI.Authors = Authors; +AI.AuthorListResponsesSinglePage = AuthorListResponsesSinglePage; +AI.Tasks = Tasks; +AI.TaskListResponsesSinglePage = TaskListResponsesSinglePage; +AI.Models = Models; +AI.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray; +AI.ToMarkdown = ToMarkdown; +AI.ToMarkdownSupportedResponsesSinglePage = ToMarkdownSupportedResponsesSinglePage; +AI.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage; + +export declare namespace AI { + export { type AIRunResponse as AIRunResponse, type AIRunParams as AIRunParams }; + + export { + Finetunes as Finetunes, + type FinetuneCreateResponse as FinetuneCreateResponse, + type FinetuneListResponse as FinetuneListResponse, + type FinetuneCreateParams as FinetuneCreateParams, + type FinetuneListParams as FinetuneListParams, + }; + + export { + Authors as Authors, + type AuthorListResponse as AuthorListResponse, + AuthorListResponsesSinglePage as AuthorListResponsesSinglePage, + type AuthorListParams as AuthorListParams, + }; + + export { + Tasks as Tasks, + type TaskListResponse as TaskListResponse, + TaskListResponsesSinglePage as TaskListResponsesSinglePage, + type TaskListParams as TaskListParams, + }; + + export { + Models as Models, + type ModelListResponse as ModelListResponse, + ModelListResponsesV4PagePaginationArray as ModelListResponsesV4PagePaginationArray, + type ModelListParams as ModelListParams, + }; + + export { + ToMarkdown as ToMarkdown, + type ToMarkdownSupportedResponse as ToMarkdownSupportedResponse, + type ToMarkdownTransformResponse as ToMarkdownTransformResponse, + ToMarkdownSupportedResponsesSinglePage as ToMarkdownSupportedResponsesSinglePage, + ToMarkdownTransformResponsesSinglePage as ToMarkdownTransformResponsesSinglePage, + type ToMarkdownSupportedParams as ToMarkdownSupportedParams, + type ToMarkdownTransformParams as ToMarkdownTransformParams, + }; +} diff --git a/src/resources/ai/authors.ts b/src/resources/ai/authors.ts new file mode 100644 index 0000000000..4b672ce143 --- /dev/null +++ b/src/resources/ai/authors.ts @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class Authors extends APIResource { + /** + * Author Search + */ + list( + params: AuthorListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/authors/search`, + AuthorListResponsesSinglePage, + options, + ); + } +} + +export class AuthorListResponsesSinglePage extends SinglePage {} + +export type AuthorListResponse = unknown; + +export interface AuthorListParams { + account_id: string; +} + +Authors.AuthorListResponsesSinglePage = AuthorListResponsesSinglePage; + +export declare namespace Authors { + export { + type AuthorListResponse as AuthorListResponse, + AuthorListResponsesSinglePage as AuthorListResponsesSinglePage, + type AuthorListParams as AuthorListParams, + }; +} diff --git a/src/resources/ai/finetunes.ts b/src/resources/ai/finetunes.ts new file mode 100644 index 0000000000..af0d27842e --- /dev/null +++ b/src/resources/ai/finetunes.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './finetunes/index'; diff --git a/src/resources/ai/finetunes/assets.ts b/src/resources/ai/finetunes/assets.ts new file mode 100644 index 0000000000..b4504c0f79 --- /dev/null +++ b/src/resources/ai/finetunes/assets.ts @@ -0,0 +1,46 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class Assets extends APIResource { + /** + * Upload a Finetune Asset + */ + create( + finetuneId: string, + params: AssetCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post( + `/accounts/${account_id}/ai/finetunes/${finetuneId}/finetune-assets`, + Core.multipartFormRequestOptions({ body, ...options }), + ); + } +} + +export interface AssetCreateResponse { + success: boolean; +} + +export interface AssetCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + file?: Core.Uploadable; + + /** + * Body param + */ + file_name?: string; +} + +export declare namespace Assets { + export { type AssetCreateResponse as AssetCreateResponse, type AssetCreateParams as AssetCreateParams }; +} diff --git a/src/resources/ai/finetunes/finetunes.ts b/src/resources/ai/finetunes/finetunes.ts new file mode 100644 index 0000000000..183df88d0a --- /dev/null +++ b/src/resources/ai/finetunes/finetunes.ts @@ -0,0 +1,127 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as AssetsAPI from './assets'; +import { AssetCreateParams, AssetCreateResponse, Assets } from './assets'; +import * as PublicAPI from './public'; +import { Public, PublicListParams, PublicListResponse, PublicListResponsesSinglePage } from './public'; + +export class Finetunes extends APIResource { + assets: AssetsAPI.Assets = new AssetsAPI.Assets(this._client); + public: PublicAPI.Public = new PublicAPI.Public(this._client); + + /** + * Create a new Finetune + */ + create( + params: FinetuneCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai/finetunes`, { body, ...options }) as Core.APIPromise<{ + result: FinetuneCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Finetunes + */ + list(params: FinetuneListParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/ai/finetunes`, options) as Core.APIPromise<{ + result: FinetuneListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface FinetuneCreateResponse { + id: string; + + created_at: string; + + model: string; + + modified_at: string; + + name: string; + + public: boolean; + + description?: string; +} + +export interface FinetuneListResponse { + id: string; + + created_at: string; + + model: string; + + modified_at: string; + + name: string; + + description?: string; +} + +export interface FinetuneCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + model: string; + + /** + * Body param + */ + name: string; + + /** + * Body param + */ + description?: string; + + /** + * Body param + */ + public?: boolean; +} + +export interface FinetuneListParams { + account_id: string; +} + +Finetunes.Assets = Assets; +Finetunes.Public = Public; +Finetunes.PublicListResponsesSinglePage = PublicListResponsesSinglePage; + +export declare namespace Finetunes { + export { + type FinetuneCreateResponse as FinetuneCreateResponse, + type FinetuneListResponse as FinetuneListResponse, + type FinetuneCreateParams as FinetuneCreateParams, + type FinetuneListParams as FinetuneListParams, + }; + + export { + Assets as Assets, + type AssetCreateResponse as AssetCreateResponse, + type AssetCreateParams as AssetCreateParams, + }; + + export { + Public as Public, + type PublicListResponse as PublicListResponse, + PublicListResponsesSinglePage as PublicListResponsesSinglePage, + type PublicListParams as PublicListParams, + }; +} diff --git a/src/resources/ai/finetunes/index.ts b/src/resources/ai/finetunes/index.ts new file mode 100644 index 0000000000..b1afe5dee7 --- /dev/null +++ b/src/resources/ai/finetunes/index.ts @@ -0,0 +1,16 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Assets, type AssetCreateResponse, type AssetCreateParams } from './assets'; +export { + Finetunes, + type FinetuneCreateResponse, + type FinetuneListResponse, + type FinetuneCreateParams, + type FinetuneListParams, +} from './finetunes'; +export { + PublicListResponsesSinglePage, + Public, + type PublicListResponse, + type PublicListParams, +} from './public'; diff --git a/src/resources/ai/finetunes/public.ts b/src/resources/ai/finetunes/public.ts new file mode 100644 index 0000000000..d469708d39 --- /dev/null +++ b/src/resources/ai/finetunes/public.ts @@ -0,0 +1,72 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class Public extends APIResource { + /** + * List Public Finetunes + */ + list( + params: PublicListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/finetunes/public`, + PublicListResponsesSinglePage, + { query, ...options }, + ); + } +} + +export class PublicListResponsesSinglePage extends SinglePage {} + +export interface PublicListResponse { + id: string; + + created_at: string; + + model: string; + + modified_at: string; + + name: string; + + public: boolean; + + description?: string; +} + +export interface PublicListParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param: Pagination Limit + */ + limit?: number; + + /** + * Query param: Pagination Offset + */ + offset?: number; + + /** + * Query param: Order By Column Name + */ + orderBy?: string; +} + +Public.PublicListResponsesSinglePage = PublicListResponsesSinglePage; + +export declare namespace Public { + export { + type PublicListResponse as PublicListResponse, + PublicListResponsesSinglePage as PublicListResponsesSinglePage, + type PublicListParams as PublicListParams, + }; +} diff --git a/src/resources/ai/index.ts b/src/resources/ai/index.ts new file mode 100644 index 0000000000..60f0842740 --- /dev/null +++ b/src/resources/ai/index.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AI } from './ai'; +export { + AuthorListResponsesSinglePage, + Authors, + type AuthorListResponse, + type AuthorListParams, +} from './authors'; +export { + Finetunes, + type FinetuneCreateResponse, + type FinetuneListResponse, + type FinetuneCreateParams, + type FinetuneListParams, +} from './finetunes/index'; +export { + ModelListResponsesV4PagePaginationArray, + Models, + type ModelListResponse, + type ModelListParams, +} from './models/index'; +export { TaskListResponsesSinglePage, Tasks, type TaskListResponse, type TaskListParams } from './tasks'; +export { + ToMarkdownSupportedResponsesSinglePage, + ToMarkdownTransformResponsesSinglePage, + ToMarkdown, + type ToMarkdownSupportedResponse, + type ToMarkdownTransformResponse, + type ToMarkdownSupportedParams, + type ToMarkdownTransformParams, +} from './to-markdown'; diff --git a/src/resources/ai/models.ts b/src/resources/ai/models.ts new file mode 100644 index 0000000000..8ce5add23b --- /dev/null +++ b/src/resources/ai/models.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './models/index'; diff --git a/src/resources/ai/models/index.ts b/src/resources/ai/models/index.ts new file mode 100644 index 0000000000..4d7a7597b2 --- /dev/null +++ b/src/resources/ai/models/index.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + ModelListResponsesV4PagePaginationArray, + Models, + type ModelListResponse, + type ModelListParams, +} from './models'; +export { Schema, type SchemaGetResponse, type SchemaGetParams } from './schema'; diff --git a/src/resources/ai/models/models.ts b/src/resources/ai/models/models.ts new file mode 100644 index 0000000000..752742dde3 --- /dev/null +++ b/src/resources/ai/models/models.ts @@ -0,0 +1,79 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as SchemaAPI from './schema'; +import { Schema, SchemaGetParams, SchemaGetResponse } from './schema'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Models extends APIResource { + schema: SchemaAPI.Schema = new SchemaAPI.Schema(this._client); + + /** + * Model Search + */ + list( + params: ModelListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/models/search`, + ModelListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class ModelListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export type ModelListResponse = unknown; + +export interface ModelListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param: Filter by Author + */ + author?: string; + + /** + * Query param: Filter to hide experimental models + */ + hide_experimental?: boolean; + + /** + * Query param: Search + */ + search?: string; + + /** + * Query param: Filter by Source Id + */ + source?: number; + + /** + * Query param: Filter by Task Name + */ + task?: string; +} + +Models.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray; +Models.Schema = Schema; + +export declare namespace Models { + export { + type ModelListResponse as ModelListResponse, + ModelListResponsesV4PagePaginationArray as ModelListResponsesV4PagePaginationArray, + type ModelListParams as ModelListParams, + }; + + export { + Schema as Schema, + type SchemaGetResponse as SchemaGetResponse, + type SchemaGetParams as SchemaGetParams, + }; +} diff --git a/src/resources/ai/models/schema.ts b/src/resources/ai/models/schema.ts new file mode 100644 index 0000000000..4740eff1e0 --- /dev/null +++ b/src/resources/ai/models/schema.ts @@ -0,0 +1,58 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class Schema extends APIResource { + /** + * Get Model Schema + */ + get(params: SchemaGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/ai/models/schema`, { query, ...options }) as Core.APIPromise<{ + result: SchemaGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SchemaGetResponse { + input: SchemaGetResponse.Input; + + output: SchemaGetResponse.Output; +} + +export namespace SchemaGetResponse { + export interface Input { + additionalProperties: boolean; + + description: string; + + type: string; + } + + export interface Output { + additionalProperties: boolean; + + description: string; + + type: string; + } +} + +export interface SchemaGetParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param: Model Name + */ + model: string; +} + +export declare namespace Schema { + export { type SchemaGetResponse as SchemaGetResponse, type SchemaGetParams as SchemaGetParams }; +} diff --git a/src/resources/ai/tasks.ts b/src/resources/ai/tasks.ts new file mode 100644 index 0000000000..5e830da4d9 --- /dev/null +++ b/src/resources/ai/tasks.ts @@ -0,0 +1,40 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class Tasks extends APIResource { + /** + * Task Search + */ + list( + params: TaskListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tasks/search`, + TaskListResponsesSinglePage, + options, + ); + } +} + +export class TaskListResponsesSinglePage extends SinglePage {} + +export type TaskListResponse = unknown; + +export interface TaskListParams { + account_id: string; +} + +Tasks.TaskListResponsesSinglePage = TaskListResponsesSinglePage; + +export declare namespace Tasks { + export { + type TaskListResponse as TaskListResponse, + TaskListResponsesSinglePage as TaskListResponsesSinglePage, + type TaskListParams as TaskListParams, + }; +} diff --git a/src/resources/ai/to-markdown.ts b/src/resources/ai/to-markdown.ts new file mode 100644 index 0000000000..f14950e348 --- /dev/null +++ b/src/resources/ai/to-markdown.ts @@ -0,0 +1,95 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class ToMarkdown extends APIResource { + /** + * Get all converted formats supported + */ + supported( + params: ToMarkdownSupportedParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tomarkdown/supported`, + ToMarkdownSupportedResponsesSinglePage, + options, + ); + } + + /** + * Convert Files into Markdown + */ + transform( + params: ToMarkdownTransformParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, file } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tomarkdown`, + ToMarkdownTransformResponsesSinglePage, + Core.multipartFormRequestOptions({ body: file, method: 'post', ...options }), + ); + } +} + +export class ToMarkdownSupportedResponsesSinglePage extends SinglePage {} + +export class ToMarkdownTransformResponsesSinglePage extends SinglePage {} + +export interface ToMarkdownSupportedResponse { + extension: string; + + mimeType: string; +} + +export interface ToMarkdownTransformResponse { + data: string; + + format: string; + + mimeType: string; + + name: string; + + tokens: string; +} + +export interface ToMarkdownSupportedParams { + account_id: string; +} + +export interface ToMarkdownTransformParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + file: ToMarkdownTransformParams.File; +} + +export namespace ToMarkdownTransformParams { + export interface File { + files: Array; + } +} + +ToMarkdown.ToMarkdownSupportedResponsesSinglePage = ToMarkdownSupportedResponsesSinglePage; +ToMarkdown.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage; + +export declare namespace ToMarkdown { + export { + type ToMarkdownSupportedResponse as ToMarkdownSupportedResponse, + type ToMarkdownTransformResponse as ToMarkdownTransformResponse, + ToMarkdownSupportedResponsesSinglePage as ToMarkdownSupportedResponsesSinglePage, + ToMarkdownTransformResponsesSinglePage as ToMarkdownTransformResponsesSinglePage, + type ToMarkdownSupportedParams as ToMarkdownSupportedParams, + type ToMarkdownTransformParams as ToMarkdownTransformParams, + }; +} diff --git a/src/resources/aisearch.ts b/src/resources/aisearch.ts new file mode 100644 index 0000000000..97b1aac883 --- /dev/null +++ b/src/resources/aisearch.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './aisearch/index'; diff --git a/src/resources/aisearch/aisearch.ts b/src/resources/aisearch/aisearch.ts new file mode 100644 index 0000000000..732c8c4ade --- /dev/null +++ b/src/resources/aisearch/aisearch.ts @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as TokensAPI from './tokens'; +import { + TokenCreateParams, + TokenCreateResponse, + TokenDeleteParams, + TokenDeleteResponse, + TokenListParams, + TokenListResponse, + TokenListResponsesV4PagePaginationArray, + TokenReadParams, + TokenReadResponse, + TokenUpdateParams, + TokenUpdateResponse, + Tokens, +} from './tokens'; +import * as InstancesAPI from './instances/instances'; +import { + InstanceChatCompletionsParams, + InstanceChatCompletionsResponse, + InstanceCreateParams, + InstanceCreateResponse, + InstanceDeleteParams, + InstanceDeleteResponse, + InstanceListParams, + InstanceListResponse, + InstanceListResponsesV4PagePaginationArray, + InstanceReadParams, + InstanceReadResponse, + InstanceSearchParams, + InstanceSearchResponse, + InstanceStatsParams, + InstanceStatsResponse, + InstanceUpdateParams, + InstanceUpdateResponse, + Instances, +} from './instances/instances'; + +export class AISearch extends APIResource { + instances: InstancesAPI.Instances = new InstancesAPI.Instances(this._client); + tokens: TokensAPI.Tokens = new TokensAPI.Tokens(this._client); +} + +AISearch.Instances = Instances; +AISearch.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; +AISearch.Tokens = Tokens; +AISearch.TokenListResponsesV4PagePaginationArray = TokenListResponsesV4PagePaginationArray; + +export declare namespace AISearch { + export { + Instances as Instances, + type InstanceCreateResponse as InstanceCreateResponse, + type InstanceUpdateResponse as InstanceUpdateResponse, + type InstanceListResponse as InstanceListResponse, + type InstanceDeleteResponse as InstanceDeleteResponse, + type InstanceChatCompletionsResponse as InstanceChatCompletionsResponse, + type InstanceReadResponse as InstanceReadResponse, + type InstanceSearchResponse as InstanceSearchResponse, + type InstanceStatsResponse as InstanceStatsResponse, + InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, + type InstanceCreateParams as InstanceCreateParams, + type InstanceUpdateParams as InstanceUpdateParams, + type InstanceListParams as InstanceListParams, + type InstanceDeleteParams as InstanceDeleteParams, + type InstanceChatCompletionsParams as InstanceChatCompletionsParams, + type InstanceReadParams as InstanceReadParams, + type InstanceSearchParams as InstanceSearchParams, + type InstanceStatsParams as InstanceStatsParams, + }; + + export { + Tokens as Tokens, + type TokenCreateResponse as TokenCreateResponse, + type TokenUpdateResponse as TokenUpdateResponse, + type TokenListResponse as TokenListResponse, + type TokenDeleteResponse as TokenDeleteResponse, + type TokenReadResponse as TokenReadResponse, + TokenListResponsesV4PagePaginationArray as TokenListResponsesV4PagePaginationArray, + type TokenCreateParams as TokenCreateParams, + type TokenUpdateParams as TokenUpdateParams, + type TokenListParams as TokenListParams, + type TokenDeleteParams as TokenDeleteParams, + type TokenReadParams as TokenReadParams, + }; +} diff --git a/src/resources/aisearch/index.ts b/src/resources/aisearch/index.ts new file mode 100644 index 0000000000..9c78c3e801 --- /dev/null +++ b/src/resources/aisearch/index.ts @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { AISearch } from './aisearch'; +export { + InstanceListResponsesV4PagePaginationArray, + Instances, + type InstanceCreateResponse, + type InstanceUpdateResponse, + type InstanceListResponse, + type InstanceDeleteResponse, + type InstanceChatCompletionsResponse, + type InstanceReadResponse, + type InstanceSearchResponse, + type InstanceStatsResponse, + type InstanceCreateParams, + type InstanceUpdateParams, + type InstanceListParams, + type InstanceDeleteParams, + type InstanceChatCompletionsParams, + type InstanceReadParams, + type InstanceSearchParams, + type InstanceStatsParams, +} from './instances/index'; +export { + TokenListResponsesV4PagePaginationArray, + Tokens, + type TokenCreateResponse, + type TokenUpdateResponse, + type TokenListResponse, + type TokenDeleteResponse, + type TokenReadResponse, + type TokenCreateParams, + type TokenUpdateParams, + type TokenListParams, + type TokenDeleteParams, + type TokenReadParams, +} from './tokens'; diff --git a/src/resources/aisearch/instances.ts b/src/resources/aisearch/instances.ts new file mode 100644 index 0000000000..e3873a7498 --- /dev/null +++ b/src/resources/aisearch/instances.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './instances/index'; diff --git a/src/resources/aisearch/instances/index.ts b/src/resources/aisearch/instances/index.ts new file mode 100644 index 0000000000..c140ae2abc --- /dev/null +++ b/src/resources/aisearch/instances/index.ts @@ -0,0 +1,42 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + InstanceListResponsesV4PagePaginationArray, + Instances, + type InstanceCreateResponse, + type InstanceUpdateResponse, + type InstanceListResponse, + type InstanceDeleteResponse, + type InstanceChatCompletionsResponse, + type InstanceReadResponse, + type InstanceSearchResponse, + type InstanceStatsResponse, + type InstanceCreateParams, + type InstanceUpdateParams, + type InstanceListParams, + type InstanceDeleteParams, + type InstanceChatCompletionsParams, + type InstanceReadParams, + type InstanceSearchParams, + type InstanceStatsParams, +} from './instances'; +export { + ItemListResponsesV4PagePaginationArray, + Items, + type ItemListResponse, + type ItemGetResponse, + type ItemListParams, + type ItemGetParams, +} from './items'; +export { + JobListResponsesV4PagePaginationArray, + Jobs, + type JobCreateResponse, + type JobListResponse, + type JobGetResponse, + type JobLogsResponse, + type JobCreateParams, + type JobListParams, + type JobGetParams, + type JobLogsParams, +} from './jobs'; diff --git a/src/resources/aisearch/instances/instances.ts b/src/resources/aisearch/instances/instances.ts new file mode 100644 index 0000000000..4d02df6b0a --- /dev/null +++ b/src/resources/aisearch/instances/instances.ts @@ -0,0 +1,2540 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as ItemsAPI from './items'; +import { + ItemGetParams, + ItemGetResponse, + ItemListParams, + ItemListResponse, + ItemListResponsesV4PagePaginationArray, + Items, +} from './items'; +import * as JobsAPI from './jobs'; +import { + JobCreateParams, + JobCreateResponse, + JobGetParams, + JobGetResponse, + JobListParams, + JobListResponse, + JobListResponsesV4PagePaginationArray, + JobLogsParams, + JobLogsResponse, + Jobs, +} from './jobs'; +import * as SippyAPI from '../../r2/buckets/sippy'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Instances extends APIResource { + items: ItemsAPI.Items = new ItemsAPI.Items(this._client); + jobs: JobsAPI.Jobs = new JobsAPI.Jobs(this._client); + + /** + * Create new instances. + * + * @example + * ```ts + * const instance = await client.aiSearch.instances.create({ + * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', + * id: 'my-ai-search', + * source: 'source', + * type: 'r2', + * }); + * ``` + */ + create( + params: InstanceCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-search/instances`, { + body, + ...options, + }) as Core.APIPromise<{ result: InstanceCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update instances. + * + * @example + * ```ts + * const instance = await client.aiSearch.instances.update( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + update( + id: string, + params: InstanceUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/ai-search/instances/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: InstanceUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List instances. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const instanceListResponse of client.aiSearch.instances.list( + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: InstanceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-search/instances`, + InstanceListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete instances. + * + * @example + * ```ts + * const instance = await client.aiSearch.instances.delete( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + delete( + id: string, + params: InstanceDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/ai-search/instances/${id}`, options) as Core.APIPromise<{ + result: InstanceDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Chat Completions + * + * @example + * ```ts + * const response = + * await client.aiSearch.instances.chatCompletions( + * 'my-ai-search', + * { + * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', + * messages: [{ content: 'content', role: 'system' }], + * }, + * ); + * ``` + */ + chatCompletions( + id: string, + params: InstanceChatCompletionsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post(`/accounts/${account_id}/ai-search/instances/${id}/chat/completions`, { + body, + ...options, + }); + } + + /** + * Read instances. + * + * @example + * ```ts + * const response = await client.aiSearch.instances.read( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + read( + id: string, + params: InstanceReadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/ai-search/instances/${id}`, options) as Core.APIPromise<{ + result: InstanceReadResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Search + * + * @example + * ```ts + * const response = await client.aiSearch.instances.search( + * 'my-ai-search', + * { + * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', + * messages: [{ content: 'content', role: 'system' }], + * }, + * ); + * ``` + */ + search( + id: string, + params: InstanceSearchParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-search/instances/${id}/search`, { + body, + ...options, + }) as Core.APIPromise<{ result: InstanceSearchResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Stats + * + * @example + * ```ts + * const response = await client.aiSearch.instances.stats( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + stats( + id: string, + params: InstanceStatsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-search/instances/${id}/stats`, + options, + ) as Core.APIPromise<{ result: InstanceStatsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class InstanceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface InstanceCreateResponse { + /** + * Use your AI Search ID. + */ + id: string; + + created_at: string; + + modified_at: string; + + source: string; + + type: 'r2' | 'web-crawler'; + + vectorize_name: string; + + ai_gateway_id?: string | null; + + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + cache?: boolean; + + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + chunk_overlap?: number; + + chunk_size?: number; + + created_by?: string | null; + + custom_metadata?: Array; + + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + enable?: boolean; + + hybrid_search_enabled?: boolean; + + last_activity?: string | null; + + max_num_results?: number; + + metadata?: InstanceCreateResponse.Metadata; + + modified_by?: string | null; + + paused?: boolean; + + public_endpoint_id?: string | null; + + public_endpoint_params?: InstanceCreateResponse.PublicEndpointParams; + + reranking?: boolean; + + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_query?: boolean; + + score_threshold?: number; + + source_params?: InstanceCreateResponse.SourceParams; + + status?: string; + + token_id?: string; +} + +export namespace InstanceCreateResponse { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.Provider; + } + } + } +} + +export interface InstanceUpdateResponse { + /** + * Use your AI Search ID. + */ + id: string; + + created_at: string; + + modified_at: string; + + source: string; + + type: 'r2' | 'web-crawler'; + + vectorize_name: string; + + ai_gateway_id?: string | null; + + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + cache?: boolean; + + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + chunk_overlap?: number; + + chunk_size?: number; + + created_by?: string | null; + + custom_metadata?: Array; + + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + enable?: boolean; + + hybrid_search_enabled?: boolean; + + last_activity?: string | null; + + max_num_results?: number; + + metadata?: InstanceUpdateResponse.Metadata; + + modified_by?: string | null; + + paused?: boolean; + + public_endpoint_id?: string | null; + + public_endpoint_params?: InstanceUpdateResponse.PublicEndpointParams; + + reranking?: boolean; + + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_query?: boolean; + + score_threshold?: number; + + source_params?: InstanceUpdateResponse.SourceParams; + + status?: string; + + token_id?: string; +} + +export namespace InstanceUpdateResponse { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.Provider; + } + } + } +} + +export interface InstanceListResponse { + /** + * Use your AI Search ID. + */ + id: string; + + created_at: string; + + modified_at: string; + + source: string; + + type: 'r2' | 'web-crawler'; + + vectorize_name: string; + + ai_gateway_id?: string | null; + + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + cache?: boolean; + + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + chunk_overlap?: number; + + chunk_size?: number; + + created_by?: string | null; + + custom_metadata?: Array; + + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + enable?: boolean; + + hybrid_search_enabled?: boolean; + + last_activity?: string | null; + + max_num_results?: number; + + metadata?: InstanceListResponse.Metadata; + + modified_by?: string | null; + + paused?: boolean; + + public_endpoint_id?: string | null; + + public_endpoint_params?: InstanceListResponse.PublicEndpointParams; + + reranking?: boolean; + + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_query?: boolean; + + score_threshold?: number; + + source_params?: InstanceListResponse.SourceParams; + + status?: string; + + token_id?: string; +} + +export namespace InstanceListResponse { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.Provider; + } + } + } +} + +export interface InstanceDeleteResponse { + /** + * Use your AI Search ID. + */ + id: string; + + created_at: string; + + modified_at: string; + + source: string; + + type: 'r2' | 'web-crawler'; + + vectorize_name: string; + + ai_gateway_id?: string | null; + + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + cache?: boolean; + + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + chunk_overlap?: number; + + chunk_size?: number; + + created_by?: string | null; + + custom_metadata?: Array; + + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + enable?: boolean; + + hybrid_search_enabled?: boolean; + + last_activity?: string | null; + + max_num_results?: number; + + metadata?: InstanceDeleteResponse.Metadata; + + modified_by?: string | null; + + paused?: boolean; + + public_endpoint_id?: string | null; + + public_endpoint_params?: InstanceDeleteResponse.PublicEndpointParams; + + reranking?: boolean; + + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_query?: boolean; + + score_threshold?: number; + + source_params?: InstanceDeleteResponse.SourceParams; + + status?: string; + + token_id?: string; +} + +export namespace InstanceDeleteResponse { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.Provider; + } + } + } +} + +export interface InstanceChatCompletionsResponse { + choices: Array; + + chunks: Array; + + id?: string; + + model?: string; + + object?: string; + + [k: string]: unknown; +} + +export namespace InstanceChatCompletionsResponse { + export interface Choice { + message: Choice.Message; + + index?: number; + } + + export namespace Choice { + export interface Message { + content: string | null; + + role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; + + [k: string]: unknown; + } + } + + export interface Chunk { + id: string; + + score: number; + + text: string; + + type: string; + + item?: Chunk.Item; + + scoring_details?: Chunk.ScoringDetails; + } + + export namespace Chunk { + export interface Item { + key: string; + + metadata?: { [key: string]: unknown }; + + timestamp?: number; + } + + export interface ScoringDetails { + keyword_rank?: number; + + keyword_score?: number; + + vector_rank?: number; + + vector_score?: number; + } + } +} + +export interface InstanceReadResponse { + /** + * Use your AI Search ID. + */ + id: string; + + created_at: string; + + modified_at: string; + + source: string; + + type: 'r2' | 'web-crawler'; + + vectorize_name: string; + + ai_gateway_id?: string | null; + + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + cache?: boolean; + + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + chunk_overlap?: number; + + chunk_size?: number; + + created_by?: string | null; + + custom_metadata?: Array; + + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + enable?: boolean; + + hybrid_search_enabled?: boolean; + + last_activity?: string | null; + + max_num_results?: number; + + metadata?: InstanceReadResponse.Metadata; + + modified_by?: string | null; + + paused?: boolean; + + public_endpoint_id?: string | null; + + public_endpoint_params?: InstanceReadResponse.PublicEndpointParams; + + reranking?: boolean; + + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_query?: boolean; + + score_threshold?: number; + + source_params?: InstanceReadResponse.SourceParams; + + status?: string; + + token_id?: string; +} + +export namespace InstanceReadResponse { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.Provider; + } + } + } +} + +export interface InstanceSearchResponse { + chunks: Array; + + search_query: string; +} + +export namespace InstanceSearchResponse { + export interface Chunk { + id: string; + + score: number; + + text: string; + + type: string; + + item?: Chunk.Item; + + scoring_details?: Chunk.ScoringDetails; + } + + export namespace Chunk { + export interface Item { + key: string; + + metadata?: { [key: string]: unknown }; + + timestamp?: number; + } + + export interface ScoringDetails { + keyword_rank?: number; + + keyword_score?: number; + + vector_rank?: number; + + vector_score?: number; + } + } +} + +export interface InstanceStatsResponse { + completed?: number; + + error?: number; + + file_embed_errors?: { [key: string]: unknown }; + + index_source_errors?: { [key: string]: unknown }; + + last_activity?: string; + + queued?: number; + + running?: number; + + skipped?: number; +} + +export interface InstanceCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param: Use your AI Search ID. + */ + id: string; + + /** + * Body param + */ + source: string; + + /** + * Body param + */ + type: 'r2' | 'web-crawler'; + + /** + * Body param + */ + ai_gateway_id?: string | null; + + /** + * Body param + */ + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + chunk?: boolean; + + /** + * Body param + */ + chunk_overlap?: number; + + /** + * Body param + */ + chunk_size?: number; + + /** + * Body param + */ + custom_metadata?: Array; + + /** + * Body param + */ + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + /** + * Body param + */ + hybrid_search_enabled?: boolean; + + /** + * Body param + */ + max_num_results?: number; + + /** + * Body param + */ + metadata?: InstanceCreateParams.Metadata; + + /** + * Body param + */ + public_endpoint_params?: InstanceCreateParams.PublicEndpointParams; + + /** + * Body param + */ + reranking?: boolean; + + /** + * Body param + */ + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + /** + * Body param + */ + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + rewrite_query?: boolean; + + /** + * Body param + */ + score_threshold?: number; + + /** + * Body param + */ + source_params?: InstanceCreateParams.SourceParams; + + /** + * Body param + */ + token_id?: string; +} + +export namespace InstanceCreateParams { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.ProviderParam; + } + } + } +} + +export interface InstanceUpdateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + ai_gateway_id?: string | null; + + /** + * Body param + */ + ai_search_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + cache?: boolean; + + /** + * Body param + */ + cache_threshold?: 'super_strict_match' | 'close_enough' | 'flexible_friend' | 'anything_goes'; + + /** + * Body param + */ + chunk?: boolean; + + /** + * Body param + */ + chunk_overlap?: number; + + /** + * Body param + */ + chunk_size?: number; + + /** + * Body param + */ + custom_metadata?: Array; + + /** + * Body param + */ + embedding_model?: + | '@cf/qwen/qwen3-embedding-0.6b' + | '@cf/baai/bge-m3' + | '@cf/baai/bge-large-en-v1.5' + | '@cf/google/embeddinggemma-300m' + | 'google-ai-studio/gemini-embedding-001' + | 'openai/text-embedding-3-small' + | 'openai/text-embedding-3-large' + | ''; + + /** + * Body param + */ + hybrid_search_enabled?: boolean; + + /** + * Body param + */ + max_num_results?: number; + + /** + * Body param + */ + metadata?: InstanceUpdateParams.Metadata; + + /** + * Body param + */ + paused?: boolean; + + /** + * Body param + */ + public_endpoint_params?: InstanceUpdateParams.PublicEndpointParams; + + /** + * Body param + */ + reranking?: boolean; + + /** + * Body param + */ + reranking_model?: '@cf/baai/bge-reranker-base' | ''; + + /** + * Body param + */ + rewrite_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + rewrite_query?: boolean; + + /** + * Body param + */ + score_threshold?: number; + + /** + * Body param + */ + source_params?: InstanceUpdateParams.SourceParams; + + /** + * Body param + */ + summarization?: boolean; + + /** + * Body param + */ + summarization_model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + system_prompt_ai_search?: string | null; + + /** + * Body param + */ + system_prompt_index_summarization?: string | null; + + /** + * Body param + */ + system_prompt_rewrite_query?: string | null; + + /** + * Body param + */ + token_id?: string; +} + +export namespace InstanceUpdateParams { + export interface CustomMetadata { + data_type: 'text' | 'number' | 'boolean'; + + field_name: string; + } + + export interface Metadata { + created_from_aisearch_wizard?: boolean; + + worker_domain?: string; + } + + export interface PublicEndpointParams { + authorized_hosts?: Array; + + chat_completions_endpoint?: PublicEndpointParams.ChatCompletionsEndpoint; + + enabled?: boolean; + + mcp?: PublicEndpointParams.Mcp; + + rate_limit?: PublicEndpointParams.RateLimit; + + search_endpoint?: PublicEndpointParams.SearchEndpoint; + } + + export namespace PublicEndpointParams { + export interface ChatCompletionsEndpoint { + /** + * Disable chat completions endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface Mcp { + description?: string; + + /** + * Disable MCP endpoint for this public endpoint + */ + disabled?: boolean; + } + + export interface RateLimit { + period_ms?: number; + + requests?: number; + + technique?: 'fixed' | 'sliding'; + } + + export interface SearchEndpoint { + /** + * Disable search endpoint for this public endpoint + */ + disabled?: boolean; + } + } + + export interface SourceParams { + /** + * List of path patterns to exclude. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /admin/** matches + * /admin/users and /admin/settings/advanced) + */ + exclude_items?: Array; + + /** + * List of path patterns to include. Uses micromatch glob syntax: \* matches within + * a path segment, ** matches across path segments (e.g., /blog/** matches + * /blog/post and /blog/2024/post) + */ + include_items?: Array; + + prefix?: string; + + r2_jurisdiction?: string; + + web_crawler?: SourceParams.WebCrawler; + } + + export namespace SourceParams { + export interface WebCrawler { + parse_options?: WebCrawler.ParseOptions; + + parse_type?: 'sitemap' | 'feed-rss'; + + store_options?: WebCrawler.StoreOptions; + } + + export namespace WebCrawler { + export interface ParseOptions { + include_headers?: { [key: string]: string }; + + include_images?: boolean; + + /** + * List of specific sitemap URLs to use for crawling. Only valid when parse_type is + * 'sitemap'. + */ + specific_sitemaps?: Array; + + use_browser_rendering?: boolean; + } + + export interface StoreOptions { + storage_id: string; + + r2_jurisdiction?: string; + + storage_type?: SippyAPI.ProviderParam; + } + } + } +} + +export interface InstanceListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param: Search by id + */ + search?: string; +} + +export interface InstanceDeleteParams { + account_id: string; +} + +export interface InstanceChatCompletionsParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + messages: Array; + + /** + * Body param + */ + ai_search_options?: InstanceChatCompletionsParams.AISearchOptions; + + /** + * Body param + */ + model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + /** + * Body param + */ + stream?: boolean; + + [k: string]: unknown; +} + +export namespace InstanceChatCompletionsParams { + export interface Message { + content: string | null; + + role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; + + [k: string]: unknown; + } + + export interface AISearchOptions { + query_rewrite?: AISearchOptions.QueryRewrite; + + reranking?: AISearchOptions.Reranking; + + retrieval?: AISearchOptions.Retrieval; + } + + export namespace AISearchOptions { + export interface QueryRewrite { + enabled?: boolean; + + model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_prompt?: string; + } + + export interface Reranking { + enabled?: boolean; + + match_threshold?: number; + + model?: '@cf/baai/bge-reranker-base' | ''; + } + + export interface Retrieval { + context_expansion?: number; + + filters?: { [key: string]: unknown }; + + match_threshold?: number; + + max_num_results?: number; + + retrieval_type?: 'vector' | 'keyword' | 'hybrid'; + + return_on_failure?: boolean; + } + } +} + +export interface InstanceReadParams { + account_id: string; +} + +export interface InstanceSearchParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + messages: Array; + + /** + * Body param + */ + ai_search_options?: InstanceSearchParams.AISearchOptions; +} + +export namespace InstanceSearchParams { + export interface Message { + content: string | null; + + role: 'system' | 'developer' | 'user' | 'assistant' | 'tool'; + + [k: string]: unknown; + } + + export interface AISearchOptions { + query_rewrite?: AISearchOptions.QueryRewrite; + + reranking?: AISearchOptions.Reranking; + + retrieval?: AISearchOptions.Retrieval; + } + + export namespace AISearchOptions { + export interface QueryRewrite { + enabled?: boolean; + + model?: + | '@cf/meta/llama-3.3-70b-instruct-fp8-fast' + | '@cf/zai-org/glm-4.7-flash' + | '@cf/meta/llama-3.1-8b-instruct-fast' + | '@cf/meta/llama-3.1-8b-instruct-fp8' + | '@cf/meta/llama-4-scout-17b-16e-instruct' + | '@cf/qwen/qwen3-30b-a3b-fp8' + | '@cf/deepseek-ai/deepseek-r1-distill-qwen-32b' + | '@cf/moonshotai/kimi-k2-instruct' + | 'anthropic/claude-3-7-sonnet' + | 'anthropic/claude-sonnet-4' + | 'anthropic/claude-opus-4' + | 'anthropic/claude-3-5-haiku' + | 'cerebras/qwen-3-235b-a22b-instruct' + | 'cerebras/qwen-3-235b-a22b-thinking' + | 'cerebras/llama-3.3-70b' + | 'cerebras/llama-4-maverick-17b-128e-instruct' + | 'cerebras/llama-4-scout-17b-16e-instruct' + | 'cerebras/gpt-oss-120b' + | 'google-ai-studio/gemini-2.5-flash' + | 'google-ai-studio/gemini-2.5-pro' + | 'grok/grok-4' + | 'groq/llama-3.3-70b-versatile' + | 'groq/llama-3.1-8b-instant' + | 'openai/gpt-5' + | 'openai/gpt-5-mini' + | 'openai/gpt-5-nano' + | ''; + + rewrite_prompt?: string; + } + + export interface Reranking { + enabled?: boolean; + + match_threshold?: number; + + model?: '@cf/baai/bge-reranker-base' | ''; + } + + export interface Retrieval { + context_expansion?: number; + + filters?: { [key: string]: unknown }; + + match_threshold?: number; + + max_num_results?: number; + + retrieval_type?: 'vector' | 'keyword' | 'hybrid'; + + return_on_failure?: boolean; + } + } +} + +export interface InstanceStatsParams { + account_id: string; +} + +Instances.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; +Instances.Items = Items; +Instances.ItemListResponsesV4PagePaginationArray = ItemListResponsesV4PagePaginationArray; +Instances.Jobs = Jobs; +Instances.JobListResponsesV4PagePaginationArray = JobListResponsesV4PagePaginationArray; + +export declare namespace Instances { + export { + type InstanceCreateResponse as InstanceCreateResponse, + type InstanceUpdateResponse as InstanceUpdateResponse, + type InstanceListResponse as InstanceListResponse, + type InstanceDeleteResponse as InstanceDeleteResponse, + type InstanceChatCompletionsResponse as InstanceChatCompletionsResponse, + type InstanceReadResponse as InstanceReadResponse, + type InstanceSearchResponse as InstanceSearchResponse, + type InstanceStatsResponse as InstanceStatsResponse, + InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, + type InstanceCreateParams as InstanceCreateParams, + type InstanceUpdateParams as InstanceUpdateParams, + type InstanceListParams as InstanceListParams, + type InstanceDeleteParams as InstanceDeleteParams, + type InstanceChatCompletionsParams as InstanceChatCompletionsParams, + type InstanceReadParams as InstanceReadParams, + type InstanceSearchParams as InstanceSearchParams, + type InstanceStatsParams as InstanceStatsParams, + }; + + export { + Items as Items, + type ItemListResponse as ItemListResponse, + type ItemGetResponse as ItemGetResponse, + ItemListResponsesV4PagePaginationArray as ItemListResponsesV4PagePaginationArray, + type ItemListParams as ItemListParams, + type ItemGetParams as ItemGetParams, + }; + + export { + Jobs as Jobs, + type JobCreateResponse as JobCreateResponse, + type JobListResponse as JobListResponse, + type JobGetResponse as JobGetResponse, + type JobLogsResponse as JobLogsResponse, + JobListResponsesV4PagePaginationArray as JobListResponsesV4PagePaginationArray, + type JobCreateParams as JobCreateParams, + type JobListParams as JobListParams, + type JobGetParams as JobGetParams, + type JobLogsParams as JobLogsParams, + }; +} diff --git a/src/resources/aisearch/instances/items.ts b/src/resources/aisearch/instances/items.ts new file mode 100644 index 0000000000..1b6b7a631d --- /dev/null +++ b/src/resources/aisearch/instances/items.ts @@ -0,0 +1,124 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Items extends APIResource { + /** + * Items List. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const itemListResponse of client.aiSearch.instances.items.list( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * )) { + * // ... + * } + * ``` + */ + list( + id: string, + params: ItemListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-search/instances/${id}/items`, + ItemListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Get Item. + * + * @example + * ```ts + * const item = await client.aiSearch.instances.items.get( + * 'my-ai-search', + * 'item_id', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + get( + id: string, + itemId: string, + params: ItemGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-search/instances/${id}/items/${itemId}`, + options, + ) as Core.APIPromise<{ result: ItemGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class ItemListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface ItemListResponse { + id: string; + + key: string; + + status: 'queued' | 'running' | 'completed' | 'error' | 'skipped'; + + error?: string; + + last_seen_at?: string; + + next_action?: string; +} + +export interface ItemGetResponse { + id: string; + + key: string; + + status: 'queued' | 'running' | 'completed' | 'error' | 'skipped'; + + error?: string; + + last_seen_at?: string; + + next_action?: string; +} + +export interface ItemListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + search?: string; + + /** + * Query param + */ + status?: 'queued' | 'running' | 'completed' | 'error' | 'skipped'; +} + +export interface ItemGetParams { + account_id: string; +} + +Items.ItemListResponsesV4PagePaginationArray = ItemListResponsesV4PagePaginationArray; + +export declare namespace Items { + export { + type ItemListResponse as ItemListResponse, + type ItemGetResponse as ItemGetResponse, + ItemListResponsesV4PagePaginationArray as ItemListResponsesV4PagePaginationArray, + type ItemListParams as ItemListParams, + type ItemGetParams as ItemGetParams, + }; +} diff --git a/src/resources/aisearch/instances/jobs.ts b/src/resources/aisearch/instances/jobs.ts new file mode 100644 index 0000000000..f08012bbba --- /dev/null +++ b/src/resources/aisearch/instances/jobs.ts @@ -0,0 +1,219 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Jobs extends APIResource { + /** + * Create new job + * + * @example + * ```ts + * const job = await client.aiSearch.instances.jobs.create( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + create( + id: string, + params: JobCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.post( + `/accounts/${account_id}/ai-search/instances/${id}/jobs`, + options, + ) as Core.APIPromise<{ result: JobCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Jobs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const jobListResponse of client.aiSearch.instances.jobs.list( + * 'my-ai-search', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * )) { + * // ... + * } + * ``` + */ + list( + id: string, + params: JobListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-search/instances/${id}/jobs`, + JobListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Get a Job Details + * + * @example + * ```ts + * const job = await client.aiSearch.instances.jobs.get( + * 'my-ai-search', + * 'job_id', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + get( + id: string, + jobId: string, + params: JobGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/ai-search/instances/${id}/jobs/${jobId}`, + options, + ) as Core.APIPromise<{ result: JobGetResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Job Logs + * + * @example + * ```ts + * const response = await client.aiSearch.instances.jobs.logs( + * 'my-ai-search', + * 'job_id', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + logs( + id: string, + jobId: string, + params: JobLogsParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/ai-search/instances/${id}/jobs/${jobId}/logs`, { + query, + ...options, + }) as Core.APIPromise<{ result: JobLogsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class JobListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface JobCreateResponse { + id: string; + + source: 'user' | 'schedule'; + + end_reason?: string; + + ended_at?: string; + + last_seen_at?: string; + + started_at?: string; +} + +export interface JobListResponse { + id: string; + + source: 'user' | 'schedule'; + + end_reason?: string; + + ended_at?: string; + + last_seen_at?: string; + + started_at?: string; +} + +export interface JobGetResponse { + id: string; + + source: 'user' | 'schedule'; + + end_reason?: string; + + ended_at?: string; + + last_seen_at?: string; + + started_at?: string; +} + +export type JobLogsResponse = Array; + +export namespace JobLogsResponse { + export interface JobLogsResponseItem { + id: number; + + created_at: number; + + message: string; + + message_type: number; + } +} + +export interface JobCreateParams { + account_id: string; +} + +export interface JobListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; +} + +export interface JobGetParams { + account_id: string; +} + +export interface JobLogsParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + page?: number; + + /** + * Query param + */ + per_page?: number; +} + +Jobs.JobListResponsesV4PagePaginationArray = JobListResponsesV4PagePaginationArray; + +export declare namespace Jobs { + export { + type JobCreateResponse as JobCreateResponse, + type JobListResponse as JobListResponse, + type JobGetResponse as JobGetResponse, + type JobLogsResponse as JobLogsResponse, + JobListResponsesV4PagePaginationArray as JobListResponsesV4PagePaginationArray, + type JobCreateParams as JobCreateParams, + type JobListParams as JobListParams, + type JobGetParams as JobGetParams, + type JobLogsParams as JobLogsParams, + }; +} diff --git a/src/resources/aisearch/tokens.ts b/src/resources/aisearch/tokens.ts new file mode 100644 index 0000000000..d4ff8e0088 --- /dev/null +++ b/src/resources/aisearch/tokens.ts @@ -0,0 +1,311 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class Tokens extends APIResource { + /** + * Create new tokens. + * + * @example + * ```ts + * const token = await client.aiSearch.tokens.create({ + * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', + * cf_api_id: 'cf_api_id', + * cf_api_key: 'cf_api_key', + * name: 'name', + * }); + * ``` + */ + create(params: TokenCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/ai-search/tokens`, { body, ...options }) as Core.APIPromise<{ + result: TokenCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update tokens. + * + * @example + * ```ts + * const token = await client.aiSearch.tokens.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22', + * cf_api_id: 'cf_api_id', + * cf_api_key: 'cf_api_key', + * name: 'name', + * }, + * ); + * ``` + */ + update( + id: string, + params: TokenUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/ai-search/tokens/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: TokenUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List tokens. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const tokenListResponse of client.aiSearch.tokens.list( + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: TokenListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai-search/tokens`, + TokenListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete tokens. + * + * @example + * ```ts + * const token = await client.aiSearch.tokens.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + delete( + id: string, + params: TokenDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/ai-search/tokens/${id}`, options) as Core.APIPromise<{ + result: TokenDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Read tokens. + * + * @example + * ```ts + * const response = await client.aiSearch.tokens.read( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'c3dc5f0b34a14ff8e1b3ec04895e1b22' }, + * ); + * ``` + */ + read( + id: string, + params: TokenReadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/ai-search/tokens/${id}`, options) as Core.APIPromise<{ + result: TokenReadResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class TokenListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface TokenCreateResponse { + id: string; + + cf_api_id: string; + + created_at: string; + + modified_at: string; + + name: string; + + created_by?: string | null; + + enabled?: boolean; + + legacy?: boolean; + + modified_by?: string | null; +} + +export interface TokenUpdateResponse { + id: string; + + cf_api_id: string; + + created_at: string; + + modified_at: string; + + name: string; + + created_by?: string | null; + + enabled?: boolean; + + legacy?: boolean; + + modified_by?: string | null; +} + +export interface TokenListResponse { + id: string; + + cf_api_id: string; + + created_at: string; + + modified_at: string; + + name: string; + + created_by?: string | null; + + enabled?: boolean; + + legacy?: boolean; + + modified_by?: string | null; +} + +export interface TokenDeleteResponse { + id: string; + + cf_api_id: string; + + created_at: string; + + modified_at: string; + + name: string; + + created_by?: string | null; + + enabled?: boolean; + + legacy?: boolean; + + modified_by?: string | null; +} + +export interface TokenReadResponse { + id: string; + + cf_api_id: string; + + created_at: string; + + modified_at: string; + + name: string; + + created_by?: string | null; + + enabled?: boolean; + + legacy?: boolean; + + modified_by?: string | null; +} + +export interface TokenCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + cf_api_id: string; + + /** + * Body param + */ + cf_api_key: string; + + /** + * Body param + */ + name: string; +} + +export interface TokenUpdateParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + cf_api_id: string; + + /** + * Body param + */ + cf_api_key: string; + + /** + * Body param + */ + name: string; +} + +export interface TokenListParams extends V4PagePaginationArrayParams { + /** + * Path param + */ + account_id: string; +} + +export interface TokenDeleteParams { + account_id: string; +} + +export interface TokenReadParams { + account_id: string; +} + +Tokens.TokenListResponsesV4PagePaginationArray = TokenListResponsesV4PagePaginationArray; + +export declare namespace Tokens { + export { + type TokenCreateResponse as TokenCreateResponse, + type TokenUpdateResponse as TokenUpdateResponse, + type TokenListResponse as TokenListResponse, + type TokenDeleteResponse as TokenDeleteResponse, + type TokenReadResponse as TokenReadResponse, + TokenListResponsesV4PagePaginationArray as TokenListResponsesV4PagePaginationArray, + type TokenCreateParams as TokenCreateParams, + type TokenUpdateParams as TokenUpdateParams, + type TokenListParams as TokenListParams, + type TokenDeleteParams as TokenDeleteParams, + type TokenReadParams as TokenReadParams, + }; +} diff --git a/src/resources/alerting.ts b/src/resources/alerting.ts new file mode 100644 index 0000000000..462cb94b23 --- /dev/null +++ b/src/resources/alerting.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './alerting/index'; diff --git a/src/resources/alerting/alerting.ts b/src/resources/alerting/alerting.ts index 08c64e6a96..e7d373dd1f 100644 --- a/src/resources/alerting/alerting.ts +++ b/src/resources/alerting/alerting.ts @@ -1,14 +1,108 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'cloudflare/resource'; -import * as V3API from 'cloudflare/resources/alerting/v3/v3'; +import { APIResource } from '../../resource'; +import * as AvailableAlertsAPI from './available-alerts'; +import { AvailableAlertListParams, AvailableAlertListResponse, AvailableAlerts } from './available-alerts'; +import * as HistoryAPI from './history'; +import { HistoriesV4PagePaginationArray, History, HistoryListParams, HistoryResource } from './history'; +import * as PoliciesAPI from './policies'; +import { + Mechanism, + Policies, + PoliciesSinglePage, + Policy, + PolicyCreateParams, + PolicyCreateResponse, + PolicyDeleteParams, + PolicyDeleteResponse, + PolicyFilter, + PolicyGetParams, + PolicyListParams, + PolicyUpdateParams, + PolicyUpdateResponse, +} from './policies'; +import * as SilencesAPI from './silences'; +import { + SilenceCreateParams, + SilenceCreateResponse, + SilenceDeleteParams, + SilenceDeleteResponse, + SilenceGetParams, + SilenceGetResponse, + SilenceListParams, + SilenceListResponse, + SilenceListResponsesSinglePage, + SilenceUpdateParams, + SilenceUpdateResponse, + SilenceUpdateResponsesSinglePage, + Silences, +} from './silences'; +import * as DestinationsAPI from './destinations/destinations'; +import { Destinations } from './destinations/destinations'; export class Alerting extends APIResource { - v3: V3API.V3 = new V3API.V3(this._client); + availableAlerts: AvailableAlertsAPI.AvailableAlerts = new AvailableAlertsAPI.AvailableAlerts(this._client); + destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); + history: HistoryAPI.HistoryResource = new HistoryAPI.HistoryResource(this._client); + policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); + silences: SilencesAPI.Silences = new SilencesAPI.Silences(this._client); } -export namespace Alerting { - export import V3 = V3API.V3; - export import V3ListResponse = V3API.V3ListResponse; - export import V3ListParams = V3API.V3ListParams; +Alerting.AvailableAlerts = AvailableAlerts; +Alerting.Destinations = Destinations; +Alerting.HistoryResource = HistoryResource; +Alerting.HistoriesV4PagePaginationArray = HistoriesV4PagePaginationArray; +Alerting.Policies = Policies; +Alerting.PoliciesSinglePage = PoliciesSinglePage; +Alerting.Silences = Silences; +Alerting.SilenceUpdateResponsesSinglePage = SilenceUpdateResponsesSinglePage; +Alerting.SilenceListResponsesSinglePage = SilenceListResponsesSinglePage; + +export declare namespace Alerting { + export { + AvailableAlerts as AvailableAlerts, + type AvailableAlertListResponse as AvailableAlertListResponse, + type AvailableAlertListParams as AvailableAlertListParams, + }; + + export { Destinations as Destinations }; + + export { + HistoryResource as HistoryResource, + type History as History, + HistoriesV4PagePaginationArray as HistoriesV4PagePaginationArray, + type HistoryListParams as HistoryListParams, + }; + + export { + Policies as Policies, + type Mechanism as Mechanism, + type Policy as Policy, + type PolicyFilter as PolicyFilter, + type PolicyCreateResponse as PolicyCreateResponse, + type PolicyUpdateResponse as PolicyUpdateResponse, + type PolicyDeleteResponse as PolicyDeleteResponse, + PoliciesSinglePage as PoliciesSinglePage, + type PolicyCreateParams as PolicyCreateParams, + type PolicyUpdateParams as PolicyUpdateParams, + type PolicyListParams as PolicyListParams, + type PolicyDeleteParams as PolicyDeleteParams, + type PolicyGetParams as PolicyGetParams, + }; + + export { + Silences as Silences, + type SilenceCreateResponse as SilenceCreateResponse, + type SilenceUpdateResponse as SilenceUpdateResponse, + type SilenceListResponse as SilenceListResponse, + type SilenceDeleteResponse as SilenceDeleteResponse, + type SilenceGetResponse as SilenceGetResponse, + SilenceUpdateResponsesSinglePage as SilenceUpdateResponsesSinglePage, + SilenceListResponsesSinglePage as SilenceListResponsesSinglePage, + type SilenceCreateParams as SilenceCreateParams, + type SilenceUpdateParams as SilenceUpdateParams, + type SilenceListParams as SilenceListParams, + type SilenceDeleteParams as SilenceDeleteParams, + type SilenceGetParams as SilenceGetParams, + }; } diff --git a/src/resources/alerting/available-alerts.ts b/src/resources/alerting/available-alerts.ts new file mode 100644 index 0000000000..3133d5adf8 --- /dev/null +++ b/src/resources/alerting/available-alerts.ts @@ -0,0 +1,70 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class AvailableAlerts extends APIResource { + /** + * Gets a list of all alert types for which an account is eligible. + * + * @example + * ```ts + * const availableAlerts = + * await client.alerting.availableAlerts.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + list( + params: AvailableAlertListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options) as Core.APIPromise<{ + result: AvailableAlertListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type AvailableAlertListResponse = { [key: string]: Array }; + +export namespace AvailableAlertListResponse { + export interface Item { + /** + * Describes the alert type. + */ + description?: string; + + /** + * Alert type name. + */ + display_name?: string; + + /** + * Format of additional configuration options (filters) for the alert type. Data + * type of filters during policy creation: Array of strings. + */ + filter_options?: Array; + + /** + * Use this value when creating and updating a notification policy. + */ + type?: string; + } +} + +export interface AvailableAlertListParams { + /** + * The account id + */ + account_id: string; +} + +export declare namespace AvailableAlerts { + export { + type AvailableAlertListResponse as AvailableAlertListResponse, + type AvailableAlertListParams as AvailableAlertListParams, + }; +} diff --git a/src/resources/alerting/destinations.ts b/src/resources/alerting/destinations.ts new file mode 100644 index 0000000000..6dcf766857 --- /dev/null +++ b/src/resources/alerting/destinations.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './destinations/index'; diff --git a/src/resources/alerting/destinations/destinations.ts b/src/resources/alerting/destinations/destinations.ts new file mode 100644 index 0000000000..f42ddd0ce3 --- /dev/null +++ b/src/resources/alerting/destinations/destinations.ts @@ -0,0 +1,76 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as EligibleAPI from './eligible'; +import { Eligible, EligibleGetParams, EligibleGetResponse } from './eligible'; +import * as PagerdutyAPI from './pagerduty'; +import { + PagerdutiesSinglePage, + Pagerduty, + PagerdutyCreateParams, + PagerdutyCreateResponse, + PagerdutyDeleteParams, + PagerdutyDeleteResponse, + PagerdutyGetParams, + PagerdutyLinkParams, + PagerdutyLinkResponse, + PagerdutyResource, +} from './pagerduty'; +import * as WebhooksAPI from './webhooks'; +import { + WebhookCreateParams, + WebhookCreateResponse, + WebhookDeleteParams, + WebhookDeleteResponse, + WebhookGetParams, + WebhookListParams, + WebhookUpdateParams, + WebhookUpdateResponse, + Webhooks, + WebhooksSinglePage, +} from './webhooks'; + +export class Destinations extends APIResource { + eligible: EligibleAPI.Eligible = new EligibleAPI.Eligible(this._client); + pagerduty: PagerdutyAPI.PagerdutyResource = new PagerdutyAPI.PagerdutyResource(this._client); + webhooks: WebhooksAPI.Webhooks = new WebhooksAPI.Webhooks(this._client); +} + +Destinations.Eligible = Eligible; +Destinations.PagerdutyResource = PagerdutyResource; +Destinations.PagerdutiesSinglePage = PagerdutiesSinglePage; +Destinations.WebhooksSinglePage = WebhooksSinglePage; + +export declare namespace Destinations { + export { + Eligible as Eligible, + type EligibleGetResponse as EligibleGetResponse, + type EligibleGetParams as EligibleGetParams, + }; + + export { + PagerdutyResource as PagerdutyResource, + type Pagerduty as Pagerduty, + type PagerdutyCreateResponse as PagerdutyCreateResponse, + type PagerdutyDeleteResponse as PagerdutyDeleteResponse, + type PagerdutyLinkResponse as PagerdutyLinkResponse, + PagerdutiesSinglePage as PagerdutiesSinglePage, + type PagerdutyCreateParams as PagerdutyCreateParams, + type PagerdutyDeleteParams as PagerdutyDeleteParams, + type PagerdutyGetParams as PagerdutyGetParams, + type PagerdutyLinkParams as PagerdutyLinkParams, + }; + + export { + type Webhooks as Webhooks, + type WebhookCreateResponse as WebhookCreateResponse, + type WebhookUpdateResponse as WebhookUpdateResponse, + type WebhookDeleteResponse as WebhookDeleteResponse, + WebhooksSinglePage as WebhooksSinglePage, + type WebhookCreateParams as WebhookCreateParams, + type WebhookUpdateParams as WebhookUpdateParams, + type WebhookListParams as WebhookListParams, + type WebhookDeleteParams as WebhookDeleteParams, + type WebhookGetParams as WebhookGetParams, + }; +} diff --git a/src/resources/alerting/destinations/eligible.ts b/src/resources/alerting/destinations/eligible.ts new file mode 100644 index 0000000000..98135394f4 --- /dev/null +++ b/src/resources/alerting/destinations/eligible.ts @@ -0,0 +1,60 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class Eligible extends APIResource { + /** + * Get a list of all delivery mechanism types for which an account is eligible. + * + * @example + * ```ts + * const eligible = + * await client.alerting.destinations.eligible.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get(params: EligibleGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/alerting/v3/destinations/eligible`, + options, + ) as Core.APIPromise<{ result: EligibleGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type EligibleGetResponse = { [key: string]: Array }; + +export namespace EligibleGetResponse { + export interface Item { + /** + * Determines whether or not the account is eligible for the delivery mechanism. + */ + eligible?: boolean; + + /** + * Beta flag. Users can create a policy with a mechanism that is not ready, but we + * cannot guarantee successful delivery of notifications. + */ + ready?: boolean; + + /** + * Determines type of delivery mechanism. + */ + type?: 'email' | 'pagerduty' | 'webhook'; + } +} + +export interface EligibleGetParams { + /** + * The account id + */ + account_id: string; +} + +export declare namespace Eligible { + export { type EligibleGetResponse as EligibleGetResponse, type EligibleGetParams as EligibleGetParams }; +} diff --git a/src/resources/alerting/destinations/index.ts b/src/resources/alerting/destinations/index.ts new file mode 100644 index 0000000000..996d9c806e --- /dev/null +++ b/src/resources/alerting/destinations/index.ts @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Destinations } from './destinations'; +export { Eligible, type EligibleGetResponse, type EligibleGetParams } from './eligible'; +export { + PagerdutiesSinglePage, + PagerdutyResource, + type Pagerduty, + type PagerdutyCreateResponse, + type PagerdutyDeleteResponse, + type PagerdutyLinkResponse, + type PagerdutyCreateParams, + type PagerdutyDeleteParams, + type PagerdutyGetParams, + type PagerdutyLinkParams, +} from './pagerduty'; +export { + WebhooksSinglePage, + Webhooks, + type WebhookCreateResponse, + type WebhookUpdateResponse, + type WebhookDeleteResponse, + type WebhookCreateParams, + type WebhookUpdateParams, + type WebhookListParams, + type WebhookDeleteParams, + type WebhookGetParams, +} from './webhooks'; diff --git a/src/resources/alerting/destinations/pagerduty.ts b/src/resources/alerting/destinations/pagerduty.ts new file mode 100644 index 0000000000..9c37f6ae42 --- /dev/null +++ b/src/resources/alerting/destinations/pagerduty.ts @@ -0,0 +1,198 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class PagerdutyResource extends APIResource { + /** + * Creates a new token for integrating with PagerDuty. + * + * @example + * ```ts + * const pagerduty = + * await client.alerting.destinations.pagerduty.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: PagerdutyCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.post( + `/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect`, + options, + ) as Core.APIPromise<{ result: PagerdutyCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Deletes all the PagerDuty Services connected to the account. + * + * @example + * ```ts + * const pagerduty = + * await client.alerting.destinations.pagerduty.delete({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + delete( + params: PagerdutyDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/alerting/v3/destinations/pagerduty`, options); + } + + /** + * Get a list of all configured PagerDuty services. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const pagerduty of client.alerting.destinations.pagerduty.get( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + get( + params: PagerdutyGetParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/destinations/pagerduty`, + PagerdutiesSinglePage, + options, + ); + } + + /** + * Links PagerDuty with the account using the integration token. + * + * @example + * ```ts + * const response = + * await client.alerting.destinations.pagerduty.link( + * '8c71e667571b4f61b94d9e4b12158038', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + link( + tokenId: string, + params: PagerdutyLinkParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect/${tokenId}`, + options, + ) as Core.APIPromise<{ result: PagerdutyLinkResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class PagerdutiesSinglePage extends SinglePage {} + +export interface Pagerduty { + /** + * UUID + */ + id?: string; + + /** + * The name of the pagerduty service. + */ + name?: string; +} + +export interface PagerdutyCreateResponse { + /** + * token in form of UUID + */ + id?: string; +} + +export interface PagerdutyDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful + */ + success: true; +} + +export namespace PagerdutyDeleteResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } +} + +export interface PagerdutyLinkResponse { + /** + * UUID + */ + id?: string; +} + +export interface PagerdutyCreateParams { + /** + * The account id + */ + account_id: string; +} + +export interface PagerdutyDeleteParams { + /** + * The account id + */ + account_id: string; +} + +export interface PagerdutyGetParams { + /** + * The account id + */ + account_id: string; +} + +export interface PagerdutyLinkParams { + /** + * The account id + */ + account_id: string; +} + +PagerdutyResource.PagerdutiesSinglePage = PagerdutiesSinglePage; + +export declare namespace PagerdutyResource { + export { + type Pagerduty as Pagerduty, + type PagerdutyCreateResponse as PagerdutyCreateResponse, + type PagerdutyDeleteResponse as PagerdutyDeleteResponse, + type PagerdutyLinkResponse as PagerdutyLinkResponse, + PagerdutiesSinglePage as PagerdutiesSinglePage, + type PagerdutyCreateParams as PagerdutyCreateParams, + type PagerdutyDeleteParams as PagerdutyDeleteParams, + type PagerdutyGetParams as PagerdutyGetParams, + type PagerdutyLinkParams as PagerdutyLinkParams, + }; +} diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts new file mode 100644 index 0000000000..605e015ae3 --- /dev/null +++ b/src/resources/alerting/destinations/webhooks.ts @@ -0,0 +1,300 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; + +export class Webhooks extends APIResource { + /** + * Creates a new webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'Slack Webhook', + * url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + * }); + * ``` + */ + create(params: WebhookCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/alerting/v3/destinations/webhooks`, { + body, + ...options, + }) as Core.APIPromise<{ result: WebhookCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update a webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.update( + * 'b115d5ec15c641ee8b7692c449b5227b', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'Slack Webhook', + * url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + * }, + * ); + * ``` + */ + update( + webhookId: string, + params: WebhookUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WebhookUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets a list of all configured webhook destinations. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const webhooks of client.alerting.destinations.webhooks.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: WebhookListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/destinations/webhooks`, + WebhooksSinglePage, + options, + ); + } + + /** + * Delete a configured webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.delete( + * 'b115d5ec15c641ee8b7692c449b5227b', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + webhookId: string, + params: WebhookDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete( + `/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, + options, + ); + } + + /** + * Get details for a single webhooks destination. + * + * @example + * ```ts + * const webhooks = + * await client.alerting.destinations.webhooks.get( + * 'b115d5ec15c641ee8b7692c449b5227b', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get(webhookId: string, params: WebhookGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, + options, + ) as Core.APIPromise<{ result: Webhooks }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class WebhooksSinglePage extends SinglePage {} + +export interface Webhooks { + /** + * The unique identifier of a webhook + */ + id?: string; + + /** + * Timestamp of when the webhook destination was created. + */ + created_at?: string; + + /** + * Timestamp of the last time an attempt to dispatch a notification to this webhook + * failed. + */ + last_failure?: string; + + /** + * Timestamp of the last time Cloudflare was able to successfully dispatch a + * notification using this webhook. + */ + last_success?: string; + + /** + * The name of the webhook destination. This will be included in the request body + * when you receive a webhook notification. + */ + name?: string; + + /** + * Type of webhook endpoint. + */ + type?: 'datadog' | 'discord' | 'feishu' | 'gchat' | 'generic' | 'opsgenie' | 'slack' | 'splunk'; + + /** + * The POST endpoint to call when dispatching a notification. + */ + url?: string; +} + +export interface WebhookCreateResponse { + /** + * UUID + */ + id?: string; +} + +export interface WebhookUpdateResponse { + /** + * UUID + */ + id?: string; +} + +export interface WebhookDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful + */ + success: true; +} + +export namespace WebhookDeleteResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } +} + +export interface WebhookCreateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param: The name of the webhook destination. This will be included in the + * request body when you receive a webhook notification. + */ + name: string; + + /** + * Body param: The POST endpoint to call when dispatching a notification. + */ + url: string; + + /** + * Body param: Optional secret that will be passed in the `cf-webhook-auth` header + * when dispatching generic webhook notifications or formatted for supported + * destinations. Secrets are not returned in any API response body. + */ + secret?: string; +} + +export interface WebhookUpdateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param: The name of the webhook destination. This will be included in the + * request body when you receive a webhook notification. + */ + name: string; + + /** + * Body param: The POST endpoint to call when dispatching a notification. + */ + url: string; + + /** + * Body param: Optional secret that will be passed in the `cf-webhook-auth` header + * when dispatching generic webhook notifications or formatted for supported + * destinations. Secrets are not returned in any API response body. + */ + secret?: string; +} + +export interface WebhookListParams { + /** + * The account id + */ + account_id: string; +} + +export interface WebhookDeleteParams { + /** + * The account id + */ + account_id: string; +} + +export interface WebhookGetParams { + /** + * The account id + */ + account_id: string; +} + +Webhooks.WebhooksSinglePage = WebhooksSinglePage; + +export declare namespace Webhooks { + export { + type Webhooks as Webhooks, + type WebhookCreateResponse as WebhookCreateResponse, + type WebhookUpdateResponse as WebhookUpdateResponse, + type WebhookDeleteResponse as WebhookDeleteResponse, + WebhooksSinglePage as WebhooksSinglePage, + type WebhookCreateParams as WebhookCreateParams, + type WebhookUpdateParams as WebhookUpdateParams, + type WebhookListParams as WebhookListParams, + type WebhookDeleteParams as WebhookDeleteParams, + type WebhookGetParams as WebhookGetParams, + }; +} diff --git a/src/resources/alerting/history.ts b/src/resources/alerting/history.ts new file mode 100644 index 0000000000..4a124a9833 --- /dev/null +++ b/src/resources/alerting/history.ts @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; + +export class HistoryResource extends APIResource { + /** + * Gets a list of history records for notifications sent to an account. The records + * are displayed for last `x` number of days based on the zone plan (free = 30, pro + * = 30, biz = 30, ent = 90). + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const history of client.alerting.history.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` + */ + list( + params: HistoryListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/history`, + HistoriesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class HistoriesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface History { + /** + * UUID + */ + id?: string; + + /** + * Message body included in the notification sent. + */ + alert_body?: string; + + /** + * Type of notification that has been dispatched. + */ + alert_type?: string; + + /** + * Description of the notification policy (if present). + */ + description?: string; + + /** + * The mechanism to which the notification has been dispatched. + */ + mechanism?: string; + + /** + * The type of mechanism to which the notification has been dispatched. This can be + * email/pagerduty/webhook based on the mechanism configured. + */ + mechanism_type?: 'email' | 'pagerduty' | 'webhook'; + + /** + * Name of the policy. + */ + name?: string; + + /** + * The unique identifier of a notification policy + */ + policy_id?: string; + + /** + * Timestamp of when the notification was dispatched in ISO 8601 format. + */ + sent?: string; +} + +export interface HistoryListParams extends V4PagePaginationArrayParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Query param: Limit the returned results to history records older than the + * specified date. This must be a timestamp that conforms to RFC3339. + */ + before?: string; + + /** + * Query param: Limit the returned results to history records newer than the + * specified date. This must be a timestamp that conforms to RFC3339. + */ + since?: string; +} + +HistoryResource.HistoriesV4PagePaginationArray = HistoriesV4PagePaginationArray; + +export declare namespace HistoryResource { + export { + type History as History, + HistoriesV4PagePaginationArray as HistoriesV4PagePaginationArray, + type HistoryListParams as HistoryListParams, + }; +} diff --git a/src/resources/alerting/index.ts b/src/resources/alerting/index.ts index 74fb2d0d67..e6a852484e 100644 --- a/src/resources/alerting/index.ts +++ b/src/resources/alerting/index.ts @@ -1,4 +1,45 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Alerting } from './alerting'; -export { V3ListResponse, V3ListParams, V3 } from './v3/index'; +export { + AvailableAlerts, + type AvailableAlertListResponse, + type AvailableAlertListParams, +} from './available-alerts'; +export { Destinations } from './destinations/index'; +export { + HistoriesV4PagePaginationArray, + HistoryResource, + type History, + type HistoryListParams, +} from './history'; +export { + PoliciesSinglePage, + Policies, + type Mechanism, + type Policy, + type PolicyFilter, + type PolicyCreateResponse, + type PolicyUpdateResponse, + type PolicyDeleteResponse, + type PolicyCreateParams, + type PolicyUpdateParams, + type PolicyListParams, + type PolicyDeleteParams, + type PolicyGetParams, +} from './policies'; +export { + SilenceUpdateResponsesSinglePage, + SilenceListResponsesSinglePage, + Silences, + type SilenceCreateResponse, + type SilenceUpdateResponse, + type SilenceListResponse, + type SilenceDeleteResponse, + type SilenceGetResponse, + type SilenceCreateParams, + type SilenceUpdateParams, + type SilenceListParams, + type SilenceDeleteParams, + type SilenceGetParams, +} from './silences'; diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts new file mode 100644 index 0000000000..7e22a6cc36 --- /dev/null +++ b/src/resources/alerting/policies.ts @@ -0,0 +1,1097 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class Policies extends APIResource { + /** + * Creates a new Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * alert_type: 'universal_ssl_event_type', + * enabled: true, + * mechanisms: {}, + * name: 'SSL Notification Event Policy', + * }); + * ``` + */ + create(params: PolicyCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/alerting/v3/policies`, { + body, + ...options, + }) as Core.APIPromise<{ result: PolicyCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update a Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.update( + * '0da2b59ef118439d8097bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + update( + policyId: string, + params: PolicyUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PolicyUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get a list of all Notification policies. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const policy of client.alerting.policies.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` + */ + list( + params: PolicyListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/policies`, + PoliciesSinglePage, + options, + ); + } + + /** + * Delete a Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.delete( + * '0da2b59ef118439d8097bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + policyId: string, + params: PolicyDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, options); + } + + /** + * Get details for a single policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.get( + * '0da2b59ef118439d8097bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get(policyId: string, params: PolicyGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/alerting/v3/policies/${policyId}`, + options, + ) as Core.APIPromise<{ result: Policy }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class PoliciesSinglePage extends SinglePage {} + +/** + * List of IDs that will be used when dispatching a notification. IDs for email + * type will be the email address. + */ +export interface Mechanism { + email?: Array; + + pagerduty?: Array; + + webhooks?: Array; +} + +export namespace Mechanism { + export interface Email { + /** + * The email address + */ + id?: string; + } + + export interface Pagerduty { + /** + * UUID + */ + id?: string; + } + + export interface Webhook { + /** + * UUID + */ + id?: string; + } +} + +/** + * List of IDs that will be used when dispatching a notification. IDs for email + * type will be the email address. + */ +export interface MechanismParam { + email?: Array; + + pagerduty?: Array; + + webhooks?: Array; +} + +export namespace MechanismParam { + export interface Email { + /** + * The email address + */ + id?: string; + } + + export interface Pagerduty { + /** + * UUID + */ + id?: string; + } + + export interface Webhook { + /** + * UUID + */ + id?: string; + } +} + +export interface Policy { + /** + * The unique identifier of a notification policy + */ + id?: string; + + /** + * Optional specification of how often to re-alert from the same incident, not + * support on all alert types. + */ + alert_interval?: string; + + /** + * Refers to which event will trigger a Notification dispatch. You can use the + * endpoint to get available alert types which then will give you a list of + * possible values. + */ + alert_type?: + | 'abuse_report_alert' + | 'access_custom_certificate_expiration_type' + | 'advanced_ddos_attack_l4_alert' + | 'advanced_ddos_attack_l7_alert' + | 'advanced_http_alert_error' + | 'bgp_hijack_notification' + | 'billing_usage_alert' + | 'block_notification_block_removed' + | 'block_notification_new_block' + | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' + | 'brand_protection_alert' + | 'brand_protection_digest' + | 'clickhouse_alert_fw_anomaly' + | 'clickhouse_alert_fw_ent_anomaly' + | 'cloudforce_one_request_notification' + | 'custom_analytics' + | 'custom_bot_detection_alert' + | 'custom_ssl_certificate_event_type' + | 'dedicated_ssl_certificate_event_type' + | 'device_connectivity_anomaly_alert' + | 'dos_attack_l4' + | 'dos_attack_l7' + | 'expiring_service_token_alert' + | 'failing_logpush_job_disabled_alert' + | 'fbm_auto_advertisement' + | 'fbm_dosd_attack' + | 'fbm_volumetric_attack' + | 'health_check_status_notification' + | 'hostname_aop_custom_certificate_expiration_type' + | 'http_alert_edge_error' + | 'http_alert_origin_error' + | 'image_notification' + | 'image_resizing_notification' + | 'incident_alert' + | 'load_balancing_health_alert' + | 'load_balancing_pool_enablement_alert' + | 'logo_match_alert' + | 'magic_tunnel_health_check_event' + | 'magic_wan_tunnel_health' + | 'maintenance_event_notification' + | 'mtls_certificate_store_certificate_expiration_type' + | 'pages_event_alert' + | 'radar_notification' + | 'real_origin_monitoring' + | 'scriptmonitor_alert_new_code_change_detections' + | 'scriptmonitor_alert_new_hosts' + | 'scriptmonitor_alert_new_malicious_hosts' + | 'scriptmonitor_alert_new_malicious_scripts' + | 'scriptmonitor_alert_new_malicious_url' + | 'scriptmonitor_alert_new_max_length_resource_url' + | 'scriptmonitor_alert_new_resources' + | 'secondary_dns_all_primaries_failing' + | 'secondary_dns_primaries_failing' + | 'secondary_dns_warning' + | 'secondary_dns_zone_successfully_updated' + | 'secondary_dns_zone_validation_warning' + | 'security_insights_alert' + | 'sentinel_alert' + | 'stream_live_notifications' + | 'synthetic_test_latency_alert' + | 'synthetic_test_low_availability_alert' + | 'traffic_anomalies_alert' + | 'tunnel_health_event' + | 'tunnel_update_event' + | 'universal_ssl_event_type' + | 'web_analytics_metrics_update' + | 'zone_aop_custom_certificate_expiration_type'; + + created?: string; + + /** + * Optional description for the Notification policy. + */ + description?: string; + + /** + * Whether or not the Notification policy is enabled. + */ + enabled?: boolean; + + /** + * Optional filters that allow you to be alerted only on a subset of events for + * that alert type based on some criteria. This is only available for select alert + * types. See alert type documentation for more details. + */ + filters?: PolicyFilter; + + /** + * List of IDs that will be used when dispatching a notification. IDs for email + * type will be the email address. + */ + mechanisms?: Mechanism; + + modified?: string; + + /** + * Name of the policy. + */ + name?: string; +} + +/** + * Optional filters that allow you to be alerted only on a subset of events for + * that alert type based on some criteria. This is only available for select alert + * types. See alert type documentation for more details. + */ +export interface PolicyFilter { + /** + * Usage depends on specific alert type + */ + actions?: Array; + + /** + * Used for configuring radar_notification + */ + affected_asns?: Array; + + /** + * Used for configuring incident_alert + */ + affected_components?: Array; + + /** + * Used for configuring radar_notification + */ + affected_locations?: Array; + + /** + * Used for configuring maintenance_event_notification + */ + airport_code?: Array; + + /** + * Usage depends on specific alert type + */ + alert_trigger_preferences?: Array; + + /** + * Usage depends on specific alert type + */ + alert_trigger_preferences_value?: Array; + + /** + * Used for configuring load_balancing_pool_enablement_alert + */ + enabled?: Array; + + /** + * Used for configuring pages_event_alert + */ + environment?: Array; + + /** + * Used for configuring pages_event_alert + */ + event?: Array; + + /** + * Used for configuring load_balancing_health_alert + */ + event_source?: Array; + + /** + * Usage depends on specific alert type + */ + event_type?: Array; + + /** + * Usage depends on specific alert type + */ + group_by?: Array; + + /** + * Used for configuring health_check_status_notification + */ + health_check_id?: Array; + + /** + * Used for configuring incident_alert + */ + incident_impact?: Array< + 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' + >; + + /** + * Used for configuring stream_live_notifications + */ + input_id?: Array; + + /** + * Used for configuring security_insights_alert + */ + insight_class?: Array; + + /** + * Used for configuring billing_usage_alert + */ + limit?: Array; + + /** + * Used for configuring logo_match_alert + */ + logo_tag?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + megabits_per_second?: Array; + + /** + * Used for configuring load_balancing_health_alert + */ + new_health?: Array; + + /** + * Used for configuring tunnel_health_event + */ + new_status?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + packets_per_second?: Array; + + /** + * Usage depends on specific alert type + */ + pool_id?: Array; + + /** + * Usage depends on specific alert type + */ + pop_names?: Array; + + /** + * Used for configuring billing_usage_alert + */ + product?: Array; + + /** + * Used for configuring pages_event_alert + */ + project_id?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + protocol?: Array; + + /** + * Usage depends on specific alert type + */ + query_tag?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + requests_per_second?: Array; + + /** + * Usage depends on specific alert type + */ + selectors?: Array; + + /** + * Used for configuring clickhouse_alert_fw_ent_anomaly + */ + services?: Array; + + /** + * Usage depends on specific alert type + */ + slo?: Array; + + /** + * Used for configuring health_check_status_notification + */ + status?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + target_hostname?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + target_ip?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + target_zone_name?: Array; + + /** + * Used for configuring traffic_anomalies_alert + */ + traffic_exclusions?: Array<'security_events'>; + + /** + * Used for configuring tunnel_health_event + */ + tunnel_id?: Array; + + /** + * Usage depends on specific alert type + */ + tunnel_name?: Array; + + /** + * Usage depends on specific alert type + */ + type?: Array; + + /** + * Usage depends on specific alert type + */ + where?: Array; + + /** + * Usage depends on specific alert type + */ + zones?: Array; +} + +/** + * Optional filters that allow you to be alerted only on a subset of events for + * that alert type based on some criteria. This is only available for select alert + * types. See alert type documentation for more details. + */ +export interface PolicyFilterParam { + /** + * Usage depends on specific alert type + */ + actions?: Array; + + /** + * Used for configuring radar_notification + */ + affected_asns?: Array; + + /** + * Used for configuring incident_alert + */ + affected_components?: Array; + + /** + * Used for configuring radar_notification + */ + affected_locations?: Array; + + /** + * Used for configuring maintenance_event_notification + */ + airport_code?: Array; + + /** + * Usage depends on specific alert type + */ + alert_trigger_preferences?: Array; + + /** + * Usage depends on specific alert type + */ + alert_trigger_preferences_value?: Array; + + /** + * Used for configuring load_balancing_pool_enablement_alert + */ + enabled?: Array; + + /** + * Used for configuring pages_event_alert + */ + environment?: Array; + + /** + * Used for configuring pages_event_alert + */ + event?: Array; + + /** + * Used for configuring load_balancing_health_alert + */ + event_source?: Array; + + /** + * Usage depends on specific alert type + */ + event_type?: Array; + + /** + * Usage depends on specific alert type + */ + group_by?: Array; + + /** + * Used for configuring health_check_status_notification + */ + health_check_id?: Array; + + /** + * Used for configuring incident_alert + */ + incident_impact?: Array< + 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' + >; + + /** + * Used for configuring stream_live_notifications + */ + input_id?: Array; + + /** + * Used for configuring security_insights_alert + */ + insight_class?: Array; + + /** + * Used for configuring billing_usage_alert + */ + limit?: Array; + + /** + * Used for configuring logo_match_alert + */ + logo_tag?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + megabits_per_second?: Array; + + /** + * Used for configuring load_balancing_health_alert + */ + new_health?: Array; + + /** + * Used for configuring tunnel_health_event + */ + new_status?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + packets_per_second?: Array; + + /** + * Usage depends on specific alert type + */ + pool_id?: Array; + + /** + * Usage depends on specific alert type + */ + pop_names?: Array; + + /** + * Used for configuring billing_usage_alert + */ + product?: Array; + + /** + * Used for configuring pages_event_alert + */ + project_id?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + protocol?: Array; + + /** + * Usage depends on specific alert type + */ + query_tag?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + requests_per_second?: Array; + + /** + * Usage depends on specific alert type + */ + selectors?: Array; + + /** + * Used for configuring clickhouse_alert_fw_ent_anomaly + */ + services?: Array; + + /** + * Usage depends on specific alert type + */ + slo?: Array; + + /** + * Used for configuring health_check_status_notification + */ + status?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + target_hostname?: Array; + + /** + * Used for configuring advanced_ddos_attack_l4_alert + */ + target_ip?: Array; + + /** + * Used for configuring advanced_ddos_attack_l7_alert + */ + target_zone_name?: Array; + + /** + * Used for configuring traffic_anomalies_alert + */ + traffic_exclusions?: Array<'security_events'>; + + /** + * Used for configuring tunnel_health_event + */ + tunnel_id?: Array; + + /** + * Usage depends on specific alert type + */ + tunnel_name?: Array; + + /** + * Usage depends on specific alert type + */ + type?: Array; + + /** + * Usage depends on specific alert type + */ + where?: Array; + + /** + * Usage depends on specific alert type + */ + zones?: Array; +} + +export interface PolicyCreateResponse { + /** + * UUID + */ + id?: string; +} + +export interface PolicyUpdateResponse { + /** + * UUID + */ + id?: string; +} + +export interface PolicyDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful + */ + success: true; + + result_info?: PolicyDeleteResponse.ResultInfo; +} + +export namespace PolicyDeleteResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } + + export interface ResultInfo { + /** + * Total number of results for the requested service + */ + count?: number; + + /** + * Current page within paginated list of results + */ + page?: number; + + /** + * Number of results per page of results + */ + per_page?: number; + + /** + * Total results available without any search parameters + */ + total_count?: number; + } +} + +export interface PolicyCreateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param: Refers to which event will trigger a Notification dispatch. You can + * use the endpoint to get available alert types which then will give you a list of + * possible values. + */ + alert_type: + | 'abuse_report_alert' + | 'access_custom_certificate_expiration_type' + | 'advanced_ddos_attack_l4_alert' + | 'advanced_ddos_attack_l7_alert' + | 'advanced_http_alert_error' + | 'bgp_hijack_notification' + | 'billing_usage_alert' + | 'block_notification_block_removed' + | 'block_notification_new_block' + | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' + | 'brand_protection_alert' + | 'brand_protection_digest' + | 'clickhouse_alert_fw_anomaly' + | 'clickhouse_alert_fw_ent_anomaly' + | 'cloudforce_one_request_notification' + | 'custom_analytics' + | 'custom_bot_detection_alert' + | 'custom_ssl_certificate_event_type' + | 'dedicated_ssl_certificate_event_type' + | 'device_connectivity_anomaly_alert' + | 'dos_attack_l4' + | 'dos_attack_l7' + | 'expiring_service_token_alert' + | 'failing_logpush_job_disabled_alert' + | 'fbm_auto_advertisement' + | 'fbm_dosd_attack' + | 'fbm_volumetric_attack' + | 'health_check_status_notification' + | 'hostname_aop_custom_certificate_expiration_type' + | 'http_alert_edge_error' + | 'http_alert_origin_error' + | 'image_notification' + | 'image_resizing_notification' + | 'incident_alert' + | 'load_balancing_health_alert' + | 'load_balancing_pool_enablement_alert' + | 'logo_match_alert' + | 'magic_tunnel_health_check_event' + | 'magic_wan_tunnel_health' + | 'maintenance_event_notification' + | 'mtls_certificate_store_certificate_expiration_type' + | 'pages_event_alert' + | 'radar_notification' + | 'real_origin_monitoring' + | 'scriptmonitor_alert_new_code_change_detections' + | 'scriptmonitor_alert_new_hosts' + | 'scriptmonitor_alert_new_malicious_hosts' + | 'scriptmonitor_alert_new_malicious_scripts' + | 'scriptmonitor_alert_new_malicious_url' + | 'scriptmonitor_alert_new_max_length_resource_url' + | 'scriptmonitor_alert_new_resources' + | 'secondary_dns_all_primaries_failing' + | 'secondary_dns_primaries_failing' + | 'secondary_dns_warning' + | 'secondary_dns_zone_successfully_updated' + | 'secondary_dns_zone_validation_warning' + | 'security_insights_alert' + | 'sentinel_alert' + | 'stream_live_notifications' + | 'synthetic_test_latency_alert' + | 'synthetic_test_low_availability_alert' + | 'traffic_anomalies_alert' + | 'tunnel_health_event' + | 'tunnel_update_event' + | 'universal_ssl_event_type' + | 'web_analytics_metrics_update' + | 'zone_aop_custom_certificate_expiration_type'; + + /** + * Body param: Whether or not the Notification policy is enabled. + */ + enabled: boolean; + + /** + * Body param: List of IDs that will be used when dispatching a notification. IDs + * for email type will be the email address. + */ + mechanisms: MechanismParam; + + /** + * Body param: Name of the policy. + */ + name: string; + + /** + * Body param: Optional specification of how often to re-alert from the same + * incident, not support on all alert types. + */ + alert_interval?: string; + + /** + * Body param: Optional description for the Notification policy. + */ + description?: string; + + /** + * Body param: Optional filters that allow you to be alerted only on a subset of + * events for that alert type based on some criteria. This is only available for + * select alert types. See alert type documentation for more details. + */ + filters?: PolicyFilterParam; +} + +export interface PolicyUpdateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param: Optional specification of how often to re-alert from the same + * incident, not support on all alert types. + */ + alert_interval?: string; + + /** + * Body param: Refers to which event will trigger a Notification dispatch. You can + * use the endpoint to get available alert types which then will give you a list of + * possible values. + */ + alert_type?: + | 'abuse_report_alert' + | 'access_custom_certificate_expiration_type' + | 'advanced_ddos_attack_l4_alert' + | 'advanced_ddos_attack_l7_alert' + | 'advanced_http_alert_error' + | 'bgp_hijack_notification' + | 'billing_usage_alert' + | 'block_notification_block_removed' + | 'block_notification_new_block' + | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' + | 'brand_protection_alert' + | 'brand_protection_digest' + | 'clickhouse_alert_fw_anomaly' + | 'clickhouse_alert_fw_ent_anomaly' + | 'cloudforce_one_request_notification' + | 'custom_analytics' + | 'custom_bot_detection_alert' + | 'custom_ssl_certificate_event_type' + | 'dedicated_ssl_certificate_event_type' + | 'device_connectivity_anomaly_alert' + | 'dos_attack_l4' + | 'dos_attack_l7' + | 'expiring_service_token_alert' + | 'failing_logpush_job_disabled_alert' + | 'fbm_auto_advertisement' + | 'fbm_dosd_attack' + | 'fbm_volumetric_attack' + | 'health_check_status_notification' + | 'hostname_aop_custom_certificate_expiration_type' + | 'http_alert_edge_error' + | 'http_alert_origin_error' + | 'image_notification' + | 'image_resizing_notification' + | 'incident_alert' + | 'load_balancing_health_alert' + | 'load_balancing_pool_enablement_alert' + | 'logo_match_alert' + | 'magic_tunnel_health_check_event' + | 'magic_wan_tunnel_health' + | 'maintenance_event_notification' + | 'mtls_certificate_store_certificate_expiration_type' + | 'pages_event_alert' + | 'radar_notification' + | 'real_origin_monitoring' + | 'scriptmonitor_alert_new_code_change_detections' + | 'scriptmonitor_alert_new_hosts' + | 'scriptmonitor_alert_new_malicious_hosts' + | 'scriptmonitor_alert_new_malicious_scripts' + | 'scriptmonitor_alert_new_malicious_url' + | 'scriptmonitor_alert_new_max_length_resource_url' + | 'scriptmonitor_alert_new_resources' + | 'secondary_dns_all_primaries_failing' + | 'secondary_dns_primaries_failing' + | 'secondary_dns_warning' + | 'secondary_dns_zone_successfully_updated' + | 'secondary_dns_zone_validation_warning' + | 'security_insights_alert' + | 'sentinel_alert' + | 'stream_live_notifications' + | 'synthetic_test_latency_alert' + | 'synthetic_test_low_availability_alert' + | 'traffic_anomalies_alert' + | 'tunnel_health_event' + | 'tunnel_update_event' + | 'universal_ssl_event_type' + | 'web_analytics_metrics_update' + | 'zone_aop_custom_certificate_expiration_type'; + + /** + * Body param: Optional description for the Notification policy. + */ + description?: string; + + /** + * Body param: Whether or not the Notification policy is enabled. + */ + enabled?: boolean; + + /** + * Body param: Optional filters that allow you to be alerted only on a subset of + * events for that alert type based on some criteria. This is only available for + * select alert types. See alert type documentation for more details. + */ + filters?: PolicyFilterParam; + + /** + * Body param: List of IDs that will be used when dispatching a notification. IDs + * for email type will be the email address. + */ + mechanisms?: MechanismParam; + + /** + * Body param: Name of the policy. + */ + name?: string; +} + +export interface PolicyListParams { + /** + * The account id + */ + account_id: string; +} + +export interface PolicyDeleteParams { + /** + * The account id + */ + account_id: string; +} + +export interface PolicyGetParams { + /** + * The account id + */ + account_id: string; +} + +Policies.PoliciesSinglePage = PoliciesSinglePage; + +export declare namespace Policies { + export { + type Mechanism as Mechanism, + type Policy as Policy, + type PolicyFilter as PolicyFilter, + type PolicyCreateResponse as PolicyCreateResponse, + type PolicyUpdateResponse as PolicyUpdateResponse, + type PolicyDeleteResponse as PolicyDeleteResponse, + PoliciesSinglePage as PoliciesSinglePage, + type PolicyCreateParams as PolicyCreateParams, + type PolicyUpdateParams as PolicyUpdateParams, + type PolicyListParams as PolicyListParams, + type PolicyDeleteParams as PolicyDeleteParams, + type PolicyGetParams as PolicyGetParams, + }; +} diff --git a/src/resources/alerting/silences.ts b/src/resources/alerting/silences.ts new file mode 100644 index 0000000000..a1a4fa6da8 --- /dev/null +++ b/src/resources/alerting/silences.ts @@ -0,0 +1,374 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class Silences extends APIResource { + /** + * Creates a new silence for an account. + * + * @example + * ```ts + * const silence = await client.alerting.silences.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [{}], + * }); + * ``` + */ + create(params: SilenceCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, body } = params; + return this._client.post(`/accounts/${account_id}/alerting/v3/silences`, { body: body, ...options }); + } + + /** + * Updates existing silences for an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const silenceUpdateResponse of client.alerting.silences.update( + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [{}], + * }, + * )) { + * // ... + * } + * ``` + */ + update( + params: SilenceUpdateParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, body } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/silences`, + SilenceUpdateResponsesSinglePage, + { body: body, method: 'put', ...options }, + ); + } + + /** + * Gets a list of silences for an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const silenceListResponse of client.alerting.silences.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: SilenceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/alerting/v3/silences`, + SilenceListResponsesSinglePage, + options, + ); + } + + /** + * Deletes an existing silence for an account. + * + * @example + * ```ts + * const silence = await client.alerting.silences.delete( + * 'f878e90c23f44126ae3cfc399f646977', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + silenceId: string, + params: SilenceDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/alerting/v3/silences/${silenceId}`, options); + } + + /** + * Gets a specific silence for an account. + * + * @example + * ```ts + * const silence = await client.alerting.silences.get( + * 'f878e90c23f44126ae3cfc399f646977', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + silenceId: string, + params: SilenceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/alerting/v3/silences/${silenceId}`, + options, + ) as Core.APIPromise<{ result: SilenceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class SilenceUpdateResponsesSinglePage extends SinglePage {} + +export class SilenceListResponsesSinglePage extends SinglePage {} + +export interface SilenceCreateResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful + */ + success: true; +} + +export namespace SilenceCreateResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } +} + +export interface SilenceUpdateResponse { + /** + * Silence ID + */ + id?: string; + + /** + * When the silence was created. + */ + created_at?: string; + + /** + * When the silence ends. + */ + end_time?: string; + + /** + * The unique identifier of a notification policy + */ + policy_id?: string; + + /** + * When the silence starts. + */ + start_time?: string; + + /** + * When the silence was modified. + */ + updated_at?: string; +} + +export interface SilenceListResponse { + /** + * Silence ID + */ + id?: string; + + /** + * When the silence was created. + */ + created_at?: string; + + /** + * When the silence ends. + */ + end_time?: string; + + /** + * The unique identifier of a notification policy + */ + policy_id?: string; + + /** + * When the silence starts. + */ + start_time?: string; + + /** + * When the silence was modified. + */ + updated_at?: string; +} + +export interface SilenceDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful + */ + success: true; +} + +export namespace SilenceDeleteResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } +} + +export interface SilenceGetResponse { + /** + * Silence ID + */ + id?: string; + + /** + * When the silence was created. + */ + created_at?: string; + + /** + * When the silence ends. + */ + end_time?: string; + + /** + * The unique identifier of a notification policy + */ + policy_id?: string; + + /** + * When the silence starts. + */ + start_time?: string; + + /** + * When the silence was modified. + */ + updated_at?: string; +} + +export interface SilenceCreateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param + */ + body: Array; +} + +export namespace SilenceCreateParams { + export interface Body { + /** + * When the silence ends. + */ + end_time?: string; + + /** + * The unique identifier of a notification policy + */ + policy_id?: string; + + /** + * When the silence starts. + */ + start_time?: string; + } +} + +export interface SilenceUpdateParams { + /** + * Path param: The account id + */ + account_id: string; + + /** + * Body param + */ + body: Array; +} + +export namespace SilenceUpdateParams { + export interface Body { + /** + * Silence ID + */ + id?: string; + + /** + * When the silence ends. + */ + end_time?: string; + + /** + * When the silence starts. + */ + start_time?: string; + } +} + +export interface SilenceListParams { + /** + * The account id + */ + account_id: string; +} + +export interface SilenceDeleteParams { + /** + * The account id + */ + account_id: string; +} + +export interface SilenceGetParams { + /** + * The account id + */ + account_id: string; +} + +Silences.SilenceUpdateResponsesSinglePage = SilenceUpdateResponsesSinglePage; +Silences.SilenceListResponsesSinglePage = SilenceListResponsesSinglePage; + +export declare namespace Silences { + export { + type SilenceCreateResponse as SilenceCreateResponse, + type SilenceUpdateResponse as SilenceUpdateResponse, + type SilenceListResponse as SilenceListResponse, + type SilenceDeleteResponse as SilenceDeleteResponse, + type SilenceGetResponse as SilenceGetResponse, + SilenceUpdateResponsesSinglePage as SilenceUpdateResponsesSinglePage, + SilenceListResponsesSinglePage as SilenceListResponsesSinglePage, + type SilenceCreateParams as SilenceCreateParams, + type SilenceUpdateParams as SilenceUpdateParams, + type SilenceListParams as SilenceListParams, + type SilenceDeleteParams as SilenceDeleteParams, + type SilenceGetParams as SilenceGetParams, + }; +} diff --git a/src/resources/alerting/v3/destinations/destinations.ts b/src/resources/alerting/v3/destinations/destinations.ts deleted file mode 100644 index 0486e2583b..0000000000 --- a/src/resources/alerting/v3/destinations/destinations.ts +++ /dev/null @@ -1,38 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import { APIResource } from 'cloudflare/resource'; -import * as EligibleAPI from 'cloudflare/resources/alerting/v3/destinations/eligible'; -import * as PagerdutyAPI from 'cloudflare/resources/alerting/v3/destinations/pagerduty'; -import * as WebhooksAPI from 'cloudflare/resources/alerting/v3/destinations/webhooks'; - -export class Destinations extends APIResource { - eligible: EligibleAPI.Eligible = new EligibleAPI.Eligible(this._client); - pagerduty: PagerdutyAPI.Pagerduty = new PagerdutyAPI.Pagerduty(this._client); - webhooks: WebhooksAPI.Webhooks = new WebhooksAPI.Webhooks(this._client); -} - -export namespace Destinations { - export import Eligible = EligibleAPI.Eligible; - export import EligibleGetResponse = EligibleAPI.EligibleGetResponse; - export import EligibleGetParams = EligibleAPI.EligibleGetParams; - export import Pagerduty = PagerdutyAPI.Pagerduty; - export import PagerdutyCreateResponse = PagerdutyAPI.PagerdutyCreateResponse; - export import PagerdutyDeleteResponse = PagerdutyAPI.PagerdutyDeleteResponse; - export import PagerdutyGetResponse = PagerdutyAPI.PagerdutyGetResponse; - export import PagerdutyLinkResponse = PagerdutyAPI.PagerdutyLinkResponse; - export import PagerdutyCreateParams = PagerdutyAPI.PagerdutyCreateParams; - export import PagerdutyDeleteParams = PagerdutyAPI.PagerdutyDeleteParams; - export import PagerdutyGetParams = PagerdutyAPI.PagerdutyGetParams; - export import PagerdutyLinkParams = PagerdutyAPI.PagerdutyLinkParams; - export import Webhooks = WebhooksAPI.Webhooks; - export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse; - export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; - export import WebhookListResponse = WebhooksAPI.WebhookListResponse; - export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; - export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams; - export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; - export import WebhookListParams = WebhooksAPI.WebhookListParams; - export import WebhookDeleteParams = WebhooksAPI.WebhookDeleteParams; - export import WebhookGetParams = WebhooksAPI.WebhookGetParams; -} diff --git a/src/resources/alerting/v3/destinations/eligible.ts b/src/resources/alerting/v3/destinations/eligible.ts deleted file mode 100644 index f6c25aff3e..0000000000 --- a/src/resources/alerting/v3/destinations/eligible.ts +++ /dev/null @@ -1,34 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as EligibleAPI from 'cloudflare/resources/alerting/v3/destinations/eligible'; - -export class Eligible extends APIResource { - /** - * Get a list of all delivery mechanism types for which an account is eligible. - */ - get(params: EligibleGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/destinations/eligible`, - options, - ) as Core.APIPromise<{ result: EligibleGetResponse | null }> - )._thenUnwrap((obj) => obj.result); - } -} - -export type EligibleGetResponse = unknown | Array | string; - -export interface EligibleGetParams { - /** - * The account id - */ - account_id: string; -} - -export namespace Eligible { - export import EligibleGetResponse = EligibleAPI.EligibleGetResponse; - export import EligibleGetParams = EligibleAPI.EligibleGetParams; -} diff --git a/src/resources/alerting/v3/destinations/index.ts b/src/resources/alerting/v3/destinations/index.ts deleted file mode 100644 index e323dd7909..0000000000 --- a/src/resources/alerting/v3/destinations/index.ts +++ /dev/null @@ -1,28 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { Destinations } from './destinations'; -export { EligibleGetResponse, EligibleGetParams, Eligible } from './eligible'; -export { - PagerdutyCreateResponse, - PagerdutyDeleteResponse, - PagerdutyGetResponse, - PagerdutyLinkResponse, - PagerdutyCreateParams, - PagerdutyDeleteParams, - PagerdutyGetParams, - PagerdutyLinkParams, - Pagerduty, -} from './pagerduty'; -export { - WebhookCreateResponse, - WebhookUpdateResponse, - WebhookListResponse, - WebhookDeleteResponse, - WebhookGetResponse, - WebhookCreateParams, - WebhookUpdateParams, - WebhookListParams, - WebhookDeleteParams, - WebhookGetParams, - Webhooks, -} from './webhooks'; diff --git a/src/resources/alerting/v3/destinations/pagerduty.ts b/src/resources/alerting/v3/destinations/pagerduty.ts deleted file mode 100644 index dc32e71bf7..0000000000 --- a/src/resources/alerting/v3/destinations/pagerduty.ts +++ /dev/null @@ -1,143 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as PagerdutyAPI from 'cloudflare/resources/alerting/v3/destinations/pagerduty'; - -export class Pagerduty extends APIResource { - /** - * Creates a new token for integrating with PagerDuty. - */ - create( - params: PagerdutyCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.post( - `/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect`, - options, - ) as Core.APIPromise<{ result: PagerdutyCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Deletes all the PagerDuty Services connected to the account. - */ - delete( - params: PagerdutyDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/alerting/v3/destinations/pagerduty`, - options, - ) as Core.APIPromise<{ result: PagerdutyDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a list of all configured PagerDuty services. - */ - get( - params: PagerdutyGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/destinations/pagerduty`, - options, - ) as Core.APIPromise<{ result: PagerdutyGetResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Links PagerDuty with the account using the integration token. - */ - link( - tokenId: string, - params: PagerdutyLinkParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/destinations/pagerduty/connect/${tokenId}`, - options, - ) as Core.APIPromise<{ result: PagerdutyLinkResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface PagerdutyCreateResponse { - /** - * token in form of UUID - */ - id?: string; -} - -export type PagerdutyDeleteResponse = unknown | Array | string; - -export type PagerdutyGetResponse = Array; - -export namespace PagerdutyGetResponse { - export interface PagerdutyGetResponseItem { - /** - * UUID - */ - id?: string; - - /** - * The name of the pagerduty service. - */ - name?: string; - } -} - -export interface PagerdutyLinkResponse { - /** - * UUID - */ - id?: string; -} - -export interface PagerdutyCreateParams { - /** - * The account id - */ - account_id: string; -} - -export interface PagerdutyDeleteParams { - /** - * The account id - */ - account_id: string; -} - -export interface PagerdutyGetParams { - /** - * The account id - */ - account_id: string; -} - -export interface PagerdutyLinkParams { - /** - * The account id - */ - account_id: string; -} - -export namespace Pagerduty { - export import PagerdutyCreateResponse = PagerdutyAPI.PagerdutyCreateResponse; - export import PagerdutyDeleteResponse = PagerdutyAPI.PagerdutyDeleteResponse; - export import PagerdutyGetResponse = PagerdutyAPI.PagerdutyGetResponse; - export import PagerdutyLinkResponse = PagerdutyAPI.PagerdutyLinkResponse; - export import PagerdutyCreateParams = PagerdutyAPI.PagerdutyCreateParams; - export import PagerdutyDeleteParams = PagerdutyAPI.PagerdutyDeleteParams; - export import PagerdutyGetParams = PagerdutyAPI.PagerdutyGetParams; - export import PagerdutyLinkParams = PagerdutyAPI.PagerdutyLinkParams; -} diff --git a/src/resources/alerting/v3/destinations/webhooks.ts b/src/resources/alerting/v3/destinations/webhooks.ts deleted file mode 100644 index 323ac67e7c..0000000000 --- a/src/resources/alerting/v3/destinations/webhooks.ts +++ /dev/null @@ -1,285 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as WebhooksAPI from 'cloudflare/resources/alerting/v3/destinations/webhooks'; - -export class Webhooks extends APIResource { - /** - * Creates a new webhook destination. - */ - create(params: WebhookCreateParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/alerting/v3/destinations/webhooks`, { - body, - ...options, - }) as Core.APIPromise<{ result: WebhookCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update a webhook destination. - */ - update( - webhookId: string, - params: WebhookUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WebhookUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Gets a list of all configured webhook destinations. - */ - list( - params: WebhookListParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/destinations/webhooks`, - options, - ) as Core.APIPromise<{ result: WebhookListResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Delete a configured webhook destination. - */ - delete( - webhookId: string, - params: WebhookDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, - options, - ) as Core.APIPromise<{ result: WebhookDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get details for a single webhooks destination. - */ - get( - webhookId: string, - params: WebhookGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/destinations/webhooks/${webhookId}`, - options, - ) as Core.APIPromise<{ result: WebhookGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface WebhookCreateResponse { - /** - * UUID - */ - id?: string; -} - -export interface WebhookUpdateResponse { - /** - * UUID - */ - id?: string; -} - -export type WebhookListResponse = Array; - -export namespace WebhookListResponse { - export interface WebhookListResponseItem { - /** - * The unique identifier of a webhook - */ - id?: string; - - /** - * Timestamp of when the webhook destination was created. - */ - created_at?: string; - - /** - * Timestamp of the last time an attempt to dispatch a notification to this webhook - * failed. - */ - last_failure?: string; - - /** - * Timestamp of the last time Cloudflare was able to successfully dispatch a - * notification using this webhook. - */ - last_success?: string; - - /** - * The name of the webhook destination. This will be included in the request body - * when you receive a webhook notification. - */ - name?: string; - - /** - * Optional secret that will be passed in the `cf-webhook-auth` header when - * dispatching generic webhook notifications or formatted for supported - * destinations. Secrets are not returned in any API response body. - */ - secret?: string; - - /** - * Type of webhook endpoint. - */ - type?: 'slack' | 'generic' | 'gchat'; - - /** - * The POST endpoint to call when dispatching a notification. - */ - url?: string; - } -} - -export type WebhookDeleteResponse = unknown | Array | string; - -export interface WebhookGetResponse { - /** - * The unique identifier of a webhook - */ - id?: string; - - /** - * Timestamp of when the webhook destination was created. - */ - created_at?: string; - - /** - * Timestamp of the last time an attempt to dispatch a notification to this webhook - * failed. - */ - last_failure?: string; - - /** - * Timestamp of the last time Cloudflare was able to successfully dispatch a - * notification using this webhook. - */ - last_success?: string; - - /** - * The name of the webhook destination. This will be included in the request body - * when you receive a webhook notification. - */ - name?: string; - - /** - * Optional secret that will be passed in the `cf-webhook-auth` header when - * dispatching generic webhook notifications or formatted for supported - * destinations. Secrets are not returned in any API response body. - */ - secret?: string; - - /** - * Type of webhook endpoint. - */ - type?: 'slack' | 'generic' | 'gchat'; - - /** - * The POST endpoint to call when dispatching a notification. - */ - url?: string; -} - -export interface WebhookCreateParams { - /** - * Path param: The account id - */ - account_id: string; - - /** - * Body param: The name of the webhook destination. This will be included in the - * request body when you receive a webhook notification. - */ - name: string; - - /** - * Body param: The POST endpoint to call when dispatching a notification. - */ - url: string; - - /** - * Body param: Optional secret that will be passed in the `cf-webhook-auth` header - * when dispatching generic webhook notifications or formatted for supported - * destinations. Secrets are not returned in any API response body. - */ - secret?: string; -} - -export interface WebhookUpdateParams { - /** - * Path param: The account id - */ - account_id: string; - - /** - * Body param: The name of the webhook destination. This will be included in the - * request body when you receive a webhook notification. - */ - name: string; - - /** - * Body param: The POST endpoint to call when dispatching a notification. - */ - url: string; - - /** - * Body param: Optional secret that will be passed in the `cf-webhook-auth` header - * when dispatching generic webhook notifications or formatted for supported - * destinations. Secrets are not returned in any API response body. - */ - secret?: string; -} - -export interface WebhookListParams { - /** - * The account id - */ - account_id: string; -} - -export interface WebhookDeleteParams { - /** - * The account id - */ - account_id: string; -} - -export interface WebhookGetParams { - /** - * The account id - */ - account_id: string; -} - -export namespace Webhooks { - export import WebhookCreateResponse = WebhooksAPI.WebhookCreateResponse; - export import WebhookUpdateResponse = WebhooksAPI.WebhookUpdateResponse; - export import WebhookListResponse = WebhooksAPI.WebhookListResponse; - export import WebhookDeleteResponse = WebhooksAPI.WebhookDeleteResponse; - export import WebhookGetResponse = WebhooksAPI.WebhookGetResponse; - export import WebhookCreateParams = WebhooksAPI.WebhookCreateParams; - export import WebhookUpdateParams = WebhooksAPI.WebhookUpdateParams; - export import WebhookListParams = WebhooksAPI.WebhookListParams; - export import WebhookDeleteParams = WebhooksAPI.WebhookDeleteParams; - export import WebhookGetParams = WebhooksAPI.WebhookGetParams; -} diff --git a/src/resources/alerting/v3/histories.ts b/src/resources/alerting/v3/histories.ts deleted file mode 100644 index 927994010b..0000000000 --- a/src/resources/alerting/v3/histories.ts +++ /dev/null @@ -1,100 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as HistoriesAPI from 'cloudflare/resources/alerting/v3/histories'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; - -export class Histories extends APIResource { - /** - * Gets a list of history records for notifications sent to an account. The records - * are displayed for last `x` number of days based on the zone plan (free = 30, pro - * = 30, biz = 30, ent = 90). - */ - list( - params: HistoryListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/alerting/v3/history`, - HistoryListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } -} - -export class HistoryListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface HistoryListResponse { - /** - * UUID - */ - id?: string; - - /** - * Message body included in the notification sent. - */ - alert_body?: string; - - /** - * Type of notification that has been dispatched. - */ - alert_type?: string; - - /** - * Description of the notification policy (if present). - */ - description?: string; - - /** - * The mechanism to which the notification has been dispatched. - */ - mechanism?: string; - - /** - * The type of mechanism to which the notification has been dispatched. This can be - * email/pagerduty/webhook based on the mechanism configured. - */ - mechanism_type?: 'email' | 'pagerduty' | 'webhook'; - - /** - * Name of the policy. - */ - name?: string; - - /** - * The unique identifier of a notification policy - */ - policy_id?: string; - - /** - * Timestamp of when the notification was dispatched in ISO 8601 format. - */ - sent?: string; -} - -export interface HistoryListParams extends V4PagePaginationArrayParams { - /** - * Path param: The account id - */ - account_id: string; - - /** - * Query param: Limit the returned results to history records older than the - * specified date. This must be a timestamp that conforms to RFC3339. - */ - before?: string; - - /** - * Query param: Limit the returned results to history records newer than the - * specified date. This must be a timestamp that conforms to RFC3339. - */ - since?: string; -} - -export namespace Histories { - export import HistoryListResponse = HistoriesAPI.HistoryListResponse; - export import HistoryListResponsesV4PagePaginationArray = HistoriesAPI.HistoryListResponsesV4PagePaginationArray; - export import HistoryListParams = HistoriesAPI.HistoryListParams; -} diff --git a/src/resources/alerting/v3/index.ts b/src/resources/alerting/v3/index.ts deleted file mode 100644 index b65122564e..0000000000 --- a/src/resources/alerting/v3/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -export { Destinations } from './destinations/index'; -export { - HistoryListResponse, - HistoryListParams, - HistoryListResponsesV4PagePaginationArray, - Histories, -} from './histories'; -export { - PolicyCreateResponse, - PolicyUpdateResponse, - PolicyListResponse, - PolicyDeleteResponse, - PolicyGetResponse, - PolicyCreateParams, - PolicyUpdateParams, - PolicyListParams, - PolicyDeleteParams, - PolicyGetParams, - Policies, -} from './policies'; -export { V3ListResponse, V3ListParams, V3 } from './v3'; diff --git a/src/resources/alerting/v3/policies.ts b/src/resources/alerting/v3/policies.ts deleted file mode 100644 index c034a9fad9..0000000000 --- a/src/resources/alerting/v3/policies.ts +++ /dev/null @@ -1,1412 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as PoliciesAPI from 'cloudflare/resources/alerting/v3/policies'; - -export class Policies extends APIResource { - /** - * Creates a new Notification policy. - */ - create(params: PolicyCreateParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/alerting/v3/policies`, { - body, - ...options, - }) as Core.APIPromise<{ result: PolicyCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Update a Notification policy. - */ - update( - policyId: string, - params: PolicyUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/alerting/v3/policies/${policyId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: PolicyUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get a list of all Notification policies. - */ - list(params: PolicyListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/alerting/v3/policies`, options) as Core.APIPromise<{ - result: PolicyListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Delete a Notification policy. - */ - delete( - policyId: string, - params: PolicyDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/alerting/v3/policies/${policyId}`, - options, - ) as Core.APIPromise<{ result: PolicyDeleteResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get details for a single policy. - */ - get( - policyId: string, - params: PolicyGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/alerting/v3/policies/${policyId}`, - options, - ) as Core.APIPromise<{ result: PolicyGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface PolicyCreateResponse { - /** - * UUID - */ - id?: string; -} - -export interface PolicyUpdateResponse { - /** - * UUID - */ - id?: string; -} - -export type PolicyListResponse = Array; - -export namespace PolicyListResponse { - export interface PolicyListResponseItem { - /** - * The unique identifier of a notification policy - */ - id?: string; - - /** - * Refers to which event will trigger a Notification dispatch. You can use the - * endpoint to get available alert types which then will give you a list of - * possible values. - */ - alert_type?: - | 'access_custom_certificate_expiration_type' - | 'advanced_ddos_attack_l4_alert' - | 'advanced_ddos_attack_l7_alert' - | 'advanced_http_alert_error' - | 'bgp_hijack_notification' - | 'billing_usage_alert' - | 'block_notification_block_removed' - | 'block_notification_new_block' - | 'block_notification_review_rejected' - | 'brand_protection_alert' - | 'brand_protection_digest' - | 'clickhouse_alert_fw_anomaly' - | 'clickhouse_alert_fw_ent_anomaly' - | 'custom_ssl_certificate_event_type' - | 'dedicated_ssl_certificate_event_type' - | 'dos_attack_l4' - | 'dos_attack_l7' - | 'expiring_service_token_alert' - | 'failing_logpush_job_disabled_alert' - | 'fbm_auto_advertisement' - | 'fbm_dosd_attack' - | 'fbm_volumetric_attack' - | 'health_check_status_notification' - | 'hostname_aop_custom_certificate_expiration_type' - | 'http_alert_edge_error' - | 'http_alert_origin_error' - | 'incident_alert' - | 'load_balancing_health_alert' - | 'load_balancing_pool_enablement_alert' - | 'logo_match_alert' - | 'magic_tunnel_health_check_event' - | 'maintenance_event_notification' - | 'mtls_certificate_store_certificate_expiration_type' - | 'pages_event_alert' - | 'radar_notification' - | 'real_origin_monitoring' - | 'scriptmonitor_alert_new_code_change_detections' - | 'scriptmonitor_alert_new_hosts' - | 'scriptmonitor_alert_new_malicious_hosts' - | 'scriptmonitor_alert_new_malicious_scripts' - | 'scriptmonitor_alert_new_malicious_url' - | 'scriptmonitor_alert_new_max_length_resource_url' - | 'scriptmonitor_alert_new_resources' - | 'secondary_dns_all_primaries_failing' - | 'secondary_dns_primaries_failing' - | 'secondary_dns_zone_successfully_updated' - | 'secondary_dns_zone_validation_warning' - | 'sentinel_alert' - | 'stream_live_notifications' - | 'traffic_anomalies_alert' - | 'tunnel_health_event' - | 'tunnel_update_event' - | 'universal_ssl_event_type' - | 'web_analytics_metrics_update' - | 'zone_aop_custom_certificate_expiration_type'; - - created?: string; - - /** - * Optional description for the Notification policy. - */ - description?: string; - - /** - * Whether or not the Notification policy is enabled. - */ - enabled?: boolean; - - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - filters?: PolicyListResponseItem.Filters; - - /** - * List of IDs that will be used when dispatching a notification. IDs for email - * type will be the email address. - */ - mechanisms?: Record>; - - modified?: string; - - /** - * Name of the policy. - */ - name?: string; - } - - export namespace PolicyListResponseItem { - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - export interface Filters { - /** - * Usage depends on specific alert type - */ - actions?: Array; - - /** - * Used for configuring radar_notification - */ - affected_asns?: Array; - - /** - * Used for configuring incident_alert. A list of identifiers for each component to - * monitor. - */ - affected_components?: Array; - - /** - * Used for configuring radar_notification - */ - affected_locations?: Array; - - /** - * Used for configuring maintenance_event_notification - */ - airport_code?: Array; - - /** - * Usage depends on specific alert type - */ - alert_trigger_preferences?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - alert_trigger_preferences_value?: Array<'99.0' | '98.0' | '97.0'>; - - /** - * Used for configuring load_balancing_pool_enablement_alert - */ - enabled?: Array; - - /** - * Used for configuring pages_event_alert - */ - environment?: Array; - - /** - * Used for configuring pages_event_alert - */ - event?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - event_source?: Array; - - /** - * Usage depends on specific alert type - */ - event_type?: Array; - - /** - * Usage depends on specific alert type - */ - group_by?: Array; - - /** - * Used for configuring health_check_status_notification - */ - health_check_id?: Array; - - /** - * Used for configuring incident_alert - */ - incident_impact?: Array< - | 'INCIDENT_IMPACT_NONE' - | 'INCIDENT_IMPACT_MINOR' - | 'INCIDENT_IMPACT_MAJOR' - | 'INCIDENT_IMPACT_CRITICAL' - >; - - /** - * Used for configuring stream_live_notifications - */ - input_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - limit?: Array; - - /** - * Used for configuring logo_match_alert - */ - logo_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - megabits_per_second?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - new_health?: Array; - - /** - * Used for configuring tunnel_health_event - */ - new_status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - packets_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - pool_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - product?: Array; - - /** - * Used for configuring pages_event_alert - */ - project_id?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - protocol?: Array; - - /** - * Usage depends on specific alert type - */ - query_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - requests_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - selectors?: Array; - - /** - * Used for configuring clickhouse_alert_fw_ent_anomaly - */ - services?: Array; - - /** - * Usage depends on specific alert type - */ - slo?: Array; - - /** - * Used for configuring health_check_status_notification - */ - status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_hostname?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - target_ip?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_zone_name?: Array; - - /** - * Used for configuring traffic_anomalies_alert - */ - traffic_exclusions?: Array<'security_events'>; - - /** - * Used for configuring tunnel_health_event - */ - tunnel_id?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - tunnel_name?: Array; - - /** - * Usage depends on specific alert type - */ - where?: Array; - - /** - * Usage depends on specific alert type - */ - zones?: Array; - } - - export interface Mechanisms { - /** - * UUID - */ - id?: string | string; - } - } -} - -export type PolicyDeleteResponse = unknown | Array | string; - -export interface PolicyGetResponse { - /** - * The unique identifier of a notification policy - */ - id?: string; - - /** - * Refers to which event will trigger a Notification dispatch. You can use the - * endpoint to get available alert types which then will give you a list of - * possible values. - */ - alert_type?: - | 'access_custom_certificate_expiration_type' - | 'advanced_ddos_attack_l4_alert' - | 'advanced_ddos_attack_l7_alert' - | 'advanced_http_alert_error' - | 'bgp_hijack_notification' - | 'billing_usage_alert' - | 'block_notification_block_removed' - | 'block_notification_new_block' - | 'block_notification_review_rejected' - | 'brand_protection_alert' - | 'brand_protection_digest' - | 'clickhouse_alert_fw_anomaly' - | 'clickhouse_alert_fw_ent_anomaly' - | 'custom_ssl_certificate_event_type' - | 'dedicated_ssl_certificate_event_type' - | 'dos_attack_l4' - | 'dos_attack_l7' - | 'expiring_service_token_alert' - | 'failing_logpush_job_disabled_alert' - | 'fbm_auto_advertisement' - | 'fbm_dosd_attack' - | 'fbm_volumetric_attack' - | 'health_check_status_notification' - | 'hostname_aop_custom_certificate_expiration_type' - | 'http_alert_edge_error' - | 'http_alert_origin_error' - | 'incident_alert' - | 'load_balancing_health_alert' - | 'load_balancing_pool_enablement_alert' - | 'logo_match_alert' - | 'magic_tunnel_health_check_event' - | 'maintenance_event_notification' - | 'mtls_certificate_store_certificate_expiration_type' - | 'pages_event_alert' - | 'radar_notification' - | 'real_origin_monitoring' - | 'scriptmonitor_alert_new_code_change_detections' - | 'scriptmonitor_alert_new_hosts' - | 'scriptmonitor_alert_new_malicious_hosts' - | 'scriptmonitor_alert_new_malicious_scripts' - | 'scriptmonitor_alert_new_malicious_url' - | 'scriptmonitor_alert_new_max_length_resource_url' - | 'scriptmonitor_alert_new_resources' - | 'secondary_dns_all_primaries_failing' - | 'secondary_dns_primaries_failing' - | 'secondary_dns_zone_successfully_updated' - | 'secondary_dns_zone_validation_warning' - | 'sentinel_alert' - | 'stream_live_notifications' - | 'traffic_anomalies_alert' - | 'tunnel_health_event' - | 'tunnel_update_event' - | 'universal_ssl_event_type' - | 'web_analytics_metrics_update' - | 'zone_aop_custom_certificate_expiration_type'; - - created?: string; - - /** - * Optional description for the Notification policy. - */ - description?: string; - - /** - * Whether or not the Notification policy is enabled. - */ - enabled?: boolean; - - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - filters?: PolicyGetResponse.Filters; - - /** - * List of IDs that will be used when dispatching a notification. IDs for email - * type will be the email address. - */ - mechanisms?: Record>; - - modified?: string; - - /** - * Name of the policy. - */ - name?: string; -} - -export namespace PolicyGetResponse { - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - export interface Filters { - /** - * Usage depends on specific alert type - */ - actions?: Array; - - /** - * Used for configuring radar_notification - */ - affected_asns?: Array; - - /** - * Used for configuring incident_alert. A list of identifiers for each component to - * monitor. - */ - affected_components?: Array; - - /** - * Used for configuring radar_notification - */ - affected_locations?: Array; - - /** - * Used for configuring maintenance_event_notification - */ - airport_code?: Array; - - /** - * Usage depends on specific alert type - */ - alert_trigger_preferences?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - alert_trigger_preferences_value?: Array<'99.0' | '98.0' | '97.0'>; - - /** - * Used for configuring load_balancing_pool_enablement_alert - */ - enabled?: Array; - - /** - * Used for configuring pages_event_alert - */ - environment?: Array; - - /** - * Used for configuring pages_event_alert - */ - event?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - event_source?: Array; - - /** - * Usage depends on specific alert type - */ - event_type?: Array; - - /** - * Usage depends on specific alert type - */ - group_by?: Array; - - /** - * Used for configuring health_check_status_notification - */ - health_check_id?: Array; - - /** - * Used for configuring incident_alert - */ - incident_impact?: Array< - 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' - >; - - /** - * Used for configuring stream_live_notifications - */ - input_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - limit?: Array; - - /** - * Used for configuring logo_match_alert - */ - logo_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - megabits_per_second?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - new_health?: Array; - - /** - * Used for configuring tunnel_health_event - */ - new_status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - packets_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - pool_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - product?: Array; - - /** - * Used for configuring pages_event_alert - */ - project_id?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - protocol?: Array; - - /** - * Usage depends on specific alert type - */ - query_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - requests_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - selectors?: Array; - - /** - * Used for configuring clickhouse_alert_fw_ent_anomaly - */ - services?: Array; - - /** - * Usage depends on specific alert type - */ - slo?: Array; - - /** - * Used for configuring health_check_status_notification - */ - status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_hostname?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - target_ip?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_zone_name?: Array; - - /** - * Used for configuring traffic_anomalies_alert - */ - traffic_exclusions?: Array<'security_events'>; - - /** - * Used for configuring tunnel_health_event - */ - tunnel_id?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - tunnel_name?: Array; - - /** - * Usage depends on specific alert type - */ - where?: Array; - - /** - * Usage depends on specific alert type - */ - zones?: Array; - } - - export interface Mechanisms { - /** - * UUID - */ - id?: string | string; - } -} - -export interface PolicyCreateParams { - /** - * Path param: The account id - */ - account_id: string; - - /** - * Body param: Refers to which event will trigger a Notification dispatch. You can - * use the endpoint to get available alert types which then will give you a list of - * possible values. - */ - alert_type: - | 'access_custom_certificate_expiration_type' - | 'advanced_ddos_attack_l4_alert' - | 'advanced_ddos_attack_l7_alert' - | 'advanced_http_alert_error' - | 'bgp_hijack_notification' - | 'billing_usage_alert' - | 'block_notification_block_removed' - | 'block_notification_new_block' - | 'block_notification_review_rejected' - | 'brand_protection_alert' - | 'brand_protection_digest' - | 'clickhouse_alert_fw_anomaly' - | 'clickhouse_alert_fw_ent_anomaly' - | 'custom_ssl_certificate_event_type' - | 'dedicated_ssl_certificate_event_type' - | 'dos_attack_l4' - | 'dos_attack_l7' - | 'expiring_service_token_alert' - | 'failing_logpush_job_disabled_alert' - | 'fbm_auto_advertisement' - | 'fbm_dosd_attack' - | 'fbm_volumetric_attack' - | 'health_check_status_notification' - | 'hostname_aop_custom_certificate_expiration_type' - | 'http_alert_edge_error' - | 'http_alert_origin_error' - | 'incident_alert' - | 'load_balancing_health_alert' - | 'load_balancing_pool_enablement_alert' - | 'logo_match_alert' - | 'magic_tunnel_health_check_event' - | 'maintenance_event_notification' - | 'mtls_certificate_store_certificate_expiration_type' - | 'pages_event_alert' - | 'radar_notification' - | 'real_origin_monitoring' - | 'scriptmonitor_alert_new_code_change_detections' - | 'scriptmonitor_alert_new_hosts' - | 'scriptmonitor_alert_new_malicious_hosts' - | 'scriptmonitor_alert_new_malicious_scripts' - | 'scriptmonitor_alert_new_malicious_url' - | 'scriptmonitor_alert_new_max_length_resource_url' - | 'scriptmonitor_alert_new_resources' - | 'secondary_dns_all_primaries_failing' - | 'secondary_dns_primaries_failing' - | 'secondary_dns_zone_successfully_updated' - | 'secondary_dns_zone_validation_warning' - | 'sentinel_alert' - | 'stream_live_notifications' - | 'traffic_anomalies_alert' - | 'tunnel_health_event' - | 'tunnel_update_event' - | 'universal_ssl_event_type' - | 'web_analytics_metrics_update' - | 'zone_aop_custom_certificate_expiration_type'; - - /** - * Body param: Whether or not the Notification policy is enabled. - */ - enabled: boolean; - - /** - * Body param: List of IDs that will be used when dispatching a notification. IDs - * for email type will be the email address. - */ - mechanisms: Record>; - - /** - * Body param: Name of the policy. - */ - name: string; - - /** - * Body param: Optional description for the Notification policy. - */ - description?: string; - - /** - * Body param: Optional filters that allow you to be alerted only on a subset of - * events for that alert type based on some criteria. This is only available for - * select alert types. See alert type documentation for more details. - */ - filters?: PolicyCreateParams.Filters; -} - -export namespace PolicyCreateParams { - export interface Mechanisms { - /** - * UUID - */ - id?: string | string; - } - - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - export interface Filters { - /** - * Usage depends on specific alert type - */ - actions?: Array; - - /** - * Used for configuring radar_notification - */ - affected_asns?: Array; - - /** - * Used for configuring incident_alert. A list of identifiers for each component to - * monitor. - */ - affected_components?: Array; - - /** - * Used for configuring radar_notification - */ - affected_locations?: Array; - - /** - * Used for configuring maintenance_event_notification - */ - airport_code?: Array; - - /** - * Usage depends on specific alert type - */ - alert_trigger_preferences?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - alert_trigger_preferences_value?: Array<'99.0' | '98.0' | '97.0'>; - - /** - * Used for configuring load_balancing_pool_enablement_alert - */ - enabled?: Array; - - /** - * Used for configuring pages_event_alert - */ - environment?: Array; - - /** - * Used for configuring pages_event_alert - */ - event?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - event_source?: Array; - - /** - * Usage depends on specific alert type - */ - event_type?: Array; - - /** - * Usage depends on specific alert type - */ - group_by?: Array; - - /** - * Used for configuring health_check_status_notification - */ - health_check_id?: Array; - - /** - * Used for configuring incident_alert - */ - incident_impact?: Array< - 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' - >; - - /** - * Used for configuring stream_live_notifications - */ - input_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - limit?: Array; - - /** - * Used for configuring logo_match_alert - */ - logo_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - megabits_per_second?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - new_health?: Array; - - /** - * Used for configuring tunnel_health_event - */ - new_status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - packets_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - pool_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - product?: Array; - - /** - * Used for configuring pages_event_alert - */ - project_id?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - protocol?: Array; - - /** - * Usage depends on specific alert type - */ - query_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - requests_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - selectors?: Array; - - /** - * Used for configuring clickhouse_alert_fw_ent_anomaly - */ - services?: Array; - - /** - * Usage depends on specific alert type - */ - slo?: Array; - - /** - * Used for configuring health_check_status_notification - */ - status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_hostname?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - target_ip?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_zone_name?: Array; - - /** - * Used for configuring traffic_anomalies_alert - */ - traffic_exclusions?: Array<'security_events'>; - - /** - * Used for configuring tunnel_health_event - */ - tunnel_id?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - tunnel_name?: Array; - - /** - * Usage depends on specific alert type - */ - where?: Array; - - /** - * Usage depends on specific alert type - */ - zones?: Array; - } -} - -export interface PolicyUpdateParams { - /** - * Path param: The account id - */ - account_id: string; - - /** - * Body param: Refers to which event will trigger a Notification dispatch. You can - * use the endpoint to get available alert types which then will give you a list of - * possible values. - */ - alert_type?: - | 'access_custom_certificate_expiration_type' - | 'advanced_ddos_attack_l4_alert' - | 'advanced_ddos_attack_l7_alert' - | 'advanced_http_alert_error' - | 'bgp_hijack_notification' - | 'billing_usage_alert' - | 'block_notification_block_removed' - | 'block_notification_new_block' - | 'block_notification_review_rejected' - | 'brand_protection_alert' - | 'brand_protection_digest' - | 'clickhouse_alert_fw_anomaly' - | 'clickhouse_alert_fw_ent_anomaly' - | 'custom_ssl_certificate_event_type' - | 'dedicated_ssl_certificate_event_type' - | 'dos_attack_l4' - | 'dos_attack_l7' - | 'expiring_service_token_alert' - | 'failing_logpush_job_disabled_alert' - | 'fbm_auto_advertisement' - | 'fbm_dosd_attack' - | 'fbm_volumetric_attack' - | 'health_check_status_notification' - | 'hostname_aop_custom_certificate_expiration_type' - | 'http_alert_edge_error' - | 'http_alert_origin_error' - | 'incident_alert' - | 'load_balancing_health_alert' - | 'load_balancing_pool_enablement_alert' - | 'logo_match_alert' - | 'magic_tunnel_health_check_event' - | 'maintenance_event_notification' - | 'mtls_certificate_store_certificate_expiration_type' - | 'pages_event_alert' - | 'radar_notification' - | 'real_origin_monitoring' - | 'scriptmonitor_alert_new_code_change_detections' - | 'scriptmonitor_alert_new_hosts' - | 'scriptmonitor_alert_new_malicious_hosts' - | 'scriptmonitor_alert_new_malicious_scripts' - | 'scriptmonitor_alert_new_malicious_url' - | 'scriptmonitor_alert_new_max_length_resource_url' - | 'scriptmonitor_alert_new_resources' - | 'secondary_dns_all_primaries_failing' - | 'secondary_dns_primaries_failing' - | 'secondary_dns_zone_successfully_updated' - | 'secondary_dns_zone_validation_warning' - | 'sentinel_alert' - | 'stream_live_notifications' - | 'traffic_anomalies_alert' - | 'tunnel_health_event' - | 'tunnel_update_event' - | 'universal_ssl_event_type' - | 'web_analytics_metrics_update' - | 'zone_aop_custom_certificate_expiration_type'; - - /** - * Body param: Optional description for the Notification policy. - */ - description?: string; - - /** - * Body param: Whether or not the Notification policy is enabled. - */ - enabled?: boolean; - - /** - * Body param: Optional filters that allow you to be alerted only on a subset of - * events for that alert type based on some criteria. This is only available for - * select alert types. See alert type documentation for more details. - */ - filters?: PolicyUpdateParams.Filters; - - /** - * Body param: List of IDs that will be used when dispatching a notification. IDs - * for email type will be the email address. - */ - mechanisms?: Record>; - - /** - * Body param: Name of the policy. - */ - name?: string; -} - -export namespace PolicyUpdateParams { - /** - * Optional filters that allow you to be alerted only on a subset of events for - * that alert type based on some criteria. This is only available for select alert - * types. See alert type documentation for more details. - */ - export interface Filters { - /** - * Usage depends on specific alert type - */ - actions?: Array; - - /** - * Used for configuring radar_notification - */ - affected_asns?: Array; - - /** - * Used for configuring incident_alert. A list of identifiers for each component to - * monitor. - */ - affected_components?: Array; - - /** - * Used for configuring radar_notification - */ - affected_locations?: Array; - - /** - * Used for configuring maintenance_event_notification - */ - airport_code?: Array; - - /** - * Usage depends on specific alert type - */ - alert_trigger_preferences?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - alert_trigger_preferences_value?: Array<'99.0' | '98.0' | '97.0'>; - - /** - * Used for configuring load_balancing_pool_enablement_alert - */ - enabled?: Array; - - /** - * Used for configuring pages_event_alert - */ - environment?: Array; - - /** - * Used for configuring pages_event_alert - */ - event?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - event_source?: Array; - - /** - * Usage depends on specific alert type - */ - event_type?: Array; - - /** - * Usage depends on specific alert type - */ - group_by?: Array; - - /** - * Used for configuring health_check_status_notification - */ - health_check_id?: Array; - - /** - * Used for configuring incident_alert - */ - incident_impact?: Array< - 'INCIDENT_IMPACT_NONE' | 'INCIDENT_IMPACT_MINOR' | 'INCIDENT_IMPACT_MAJOR' | 'INCIDENT_IMPACT_CRITICAL' - >; - - /** - * Used for configuring stream_live_notifications - */ - input_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - limit?: Array; - - /** - * Used for configuring logo_match_alert - */ - logo_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - megabits_per_second?: Array; - - /** - * Used for configuring load_balancing_health_alert - */ - new_health?: Array; - - /** - * Used for configuring tunnel_health_event - */ - new_status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - packets_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - pool_id?: Array; - - /** - * Used for configuring billing_usage_alert - */ - product?: Array; - - /** - * Used for configuring pages_event_alert - */ - project_id?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - protocol?: Array; - - /** - * Usage depends on specific alert type - */ - query_tag?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - requests_per_second?: Array; - - /** - * Usage depends on specific alert type - */ - selectors?: Array; - - /** - * Used for configuring clickhouse_alert_fw_ent_anomaly - */ - services?: Array; - - /** - * Usage depends on specific alert type - */ - slo?: Array; - - /** - * Used for configuring health_check_status_notification - */ - status?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_hostname?: Array; - - /** - * Used for configuring advanced_ddos_attack_l4_alert - */ - target_ip?: Array; - - /** - * Used for configuring advanced_ddos_attack_l7_alert - */ - target_zone_name?: Array; - - /** - * Used for configuring traffic_anomalies_alert - */ - traffic_exclusions?: Array<'security_events'>; - - /** - * Used for configuring tunnel_health_event - */ - tunnel_id?: Array; - - /** - * Used for configuring magic_tunnel_health_check_event - */ - tunnel_name?: Array; - - /** - * Usage depends on specific alert type - */ - where?: Array; - - /** - * Usage depends on specific alert type - */ - zones?: Array; - } - - export interface Mechanisms { - /** - * UUID - */ - id?: string | string; - } -} - -export interface PolicyListParams { - /** - * The account id - */ - account_id: string; -} - -export interface PolicyDeleteParams { - /** - * The account id - */ - account_id: string; -} - -export interface PolicyGetParams { - /** - * The account id - */ - account_id: string; -} - -export namespace Policies { - export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; - export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; - export import PolicyListResponse = PoliciesAPI.PolicyListResponse; - export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; - export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; - export import PolicyListParams = PoliciesAPI.PolicyListParams; - export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; - export import PolicyGetParams = PoliciesAPI.PolicyGetParams; -} diff --git a/src/resources/alerting/v3/v3.ts b/src/resources/alerting/v3/v3.ts deleted file mode 100644 index f3d2eceecb..0000000000 --- a/src/resources/alerting/v3/v3.ts +++ /dev/null @@ -1,56 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as V3API from 'cloudflare/resources/alerting/v3/v3'; -import * as HistoriesAPI from 'cloudflare/resources/alerting/v3/histories'; -import * as PoliciesAPI from 'cloudflare/resources/alerting/v3/policies'; -import * as DestinationsAPI from 'cloudflare/resources/alerting/v3/destinations/destinations'; - -export class V3 extends APIResource { - destinations: DestinationsAPI.Destinations = new DestinationsAPI.Destinations(this._client); - histories: HistoriesAPI.Histories = new HistoriesAPI.Histories(this._client); - policies: PoliciesAPI.Policies = new PoliciesAPI.Policies(this._client); - - /** - * Gets a list of all alert types for which an account is eligible. - */ - list(params: V3ListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/alerting/v3/available_alerts`, options) as Core.APIPromise<{ - result: V3ListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export type V3ListResponse = unknown | Array | string; - -export interface V3ListParams { - /** - * The account id - */ - account_id: string; -} - -export namespace V3 { - export import V3ListResponse = V3API.V3ListResponse; - export import V3ListParams = V3API.V3ListParams; - export import Destinations = DestinationsAPI.Destinations; - export import Histories = HistoriesAPI.Histories; - export import HistoryListResponse = HistoriesAPI.HistoryListResponse; - export import HistoryListResponsesV4PagePaginationArray = HistoriesAPI.HistoryListResponsesV4PagePaginationArray; - export import HistoryListParams = HistoriesAPI.HistoryListParams; - export import Policies = PoliciesAPI.Policies; - export import PolicyCreateResponse = PoliciesAPI.PolicyCreateResponse; - export import PolicyUpdateResponse = PoliciesAPI.PolicyUpdateResponse; - export import PolicyListResponse = PoliciesAPI.PolicyListResponse; - export import PolicyDeleteResponse = PoliciesAPI.PolicyDeleteResponse; - export import PolicyGetResponse = PoliciesAPI.PolicyGetResponse; - export import PolicyCreateParams = PoliciesAPI.PolicyCreateParams; - export import PolicyUpdateParams = PoliciesAPI.PolicyUpdateParams; - export import PolicyListParams = PoliciesAPI.PolicyListParams; - export import PolicyDeleteParams = PoliciesAPI.PolicyDeleteParams; - export import PolicyGetParams = PoliciesAPI.PolicyGetParams; -} diff --git a/src/resources/api-gateway.ts b/src/resources/api-gateway.ts new file mode 100644 index 0000000000..58d1b95125 --- /dev/null +++ b/src/resources/api-gateway.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './api-gateway/index'; diff --git a/src/resources/api-gateway/api-gateway.ts b/src/resources/api-gateway/api-gateway.ts new file mode 100644 index 0000000000..03f4d421e0 --- /dev/null +++ b/src/resources/api-gateway/api-gateway.ts @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as ConfigurationsAPI from './configurations'; +import { + Configuration, + ConfigurationGetParams, + ConfigurationUpdateParams, + Configurations, +} from './configurations'; +import * as SchemasAPI from './schemas'; +import { SchemaListParams, SchemaListResponse, Schemas } from './schemas'; +import * as DiscoveryAPI from './discovery/discovery'; +import { + Discovery, + DiscoveryGetParams, + DiscoveryGetResponse, + DiscoveryOperation, +} from './discovery/discovery'; +import * as ExpressionTemplateAPI from './expression-template/expression-template'; +import { ExpressionTemplate } from './expression-template/expression-template'; +import * as OperationsAPI from './operations/operations'; +import { + APIShield, + OperationBulkCreateParams, + OperationBulkCreateResponse, + OperationBulkCreateResponsesSinglePage, + OperationBulkDeleteParams, + OperationBulkDeleteResponse, + OperationCreateParams, + OperationCreateResponse, + OperationDeleteParams, + OperationDeleteResponse, + OperationGetParams, + OperationGetResponse, + OperationListParams, + OperationListResponse, + OperationListResponsesV4PagePaginationArray, + Operations, +} from './operations/operations'; +import * as SettingsAPI from './settings/settings'; +import { Settings } from './settings/settings'; +import * as UserSchemasAPI from './user-schemas/user-schemas'; +import { + Message, + OldPublicSchema, + OldPublicSchemasV4PagePaginationArray, + UserSchemaCreateParams, + UserSchemaCreateResponse, + UserSchemaDeleteParams, + UserSchemaDeleteResponse, + UserSchemaEditParams, + UserSchemaGetParams, + UserSchemaListParams, + UserSchemas, +} from './user-schemas/user-schemas'; + +export class APIGateway extends APIResource { + configurations: ConfigurationsAPI.Configurations = new ConfigurationsAPI.Configurations(this._client); + discovery: DiscoveryAPI.Discovery = new DiscoveryAPI.Discovery(this._client); + operations: OperationsAPI.Operations = new OperationsAPI.Operations(this._client); + schemas: SchemasAPI.Schemas = new SchemasAPI.Schemas(this._client); + settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); + userSchemas: UserSchemasAPI.UserSchemas = new UserSchemasAPI.UserSchemas(this._client); + expressionTemplate: ExpressionTemplateAPI.ExpressionTemplate = new ExpressionTemplateAPI.ExpressionTemplate( + this._client, + ); +} + +APIGateway.Configurations = Configurations; +APIGateway.Discovery = Discovery; +APIGateway.Operations = Operations; +APIGateway.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; +APIGateway.OperationBulkCreateResponsesSinglePage = OperationBulkCreateResponsesSinglePage; +APIGateway.Schemas = Schemas; +APIGateway.UserSchemas = UserSchemas; +APIGateway.OldPublicSchemasV4PagePaginationArray = OldPublicSchemasV4PagePaginationArray; +APIGateway.ExpressionTemplate = ExpressionTemplate; + +export declare namespace APIGateway { + export { + Configurations as Configurations, + type Configuration as Configuration, + type ConfigurationUpdateParams as ConfigurationUpdateParams, + type ConfigurationGetParams as ConfigurationGetParams, + }; + + export { + Discovery as Discovery, + type DiscoveryOperation as DiscoveryOperation, + type DiscoveryGetResponse as DiscoveryGetResponse, + type DiscoveryGetParams as DiscoveryGetParams, + }; + + export { + Operations as Operations, + type APIShield as APIShield, + type OperationCreateResponse as OperationCreateResponse, + type OperationListResponse as OperationListResponse, + type OperationDeleteResponse as OperationDeleteResponse, + type OperationBulkCreateResponse as OperationBulkCreateResponse, + type OperationBulkDeleteResponse as OperationBulkDeleteResponse, + type OperationGetResponse as OperationGetResponse, + OperationListResponsesV4PagePaginationArray as OperationListResponsesV4PagePaginationArray, + OperationBulkCreateResponsesSinglePage as OperationBulkCreateResponsesSinglePage, + type OperationCreateParams as OperationCreateParams, + type OperationListParams as OperationListParams, + type OperationDeleteParams as OperationDeleteParams, + type OperationBulkCreateParams as OperationBulkCreateParams, + type OperationBulkDeleteParams as OperationBulkDeleteParams, + type OperationGetParams as OperationGetParams, + }; + + export { + Schemas as Schemas, + type SchemaListResponse as SchemaListResponse, + type SchemaListParams as SchemaListParams, + }; + + export { type Settings as Settings }; + + export { + UserSchemas as UserSchemas, + type Message as Message, + type OldPublicSchema as OldPublicSchema, + type UserSchemaCreateResponse as UserSchemaCreateResponse, + type UserSchemaDeleteResponse as UserSchemaDeleteResponse, + OldPublicSchemasV4PagePaginationArray as OldPublicSchemasV4PagePaginationArray, + type UserSchemaCreateParams as UserSchemaCreateParams, + type UserSchemaListParams as UserSchemaListParams, + type UserSchemaDeleteParams as UserSchemaDeleteParams, + type UserSchemaEditParams as UserSchemaEditParams, + type UserSchemaGetParams as UserSchemaGetParams, + }; + + export { ExpressionTemplate as ExpressionTemplate }; +} diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts new file mode 100644 index 0000000000..a9462e934c --- /dev/null +++ b/src/resources/api-gateway/configurations.ts @@ -0,0 +1,176 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Configurations extends APIResource { + /** + * Update configuration properties + * + * @example + * ```ts + * const configuration = + * await client.apiGateway.configurations.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * auth_id_characteristics: [ + * { name: 'authorization', type: 'header' }, + * ], + * }); + * ``` + */ + update(params: ConfigurationUpdateParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, normalize, ...body } = params; + return ( + this._client.put(`/zones/${zone_id}/api_gateway/configuration`, { + query: { normalize }, + body, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve information about specific configuration properties + * + * @example + * ```ts + * const configuration = + * await client.apiGateway.configurations.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...query } = params; + return ( + this._client.get(`/zones/${zone_id}/api_gateway/configuration`, { + query, + ...options, + }) as Core.APIPromise<{ result: Configuration }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface Configuration { + auth_id_characteristics: Array< + Configuration.APIShieldAuthIDCharacteristic | Configuration.APIShieldAuthIDCharacteristicJWTClaim + >; +} + +export namespace Configuration { + /** + * Auth ID Characteristic + */ + export interface APIShieldAuthIDCharacteristic { + /** + * The name of the characteristic field, i.e., the header or cookie name. + */ + name: string; + + /** + * The type of characteristic. + */ + type: 'header' | 'cookie'; + } + + /** + * Auth ID Characteristic extracted from JWT Token Claims + */ + export interface APIShieldAuthIDCharacteristicJWTClaim { + /** + * Claim location expressed as `$(token_config_id):$(json_path)`, where + * `token_config_id` is the ID of the token configuration used in validating the + * JWT, and `json_path` is a RFC 9535 JSONPath + * (https://goessner.net/articles/JsonPath/, + * https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in + * dot or bracket notation, may only specify literal keys or array indexes, and + * must return a singleton value, which will be interpreted as a string. + */ + name: string; + + /** + * The type of characteristic. + */ + type: 'jwt'; + } +} + +export interface ConfigurationUpdateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param + */ + auth_id_characteristics: Array< + | ConfigurationUpdateParams.APIShieldAuthIDCharacteristic + | ConfigurationUpdateParams.APIShieldAuthIDCharacteristicJWTClaim + >; + + /** + * Query param: Ensures that the configuration is written or retrieved in + * normalized fashion + */ + normalize?: boolean; +} + +export namespace ConfigurationUpdateParams { + /** + * Auth ID Characteristic + */ + export interface APIShieldAuthIDCharacteristic { + /** + * The name of the characteristic field, i.e., the header or cookie name. + */ + name: string; + + /** + * The type of characteristic. + */ + type: 'header' | 'cookie'; + } + + /** + * Auth ID Characteristic extracted from JWT Token Claims + */ + export interface APIShieldAuthIDCharacteristicJWTClaim { + /** + * Claim location expressed as `$(token_config_id):$(json_path)`, where + * `token_config_id` is the ID of the token configuration used in validating the + * JWT, and `json_path` is a RFC 9535 JSONPath + * (https://goessner.net/articles/JsonPath/, + * https://www.rfc-editor.org/rfc/rfc9535.html). The JSONPath expression may be in + * dot or bracket notation, may only specify literal keys or array indexes, and + * must return a singleton value, which will be interpreted as a string. + */ + name: string; + + /** + * The type of characteristic. + */ + type: 'jwt'; + } +} + +export interface ConfigurationGetParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Ensures that the configuration is written or retrieved in + * normalized fashion + */ + normalize?: boolean; +} + +export declare namespace Configurations { + export { + type Configuration as Configuration, + type ConfigurationUpdateParams as ConfigurationUpdateParams, + type ConfigurationGetParams as ConfigurationGetParams, + }; +} diff --git a/src/resources/api-gateway/discovery.ts b/src/resources/api-gateway/discovery.ts new file mode 100644 index 0000000000..2408c50409 --- /dev/null +++ b/src/resources/api-gateway/discovery.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './discovery/index'; diff --git a/src/resources/api-gateway/discovery/discovery.ts b/src/resources/api-gateway/discovery/discovery.ts new file mode 100644 index 0000000000..dc9185efdb --- /dev/null +++ b/src/resources/api-gateway/discovery/discovery.ts @@ -0,0 +1,137 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as OperationsAPI from './operations'; +import { + OperationBulkEditParams, + OperationBulkEditResponse, + OperationEditParams, + OperationEditResponse, + OperationListParams, + Operations, +} from './operations'; +import { V4PagePaginationArray } from '../../../pagination'; + +export class Discovery extends APIResource { + operations: OperationsAPI.Operations = new OperationsAPI.Operations(this._client); + + /** + * Retrieve the most up to date view of discovered operations, rendered as OpenAPI + * schemas + * + * @example + * ```ts + * const discovery = await client.apiGateway.discovery.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get(params: DiscoveryGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/api_gateway/discovery`, options) as Core.APIPromise<{ + result: DiscoveryGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class DiscoveryOperationsV4PagePaginationArray extends V4PagePaginationArray {} + +export interface DiscoveryOperation { + /** + * UUID. + */ + id: string; + + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * API discovery engine(s) that discovered this operation + */ + origin: Array<'ML' | 'SessionIdentifier' | 'LabelDiscovery'>; + + /** + * State of operation in API Discovery + * + * - `review` - Operation is not saved into API Shield Endpoint Management + * - `saved` - Operation is saved into API Shield Endpoint Management + * - `ignored` - Operation is marked as ignored + */ + state: 'review' | 'saved' | 'ignored'; + + features?: DiscoveryOperation.Features; +} + +export namespace DiscoveryOperation { + export interface Features { + traffic_stats?: Features.TrafficStats; + } + + export namespace Features { + export interface TrafficStats { + last_updated: string; + + /** + * The period in seconds these statistics were computed over + */ + period_seconds: number; + + /** + * The average number of requests seen during this period + */ + requests: number; + } + } +} + +export interface DiscoveryGetResponse { + schemas: Array; + + timestamp: string; +} + +export interface DiscoveryGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +Discovery.Operations = Operations; + +export declare namespace Discovery { + export { + type DiscoveryOperation as DiscoveryOperation, + type DiscoveryGetResponse as DiscoveryGetResponse, + type DiscoveryGetParams as DiscoveryGetParams, + }; + + export { + Operations as Operations, + type OperationBulkEditResponse as OperationBulkEditResponse, + type OperationEditResponse as OperationEditResponse, + type OperationListParams as OperationListParams, + type OperationBulkEditParams as OperationBulkEditParams, + type OperationEditParams as OperationEditParams, + }; +} diff --git a/src/resources/api-gateway/discovery/index.ts b/src/resources/api-gateway/discovery/index.ts new file mode 100644 index 0000000000..a2a9fd29a6 --- /dev/null +++ b/src/resources/api-gateway/discovery/index.ts @@ -0,0 +1,17 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + DiscoveryOperationsV4PagePaginationArray, + Discovery, + type DiscoveryOperation, + type DiscoveryGetResponse, + type DiscoveryGetParams, +} from './discovery'; +export { + Operations, + type OperationBulkEditResponse, + type OperationEditResponse, + type OperationListParams, + type OperationBulkEditParams, + type OperationEditParams, +} from './operations'; diff --git a/src/resources/api-gateway/discovery/operations.ts b/src/resources/api-gateway/discovery/operations.ts new file mode 100644 index 0000000000..f7b4a5fd74 --- /dev/null +++ b/src/resources/api-gateway/discovery/operations.ts @@ -0,0 +1,230 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as DiscoveryAPI from './discovery'; +import { DiscoveryOperationsV4PagePaginationArray } from './discovery'; +import { type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Operations extends APIResource { + /** + * Retrieve the most up to date view of discovered operations + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const discoveryOperation of client.apiGateway.discovery.operations.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: OperationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/discovery/operations`, + DiscoveryOperationsV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Update the `state` on one or more discovered operations + * + * @example + * ```ts + * const response = + * await client.apiGateway.discovery.operations.bulkEdit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: { + * '3818d821-5901-4147-a474-f5f5aec1d54e': {}, + * 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, + * }, + * }); + * ``` + */ + bulkEdit( + params: OperationBulkEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, body } = params; + return ( + this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations`, { + body: body, + ...options, + }) as Core.APIPromise<{ result: OperationBulkEditResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Update the `state` on a discovered operation + * + * @example + * ```ts + * const response = + * await client.apiGateway.discovery.operations.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + edit( + operationId: string, + params: OperationEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.patch(`/zones/${zone_id}/api_gateway/discovery/operations/${operationId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: OperationEditResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type OperationBulkEditResponse = { [key: string]: OperationBulkEditResponse.item }; + +export namespace OperationBulkEditResponse { + /** + * Mappings of discovered operations (keys) to objects describing their state + */ + export interface item { + /** + * Mark state of operation in API Discovery + * + * - `review` - Mark operation as for review + * - `ignored` - Mark operation as ignored + */ + state?: 'review' | 'ignored'; + } +} + +export interface OperationEditResponse { + /** + * State of operation in API Discovery + * + * - `review` - Operation is not saved into API Shield Endpoint Management + * - `saved` - Operation is saved into API Shield Endpoint Management + * - `ignored` - Operation is marked as ignored + */ + state?: 'review' | 'saved' | 'ignored'; +} + +export interface OperationListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: When `true`, only return API Discovery results that are not saved + * into API Shield Endpoint Management + */ + diff?: boolean; + + /** + * Query param: Direction to order results. + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Filter results to only include endpoints containing this pattern. + */ + endpoint?: string; + + /** + * Query param: Filter results to only include the specified hosts. + */ + host?: Array; + + /** + * Query param: Filter results to only include the specified HTTP methods. + */ + method?: Array; + + /** + * Query param: Field to order by + */ + order?: 'host' | 'method' | 'endpoint' | 'traffic_stats.requests' | 'traffic_stats.last_updated'; + + /** + * Query param: Filter results to only include discovery results sourced from a + * particular discovery engine + * + * - `ML` - Discovered operations that were sourced using ML API Discovery + * - `SessionIdentifier` - Discovered operations that were sourced using Session + * Identifier API Discovery + */ + origin?: 'ML' | 'SessionIdentifier' | 'LabelDiscovery'; + + /** + * Query param: Filter results to only include discovery results in a particular + * state. States are as follows + * + * - `review` - Discovered operations that are not saved into API Shield Endpoint + * Management + * - `saved` - Discovered operations that are already saved into API Shield + * Endpoint Management + * - `ignored` - Discovered operations that have been marked as ignored + */ + state?: 'review' | 'saved' | 'ignored'; +} + +export interface OperationBulkEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param + */ + body: { [key: string]: OperationBulkEditParams.Body }; +} + +export namespace OperationBulkEditParams { + /** + * Mappings of discovered operations (keys) to objects describing their state + */ + export interface Body { + /** + * Mark state of operation in API Discovery + * + * - `review` - Mark operation as for review + * - `ignored` - Mark operation as ignored + */ + state?: 'review' | 'ignored'; + } +} + +export interface OperationEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Mark state of operation in API Discovery + * + * - `review` - Mark operation as for review + * - `ignored` - Mark operation as ignored + */ + state?: 'review' | 'ignored'; +} + +export declare namespace Operations { + export { + type OperationBulkEditResponse as OperationBulkEditResponse, + type OperationEditResponse as OperationEditResponse, + type OperationListParams as OperationListParams, + type OperationBulkEditParams as OperationBulkEditParams, + type OperationEditParams as OperationEditParams, + }; +} + +export { DiscoveryOperationsV4PagePaginationArray }; diff --git a/src/resources/api-gateway/expression-template.ts b/src/resources/api-gateway/expression-template.ts new file mode 100644 index 0000000000..fac6bf8cc4 --- /dev/null +++ b/src/resources/api-gateway/expression-template.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './expression-template/index'; diff --git a/src/resources/api-gateway/expression-template/expression-template.ts b/src/resources/api-gateway/expression-template/expression-template.ts new file mode 100644 index 0000000000..a6ae3b53fb --- /dev/null +++ b/src/resources/api-gateway/expression-template/expression-template.ts @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as FallthroughAPI from './fallthrough'; +import { Fallthrough, FallthroughCreateParams, FallthroughCreateResponse } from './fallthrough'; + +export class ExpressionTemplate extends APIResource { + fallthrough: FallthroughAPI.Fallthrough = new FallthroughAPI.Fallthrough(this._client); +} + +ExpressionTemplate.Fallthrough = Fallthrough; + +export declare namespace ExpressionTemplate { + export { + Fallthrough as Fallthrough, + type FallthroughCreateResponse as FallthroughCreateResponse, + type FallthroughCreateParams as FallthroughCreateParams, + }; +} diff --git a/src/resources/api-gateway/expression-template/fallthrough.ts b/src/resources/api-gateway/expression-template/fallthrough.ts new file mode 100644 index 0000000000..9db217794a --- /dev/null +++ b/src/resources/api-gateway/expression-template/fallthrough.ts @@ -0,0 +1,64 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class Fallthrough extends APIResource { + /** + * Generate fallthrough WAF expression template from a set of API hosts + * + * @example + * ```ts + * const fallthrough = + * await client.apiGateway.expressionTemplate.fallthrough.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * hosts: ['{zone}.domain1.tld', 'domain2.tld'], + * }, + * ); + * ``` + */ + create( + params: FallthroughCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/api_gateway/expression-template/fallthrough`, { + body, + ...options, + }) as Core.APIPromise<{ result: FallthroughCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface FallthroughCreateResponse { + /** + * WAF Expression for fallthrough + */ + expression: string; + + /** + * Title for the expression + */ + title: string; +} + +export interface FallthroughCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: List of hosts to be targeted in the expression + */ + hosts: Array; +} + +export declare namespace Fallthrough { + export { + type FallthroughCreateResponse as FallthroughCreateResponse, + type FallthroughCreateParams as FallthroughCreateParams, + }; +} diff --git a/src/resources/api-gateway/expression-template/index.ts b/src/resources/api-gateway/expression-template/index.ts new file mode 100644 index 0000000000..cc73a35d00 --- /dev/null +++ b/src/resources/api-gateway/expression-template/index.ts @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { ExpressionTemplate } from './expression-template'; +export { Fallthrough, type FallthroughCreateResponse, type FallthroughCreateParams } from './fallthrough'; diff --git a/src/resources/api-gateway/index.ts b/src/resources/api-gateway/index.ts new file mode 100644 index 0000000000..494074729b --- /dev/null +++ b/src/resources/api-gateway/index.ts @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { APIGateway } from './api-gateway'; +export { + Configurations, + type Configuration, + type ConfigurationUpdateParams, + type ConfigurationGetParams, +} from './configurations'; +export { + DiscoveryOperationsV4PagePaginationArray, + Discovery, + type DiscoveryOperation, + type DiscoveryGetResponse, + type DiscoveryGetParams, +} from './discovery/index'; +export { ExpressionTemplate } from './expression-template/index'; +export { + OldPublicSchemasV4PagePaginationArray, + UserSchemas, + type Message, + type OldPublicSchema, + type UserSchemaCreateResponse, + type UserSchemaDeleteResponse, + type UserSchemaCreateParams, + type UserSchemaListParams, + type UserSchemaDeleteParams, + type UserSchemaEditParams, + type UserSchemaGetParams, +} from './user-schemas/index'; +export { + OperationListResponsesV4PagePaginationArray, + OperationBulkCreateResponsesSinglePage, + Operations, + type APIShield, + type OperationCreateResponse, + type OperationListResponse, + type OperationDeleteResponse, + type OperationBulkCreateResponse, + type OperationBulkDeleteResponse, + type OperationGetResponse, + type OperationCreateParams, + type OperationListParams, + type OperationDeleteParams, + type OperationBulkCreateParams, + type OperationBulkDeleteParams, + type OperationGetParams, +} from './operations/index'; +export { Schemas, type SchemaListResponse, type SchemaListParams } from './schemas'; +export { Settings } from './settings/index'; diff --git a/src/resources/api-gateway/operations.ts b/src/resources/api-gateway/operations.ts new file mode 100644 index 0000000000..3031d6c96e --- /dev/null +++ b/src/resources/api-gateway/operations.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './operations/index'; diff --git a/src/resources/api-gateway/operations/index.ts b/src/resources/api-gateway/operations/index.ts new file mode 100644 index 0000000000..312dd5fe1e --- /dev/null +++ b/src/resources/api-gateway/operations/index.ts @@ -0,0 +1,29 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + OperationListResponsesV4PagePaginationArray, + OperationBulkCreateResponsesSinglePage, + Operations, + type APIShield, + type OperationCreateResponse, + type OperationListResponse, + type OperationDeleteResponse, + type OperationBulkCreateResponse, + type OperationBulkDeleteResponse, + type OperationGetResponse, + type OperationCreateParams, + type OperationListParams, + type OperationDeleteParams, + type OperationBulkCreateParams, + type OperationBulkDeleteParams, + type OperationGetParams, +} from './operations'; +export { + SchemaValidation, + type SettingsMultipleRequest, + type SchemaValidationUpdateResponse, + type SchemaValidationGetResponse, + type SchemaValidationUpdateParams, + type SchemaValidationEditParams, + type SchemaValidationGetParams, +} from './schema-validation'; diff --git a/src/resources/api-gateway/operations/operations.ts b/src/resources/api-gateway/operations/operations.ts new file mode 100644 index 0000000000..df5b631ca3 --- /dev/null +++ b/src/resources/api-gateway/operations/operations.ts @@ -0,0 +1,1500 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as SchemaValidationAPI from './schema-validation'; +import { + SchemaValidation, + SchemaValidationEditParams, + SchemaValidationGetParams, + SchemaValidationGetResponse, + SchemaValidationUpdateParams, + SchemaValidationUpdateResponse, + SettingsMultipleRequest, +} from './schema-validation'; +import * as UserSchemasAPI from '../user-schemas/user-schemas'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Operations extends APIResource { + schemaValidation: SchemaValidationAPI.SchemaValidation = new SchemaValidationAPI.SchemaValidation( + this._client, + ); + + /** + * Add one operation to a zone. Endpoints can contain path variables. Host, method, + * endpoint will be normalized to a canoncial form when creating an operation and + * must be unique on the zone. Inserting an operation that matches an existing one + * will return the record of the already existing operation and update its + * last_updated date. + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * endpoint: '/api/v1/users/{var1}', + * host: 'www.example.com', + * method: 'GET', + * }, + * ); + * ``` + */ + create( + params: OperationCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/api_gateway/operations/item`, { + body, + ...options, + }) as Core.APIPromise<{ result: OperationCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve information about all operations on a zone + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const operationListResponse of client.apiGateway.operations.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: OperationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/operations`, + OperationListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete an operation + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + operationId: string, + params: OperationDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.delete(`/zones/${zone_id}/api_gateway/operations/${operationId}`, options); + } + + /** + * Add one or more operations to a zone. Endpoints can contain path variables. + * Host, method, endpoint will be normalized to a canoncial form when creating an + * operation and must be unique on the zone. Inserting an operation that matches an + * existing one will return the record of the already existing operation and update + * its last_updated date. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const operationBulkCreateResponse of client.apiGateway.operations.bulkCreate( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [ + * { + * endpoint: '/api/v1/users/{var1}', + * host: 'www.example.com', + * method: 'GET', + * }, + * ], + * }, + * )) { + * // ... + * } + * ``` + */ + bulkCreate( + params: OperationBulkCreateParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, body } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/operations`, + OperationBulkCreateResponsesSinglePage, + { body: body, method: 'post', ...options }, + ); + } + + /** + * Delete multiple operations + * + * @example + * ```ts + * const response = + * await client.apiGateway.operations.bulkDelete({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + bulkDelete( + params: OperationBulkDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.delete(`/zones/${zone_id}/api_gateway/operations`, options); + } + + /** + * Retrieve information about an operation + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + operationId: string, + params: OperationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...query } = params; + return ( + this._client.get(`/zones/${zone_id}/api_gateway/operations/${operationId}`, { + query, + ...options, + }) as Core.APIPromise<{ result: OperationGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class OperationListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export class OperationBulkCreateResponsesSinglePage extends SinglePage {} + +export interface APIShield { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; +} + +export interface OperationCreateResponse { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; + + features?: + | OperationCreateResponse.APIShieldOperationFeatureThresholds + | OperationCreateResponse.APIShieldOperationFeatureParameterSchemas + | OperationCreateResponse.APIShieldOperationFeatureAPIRouting + | OperationCreateResponse.APIShieldOperationFeatureConfidenceIntervals + | OperationCreateResponse.APIShieldOperationFeatureSchemaInfo; +} + +export namespace OperationCreateResponse { + export interface APIShieldOperationFeatureThresholds { + thresholds?: APIShieldOperationFeatureThresholds.Thresholds; + } + + export namespace APIShieldOperationFeatureThresholds { + export interface Thresholds { + /** + * The total number of auth-ids seen across this calculation. + */ + auth_id_tokens?: number; + + /** + * The number of data points used for the threshold suggestion calculation. + */ + data_points?: number; + + last_updated?: string; + + /** + * The p50 quantile of requests (in period_seconds). + */ + p50?: number; + + /** + * The p90 quantile of requests (in period_seconds). + */ + p90?: number; + + /** + * The p99 quantile of requests (in period_seconds). + */ + p99?: number; + + /** + * The period over which this threshold is suggested. + */ + period_seconds?: number; + + /** + * The estimated number of requests covered by these calculations. + */ + requests?: number; + + /** + * The suggested threshold in requests done by the same auth_id or period_seconds. + */ + suggested_threshold?: number; + } + } + + export interface APIShieldOperationFeatureParameterSchemas { + parameter_schemas: APIShieldOperationFeatureParameterSchemas.ParameterSchemas; + } + + export namespace APIShieldOperationFeatureParameterSchemas { + export interface ParameterSchemas { + last_updated?: string; + + /** + * An operation schema object containing a response. + */ + parameter_schemas?: ParameterSchemas.ParameterSchemas; + } + + export namespace ParameterSchemas { + /** + * An operation schema object containing a response. + */ + export interface ParameterSchemas { + /** + * An array containing the learned parameter schemas. + */ + parameters?: Array; + + /** + * An empty response object. This field is required to yield a valid operation + * schema. + */ + responses?: unknown | null; + } + } + } + + export interface APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + api_routing?: APIShieldOperationFeatureAPIRouting.APIRouting; + } + + export namespace APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + export interface APIRouting { + last_updated?: string; + + /** + * Target route. + */ + route?: string; + } + } + + export interface APIShieldOperationFeatureConfidenceIntervals { + confidence_intervals?: APIShieldOperationFeatureConfidenceIntervals.ConfidenceIntervals; + } + + export namespace APIShieldOperationFeatureConfidenceIntervals { + export interface ConfidenceIntervals { + last_updated?: string; + + suggested_threshold?: ConfidenceIntervals.SuggestedThreshold; + } + + export namespace ConfidenceIntervals { + export interface SuggestedThreshold { + confidence_intervals?: SuggestedThreshold.ConfidenceIntervals; + + /** + * Suggested threshold. + */ + mean?: number; + } + + export namespace SuggestedThreshold { + export interface ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + p90?: ConfidenceIntervals.P90; + + /** + * Upper and lower bound for percentile estimate + */ + p95?: ConfidenceIntervals.P95; + + /** + * Upper and lower bound for percentile estimate + */ + p99?: ConfidenceIntervals.P99; + } + + export namespace ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + export interface P90 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P95 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P99 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + } + } + } + } + + export interface APIShieldOperationFeatureSchemaInfo { + schema_info?: APIShieldOperationFeatureSchemaInfo.SchemaInfo; + } + + export namespace APIShieldOperationFeatureSchemaInfo { + export interface SchemaInfo { + /** + * Schema active on endpoint. + */ + active_schema?: SchemaInfo.ActiveSchema; + + /** + * True if a Cloudflare-provided learned schema is available for this endpoint. + */ + learned_available?: boolean; + + /** + * Action taken on requests failing validation. + */ + mitigation_action?: 'none' | 'log' | 'block' | null; + } + + export namespace SchemaInfo { + /** + * Schema active on endpoint. + */ + export interface ActiveSchema { + /** + * UUID. + */ + id?: string; + + created_at?: string; + + /** + * True if schema is Cloudflare-provided. + */ + is_learned?: boolean; + + /** + * Schema file name. + */ + name?: string; + } + } + } +} + +export interface OperationListResponse { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; + + features?: + | OperationListResponse.APIShieldOperationFeatureThresholds + | OperationListResponse.APIShieldOperationFeatureParameterSchemas + | OperationListResponse.APIShieldOperationFeatureAPIRouting + | OperationListResponse.APIShieldOperationFeatureConfidenceIntervals + | OperationListResponse.APIShieldOperationFeatureSchemaInfo; +} + +export namespace OperationListResponse { + export interface APIShieldOperationFeatureThresholds { + thresholds?: APIShieldOperationFeatureThresholds.Thresholds; + } + + export namespace APIShieldOperationFeatureThresholds { + export interface Thresholds { + /** + * The total number of auth-ids seen across this calculation. + */ + auth_id_tokens?: number; + + /** + * The number of data points used for the threshold suggestion calculation. + */ + data_points?: number; + + last_updated?: string; + + /** + * The p50 quantile of requests (in period_seconds). + */ + p50?: number; + + /** + * The p90 quantile of requests (in period_seconds). + */ + p90?: number; + + /** + * The p99 quantile of requests (in period_seconds). + */ + p99?: number; + + /** + * The period over which this threshold is suggested. + */ + period_seconds?: number; + + /** + * The estimated number of requests covered by these calculations. + */ + requests?: number; + + /** + * The suggested threshold in requests done by the same auth_id or period_seconds. + */ + suggested_threshold?: number; + } + } + + export interface APIShieldOperationFeatureParameterSchemas { + parameter_schemas: APIShieldOperationFeatureParameterSchemas.ParameterSchemas; + } + + export namespace APIShieldOperationFeatureParameterSchemas { + export interface ParameterSchemas { + last_updated?: string; + + /** + * An operation schema object containing a response. + */ + parameter_schemas?: ParameterSchemas.ParameterSchemas; + } + + export namespace ParameterSchemas { + /** + * An operation schema object containing a response. + */ + export interface ParameterSchemas { + /** + * An array containing the learned parameter schemas. + */ + parameters?: Array; + + /** + * An empty response object. This field is required to yield a valid operation + * schema. + */ + responses?: unknown | null; + } + } + } + + export interface APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + api_routing?: APIShieldOperationFeatureAPIRouting.APIRouting; + } + + export namespace APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + export interface APIRouting { + last_updated?: string; + + /** + * Target route. + */ + route?: string; + } + } + + export interface APIShieldOperationFeatureConfidenceIntervals { + confidence_intervals?: APIShieldOperationFeatureConfidenceIntervals.ConfidenceIntervals; + } + + export namespace APIShieldOperationFeatureConfidenceIntervals { + export interface ConfidenceIntervals { + last_updated?: string; + + suggested_threshold?: ConfidenceIntervals.SuggestedThreshold; + } + + export namespace ConfidenceIntervals { + export interface SuggestedThreshold { + confidence_intervals?: SuggestedThreshold.ConfidenceIntervals; + + /** + * Suggested threshold. + */ + mean?: number; + } + + export namespace SuggestedThreshold { + export interface ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + p90?: ConfidenceIntervals.P90; + + /** + * Upper and lower bound for percentile estimate + */ + p95?: ConfidenceIntervals.P95; + + /** + * Upper and lower bound for percentile estimate + */ + p99?: ConfidenceIntervals.P99; + } + + export namespace ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + export interface P90 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P95 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P99 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + } + } + } + } + + export interface APIShieldOperationFeatureSchemaInfo { + schema_info?: APIShieldOperationFeatureSchemaInfo.SchemaInfo; + } + + export namespace APIShieldOperationFeatureSchemaInfo { + export interface SchemaInfo { + /** + * Schema active on endpoint. + */ + active_schema?: SchemaInfo.ActiveSchema; + + /** + * True if a Cloudflare-provided learned schema is available for this endpoint. + */ + learned_available?: boolean; + + /** + * Action taken on requests failing validation. + */ + mitigation_action?: 'none' | 'log' | 'block' | null; + } + + export namespace SchemaInfo { + /** + * Schema active on endpoint. + */ + export interface ActiveSchema { + /** + * UUID. + */ + id?: string; + + created_at?: string; + + /** + * True if schema is Cloudflare-provided. + */ + is_learned?: boolean; + + /** + * Schema file name. + */ + name?: string; + } + } + } +} + +export interface OperationDeleteResponse { + errors: UserSchemasAPI.Message; + + messages: UserSchemasAPI.Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export interface OperationBulkCreateResponse { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; + + features?: + | OperationBulkCreateResponse.APIShieldOperationFeatureThresholds + | OperationBulkCreateResponse.APIShieldOperationFeatureParameterSchemas + | OperationBulkCreateResponse.APIShieldOperationFeatureAPIRouting + | OperationBulkCreateResponse.APIShieldOperationFeatureConfidenceIntervals + | OperationBulkCreateResponse.APIShieldOperationFeatureSchemaInfo; +} + +export namespace OperationBulkCreateResponse { + export interface APIShieldOperationFeatureThresholds { + thresholds?: APIShieldOperationFeatureThresholds.Thresholds; + } + + export namespace APIShieldOperationFeatureThresholds { + export interface Thresholds { + /** + * The total number of auth-ids seen across this calculation. + */ + auth_id_tokens?: number; + + /** + * The number of data points used for the threshold suggestion calculation. + */ + data_points?: number; + + last_updated?: string; + + /** + * The p50 quantile of requests (in period_seconds). + */ + p50?: number; + + /** + * The p90 quantile of requests (in period_seconds). + */ + p90?: number; + + /** + * The p99 quantile of requests (in period_seconds). + */ + p99?: number; + + /** + * The period over which this threshold is suggested. + */ + period_seconds?: number; + + /** + * The estimated number of requests covered by these calculations. + */ + requests?: number; + + /** + * The suggested threshold in requests done by the same auth_id or period_seconds. + */ + suggested_threshold?: number; + } + } + + export interface APIShieldOperationFeatureParameterSchemas { + parameter_schemas: APIShieldOperationFeatureParameterSchemas.ParameterSchemas; + } + + export namespace APIShieldOperationFeatureParameterSchemas { + export interface ParameterSchemas { + last_updated?: string; + + /** + * An operation schema object containing a response. + */ + parameter_schemas?: ParameterSchemas.ParameterSchemas; + } + + export namespace ParameterSchemas { + /** + * An operation schema object containing a response. + */ + export interface ParameterSchemas { + /** + * An array containing the learned parameter schemas. + */ + parameters?: Array; + + /** + * An empty response object. This field is required to yield a valid operation + * schema. + */ + responses?: unknown | null; + } + } + } + + export interface APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + api_routing?: APIShieldOperationFeatureAPIRouting.APIRouting; + } + + export namespace APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + export interface APIRouting { + last_updated?: string; + + /** + * Target route. + */ + route?: string; + } + } + + export interface APIShieldOperationFeatureConfidenceIntervals { + confidence_intervals?: APIShieldOperationFeatureConfidenceIntervals.ConfidenceIntervals; + } + + export namespace APIShieldOperationFeatureConfidenceIntervals { + export interface ConfidenceIntervals { + last_updated?: string; + + suggested_threshold?: ConfidenceIntervals.SuggestedThreshold; + } + + export namespace ConfidenceIntervals { + export interface SuggestedThreshold { + confidence_intervals?: SuggestedThreshold.ConfidenceIntervals; + + /** + * Suggested threshold. + */ + mean?: number; + } + + export namespace SuggestedThreshold { + export interface ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + p90?: ConfidenceIntervals.P90; + + /** + * Upper and lower bound for percentile estimate + */ + p95?: ConfidenceIntervals.P95; + + /** + * Upper and lower bound for percentile estimate + */ + p99?: ConfidenceIntervals.P99; + } + + export namespace ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + export interface P90 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P95 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P99 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + } + } + } + } + + export interface APIShieldOperationFeatureSchemaInfo { + schema_info?: APIShieldOperationFeatureSchemaInfo.SchemaInfo; + } + + export namespace APIShieldOperationFeatureSchemaInfo { + export interface SchemaInfo { + /** + * Schema active on endpoint. + */ + active_schema?: SchemaInfo.ActiveSchema; + + /** + * True if a Cloudflare-provided learned schema is available for this endpoint. + */ + learned_available?: boolean; + + /** + * Action taken on requests failing validation. + */ + mitigation_action?: 'none' | 'log' | 'block' | null; + } + + export namespace SchemaInfo { + /** + * Schema active on endpoint. + */ + export interface ActiveSchema { + /** + * UUID. + */ + id?: string; + + created_at?: string; + + /** + * True if schema is Cloudflare-provided. + */ + is_learned?: boolean; + + /** + * Schema file name. + */ + name?: string; + } + } + } +} + +export interface OperationBulkDeleteResponse { + errors: UserSchemasAPI.Message; + + messages: UserSchemasAPI.Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export interface OperationGetResponse { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; + + features?: + | OperationGetResponse.APIShieldOperationFeatureThresholds + | OperationGetResponse.APIShieldOperationFeatureParameterSchemas + | OperationGetResponse.APIShieldOperationFeatureAPIRouting + | OperationGetResponse.APIShieldOperationFeatureConfidenceIntervals + | OperationGetResponse.APIShieldOperationFeatureSchemaInfo; +} + +export namespace OperationGetResponse { + export interface APIShieldOperationFeatureThresholds { + thresholds?: APIShieldOperationFeatureThresholds.Thresholds; + } + + export namespace APIShieldOperationFeatureThresholds { + export interface Thresholds { + /** + * The total number of auth-ids seen across this calculation. + */ + auth_id_tokens?: number; + + /** + * The number of data points used for the threshold suggestion calculation. + */ + data_points?: number; + + last_updated?: string; + + /** + * The p50 quantile of requests (in period_seconds). + */ + p50?: number; + + /** + * The p90 quantile of requests (in period_seconds). + */ + p90?: number; + + /** + * The p99 quantile of requests (in period_seconds). + */ + p99?: number; + + /** + * The period over which this threshold is suggested. + */ + period_seconds?: number; + + /** + * The estimated number of requests covered by these calculations. + */ + requests?: number; + + /** + * The suggested threshold in requests done by the same auth_id or period_seconds. + */ + suggested_threshold?: number; + } + } + + export interface APIShieldOperationFeatureParameterSchemas { + parameter_schemas: APIShieldOperationFeatureParameterSchemas.ParameterSchemas; + } + + export namespace APIShieldOperationFeatureParameterSchemas { + export interface ParameterSchemas { + last_updated?: string; + + /** + * An operation schema object containing a response. + */ + parameter_schemas?: ParameterSchemas.ParameterSchemas; + } + + export namespace ParameterSchemas { + /** + * An operation schema object containing a response. + */ + export interface ParameterSchemas { + /** + * An array containing the learned parameter schemas. + */ + parameters?: Array; + + /** + * An empty response object. This field is required to yield a valid operation + * schema. + */ + responses?: unknown | null; + } + } + } + + export interface APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + api_routing?: APIShieldOperationFeatureAPIRouting.APIRouting; + } + + export namespace APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + export interface APIRouting { + last_updated?: string; + + /** + * Target route. + */ + route?: string; + } + } + + export interface APIShieldOperationFeatureConfidenceIntervals { + confidence_intervals?: APIShieldOperationFeatureConfidenceIntervals.ConfidenceIntervals; + } + + export namespace APIShieldOperationFeatureConfidenceIntervals { + export interface ConfidenceIntervals { + last_updated?: string; + + suggested_threshold?: ConfidenceIntervals.SuggestedThreshold; + } + + export namespace ConfidenceIntervals { + export interface SuggestedThreshold { + confidence_intervals?: SuggestedThreshold.ConfidenceIntervals; + + /** + * Suggested threshold. + */ + mean?: number; + } + + export namespace SuggestedThreshold { + export interface ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + p90?: ConfidenceIntervals.P90; + + /** + * Upper and lower bound for percentile estimate + */ + p95?: ConfidenceIntervals.P95; + + /** + * Upper and lower bound for percentile estimate + */ + p99?: ConfidenceIntervals.P99; + } + + export namespace ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + export interface P90 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P95 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P99 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + } + } + } + } + + export interface APIShieldOperationFeatureSchemaInfo { + schema_info?: APIShieldOperationFeatureSchemaInfo.SchemaInfo; + } + + export namespace APIShieldOperationFeatureSchemaInfo { + export interface SchemaInfo { + /** + * Schema active on endpoint. + */ + active_schema?: SchemaInfo.ActiveSchema; + + /** + * True if a Cloudflare-provided learned schema is available for this endpoint. + */ + learned_available?: boolean; + + /** + * Action taken on requests failing validation. + */ + mitigation_action?: 'none' | 'log' | 'block' | null; + } + + export namespace SchemaInfo { + /** + * Schema active on endpoint. + */ + export interface ActiveSchema { + /** + * UUID. + */ + id?: string; + + created_at?: string; + + /** + * True if schema is Cloudflare-provided. + */ + is_learned?: boolean; + + /** + * Schema file name. + */ + name?: string; + } + } + } +} + +export interface OperationCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: The endpoint which can contain path parameter templates in curly + * braces, each will be replaced from left to right with {varN}, starting with + * {var1}, during insertion. This will further be Cloudflare-normalized upon + * insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * Body param: RFC3986-compliant host. + */ + host: string; + + /** + * Body param: The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; +} + +export interface OperationListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Direction to order results. + */ + direction?: 'asc' | 'desc'; + + /** + * Query param: Filter results to only include endpoints containing this pattern. + */ + endpoint?: string; + + /** + * Query param: Add feature(s) to the results. The feature name that is given here + * corresponds to the resulting feature object. Have a look at the top-level object + * description for more details on the specific meaning. + */ + feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>; + + /** + * Query param: Filter results to only include the specified hosts. + */ + host?: Array; + + /** + * Query param: Filter results to only include the specified HTTP methods. + */ + method?: Array; + + /** + * Query param: Field to order by. When requesting a feature, the feature keys are + * available for ordering as well, e.g., `thresholds.suggested_threshold`. + */ + order?: 'method' | 'host' | 'endpoint' | 'thresholds.$key'; +} + +export interface OperationDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface OperationBulkCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param + */ + body: Array; +} + +export namespace OperationBulkCreateParams { + export interface Body { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + } +} + +export interface OperationBulkDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface OperationGetParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Add feature(s) to the results. The feature name that is given here + * corresponds to the resulting feature object. Have a look at the top-level object + * description for more details on the specific meaning. + */ + feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>; +} + +Operations.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; +Operations.OperationBulkCreateResponsesSinglePage = OperationBulkCreateResponsesSinglePage; +Operations.SchemaValidation = SchemaValidation; + +export declare namespace Operations { + export { + type APIShield as APIShield, + type OperationCreateResponse as OperationCreateResponse, + type OperationListResponse as OperationListResponse, + type OperationDeleteResponse as OperationDeleteResponse, + type OperationBulkCreateResponse as OperationBulkCreateResponse, + type OperationBulkDeleteResponse as OperationBulkDeleteResponse, + type OperationGetResponse as OperationGetResponse, + OperationListResponsesV4PagePaginationArray as OperationListResponsesV4PagePaginationArray, + OperationBulkCreateResponsesSinglePage as OperationBulkCreateResponsesSinglePage, + type OperationCreateParams as OperationCreateParams, + type OperationListParams as OperationListParams, + type OperationDeleteParams as OperationDeleteParams, + type OperationBulkCreateParams as OperationBulkCreateParams, + type OperationBulkDeleteParams as OperationBulkDeleteParams, + type OperationGetParams as OperationGetParams, + }; + + export { + SchemaValidation as SchemaValidation, + type SettingsMultipleRequest as SettingsMultipleRequest, + type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationGetResponse as SchemaValidationGetResponse, + type SchemaValidationUpdateParams as SchemaValidationUpdateParams, + type SchemaValidationEditParams as SchemaValidationEditParams, + type SchemaValidationGetParams as SchemaValidationGetParams, + }; +} diff --git a/src/resources/api-gateway/operations/schema-validation.ts b/src/resources/api-gateway/operations/schema-validation.ts new file mode 100644 index 0000000000..4d7e821cce --- /dev/null +++ b/src/resources/api-gateway/operations/schema-validation.ts @@ -0,0 +1,190 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +/** + * @deprecated Please use the [Schema Validation Operations Settings](https://developers.cloudflare.com/api/resources/schema_validation/subresources/settings/subresources/operations/) APIs instead + */ +export class SchemaValidation extends APIResource { + /** + * Updates operation-level schema validation settings on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + update( + operationId: string, + params: SchemaValidationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return this._client.put(`/zones/${zone_id}/api_gateway/operations/${operationId}/schema_validation`, { + body, + ...options, + }); + } + + /** + * Updates multiple operation-level schema validation settings on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + edit( + params: SchemaValidationEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, settings_multiple_request } = params; + return ( + this._client.patch(`/zones/${zone_id}/api_gateway/operations/schema_validation`, { + body: settings_multiple_request, + ...options, + }) as Core.APIPromise<{ result: SettingsMultipleRequest }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves operation-level schema validation settings on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + get( + operationId: string, + params: SchemaValidationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.get( + `/zones/${zone_id}/api_gateway/operations/${operationId}/schema_validation`, + options, + ); + } +} + +export type SettingsMultipleRequest = { [key: string]: SettingsMultipleRequest.item }; + +export namespace SettingsMultipleRequest { + /** + * Operation ID to mitigation action mappings + */ + export interface item { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; + } +} + +export type SettingsMultipleRequestParam = { [key: string]: SettingsMultipleRequestParam.item }; + +export namespace SettingsMultipleRequestParam { + /** + * Operation ID to mitigation action mappings + */ + export interface item { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; + } +} + +export interface SchemaValidationUpdateResponse { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; + + /** + * UUID. + */ + operation_id?: string; +} + +export interface SchemaValidationGetResponse { + /** + * When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; + + /** + * UUID. + */ + operation_id?: string; +} + +export interface SchemaValidationUpdateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: When set, this applies a mitigation action to this operation + * + * - `log` log request when request does not conform to schema for this operation + * - `block` deny access to the site when request does not conform to schema for + * this operation + * - `none` will skip mitigation for this operation + * - `null` indicates that no operation level mitigation is in place, see Zone + * Level Schema Validation Settings for mitigation action that will be applied + */ + mitigation_action?: 'log' | 'block' | 'none' | null; +} + +export interface SchemaValidationEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param + */ + settings_multiple_request: SettingsMultipleRequestParam; +} + +export interface SchemaValidationGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +export declare namespace SchemaValidation { + export { + type SettingsMultipleRequest as SettingsMultipleRequest, + type SchemaValidationUpdateResponse as SchemaValidationUpdateResponse, + type SchemaValidationGetResponse as SchemaValidationGetResponse, + type SchemaValidationUpdateParams as SchemaValidationUpdateParams, + type SchemaValidationEditParams as SchemaValidationEditParams, + type SchemaValidationGetParams as SchemaValidationGetParams, + }; +} diff --git a/src/resources/api-gateway/schemas.ts b/src/resources/api-gateway/schemas.ts new file mode 100644 index 0000000000..9e56057d7b --- /dev/null +++ b/src/resources/api-gateway/schemas.ts @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Schemas extends APIResource { + /** + * Retrieve operations and features as OpenAPI schemas + * + * @example + * ```ts + * const schemas = await client.apiGateway.schemas.list({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + list(params: SchemaListParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...query } = params; + return ( + this._client.get(`/zones/${zone_id}/api_gateway/schemas`, { query, ...options }) as Core.APIPromise<{ + result: SchemaListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SchemaListResponse { + schemas?: Array; + + timestamp?: string; +} + +export interface SchemaListParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Add feature(s) to the results. The feature name that is given here + * corresponds to the resulting feature object. Have a look at the top-level object + * description for more details on the specific meaning. + */ + feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>; + + /** + * Query param: Receive schema only for the given host(s). + */ + host?: Array; +} + +export declare namespace Schemas { + export { type SchemaListResponse as SchemaListResponse, type SchemaListParams as SchemaListParams }; +} diff --git a/src/resources/api-gateway/settings.ts b/src/resources/api-gateway/settings.ts new file mode 100644 index 0000000000..2200dbfabb --- /dev/null +++ b/src/resources/api-gateway/settings.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './settings/index'; diff --git a/src/resources/api-gateway/settings/index.ts b/src/resources/api-gateway/settings/index.ts new file mode 100644 index 0000000000..086f66ad01 --- /dev/null +++ b/src/resources/api-gateway/settings/index.ts @@ -0,0 +1,9 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + SchemaValidation, + type SchemaValidationUpdateParams, + type SchemaValidationEditParams, + type SchemaValidationGetParams, +} from './schema-validation'; +export { Settings } from './settings'; diff --git a/src/resources/api-gateway/settings/schema-validation.ts b/src/resources/api-gateway/settings/schema-validation.ts new file mode 100644 index 0000000000..8b3dbc93f7 --- /dev/null +++ b/src/resources/api-gateway/settings/schema-validation.ts @@ -0,0 +1,129 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as SettingsAPI from './settings'; + +export class SchemaValidation extends APIResource { + /** + * Updates zone level schema validation settings on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + update( + params: SchemaValidationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return this._client.put(`/zones/${zone_id}/api_gateway/settings/schema_validation`, { body, ...options }); + } + + /** + * Updates zone level schema validation settings on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + edit( + params: SchemaValidationEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return this._client.patch(`/zones/${zone_id}/api_gateway/settings/schema_validation`, { + body, + ...options, + }); + } + + /** + * Retrieves zone level schema validation settings currently set on the zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + get( + params: SchemaValidationGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.get(`/zones/${zone_id}/api_gateway/settings/schema_validation`, options); + } +} + +export interface SchemaValidationUpdateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: The default mitigation action used when there is no mitigation + * action defined on the operation + * + * Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + */ + validation_default_mitigation_action: 'none' | 'log' | 'block'; + + /** + * Body param: When set, this overrides both zone level and operation level + * mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * - `null` indicates that no override is in place + * + * To clear any override, use the special value `disable_override` or `null` + */ + validation_override_mitigation_action?: 'none' | 'disable_override' | null; +} + +export interface SchemaValidationEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: The default mitigation action used when there is no mitigation + * action defined on the operation Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + * + * `null` will have no effect. + */ + validation_default_mitigation_action?: 'none' | 'log' | 'block' | null; + + /** + * Body param: When set, this overrides both zone level and operation level + * mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * + * To clear any override, use the special value `disable_override` + * + * `null` will have no effect. + */ + validation_override_mitigation_action?: 'none' | 'disable_override' | null; +} + +export interface SchemaValidationGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +export declare namespace SchemaValidation { + export { + type SchemaValidationUpdateParams as SchemaValidationUpdateParams, + type SchemaValidationEditParams as SchemaValidationEditParams, + type SchemaValidationGetParams as SchemaValidationGetParams, + }; +} diff --git a/src/resources/api-gateway/settings/settings.ts b/src/resources/api-gateway/settings/settings.ts new file mode 100644 index 0000000000..505baddce3 --- /dev/null +++ b/src/resources/api-gateway/settings/settings.ts @@ -0,0 +1,56 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as SchemaValidationAPI from './schema-validation'; +import { + SchemaValidation, + SchemaValidationEditParams, + SchemaValidationGetParams, + SchemaValidationUpdateParams, +} from './schema-validation'; + +/** + * @deprecated Please use the [Schema Validation Settings](https://developers.cloudflare.com/api/resources/schema_validation/subresources/settings/) APIs instead + */ +export class Settings extends APIResource { + schemaValidation: SchemaValidationAPI.SchemaValidation = new SchemaValidationAPI.SchemaValidation( + this._client, + ); +} + +export interface Settings { + /** + * The default mitigation action used when there is no mitigation action defined on + * the operation + * + * Mitigation actions are as follows: + * + * - `log` - log request when request does not conform to schema + * - `block` - deny access to the site when request does not conform to schema + * + * A special value of of `none` will skip running schema validation entirely for + * the request when there is no mitigation action defined on the operation + */ + validation_default_mitigation_action?: 'none' | 'log' | 'block'; + + /** + * When set, this overrides both zone level and operation level mitigation actions. + * + * - `none` will skip running schema validation entirely for the request + * - `null` indicates that no override is in place + */ + validation_override_mitigation_action?: 'none' | null; +} + +Settings.SchemaValidation = SchemaValidation; + +export declare namespace Settings { + export { type Settings as Settings }; + + export { + SchemaValidation as SchemaValidation, + type SchemaValidationUpdateParams as SchemaValidationUpdateParams, + type SchemaValidationEditParams as SchemaValidationEditParams, + type SchemaValidationGetParams as SchemaValidationGetParams, + }; +} diff --git a/src/resources/api-gateway/user-schemas.ts b/src/resources/api-gateway/user-schemas.ts new file mode 100644 index 0000000000..62f21ce9c4 --- /dev/null +++ b/src/resources/api-gateway/user-schemas.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './user-schemas/index'; diff --git a/src/resources/api-gateway/user-schemas/hosts.ts b/src/resources/api-gateway/user-schemas/hosts.ts new file mode 100644 index 0000000000..9f3c20449a --- /dev/null +++ b/src/resources/api-gateway/user-schemas/hosts.ts @@ -0,0 +1,62 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Hosts extends APIResource { + /** + * Retrieve schema hosts in a zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + list( + params: HostListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/user_schemas/hosts`, + HostListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class HostListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface HostListResponse { + created_at: string; + + /** + * Hosts serving the schema, e.g zone.host.com + */ + hosts: Array; + + /** + * Name of the schema + */ + name: string; + + /** + * UUID. + */ + schema_id: string; +} + +export interface HostListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; +} + +Hosts.HostListResponsesV4PagePaginationArray = HostListResponsesV4PagePaginationArray; + +export declare namespace Hosts { + export { + type HostListResponse as HostListResponse, + HostListResponsesV4PagePaginationArray as HostListResponsesV4PagePaginationArray, + type HostListParams as HostListParams, + }; +} diff --git a/src/resources/api-gateway/user-schemas/index.ts b/src/resources/api-gateway/user-schemas/index.ts new file mode 100644 index 0000000000..73dd44c925 --- /dev/null +++ b/src/resources/api-gateway/user-schemas/index.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + HostListResponsesV4PagePaginationArray, + Hosts, + type HostListResponse, + type HostListParams, +} from './hosts'; +export { + OldPublicSchemasV4PagePaginationArray, + UserSchemas, + type Message, + type OldPublicSchema, + type UserSchemaCreateResponse, + type UserSchemaDeleteResponse, + type UserSchemaCreateParams, + type UserSchemaListParams, + type UserSchemaDeleteParams, + type UserSchemaEditParams, + type UserSchemaGetParams, +} from './user-schemas'; +export { + OperationListResponsesV4PagePaginationArray, + Operations, + type OperationListResponse, + type OperationListParams, +} from './operations'; diff --git a/src/resources/api-gateway/user-schemas/operations.ts b/src/resources/api-gateway/user-schemas/operations.ts new file mode 100644 index 0000000000..e160ab32ce --- /dev/null +++ b/src/resources/api-gateway/user-schemas/operations.ts @@ -0,0 +1,377 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +export class Operations extends APIResource { + /** + * Retrieves all operations from the schema. Operations that already exist in API + * Shield Endpoint Management will be returned as full operations. + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + list( + schemaId: string, + params: OperationListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/user_schemas/${schemaId}/operations`, + OperationListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } +} + +export class OperationListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export type OperationListResponse = + | OperationListResponse.APIShieldOperation + | OperationListResponse.APIShieldBasicOperation; + +export namespace OperationListResponse { + export interface APIShieldOperation { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + last_updated: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + + /** + * UUID. + */ + operation_id: string; + + features?: + | APIShieldOperation.APIShieldOperationFeatureThresholds + | APIShieldOperation.APIShieldOperationFeatureParameterSchemas + | APIShieldOperation.APIShieldOperationFeatureAPIRouting + | APIShieldOperation.APIShieldOperationFeatureConfidenceIntervals + | APIShieldOperation.APIShieldOperationFeatureSchemaInfo; + } + + export namespace APIShieldOperation { + export interface APIShieldOperationFeatureThresholds { + thresholds?: APIShieldOperationFeatureThresholds.Thresholds; + } + + export namespace APIShieldOperationFeatureThresholds { + export interface Thresholds { + /** + * The total number of auth-ids seen across this calculation. + */ + auth_id_tokens?: number; + + /** + * The number of data points used for the threshold suggestion calculation. + */ + data_points?: number; + + last_updated?: string; + + /** + * The p50 quantile of requests (in period_seconds). + */ + p50?: number; + + /** + * The p90 quantile of requests (in period_seconds). + */ + p90?: number; + + /** + * The p99 quantile of requests (in period_seconds). + */ + p99?: number; + + /** + * The period over which this threshold is suggested. + */ + period_seconds?: number; + + /** + * The estimated number of requests covered by these calculations. + */ + requests?: number; + + /** + * The suggested threshold in requests done by the same auth_id or period_seconds. + */ + suggested_threshold?: number; + } + } + + export interface APIShieldOperationFeatureParameterSchemas { + parameter_schemas: APIShieldOperationFeatureParameterSchemas.ParameterSchemas; + } + + export namespace APIShieldOperationFeatureParameterSchemas { + export interface ParameterSchemas { + last_updated?: string; + + /** + * An operation schema object containing a response. + */ + parameter_schemas?: ParameterSchemas.ParameterSchemas; + } + + export namespace ParameterSchemas { + /** + * An operation schema object containing a response. + */ + export interface ParameterSchemas { + /** + * An array containing the learned parameter schemas. + */ + parameters?: Array; + + /** + * An empty response object. This field is required to yield a valid operation + * schema. + */ + responses?: unknown | null; + } + } + } + + export interface APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + api_routing?: APIShieldOperationFeatureAPIRouting.APIRouting; + } + + export namespace APIShieldOperationFeatureAPIRouting { + /** + * API Routing settings on endpoint. + */ + export interface APIRouting { + last_updated?: string; + + /** + * Target route. + */ + route?: string; + } + } + + export interface APIShieldOperationFeatureConfidenceIntervals { + confidence_intervals?: APIShieldOperationFeatureConfidenceIntervals.ConfidenceIntervals; + } + + export namespace APIShieldOperationFeatureConfidenceIntervals { + export interface ConfidenceIntervals { + last_updated?: string; + + suggested_threshold?: ConfidenceIntervals.SuggestedThreshold; + } + + export namespace ConfidenceIntervals { + export interface SuggestedThreshold { + confidence_intervals?: SuggestedThreshold.ConfidenceIntervals; + + /** + * Suggested threshold. + */ + mean?: number; + } + + export namespace SuggestedThreshold { + export interface ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + p90?: ConfidenceIntervals.P90; + + /** + * Upper and lower bound for percentile estimate + */ + p95?: ConfidenceIntervals.P95; + + /** + * Upper and lower bound for percentile estimate + */ + p99?: ConfidenceIntervals.P99; + } + + export namespace ConfidenceIntervals { + /** + * Upper and lower bound for percentile estimate + */ + export interface P90 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P95 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + + /** + * Upper and lower bound for percentile estimate + */ + export interface P99 { + /** + * Lower bound for percentile estimate + */ + lower?: number; + + /** + * Upper bound for percentile estimate + */ + upper?: number; + } + } + } + } + } + + export interface APIShieldOperationFeatureSchemaInfo { + schema_info?: APIShieldOperationFeatureSchemaInfo.SchemaInfo; + } + + export namespace APIShieldOperationFeatureSchemaInfo { + export interface SchemaInfo { + /** + * Schema active on endpoint. + */ + active_schema?: SchemaInfo.ActiveSchema; + + /** + * True if a Cloudflare-provided learned schema is available for this endpoint. + */ + learned_available?: boolean; + + /** + * Action taken on requests failing validation. + */ + mitigation_action?: 'none' | 'log' | 'block' | null; + } + + export namespace SchemaInfo { + /** + * Schema active on endpoint. + */ + export interface ActiveSchema { + /** + * UUID. + */ + id?: string; + + created_at?: string; + + /** + * True if schema is Cloudflare-provided. + */ + is_learned?: boolean; + + /** + * Schema file name. + */ + name?: string; + } + } + } + } + + export interface APIShieldBasicOperation { + /** + * The endpoint which can contain path parameter templates in curly braces, each + * will be replaced from left to right with {varN}, starting with {var1}, during + * insertion. This will further be Cloudflare-normalized upon insertion. See: + * https://developers.cloudflare.com/rules/normalization/how-it-works/. + */ + endpoint: string; + + /** + * RFC3986-compliant host. + */ + host: string; + + /** + * The HTTP method used to access the endpoint. + */ + method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; + } +} + +export interface OperationListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Filter results to only include endpoints containing this pattern. + */ + endpoint?: string; + + /** + * Query param: Add feature(s) to the results. The feature name that is given here + * corresponds to the resulting feature object. Have a look at the top-level object + * description for more details on the specific meaning. + */ + feature?: Array<'thresholds' | 'parameter_schemas' | 'schema_info'>; + + /** + * Query param: Filter results to only include the specified hosts. + */ + host?: Array; + + /** + * Query param: Filter results to only include the specified HTTP methods. + */ + method?: Array; + + /** + * Query param: Filter results by whether operations exist in API Shield Endpoint + * Management or not. `new` will just return operations from the schema that do not + * exist in API Shield Endpoint Management. `existing` will just return operations + * from the schema that already exist in API Shield Endpoint Management. + */ + operation_status?: 'new' | 'existing'; +} + +Operations.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; + +export declare namespace Operations { + export { + type OperationListResponse as OperationListResponse, + OperationListResponsesV4PagePaginationArray as OperationListResponsesV4PagePaginationArray, + type OperationListParams as OperationListParams, + }; +} diff --git a/src/resources/api-gateway/user-schemas/user-schemas.ts b/src/resources/api-gateway/user-schemas/user-schemas.ts new file mode 100644 index 0000000000..e2e0aaf6c2 --- /dev/null +++ b/src/resources/api-gateway/user-schemas/user-schemas.ts @@ -0,0 +1,318 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import * as HostsAPI from './hosts'; +import { HostListParams, HostListResponse, HostListResponsesV4PagePaginationArray, Hosts } from './hosts'; +import * as OperationsAPI from './operations'; +import { + OperationListParams, + OperationListResponse, + OperationListResponsesV4PagePaginationArray, + Operations, +} from './operations'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; + +/** + * @deprecated Please use the [Schema Validation](https://developers.cloudflare.com/api/resources/schema_validation/) APIs instead + */ +export class UserSchemas extends APIResource { + operations: OperationsAPI.Operations = new OperationsAPI.Operations(this._client); + hosts: HostsAPI.Hosts = new HostsAPI.Hosts(this._client); + + /** + * Upload a schema to a zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + create( + params: UserSchemaCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post( + `/zones/${zone_id}/api_gateway/user_schemas`, + Core.multipartFormRequestOptions({ body, ...options }), + ) as Core.APIPromise<{ result: UserSchemaCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve information about all schemas on a zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + list( + params: UserSchemaListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList( + `/zones/${zone_id}/api_gateway/user_schemas`, + OldPublicSchemasV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Delete a schema + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + delete( + schemaId: string, + params: UserSchemaDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.delete(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, options); + } + + /** + * Enable validation for a schema + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + edit( + schemaId: string, + params: UserSchemaEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.patch(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: OldPublicSchema }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieve information about a specific schema on a zone + * + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. + */ + get( + schemaId: string, + params: UserSchemaGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...query } = params; + return ( + this._client.get(`/zones/${zone_id}/api_gateway/user_schemas/${schemaId}`, { + query, + ...options, + }) as Core.APIPromise<{ result: OldPublicSchema }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class OldPublicSchemasV4PagePaginationArray extends V4PagePaginationArray {} + +export type Message = Array; + +export namespace Message { + export interface MessageItem { + code: number; + + message: string; + + documentation_url?: string; + + source?: MessageItem.Source; + } + + export namespace MessageItem { + export interface Source { + pointer?: string; + } + } +} + +export interface OldPublicSchema { + created_at: string; + + /** + * Kind of schema + */ + kind: 'openapi_v3'; + + /** + * Name of the schema + */ + name: string; + + /** + * UUID. + */ + schema_id: string; + + /** + * Source of the schema + */ + source?: string; + + /** + * Flag whether schema is enabled for validation. + */ + validation_enabled?: boolean; +} + +export interface UserSchemaCreateResponse { + schema: OldPublicSchema; + + upload_details?: UserSchemaCreateResponse.UploadDetails; +} + +export namespace UserSchemaCreateResponse { + export interface UploadDetails { + /** + * Diagnostic warning events that occurred during processing. These events are + * non-critical errors found within the schema. + */ + warnings?: Array; + } + + export namespace UploadDetails { + export interface Warning { + /** + * Code that identifies the event that occurred. + */ + code: number; + + /** + * JSONPath location(s) in the schema where these events were encountered. See + * [https://goessner.net/articles/JsonPath/](https://goessner.net/articles/JsonPath/) + * for JSONPath specification. + */ + locations?: Array; + + /** + * Diagnostic message that describes the event. + */ + message?: string; + } + } +} + +export interface UserSchemaDeleteResponse { + errors: Message; + + messages: Message; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export interface UserSchemaCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Schema file bytes + */ + file: Core.Uploadable; + + /** + * Body param: Kind of schema + */ + kind: 'openapi_v3'; + + /** + * Body param: Name of the schema + */ + name?: string; + + /** + * Body param: Flag whether schema is enabled for validation. + */ + validation_enabled?: 'true' | 'false'; +} + +export interface UserSchemaListParams extends V4PagePaginationArrayParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Omit the source-files of schemas and only retrieve their meta-data. + */ + omit_source?: boolean; + + /** + * Query param: Flag whether schema is enabled for validation. + */ + validation_enabled?: boolean; +} + +export interface UserSchemaDeleteParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface UserSchemaEditParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: Flag whether schema is enabled for validation. + */ + validation_enabled?: true; +} + +export interface UserSchemaGetParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Query param: Omit the source-files of schemas and only retrieve their meta-data. + */ + omit_source?: boolean; +} + +UserSchemas.OldPublicSchemasV4PagePaginationArray = OldPublicSchemasV4PagePaginationArray; +UserSchemas.Operations = Operations; +UserSchemas.OperationListResponsesV4PagePaginationArray = OperationListResponsesV4PagePaginationArray; +UserSchemas.Hosts = Hosts; +UserSchemas.HostListResponsesV4PagePaginationArray = HostListResponsesV4PagePaginationArray; + +export declare namespace UserSchemas { + export { + type Message as Message, + type OldPublicSchema as OldPublicSchema, + type UserSchemaCreateResponse as UserSchemaCreateResponse, + type UserSchemaDeleteResponse as UserSchemaDeleteResponse, + OldPublicSchemasV4PagePaginationArray as OldPublicSchemasV4PagePaginationArray, + type UserSchemaCreateParams as UserSchemaCreateParams, + type UserSchemaListParams as UserSchemaListParams, + type UserSchemaDeleteParams as UserSchemaDeleteParams, + type UserSchemaEditParams as UserSchemaEditParams, + type UserSchemaGetParams as UserSchemaGetParams, + }; + + export { + Operations as Operations, + type OperationListResponse as OperationListResponse, + OperationListResponsesV4PagePaginationArray as OperationListResponsesV4PagePaginationArray, + type OperationListParams as OperationListParams, + }; + + export { + Hosts as Hosts, + type HostListResponse as HostListResponse, + HostListResponsesV4PagePaginationArray as HostListResponsesV4PagePaginationArray, + type HostListParams as HostListParams, + }; +} diff --git a/src/resources/argo.ts b/src/resources/argo.ts new file mode 100644 index 0000000000..3be0c293f0 --- /dev/null +++ b/src/resources/argo.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './argo/index'; diff --git a/src/resources/argo/argo.ts b/src/resources/argo/argo.ts index fb7e781ea8..3de020a9ef 100644 --- a/src/resources/argo/argo.ts +++ b/src/resources/argo/argo.ts @@ -1,23 +1,45 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'cloudflare/resource'; -import * as SmartRoutingAPI from 'cloudflare/resources/argo/smart-routing'; -import * as TieredCachingAPI from 'cloudflare/resources/argo/tiered-caching'; +import { APIResource } from '../../resource'; +import * as SmartRoutingAPI from './smart-routing'; +import { + SmartRouting, + SmartRoutingEditParams, + SmartRoutingEditResponse, + SmartRoutingGetParams, + SmartRoutingGetResponse, +} from './smart-routing'; +import * as TieredCachingAPI from './tiered-caching'; +import { + TieredCaching, + TieredCachingEditParams, + TieredCachingEditResponse, + TieredCachingGetParams, + TieredCachingGetResponse, +} from './tiered-caching'; export class Argo extends APIResource { smartRouting: SmartRoutingAPI.SmartRouting = new SmartRoutingAPI.SmartRouting(this._client); tieredCaching: TieredCachingAPI.TieredCaching = new TieredCachingAPI.TieredCaching(this._client); } -export namespace Argo { - export import SmartRouting = SmartRoutingAPI.SmartRouting; - export import SmartRoutingEditResponse = SmartRoutingAPI.SmartRoutingEditResponse; - export import SmartRoutingGetResponse = SmartRoutingAPI.SmartRoutingGetResponse; - export import SmartRoutingEditParams = SmartRoutingAPI.SmartRoutingEditParams; - export import SmartRoutingGetParams = SmartRoutingAPI.SmartRoutingGetParams; - export import TieredCaching = TieredCachingAPI.TieredCaching; - export import TieredCachingEditResponse = TieredCachingAPI.TieredCachingEditResponse; - export import TieredCachingGetResponse = TieredCachingAPI.TieredCachingGetResponse; - export import TieredCachingEditParams = TieredCachingAPI.TieredCachingEditParams; - export import TieredCachingGetParams = TieredCachingAPI.TieredCachingGetParams; +Argo.SmartRouting = SmartRouting; +Argo.TieredCaching = TieredCaching; + +export declare namespace Argo { + export { + SmartRouting as SmartRouting, + type SmartRoutingEditResponse as SmartRoutingEditResponse, + type SmartRoutingGetResponse as SmartRoutingGetResponse, + type SmartRoutingEditParams as SmartRoutingEditParams, + type SmartRoutingGetParams as SmartRoutingGetParams, + }; + + export { + TieredCaching as TieredCaching, + type TieredCachingEditResponse as TieredCachingEditResponse, + type TieredCachingGetResponse as TieredCachingGetResponse, + type TieredCachingEditParams as TieredCachingEditParams, + type TieredCachingGetParams as TieredCachingGetParams, + }; } diff --git a/src/resources/argo/index.ts b/src/resources/argo/index.ts index f4dd5239de..3666abc83a 100644 --- a/src/resources/argo/index.ts +++ b/src/resources/argo/index.ts @@ -1,17 +1,17 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Argo } from './argo'; export { - SmartRoutingEditResponse, - SmartRoutingGetResponse, - SmartRoutingEditParams, - SmartRoutingGetParams, SmartRouting, + type SmartRoutingEditResponse, + type SmartRoutingGetResponse, + type SmartRoutingEditParams, + type SmartRoutingGetParams, } from './smart-routing'; export { - TieredCachingEditResponse, - TieredCachingGetResponse, - TieredCachingEditParams, - TieredCachingGetParams, TieredCaching, + type TieredCachingEditResponse, + type TieredCachingGetResponse, + type TieredCachingEditParams, + type TieredCachingGetParams, } from './tiered-caching'; diff --git a/src/resources/argo/smart-routing.ts b/src/resources/argo/smart-routing.ts index bc1ee39e9d..79790b6aa6 100644 --- a/src/resources/argo/smart-routing.ts +++ b/src/resources/argo/smart-routing.ts @@ -1,12 +1,19 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as SmartRoutingAPI from 'cloudflare/resources/argo/smart-routing'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class SmartRouting extends APIResource { /** - * Updates enablement of Argo Smart Routing. + * Configures the value of the Argo Smart Routing enablement setting. + * + * @example + * ```ts + * const response = await client.argo.smartRouting.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'on', + * }); + * ``` */ edit( params: SmartRoutingEditParams, @@ -21,7 +28,14 @@ export class SmartRouting extends APIResource { } /** - * Get Argo Smart Routing setting + * Retrieves the value of Argo Smart Routing enablement setting. + * + * @example + * ```ts + * const smartRouting = await client.argo.smartRouting.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: SmartRoutingGetParams, @@ -36,32 +50,74 @@ export class SmartRouting extends APIResource { } } -export type SmartRoutingEditResponse = unknown | string | null; +export interface SmartRoutingEditResponse { + /** + * Specifies the identifier of the Argo Smart Routing setting. + */ + id: string; + + /** + * Specifies if the setting is editable. + */ + editable: boolean; + + /** + * Specifies the enablement value of Argo Smart Routing. + */ + value: 'on' | 'off'; + + /** + * Specifies the time when the setting was last modified. + */ + modified_on?: string; +} -export type SmartRoutingGetResponse = unknown | string | null; +export interface SmartRoutingGetResponse { + /** + * Specifies the identifier of the Argo Smart Routing setting. + */ + id: string; + + /** + * Specifies if the setting is editable. + */ + editable: boolean; + + /** + * Specifies the enablement value of Argo Smart Routing. + */ + value: 'on' | 'off'; + + /** + * Specifies the time when the setting was last modified. + */ + modified_on?: string; +} export interface SmartRoutingEditParams { /** - * Path param: Identifier + * Path param: Specifies the zone associated with the API call. */ zone_id: string; /** - * Body param: Enables Argo Smart Routing. + * Body param: Specifies the enablement value of Argo Smart Routing. */ value: 'on' | 'off'; } export interface SmartRoutingGetParams { /** - * Identifier + * Specifies the zone associated with the API call. */ zone_id: string; } -export namespace SmartRouting { - export import SmartRoutingEditResponse = SmartRoutingAPI.SmartRoutingEditResponse; - export import SmartRoutingGetResponse = SmartRoutingAPI.SmartRoutingGetResponse; - export import SmartRoutingEditParams = SmartRoutingAPI.SmartRoutingEditParams; - export import SmartRoutingGetParams = SmartRoutingAPI.SmartRoutingGetParams; +export declare namespace SmartRouting { + export { + type SmartRoutingEditResponse as SmartRoutingEditResponse, + type SmartRoutingGetResponse as SmartRoutingGetResponse, + type SmartRoutingEditParams as SmartRoutingEditParams, + type SmartRoutingGetParams as SmartRoutingGetParams, + }; } diff --git a/src/resources/argo/tiered-caching.ts b/src/resources/argo/tiered-caching.ts index d3f84c37aa..9a4be3dac1 100644 --- a/src/resources/argo/tiered-caching.ts +++ b/src/resources/argo/tiered-caching.ts @@ -1,12 +1,29 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as TieredCachingAPI from 'cloudflare/resources/argo/tiered-caching'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class TieredCaching extends APIResource { /** - * Updates enablement of Tiered Caching + * Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + * lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + * (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + * to see if it has the content. If the upper-tier does not have the content, only + * the upper-tier can ask the origin for content. This practice improves bandwidth + * efficiency by limiting the number of data centers that can ask the origin for + * content, which reduces origin load and makes websites more cost-effective to + * operate. Additionally, Tiered Cache concentrates connections to origin servers + * so they come from a small number of data centers rather than the full set of + * network locations. This results in fewer open connections using server + * resources. + * + * @example + * ```ts + * const response = await client.argo.tieredCaching.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'on', + * }); + * ``` */ edit( params: TieredCachingEditParams, @@ -21,7 +38,24 @@ export class TieredCaching extends APIResource { } /** - * Get Tiered Caching setting + * Tiered Cache works by dividing Cloudflare's data centers into a hierarchy of + * lower-tiers and upper-tiers. If content is not cached in lower-tier data centers + * (generally the ones closest to a visitor), the lower-tier must ask an upper-tier + * to see if it has the content. If the upper-tier does not have the content, only + * the upper-tier can ask the origin for content. This practice improves bandwidth + * efficiency by limiting the number of data centers that can ask the origin for + * content, which reduces origin load and makes websites more cost-effective to + * operate. Additionally, Tiered Cache concentrates connections to origin servers + * so they come from a small number of data centers rather than the full set of + * network locations. This results in fewer open connections using server + * resources. + * + * @example + * ```ts + * const tieredCaching = await client.argo.tieredCaching.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: TieredCachingGetParams, @@ -36,13 +70,53 @@ export class TieredCaching extends APIResource { } } -export type TieredCachingEditResponse = unknown | string | null; +export interface TieredCachingEditResponse { + /** + * The identifier of the caching setting. + */ + id: 'tiered_caching'; + + /** + * Whether the setting is editable. + */ + editable: boolean; + + /** + * Value of the Tiered Cache zone setting. + */ + value: 'on' | 'off'; + + /** + * Last time this setting was modified. + */ + modified_on?: string | null; +} -export type TieredCachingGetResponse = unknown | string | null; +export interface TieredCachingGetResponse { + /** + * The identifier of the caching setting. + */ + id: 'tiered_caching'; + + /** + * Whether the setting is editable. + */ + editable: boolean; + + /** + * Value of the Tiered Cache zone setting. + */ + value: 'on' | 'off'; + + /** + * Last time this setting was modified. + */ + modified_on?: string | null; +} export interface TieredCachingEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -54,14 +128,16 @@ export interface TieredCachingEditParams { export interface TieredCachingGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } -export namespace TieredCaching { - export import TieredCachingEditResponse = TieredCachingAPI.TieredCachingEditResponse; - export import TieredCachingGetResponse = TieredCachingAPI.TieredCachingGetResponse; - export import TieredCachingEditParams = TieredCachingAPI.TieredCachingEditParams; - export import TieredCachingGetParams = TieredCachingAPI.TieredCachingGetParams; +export declare namespace TieredCaching { + export { + type TieredCachingEditResponse as TieredCachingEditResponse, + type TieredCachingGetResponse as TieredCachingGetResponse, + type TieredCachingEditParams as TieredCachingEditParams, + type TieredCachingGetParams as TieredCachingGetParams, + }; } diff --git a/src/resources/audit-logs.ts b/src/resources/audit-logs.ts index bd68a5388b..ef9d81b224 100644 --- a/src/resources/audit-logs.ts +++ b/src/resources/audit-logs.ts @@ -1,9 +1,10 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AuditLogsAPI from 'cloudflare/resources/audit-logs'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from 'cloudflare/pagination'; +import { APIResource } from '../resource'; +import * as Core from '../core'; +import * as Shared from './shared'; +import { AuditLogsV4PagePaginationArray } from './shared'; +import { type V4PagePaginationArrayParams } from '../pagination'; export class AuditLogs extends APIResource { /** @@ -13,112 +14,12 @@ export class AuditLogs extends APIResource { list( params: AuditLogListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/audit_logs`, - AuditLogListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } -} - -export class AuditLogListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface AuditLogListResponse { - /** - * A string that uniquely identifies the audit log. - */ - id?: string; - - action?: AuditLogListResponse.Action; - - actor?: AuditLogListResponse.Actor; - - /** - * The source of the event. - */ - interface?: string; - - /** - * An object which can lend more context to the action being logged. This is a - * flexible value and varies between different actions. - */ - metadata?: unknown; - - /** - * The new value of the resource that was modified. - */ - newValue?: string; - - /** - * The value of the resource before it was modified. - */ - oldValue?: string; - - owner?: AuditLogListResponse.Owner; - - resource?: AuditLogListResponse.Resource; - - /** - * A UTC RFC3339 timestamp that specifies when the action being logged occured. - */ - when?: string; -} - -export namespace AuditLogListResponse { - export interface Action { - /** - * A boolean that indicates if the action attempted was successful. - */ - result?: boolean; - - /** - * A short string that describes the action that was performed. - */ - type?: string; - } - - export interface Actor { - /** - * The ID of the actor that performed the action. If a user performed the action, - * this will be their User ID. - */ - id?: string; - - /** - * The email of the user that performed the action. - */ - email?: string; - - /** - * The IP address of the request that performed the action. - */ - ip?: string; - - /** - * The type of actor, whether a User, Cloudflare Admin, or an Automated System. - */ - type?: 'user' | 'admin' | 'Cloudflare'; - } - - export interface Owner { - /** - * Identifier - */ - id?: string; - } - - export interface Resource { - /** - * An identifier for the resource that was affected by the action. - */ - id?: string; - - /** - * A short string that describes the resource that was affected by the action. - */ - type?: string; + return this._client.getAPIList(`/accounts/${account_id}/audit_logs`, AuditLogsV4PagePaginationArray, { + query, + ...options, + }); } } @@ -134,21 +35,20 @@ export interface AuditLogListParams extends V4PagePaginationArrayParams { id?: string; /** - * Query param: + * Query param */ action?: AuditLogListParams.Action; /** - * Query param: + * Query param */ actor?: AuditLogListParams.Actor; /** * Query param: Limits the returned results to logs older than the specified date. - * This can be a date string `2019-04-30` or an absolute timestamp that conforms to - * RFC3339. + * A `full-date` that conforms to RFC3339. */ - before?: string; + before?: (string & {}) | (string & {}); /** * Query param: Changes the direction of the chronological sorting. @@ -167,13 +67,12 @@ export interface AuditLogListParams extends V4PagePaginationArrayParams { /** * Query param: Limits the returned results to logs newer than the specified date. - * This can be a date string `2019-04-30` or an absolute timestamp that conforms to - * RFC3339. + * A `full-date` that conforms to RFC3339. */ - since?: string; + since?: (string & {}) | (string & {}); /** - * Query param: + * Query param */ zone?: AuditLogListParams.Zone; } @@ -207,8 +106,8 @@ export namespace AuditLogListParams { } } -export namespace AuditLogs { - export import AuditLogListResponse = AuditLogsAPI.AuditLogListResponse; - export import AuditLogListResponsesV4PagePaginationArray = AuditLogsAPI.AuditLogListResponsesV4PagePaginationArray; - export import AuditLogListParams = AuditLogsAPI.AuditLogListParams; +export declare namespace AuditLogs { + export { type AuditLogListParams as AuditLogListParams }; } + +export { AuditLogsV4PagePaginationArray }; diff --git a/src/resources/available-plans.ts b/src/resources/available-plans.ts deleted file mode 100644 index 54ba4d9d42..0000000000 --- a/src/resources/available-plans.ts +++ /dev/null @@ -1,96 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AvailablePlansAPI from 'cloudflare/resources/available-plans'; - -export class AvailablePlans extends APIResource { - /** - * Lists available plans the zone can subscribe to. - */ - list( - zoneIdentifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneIdentifier}/available_plans`, options) as Core.APIPromise<{ - result: AvailablePlanListResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Details of the available plan that the zone can subscribe to. - */ - get( - zoneIdentifier: string, - planIdentifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.get( - `/zones/${zoneIdentifier}/available_plans/${planIdentifier}`, - options, - ) as Core.APIPromise<{ result: BillSubsAPIAvailableRatePlan }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface BillSubsAPIAvailableRatePlan { - /** - * Identifier - */ - id?: string; - - /** - * Indicates whether you can subscribe to this plan. - */ - can_subscribe?: boolean; - - /** - * The monetary unit in which pricing information is displayed. - */ - currency?: string; - - /** - * Indicates whether this plan is managed externally. - */ - externally_managed?: boolean; - - /** - * The frequency at which you will be billed for this plan. - */ - frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; - - /** - * Indicates whether you are currently subscribed to this plan. - */ - is_subscribed?: boolean; - - /** - * Indicates whether this plan has a legacy discount applied. - */ - legacy_discount?: boolean; - - /** - * The legacy identifier for this rate plan, if any. - */ - legacy_id?: string; - - /** - * The plan name. - */ - name?: string; - - /** - * The amount you will be billed for this plan. - */ - price?: number; -} - -export type AvailablePlanListResponse = Array; - -export namespace AvailablePlans { - export import BillSubsAPIAvailableRatePlan = AvailablePlansAPI.BillSubsAPIAvailableRatePlan; - export import AvailablePlanListResponse = AvailablePlansAPI.AvailablePlanListResponse; -} diff --git a/src/resources/available-rate-plans.ts b/src/resources/available-rate-plans.ts deleted file mode 100644 index df4856d9b9..0000000000 --- a/src/resources/available-rate-plans.ts +++ /dev/null @@ -1,133 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as AvailableRatePlansAPI from 'cloudflare/resources/available-rate-plans'; - -export class AvailableRatePlans extends APIResource { - /** - * Lists all rate plans the zone can subscribe to. - */ - get( - zoneIdentifier: string, - options?: Core.RequestOptions, - ): Core.APIPromise { - return ( - this._client.get(`/zones/${zoneIdentifier}/available_rate_plans`, options) as Core.APIPromise<{ - result: AvailableRatePlanGetResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface BillSubsRatePlan { - /** - * Plan identifier tag. - */ - id?: string; - - /** - * Array of available components values for the plan. - */ - components?: Array; - - /** - * The monetary unit in which pricing information is displayed. - */ - currency?: string; - - /** - * The duration of the plan subscription. - */ - duration?: number; - - /** - * The frequency at which you will be billed for this plan. - */ - frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; - - /** - * The plan name. - */ - name?: string; -} - -export namespace BillSubsRatePlan { - export interface Component { - /** - * The default amount allocated. - */ - default?: number; - - /** - * The unique component. - */ - name?: 'zones' | 'page_rules' | 'dedicated_certificates' | 'dedicated_certificates_custom'; - - /** - * The unit price of the addon. - */ - unit_price?: number; - } -} - -export type AvailableRatePlanGetResponse = - Array; - -export namespace AvailableRatePlanGetResponse { - export interface AvailableRatePlanGetResponseItem { - /** - * Plan identifier tag. - */ - id?: string; - - /** - * Array of available components values for the plan. - */ - components?: Array; - - /** - * The monetary unit in which pricing information is displayed. - */ - currency?: string; - - /** - * The duration of the plan subscription. - */ - duration?: number; - - /** - * The frequency at which you will be billed for this plan. - */ - frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; - - /** - * The plan name. - */ - name?: string; - } - - export namespace AvailableRatePlanGetResponseItem { - export interface Component { - /** - * The default amount allocated. - */ - default?: number; - - /** - * The unique component. - */ - name?: 'zones' | 'page_rules' | 'dedicated_certificates' | 'dedicated_certificates_custom'; - - /** - * The unit price of the addon. - */ - unit_price?: number; - } - } -} - -export namespace AvailableRatePlans { - export import BillSubsRatePlan = AvailableRatePlansAPI.BillSubsRatePlan; - export import AvailableRatePlanGetResponse = AvailableRatePlansAPI.AvailableRatePlanGetResponse; -} diff --git a/src/resources/billing.ts b/src/resources/billing.ts new file mode 100644 index 0000000000..565ff303e6 --- /dev/null +++ b/src/resources/billing.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './billing/index'; diff --git a/src/resources/billing/billing.ts b/src/resources/billing/billing.ts index 9f14a7657d..0348709db6 100644 --- a/src/resources/billing/billing.ts +++ b/src/resources/billing/billing.ts @@ -1,13 +1,19 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from 'cloudflare/resource'; -import * as ProfilesAPI from 'cloudflare/resources/billing/profiles'; +import { APIResource } from '../../resource'; +import * as ProfilesAPI from './profiles'; +import { ProfileGetParams, ProfileGetResponse, Profiles } from './profiles'; export class Billing extends APIResource { profiles: ProfilesAPI.Profiles = new ProfilesAPI.Profiles(this._client); } -export namespace Billing { - export import Profiles = ProfilesAPI.Profiles; - export import ProfileGetResponse = ProfilesAPI.ProfileGetResponse; +Billing.Profiles = Profiles; + +export declare namespace Billing { + export { + Profiles as Profiles, + type ProfileGetResponse as ProfileGetResponse, + type ProfileGetParams as ProfileGetParams, + }; } diff --git a/src/resources/billing/index.ts b/src/resources/billing/index.ts index cd46c35df7..76f1a80afd 100644 --- a/src/resources/billing/index.ts +++ b/src/resources/billing/index.ts @@ -1,4 +1,4 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Billing } from './billing'; -export { ProfileGetResponse, Profiles } from './profiles'; +export { Profiles, type ProfileGetResponse, type ProfileGetParams } from './profiles'; diff --git a/src/resources/billing/profiles.ts b/src/resources/billing/profiles.ts index 36419bcf9b..d3d6d969be 100644 --- a/src/resources/billing/profiles.ts +++ b/src/resources/billing/profiles.ts @@ -1,24 +1,114 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as ProfilesAPI from 'cloudflare/resources/billing/profiles'; +import { APIResource } from '../../resource'; +import * as Core from '../../core'; export class Profiles extends APIResource { /** * Gets the current billing profile for the account. + * + * @deprecated */ - get(accountIdentifier: unknown, options?: Core.RequestOptions): Core.APIPromise { + get(params: ProfileGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; return ( - this._client.get(`/accounts/${accountIdentifier}/billing/profile`, options) as Core.APIPromise<{ + this._client.get(`/accounts/${account_id}/billing/profile`, options) as Core.APIPromise<{ result: ProfileGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export type ProfileGetResponse = unknown | string | null; +export interface ProfileGetResponse { + /** + * Billing item identifier tag. + */ + id?: string; + + account_type?: string; + + address?: string; + + address2?: string; + + balance?: string; + + card_expiry_month?: number; + + card_expiry_year?: number; + + card_number?: string; + + city?: string; + + company?: string; + + country?: string; + + created_on?: string; + + device_data?: string; + + edited_on?: string; + + enterprise_billing_email?: string; + + enterprise_primary_email?: string; + + first_name?: string; + + is_partner?: boolean; + + last_name?: string; + + next_bill_date?: string; + + payment_address?: string; + + payment_address2?: string; + + payment_city?: string; + + payment_country?: string; + + payment_email?: string; + + payment_first_name?: string; + + payment_gateway?: string; + + payment_last_name?: string; + + payment_nonce?: string; + + payment_state?: string; + + payment_zipcode?: string; + + primary_email?: string; + + state?: string; + + tax_id_type?: string; + + telephone?: string; + + use_legacy?: boolean; + + validation_code?: string; + + vat?: string; + + zipcode?: string; +} + +export interface ProfileGetParams { + /** + * Identifier + */ + account_id: string; +} -export namespace Profiles { - export import ProfileGetResponse = ProfilesAPI.ProfileGetResponse; +export declare namespace Profiles { + export { type ProfileGetResponse as ProfileGetResponse, type ProfileGetParams as ProfileGetParams }; } diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index 304c957fd0..8db71dac25 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -1,8 +1,7 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as BotManagementAPI from 'cloudflare/resources/bot-management'; +import { APIResource } from '../resource'; +import * as Core from '../core'; export class BotManagement extends APIResource { /** @@ -15,7 +14,70 @@ export class BotManagement extends APIResource { * - **Bot Management for Enterprise** * * See [Bot Plans](https://developers.cloudflare.com/bots/plans/) for more - * information on the different plans + * information on the different plans \ + * If you recently upgraded or downgraded your plan, refer to the following examples + * to clean up old configurations. Copy and paste the example body to remove old zone + * configurations based on your current plan. + * + * #### Clean up configuration for Bot Fight Mode plan + * + * ```json + * { + * "sbfm_likely_automated": "allow", + * "sbfm_definitely_automated": "allow", + * "sbfm_verified_bots": "allow", + * "sbfm_static_resource_protection": false, + * "optimize_wordpress": false, + * "suppress_session_score": false + * } + * ``` + * + * #### Clean up configuration for SBFM Pro plan + * + * ```json + * { + * "sbfm_likely_automated": "allow", + * "fight_mode": false + * } + * ``` + * + * #### Clean up configuration for SBFM Biz plan + * + * ```json + * { + * "fight_mode": false + * } + * ``` + * + * #### Clean up configuration for BM Enterprise Subscription plan + * + * It is strongly recommended that you ensure you have + * [custom rules](https://developers.cloudflare.com/waf/custom-rules/) in place to + * protect your zone before disabling the SBFM rules. Without these protections, + * your zone is vulnerable to attacks. + * + * ```json + * { + * "sbfm_likely_automated": "allow", + * "sbfm_definitely_automated": "allow", + * "sbfm_verified_bots": "allow", + * "sbfm_static_resource_protection": false, + * "optimize_wordpress": false, + * "fight_mode": false + * } + * ``` + * + * @example + * ```ts + * const botManagement = await client.botManagement.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * ai_bots_protection: 'disabled', + * cf_robots_variant: 'off', + * crawler_protection: 'disabled', + * enable_js: true, + * fight_mode: true, + * }); + * ``` */ update( params: BotManagementUpdateParams, @@ -31,6 +93,13 @@ export class BotManagement extends APIResource { /** * Retrieve a zone's Bot Management Config + * + * @example + * ```ts + * const botManagement = await client.botManagement.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: BotManagementGetParams, @@ -45,340 +114,810 @@ export class BotManagement extends APIResource { } } -export type BotManagementUpdateResponse = - | BotManagementUpdateResponse.BotManagementBotFightModeConfig - | BotManagementUpdateResponse.BotManagementSbfmDefinitelyConfig - | BotManagementUpdateResponse.BotManagementSbfmLikelyConfig - | BotManagementUpdateResponse.BotManagementBmSubscriptionConfig; +export interface BotFightModeConfiguration { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; -export namespace BotManagementUpdateResponse { - export interface BotManagementBotFightModeConfig { + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Whether to enable Bot Fight Mode. + */ + fight_mode?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + stale_zone_configuration?: BotFightModeConfiguration.StaleZoneConfiguration; + + /** + * A read-only field that indicates whether the zone currently is running the + * latest ML model. + */ + using_latest_model?: boolean; +} + +export namespace BotFightModeConfiguration { + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + export interface StaleZoneConfiguration { /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + * Indicates that the zone's wordpress optimization for SBFM is turned on. */ - enable_js?: boolean; + optimize_wordpress?: boolean; /** - * Whether to enable Bot Fight Mode. + * Indicates that the zone's definitely automated requests are being blocked or + * challenged. */ - fight_mode?: boolean; + sbfm_definitely_automated?: string; + + /** + * Indicates that the zone's likely automated requests are being blocked or + * challenged. + */ + sbfm_likely_automated?: string; + + /** + * Indicates that the zone's static resource protection is turned on. + */ + sbfm_static_resource_protection?: string; + + /** + * Indicates that the zone's verified bot requests are being blocked. + */ + sbfm_verified_bots?: string; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Indicates that the zone's session score tracking is disabled. */ - using_latest_model?: boolean; + suppress_session_score?: boolean; } +} + +export interface BotFightModeConfigurationParam { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Whether to enable Bot Fight Mode. + */ + fight_mode?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; +} + +export interface SubscriptionConfiguration { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Automatically update to the newest bot detection models created by Cloudflare as + * they are released. + * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + */ + auto_update_model?: boolean; + + /** + * Indicates that the bot management cookie can be placed on end user devices + * accessing the site. Defaults to true + */ + bm_cookie_enabled?: boolean; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + stale_zone_configuration?: SubscriptionConfiguration.StaleZoneConfiguration; - export interface BotManagementSbfmDefinitelyConfig { + /** + * Whether to disable tracking the highest bot score for a session in the Bot + * Management cookie. + */ + suppress_session_score?: boolean; + + /** + * A read-only field that indicates whether the zone currently is running the + * latest ML model. + */ + using_latest_model?: boolean; +} + +export namespace SubscriptionConfiguration { + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + export interface StaleZoneConfiguration { /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + * Indicates that the zone's Bot Fight Mode is turned on. */ - enable_js?: boolean; + fight_mode?: boolean; /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. + * Indicates that the zone's wordpress optimization for SBFM is turned on. */ optimize_wordpress?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + * Indicates that the zone's definitely automated requests are being blocked or + * challenged. */ - sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + sbfm_definitely_automated?: string; /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. + * Indicates that the zone's likely automated requests are being blocked or + * challenged. */ - sbfm_static_resource_protection?: boolean; + sbfm_likely_automated?: string; /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + * Indicates that the zone's static resource protection is turned on. */ - sbfm_verified_bots?: 'allow' | 'block'; + sbfm_static_resource_protection?: string; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Indicates that the zone's verified bot requests are being blocked. */ - using_latest_model?: boolean; + sbfm_verified_bots?: string; } +} - export interface BotManagementSbfmLikelyConfig { - /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; +export interface SubscriptionConfigurationParam { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Automatically update to the newest bot detection models created by Cloudflare as + * they are released. + * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + */ + auto_update_model?: boolean; + + /** + * Indicates that the bot management cookie can be placed on end user devices + * accessing the site. Defaults to true + */ + bm_cookie_enabled?: boolean; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Whether to disable tracking the highest bot score for a session in the Bot + * Management cookie. + */ + suppress_session_score?: boolean; +} + +export interface SuperBotFightModeDefinitelyConfiguration { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Whether to optimize Super Bot Fight Mode protections for Wordpress. + */ + optimize_wordpress?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + */ + sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + + /** + * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + * static resources on your application need bot protection. Note: Static resource + * protection can also result in legitimate traffic being blocked. + */ + sbfm_static_resource_protection?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + */ + sbfm_verified_bots?: 'allow' | 'block'; + + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + stale_zone_configuration?: SuperBotFightModeDefinitelyConfiguration.StaleZoneConfiguration; + + /** + * A read-only field that indicates whether the zone currently is running the + * latest ML model. + */ + using_latest_model?: boolean; +} + +export namespace SuperBotFightModeDefinitelyConfiguration { + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + export interface StaleZoneConfiguration { /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. + * Indicates that the zone's Bot Fight Mode is turned on. */ - optimize_wordpress?: boolean; + fight_mode?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + * Indicates that the zone's likely automated requests are being blocked or + * challenged. */ - sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + sbfm_likely_automated?: string; + } +} +export interface SuperBotFightModeDefinitelyConfigurationParam { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Whether to optimize Super Bot Fight Mode protections for Wordpress. + */ + optimize_wordpress?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + */ + sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + + /** + * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + * static resources on your application need bot protection. Note: Static resource + * protection can also result in legitimate traffic being blocked. + */ + sbfm_static_resource_protection?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + */ + sbfm_verified_bots?: 'allow' | 'block'; +} + +export interface SuperBotFightModeLikelyConfiguration { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Whether to optimize Super Bot Fight Mode protections for Wordpress. + */ + optimize_wordpress?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + */ + sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + + /** + * Super Bot Fight Mode (SBFM) action to take on likely automated requests. + */ + sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; + + /** + * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + * static resources on your application need bot protection. Note: Static resource + * protection can also result in legitimate traffic being blocked. + */ + sbfm_static_resource_protection?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + */ + sbfm_verified_bots?: 'allow' | 'block'; + + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + stale_zone_configuration?: SuperBotFightModeLikelyConfiguration.StaleZoneConfiguration; + + /** + * A read-only field that indicates whether the zone currently is running the + * latest ML model. + */ + using_latest_model?: boolean; +} + +export namespace SuperBotFightModeLikelyConfiguration { + /** + * A read-only field that shows which unauthorized settings are currently active on + * the zone. These settings typically result from upgrades or downgrades. + */ + export interface StaleZoneConfiguration { /** - * Super Bot Fight Mode (SBFM) action to take on likely automated requests. + * Indicates that the zone's Bot Fight Mode is turned on. */ - sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; + fight_mode?: boolean; + } +} + +export interface SuperBotFightModeLikelyConfigurationParam { + /** + * Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Use lightweight, invisible JavaScript detections to improve Bot Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Whether to optimize Super Bot Fight Mode protections for Wordpress. + */ + optimize_wordpress?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + */ + sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; + + /** + * Super Bot Fight Mode (SBFM) action to take on likely automated requests. + */ + sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; + /** + * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if + * static resources on your application need bot protection. Note: Static resource + * protection can also result in legitimate traffic being blocked. + */ + sbfm_static_resource_protection?: boolean; + + /** + * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + */ + sbfm_verified_bots?: 'allow' | 'block'; +} + +export type BotManagementUpdateResponse = + | BotFightModeConfiguration + | SuperBotFightModeDefinitelyConfiguration + | SuperBotFightModeLikelyConfiguration + | SubscriptionConfiguration; + +export type BotManagementGetResponse = + | BotFightModeConfiguration + | SuperBotFightModeDefinitelyConfiguration + | SuperBotFightModeLikelyConfiguration + | SubscriptionConfiguration; + +export type BotManagementUpdateParams = + | BotManagementUpdateParams.BotFightModeConfiguration + | BotManagementUpdateParams.SuperBotFightModeDefinitelyConfiguration + | BotManagementUpdateParams.SuperBotFightModeLikelyConfiguration + | BotManagementUpdateParams.SubscriptionConfiguration; + +export declare namespace BotManagementUpdateParams { + export interface BotFightModeConfiguration { /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. + * Path param: Identifier. */ - sbfm_static_resource_protection?: boolean; + zone_id: string; /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + * Body param: Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. */ - sbfm_verified_bots?: 'allow' | 'block'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Body param: Specifies the Robots Access Control License variant to use. */ - using_latest_model?: boolean; - } + cf_robots_variant?: 'off' | 'policy_only'; - export interface BotManagementBmSubscriptionConfig { /** - * Automatically update to the newest bot detection models created by Cloudflare as - * they are released. - * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ - auto_update_model?: boolean; + crawler_protection?: 'enabled' | 'disabled'; /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. + * Body param: Use lightweight, invisible JavaScript detections to improve Bot + * Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). */ enable_js?: boolean; /** - * Whether to disable tracking the highest bot score for a session in the Bot - * Management cookie. + * Body param: Whether to enable Bot Fight Mode. */ - suppress_session_score?: boolean; + fight_mode?: boolean; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. */ - using_latest_model?: boolean; + is_robots_txt_managed?: boolean; } -} -export type BotManagementGetResponse = - | BotManagementGetResponse.BotManagementBotFightModeConfig - | BotManagementGetResponse.BotManagementSbfmDefinitelyConfig - | BotManagementGetResponse.BotManagementSbfmLikelyConfig - | BotManagementGetResponse.BotManagementBmSubscriptionConfig; + export interface SuperBotFightModeDefinitelyConfiguration { + /** + * Path param: Identifier. + */ + zone_id: string; -export namespace BotManagementGetResponse { - export interface BotManagementBotFightModeConfig { /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + * Body param: Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. */ - enable_js?: boolean; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** - * Whether to enable Bot Fight Mode. + * Body param: Specifies the Robots Access Control License variant to use. */ - fight_mode?: boolean; + cf_robots_variant?: 'off' | 'policy_only'; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ - using_latest_model?: boolean; - } + crawler_protection?: 'enabled' | 'disabled'; - export interface BotManagementSbfmDefinitelyConfig { /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. + * Body param: Use lightweight, invisible JavaScript detections to improve Bot + * Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). */ enable_js?: boolean; /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. */ optimize_wordpress?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + * Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated + * requests. */ sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. + * Body param: Super Bot Fight Mode (SBFM) to enable static resource protection. + * Enable if static resources on your application need bot protection. Note: Static + * resource protection can also result in legitimate traffic being blocked. */ sbfm_static_resource_protection?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + * Body param: Super Bot Fight Mode (SBFM) action to take on verified bots + * requests. */ sbfm_verified_bots?: 'allow' | 'block'; + } + export interface SuperBotFightModeLikelyConfiguration { /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Path param: Identifier. */ - using_latest_model?: boolean; - } + zone_id: string; + + /** + * Body param: Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + + /** + * Body param: Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; - export interface BotManagementSbfmLikelyConfig { /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + + /** + * Body param: Use lightweight, invisible JavaScript detections to improve Bot + * Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). */ enable_js?: boolean; /** - * Whether to optimize Super Bot Fight Mode protections for Wordpress. + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + + /** + * Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. */ optimize_wordpress?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on definitely automated requests. + * Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated + * requests. */ sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; /** - * Super Bot Fight Mode (SBFM) action to take on likely automated requests. + * Body param: Super Bot Fight Mode (SBFM) action to take on likely automated + * requests. */ sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; /** - * Super Bot Fight Mode (SBFM) to enable static resource protection. Enable if - * static resources on your application need bot protection. Note: Static resource - * protection can also result in legitimate traffic being blocked. + * Body param: Super Bot Fight Mode (SBFM) to enable static resource protection. + * Enable if static resources on your application need bot protection. Note: Static + * resource protection can also result in legitimate traffic being blocked. */ sbfm_static_resource_protection?: boolean; /** - * Super Bot Fight Mode (SBFM) action to take on verified bots requests. + * Body param: Super Bot Fight Mode (SBFM) action to take on verified bots + * requests. */ sbfm_verified_bots?: 'allow' | 'block'; + } + export interface SubscriptionConfiguration { /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Path param: Identifier. */ - using_latest_model?: boolean; - } + zone_id: string; + + /** + * Body param: Enable rule to block AI Scrapers and Crawlers. Please note the value + * `only_on_ad_pages` is currently not available for Enterprise customers. + */ + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; - export interface BotManagementBmSubscriptionConfig { /** - * Automatically update to the newest bot detection models created by Cloudflare as - * they are released. + * Body param: Automatically update to the newest bot detection models created by + * Cloudflare as they are released. * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) */ auto_update_model?: boolean; /** - * Use lightweight, invisible JavaScript detections to improve Bot Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + * Body param: Indicates that the bot management cookie can be placed on end user + * devices accessing the site. Defaults to true */ - enable_js?: boolean; + bm_cookie_enabled?: boolean; /** - * Whether to disable tracking the highest bot score for a session in the Bot - * Management cookie. + * Body param: Specifies the Robots Access Control License variant to use. */ - suppress_session_score?: boolean; + cf_robots_variant?: 'off' | 'policy_only'; /** - * A read-only field that indicates whether the zone currently is running the - * latest ML model. + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ - using_latest_model?: boolean; - } -} - -export interface BotManagementUpdateParams { - /** - * Path param: Identifier - */ - zone_id: string; - - /** - * Body param: Automatically update to the newest bot detection models created by - * Cloudflare as they are released. - * [Learn more.](https://developers.cloudflare.com/bots/reference/machine-learning-models#model-versions-and-release-notes) - */ - auto_update_model?: boolean; - - /** - * Body param: Use lightweight, invisible JavaScript detections to improve Bot - * Management. - * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). - */ - enable_js?: boolean; - - /** - * Body param: Whether to enable Bot Fight Mode. - */ - fight_mode?: boolean; - - /** - * Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. - */ - optimize_wordpress?: boolean; - - /** - * Body param: Super Bot Fight Mode (SBFM) action to take on definitely automated - * requests. - */ - sbfm_definitely_automated?: 'allow' | 'block' | 'managed_challenge'; - - /** - * Body param: Super Bot Fight Mode (SBFM) action to take on likely automated - * requests. - */ - sbfm_likely_automated?: 'allow' | 'block' | 'managed_challenge'; + crawler_protection?: 'enabled' | 'disabled'; - /** - * Body param: Super Bot Fight Mode (SBFM) to enable static resource protection. - * Enable if static resources on your application need bot protection. Note: Static - * resource protection can also result in legitimate traffic being blocked. - */ - sbfm_static_resource_protection?: boolean; + /** + * Body param: Use lightweight, invisible JavaScript detections to improve Bot + * Management. + * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). + */ + enable_js?: boolean; - /** - * Body param: Super Bot Fight Mode (SBFM) action to take on verified bots - * requests. - */ - sbfm_verified_bots?: 'allow' | 'block'; + /** + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; - /** - * Body param: Whether to disable tracking the highest bot score for a session in - * the Bot Management cookie. - */ - suppress_session_score?: boolean; + /** + * Body param: Whether to disable tracking the highest bot score for a session in + * the Bot Management cookie. + */ + suppress_session_score?: boolean; + } } export interface BotManagementGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } -export namespace BotManagement { - export import BotManagementUpdateResponse = BotManagementAPI.BotManagementUpdateResponse; - export import BotManagementGetResponse = BotManagementAPI.BotManagementGetResponse; - export import BotManagementUpdateParams = BotManagementAPI.BotManagementUpdateParams; - export import BotManagementGetParams = BotManagementAPI.BotManagementGetParams; +export declare namespace BotManagement { + export { + type BotFightModeConfiguration as BotFightModeConfiguration, + type SubscriptionConfiguration as SubscriptionConfiguration, + type SuperBotFightModeDefinitelyConfiguration as SuperBotFightModeDefinitelyConfiguration, + type SuperBotFightModeLikelyConfiguration as SuperBotFightModeLikelyConfiguration, + type BotManagementUpdateResponse as BotManagementUpdateResponse, + type BotManagementGetResponse as BotManagementGetResponse, + type BotManagementUpdateParams as BotManagementUpdateParams, + type BotManagementGetParams as BotManagementGetParams, + }; } diff --git a/src/resources/botnet-feed.ts b/src/resources/botnet-feed.ts new file mode 100644 index 0000000000..301c613034 --- /dev/null +++ b/src/resources/botnet-feed.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './botnet-feed/index'; diff --git a/src/resources/botnet-feed/asn.ts b/src/resources/botnet-feed/asn.ts new file mode 100755 index 0000000000..117d7f3a6a --- /dev/null +++ b/src/resources/botnet-feed/asn.ts @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class ASN extends APIResource { + /** + * Gets all the data the botnet tracking database has for a given ASN registered to + * user account for given date. If no date is given, it will return results for the + * previous day. + */ + dayReport( + asnId: number, + params: ASNDayReportParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/botnet_feed/asn/${asnId}/day_report`, { + query, + ...options, + }) as Core.APIPromise<{ result: ASNDayReportResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets all the data the botnet threat feed tracking database has for a given ASN + * registered to user account. + */ + fullReport( + asnId: number, + params: ASNFullReportParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/botnet_feed/asn/${asnId}/full_report`, + options, + ) as Core.APIPromise<{ result: ASNFullReportResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ASNDayReportResponse { + cidr?: string; + + date?: string; + + offense_count?: number; +} + +export interface ASNFullReportResponse { + cidr?: string; + + date?: string; + + offense_count?: number; +} + +export interface ASNDayReportParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Query param + */ + date?: string; +} + +export interface ASNFullReportParams { + /** + * Identifier. + */ + account_id: string; +} + +export declare namespace ASN { + export { + type ASNDayReportResponse as ASNDayReportResponse, + type ASNFullReportResponse as ASNFullReportResponse, + type ASNDayReportParams as ASNDayReportParams, + type ASNFullReportParams as ASNFullReportParams, + }; +} diff --git a/src/resources/botnet-feed/botnet-feed.ts b/src/resources/botnet-feed/botnet-feed.ts new file mode 100755 index 0000000000..3bac90ca5f --- /dev/null +++ b/src/resources/botnet-feed/botnet-feed.ts @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as ASNAPI from './asn'; +import { + ASN, + ASNDayReportParams, + ASNDayReportResponse, + ASNFullReportParams, + ASNFullReportResponse, +} from './asn'; +import * as ConfigsAPI from './configs/configs'; +import { Configs } from './configs/configs'; + +export class BotnetFeed extends APIResource { + asn: ASNAPI.ASN = new ASNAPI.ASN(this._client); + configs: ConfigsAPI.Configs = new ConfigsAPI.Configs(this._client); +} + +BotnetFeed.ASN = ASN; +BotnetFeed.Configs = Configs; + +export declare namespace BotnetFeed { + export { + ASN as ASN, + type ASNDayReportResponse as ASNDayReportResponse, + type ASNFullReportResponse as ASNFullReportResponse, + type ASNDayReportParams as ASNDayReportParams, + type ASNFullReportParams as ASNFullReportParams, + }; + + export { Configs as Configs }; +} diff --git a/src/resources/botnet-feed/configs.ts b/src/resources/botnet-feed/configs.ts new file mode 100644 index 0000000000..2aec1f46e7 --- /dev/null +++ b/src/resources/botnet-feed/configs.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './configs/index'; diff --git a/src/resources/botnet-feed/configs/asn.ts b/src/resources/botnet-feed/configs/asn.ts new file mode 100755 index 0000000000..6808129973 --- /dev/null +++ b/src/resources/botnet-feed/configs/asn.ts @@ -0,0 +1,66 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; + +export class ASN extends APIResource { + /** + * Delete an ASN from botnet threat feed for a given user. + */ + delete( + asnId: number, + params: ASNDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/botnet_feed/configs/asn/${asnId}`, + options, + ) as Core.APIPromise<{ result: ASNDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets a list of all ASNs registered for a user for the DDoS Botnet Feed API. + */ + get(params: ASNGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/botnet_feed/configs/asn`, options) as Core.APIPromise<{ + result: ASNGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface ASNDeleteResponse { + asn?: number; +} + +export interface ASNGetResponse { + asn?: number; +} + +export interface ASNDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface ASNGetParams { + /** + * Identifier. + */ + account_id: string; +} + +export declare namespace ASN { + export { + type ASNDeleteResponse as ASNDeleteResponse, + type ASNGetResponse as ASNGetResponse, + type ASNDeleteParams as ASNDeleteParams, + type ASNGetParams as ASNGetParams, + }; +} diff --git a/src/resources/botnet-feed/configs/configs.ts b/src/resources/botnet-feed/configs/configs.ts new file mode 100755 index 0000000000..8b7ecf787a --- /dev/null +++ b/src/resources/botnet-feed/configs/configs.ts @@ -0,0 +1,21 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as ASNAPI from './asn'; +import { ASN, ASNDeleteParams, ASNDeleteResponse, ASNGetParams, ASNGetResponse } from './asn'; + +export class Configs extends APIResource { + asn: ASNAPI.ASN = new ASNAPI.ASN(this._client); +} + +Configs.ASN = ASN; + +export declare namespace Configs { + export { + ASN as ASN, + type ASNDeleteResponse as ASNDeleteResponse, + type ASNGetResponse as ASNGetResponse, + type ASNDeleteParams as ASNDeleteParams, + type ASNGetParams as ASNGetParams, + }; +} diff --git a/src/resources/botnet-feed/configs/index.ts b/src/resources/botnet-feed/configs/index.ts new file mode 100755 index 0000000000..b3a34edccd --- /dev/null +++ b/src/resources/botnet-feed/configs/index.ts @@ -0,0 +1,10 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + ASN, + type ASNDeleteResponse, + type ASNGetResponse, + type ASNDeleteParams, + type ASNGetParams, +} from './asn'; +export { Configs } from './configs'; diff --git a/src/resources/botnet-feed/index.ts b/src/resources/botnet-feed/index.ts new file mode 100755 index 0000000000..1a78545f8c --- /dev/null +++ b/src/resources/botnet-feed/index.ts @@ -0,0 +1,11 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + ASN, + type ASNDayReportResponse, + type ASNFullReportResponse, + type ASNDayReportParams, + type ASNFullReportParams, +} from './asn'; +export { BotnetFeed } from './botnet-feed'; +export { Configs } from './configs/index'; diff --git a/src/resources/brand-protection.ts b/src/resources/brand-protection.ts index 1c27e909ae..43f671a51c 100644 --- a/src/resources/brand-protection.ts +++ b/src/resources/brand-protection.ts @@ -1,246 +1,3 @@ -// File generated from our OpenAPI spec by Stainless. +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import * as Core from 'cloudflare/core'; -import { APIResource } from 'cloudflare/resource'; -import * as BrandProtectionAPI from 'cloudflare/resources/brand-protection'; - -export class BrandProtection extends APIResource { - /** - * Submit suspicious URL for scanning - */ - submit( - params: BrandProtectionSubmitParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/brand-protection/submit`, { - body, - ...options, - }) as Core.APIPromise<{ result: IntelPhishingURLSubmit }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get results for a URL scan - */ - urlInfo( - params: BrandProtectionURLInfoParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/brand-protection/url-info`, { - query, - ...options, - }) as Core.APIPromise<{ result: IntelPhishingURLInfo }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface IntelPhishingURLInfo { - /** - * List of categorizations applied to this submission. - */ - categorizations?: Array; - - /** - * List of model results for completed scans. - */ - model_results?: Array; - - /** - * List of signatures that matched against site content found when crawling the - * URL. - */ - rule_matches?: Array; - - /** - * Status of the most recent scan found. - */ - scan_status?: IntelPhishingURLInfo.ScanStatus; - - /** - * For internal use. - */ - screenshot_download_signature?: string; - - /** - * For internal use. - */ - screenshot_path?: string; - - /** - * URL that was submitted. - */ - url?: string; -} - -export namespace IntelPhishingURLInfo { - export interface Categorization { - /** - * Name of the category applied. - */ - category?: string; - - /** - * Result of human review for this categorization. - */ - verification_status?: string; - } - - export interface ModelResult { - /** - * Name of the model. - */ - model_name?: string; - - /** - * Score output by the model for this submission. - */ - model_score?: number; - } - - export interface RuleMatch { - /** - * For internal use. - */ - banning?: boolean; - - /** - * For internal use. - */ - blocking?: boolean; - - /** - * Description of the signature that matched. - */ - description?: string; - - /** - * Name of the signature that matched. - */ - name?: string; - } - - /** - * Status of the most recent scan found. - */ - export interface ScanStatus { - /** - * Timestamp of when the submission was processed. - */ - last_processed?: string; - - /** - * For internal use. - */ - scan_complete?: boolean; - - /** - * Status code that the crawler received when loading the submitted URL. - */ - status_code?: number; - - /** - * ID of the most recent submission. - */ - submission_id?: number; - } -} - -export interface IntelPhishingURLSubmit { - /** - * URLs that were excluded from scanning because their domain is in our no-scan - * list. - */ - excluded_urls?: Array; - - /** - * URLs that were skipped because the same URL is currently being scanned - */ - skipped_urls?: Array; - - /** - * URLs that were successfully submitted for scanning. - */ - submitted_urls?: Array; -} - -export namespace IntelPhishingURLSubmit { - export interface ExcludedURL { - /** - * URL that was excluded. - */ - url?: string; - } - - export interface SkippedURL { - /** - * URL that was skipped. - */ - url?: string; - - /** - * ID of the submission of that URL that is currently scanning. - */ - url_id?: number; - } - - export interface SubmittedURL { - /** - * URL that was submitted. - */ - url?: string; - - /** - * ID assigned to this URL submission. Used to retrieve scanning results. - */ - url_id?: number; - } -} - -export interface BrandProtectionSubmitParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Body param: URL(s) to filter submissions results by - */ - url?: string; -} - -export interface BrandProtectionURLInfoParams { - /** - * Path param: Identifier - */ - account_id: string; - - /** - * Query param: - */ - url?: string; - - /** - * Query param: - */ - url_id_param?: BrandProtectionURLInfoParams.URLIDParam; -} - -export namespace BrandProtectionURLInfoParams { - export interface URLIDParam { - /** - * Submission ID(s) to filter submission results by. - */ - url_id?: number; - } -} - -export namespace BrandProtection { - export import IntelPhishingURLInfo = BrandProtectionAPI.IntelPhishingURLInfo; - export import IntelPhishingURLSubmit = BrandProtectionAPI.IntelPhishingURLSubmit; - export import BrandProtectionSubmitParams = BrandProtectionAPI.BrandProtectionSubmitParams; - export import BrandProtectionURLInfoParams = BrandProtectionAPI.BrandProtectionURLInfoParams; -} +export * from './brand-protection/index'; diff --git a/src/resources/brand-protection/brand-protection.ts b/src/resources/brand-protection/brand-protection.ts new file mode 100644 index 0000000000..f3dfa308ef --- /dev/null +++ b/src/resources/brand-protection/brand-protection.ts @@ -0,0 +1,286 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import * as LogoMatchesAPI from './logo-matches'; +import { + LogoMatchDownloadParams, + LogoMatchDownloadResponse, + LogoMatchGetParams, + LogoMatchGetResponse, + LogoMatches, +} from './logo-matches'; +import * as LogosAPI from './logos'; +import { LogoCreateParams, LogoCreateResponse, LogoDeleteParams, Logos } from './logos'; +import * as MatchesAPI from './matches'; +import { + MatchDownloadParams, + MatchDownloadResponse, + MatchGetParams, + MatchGetResponse, + Matches, +} from './matches'; +import * as QueriesAPI from './queries'; +import { Queries, QueryBulkParams, QueryCreateParams, QueryDeleteParams } from './queries'; +import { SinglePage } from '../../pagination'; + +export class BrandProtection extends APIResource { + queries: QueriesAPI.Queries = new QueriesAPI.Queries(this._client); + matches: MatchesAPI.Matches = new MatchesAPI.Matches(this._client); + logos: LogosAPI.Logos = new LogosAPI.Logos(this._client); + logoMatches: LogoMatchesAPI.LogoMatches = new LogoMatchesAPI.LogoMatches(this._client); + + /** + * Return new URL submissions + */ + submit( + params: BrandProtectionSubmitParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/submit`, options); + } + + /** + * Return submitted URLs based on ID + */ + urlInfo( + params: BrandProtectionURLInfoParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/brand-protection/url-info`, + BrandProtectionURLInfoResponsesSinglePage, + options, + ); + } +} + +export class BrandProtectionURLInfoResponsesSinglePage extends SinglePage {} + +export interface Info { + /** + * List of categorizations applied to this submission. + */ + categorizations?: Array; + + /** + * List of model results for completed scans. + */ + model_results?: Array; + + /** + * List of signatures that matched against site content found when crawling the + * URL. + */ + rule_matches?: Array; + + /** + * Status of the most recent scan found. + */ + scan_status?: Info.ScanStatus; + + /** + * For internal use. + */ + screenshot_download_signature?: string; + + /** + * For internal use. + */ + screenshot_path?: string; + + /** + * URL that was submitted. + */ + url?: string; +} + +export namespace Info { + export interface Categorization { + /** + * Name of the category applied. + */ + category?: string; + + /** + * Result of human review for this categorization. + */ + verification_status?: string; + } + + export interface ModelResult { + /** + * Name of the model. + */ + model_name?: string; + + /** + * This is the score that is outputted by the model for this submission. + */ + model_score?: number; + } + + export interface RuleMatch { + /** + * For internal use. + */ + banning?: boolean; + + /** + * For internal use. + */ + blocking?: boolean; + + /** + * Description of the signature that matched. + */ + description?: string; + + /** + * Name of the signature that matched. + */ + name?: string; + } + + /** + * Status of the most recent scan found. + */ + export interface ScanStatus { + /** + * Timestamp of when the submission was processed. + */ + last_processed?: string; + + /** + * For internal use. + */ + scan_complete?: boolean; + + /** + * Status code that the crawler received when loading the submitted URL. + */ + status_code?: number; + + /** + * ID of the most recent submission. + */ + submission_id?: number; + } +} + +export interface Submit { + /** + * URLs that were excluded from scanning because their domain is in our no-scan + * list. + */ + excluded_urls?: Array; + + /** + * URLs that were skipped because the same URL is currently being scanned. + */ + skipped_urls?: Array; + + /** + * URLs that were successfully submitted for scanning. + */ + submitted_urls?: Array; +} + +export namespace Submit { + export interface ExcludedURL { + /** + * URL that was excluded. + */ + url?: string; + } + + export interface SkippedURL { + /** + * URL that was skipped. + */ + url?: string; + + /** + * ID of the submission of that URL that is currently scanning. + */ + url_id?: number; + } + + export interface SubmittedURL { + /** + * URL that was submitted. + */ + url?: string; + + /** + * ID assigned to this URL submission. Used to retrieve scanning results. + */ + url_id?: number; + } +} + +export interface BrandProtectionSubmitResponse { + skipped_urls?: Array<{ [key: string]: unknown }>; + + submitted_urls?: Array<{ [key: string]: unknown }>; +} + +export type BrandProtectionURLInfoResponse = { [key: string]: unknown }; + +export interface BrandProtectionSubmitParams { + account_id: string; +} + +export interface BrandProtectionURLInfoParams { + account_id: string; +} + +BrandProtection.BrandProtectionURLInfoResponsesSinglePage = BrandProtectionURLInfoResponsesSinglePage; +BrandProtection.Queries = Queries; +BrandProtection.Matches = Matches; +BrandProtection.Logos = Logos; +BrandProtection.LogoMatches = LogoMatches; + +export declare namespace BrandProtection { + export { + type Info as Info, + type Submit as Submit, + type BrandProtectionSubmitResponse as BrandProtectionSubmitResponse, + type BrandProtectionURLInfoResponse as BrandProtectionURLInfoResponse, + BrandProtectionURLInfoResponsesSinglePage as BrandProtectionURLInfoResponsesSinglePage, + type BrandProtectionSubmitParams as BrandProtectionSubmitParams, + type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams, + }; + + export { + Queries as Queries, + type QueryCreateParams as QueryCreateParams, + type QueryDeleteParams as QueryDeleteParams, + type QueryBulkParams as QueryBulkParams, + }; + + export { + Matches as Matches, + type MatchDownloadResponse as MatchDownloadResponse, + type MatchGetResponse as MatchGetResponse, + type MatchDownloadParams as MatchDownloadParams, + type MatchGetParams as MatchGetParams, + }; + + export { + Logos as Logos, + type LogoCreateResponse as LogoCreateResponse, + type LogoCreateParams as LogoCreateParams, + type LogoDeleteParams as LogoDeleteParams, + }; + + export { + LogoMatches as LogoMatches, + type LogoMatchDownloadResponse as LogoMatchDownloadResponse, + type LogoMatchGetResponse as LogoMatchGetResponse, + type LogoMatchDownloadParams as LogoMatchDownloadParams, + type LogoMatchGetParams as LogoMatchGetParams, + }; +} diff --git a/src/resources/brand-protection/index.ts b/src/resources/brand-protection/index.ts new file mode 100644 index 0000000000..5d7054964e --- /dev/null +++ b/src/resources/brand-protection/index.ts @@ -0,0 +1,19 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { BrandProtection } from './brand-protection'; +export { + LogoMatches, + type LogoMatchDownloadResponse, + type LogoMatchGetResponse, + type LogoMatchDownloadParams, + type LogoMatchGetParams, +} from './logo-matches'; +export { Logos, type LogoCreateResponse, type LogoCreateParams, type LogoDeleteParams } from './logos'; +export { + Matches, + type MatchDownloadResponse, + type MatchGetResponse, + type MatchDownloadParams, + type MatchGetParams, +} from './matches'; +export { Queries, type QueryCreateParams, type QueryDeleteParams, type QueryBulkParams } from './queries'; diff --git a/src/resources/brand-protection/logo-matches.ts b/src/resources/brand-protection/logo-matches.ts new file mode 100644 index 0000000000..d87e3837f6 --- /dev/null +++ b/src/resources/brand-protection/logo-matches.ts @@ -0,0 +1,93 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class LogoMatches extends APIResource { + /** + * Return matches as CSV for logo queries based on ID + */ + download( + params: LogoMatchDownloadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches/download`, { + query, + ...options, + }); + } + + /** + * Return matches for logo queries based on ID + */ + get(params: LogoMatchGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches`, { query, ...options }); + } +} + +export interface LogoMatchDownloadResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface LogoMatchGetResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface LogoMatchDownloadParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + limit?: string; + + /** + * Query param + */ + logo_id?: Array; + + /** + * Query param + */ + offset?: string; +} + +export interface LogoMatchGetParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + limit?: string; + + /** + * Query param + */ + logo_id?: Array; + + /** + * Query param + */ + offset?: string; +} + +export declare namespace LogoMatches { + export { + type LogoMatchDownloadResponse as LogoMatchDownloadResponse, + type LogoMatchGetResponse as LogoMatchGetResponse, + type LogoMatchDownloadParams as LogoMatchDownloadParams, + type LogoMatchGetParams as LogoMatchGetParams, + }; +} diff --git a/src/resources/brand-protection/logos.ts b/src/resources/brand-protection/logos.ts new file mode 100644 index 0000000000..7a87dab36c --- /dev/null +++ b/src/resources/brand-protection/logos.ts @@ -0,0 +1,77 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Logos extends APIResource { + /** + * Return new saved logo queries created from image files + */ + create(params: LogoCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, match_type, tag, threshold, ...body } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/logos`, { + query: { match_type, tag, threshold }, + body, + ...options, + headers: { 'Content-Type': 'application/x-www-form-urlencoded', ...options?.headers }, + }); + } + + /** + * Return a success message after deleting saved logo queries by ID + */ + delete(logoId: string, params: LogoDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/brand-protection/logos/${logoId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface LogoCreateResponse { + id?: number; + + tag?: string; + + upload_path?: string; +} + +export interface LogoCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + match_type?: string; + + /** + * Query param + */ + tag?: string; + + /** + * Query param + */ + threshold?: number; + + /** + * Body param + */ + image?: Core.Uploadable; +} + +export interface LogoDeleteParams { + account_id: string; +} + +export declare namespace Logos { + export { + type LogoCreateResponse as LogoCreateResponse, + type LogoCreateParams as LogoCreateParams, + type LogoDeleteParams as LogoDeleteParams, + }; +} diff --git a/src/resources/brand-protection/matches.ts b/src/resources/brand-protection/matches.ts new file mode 100644 index 0000000000..985c0569c3 --- /dev/null +++ b/src/resources/brand-protection/matches.ts @@ -0,0 +1,103 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Matches extends APIResource { + /** + * Return matches as CSV for string queries based on ID + */ + download( + params: MatchDownloadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/matches/download`, { + query, + ...options, + }); + } + + /** + * Return matches for string queries based on ID + */ + get(params: MatchGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/matches`, { query, ...options }); + } +} + +export interface MatchDownloadResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface MatchGetResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface MatchDownloadParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + id?: string; + + /** + * Query param + */ + include_domain_id?: boolean; + + /** + * Query param + */ + limit?: number; + + /** + * Query param + */ + offset?: number; +} + +export interface MatchGetParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + id?: string; + + /** + * Query param + */ + include_domain_id?: boolean; + + /** + * Query param + */ + limit?: number; + + /** + * Query param + */ + offset?: number; +} + +export declare namespace Matches { + export { + type MatchDownloadResponse as MatchDownloadResponse, + type MatchGetResponse as MatchGetResponse, + type MatchDownloadParams as MatchDownloadParams, + type MatchGetParams as MatchGetParams, + }; +} diff --git a/src/resources/brand-protection/queries.ts b/src/resources/brand-protection/queries.ts new file mode 100644 index 0000000000..bc6733d4fd --- /dev/null +++ b/src/resources/brand-protection/queries.ts @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Queries extends APIResource { + /** + * Return a success message after creating new saved string queries + */ + create(params: QueryCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, id, query_scan, query_tag, ...body } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/queries`, { + query: { id, scan: query_scan, tag: query_tag }, + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Return a success message after deleting saved string queries by ID + */ + delete(params: QueryDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, id, scan, tag } = params; + return this._client.delete(`/accounts/${account_id}/brand-protection/queries`, { + query: { id, scan, tag }, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Return a success message after creating new saved string queries in bulk + */ + bulk(params: QueryBulkParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/queries/bulk`, { + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface QueryCreateParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + id?: string; + + /** + * Query param + */ + query_scan?: boolean; + + /** + * Query param + */ + query_tag?: string; + + /** + * Body param + */ + max_time?: string | null; + + /** + * Body param + */ + min_time?: string | null; + + /** + * Body param + */ + body_scan?: boolean; + + /** + * Body param + */ + string_matches?: unknown; + + /** + * Body param + */ + body_tag?: string; +} + +export interface QueryDeleteParams { + /** + * Path param + */ + account_id: string; + + /** + * Query param + */ + id?: string; + + /** + * Query param + */ + scan?: boolean; + + /** + * Query param + */ + tag?: string; +} + +export interface QueryBulkParams { + /** + * Path param + */ + account_id: string; + + /** + * Body param + */ + queries?: Array<{ [key: string]: unknown }>; +} + +export declare namespace Queries { + export { + type QueryCreateParams as QueryCreateParams, + type QueryDeleteParams as QueryDeleteParams, + type QueryBulkParams as QueryBulkParams, + }; +} diff --git a/src/resources/browser-rendering.ts b/src/resources/browser-rendering.ts new file mode 100644 index 0000000000..3443f02977 --- /dev/null +++ b/src/resources/browser-rendering.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './browser-rendering/index'; diff --git a/src/resources/browser-rendering/browser-rendering.ts b/src/resources/browser-rendering/browser-rendering.ts new file mode 100644 index 0000000000..4bc9dab9bd --- /dev/null +++ b/src/resources/browser-rendering/browser-rendering.ts @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as ContentAPI from './content'; +import { Content, ContentCreateParams, ContentCreateResponse } from './content'; +import * as JsonAPI from './json'; +import { Json, JsonCreateParams, JsonCreateResponse } from './json'; +import * as LinksAPI from './links'; +import { LinkCreateParams, LinkCreateResponse, Links } from './links'; +import * as MarkdownAPI from './markdown'; +import { Markdown, MarkdownCreateParams, MarkdownCreateResponse } from './markdown'; +import * as PDFAPI from './pdf'; +import { PDF, PDFCreateParams } from './pdf'; +import * as ScrapeAPI from './scrape'; +import { Scrape, ScrapeCreateParams, ScrapeCreateResponse } from './scrape'; +import * as ScreenshotAPI from './screenshot'; +import { Screenshot, ScreenshotCreateParams, ScreenshotCreateResponse } from './screenshot'; +import * as SnapshotAPI from './snapshot'; +import { Snapshot, SnapshotCreateParams, SnapshotCreateResponse } from './snapshot'; + +export class BrowserRendering extends APIResource { + content: ContentAPI.Content = new ContentAPI.Content(this._client); + pdf: PDFAPI.PDF = new PDFAPI.PDF(this._client); + scrape: ScrapeAPI.Scrape = new ScrapeAPI.Scrape(this._client); + screenshot: ScreenshotAPI.Screenshot = new ScreenshotAPI.Screenshot(this._client); + snapshot: SnapshotAPI.Snapshot = new SnapshotAPI.Snapshot(this._client); + json: JsonAPI.Json = new JsonAPI.Json(this._client); + links: LinksAPI.Links = new LinksAPI.Links(this._client); + markdown: MarkdownAPI.Markdown = new MarkdownAPI.Markdown(this._client); +} + +BrowserRendering.Content = Content; +BrowserRendering.PDF = PDF; +BrowserRendering.Scrape = Scrape; +BrowserRendering.Screenshot = Screenshot; +BrowserRendering.Snapshot = Snapshot; +BrowserRendering.Json = Json; +BrowserRendering.Links = Links; +BrowserRendering.Markdown = Markdown; + +export declare namespace BrowserRendering { + export { + Content as Content, + type ContentCreateResponse as ContentCreateResponse, + type ContentCreateParams as ContentCreateParams, + }; + + export { PDF as PDF, type PDFCreateParams as PDFCreateParams }; + + export { + Scrape as Scrape, + type ScrapeCreateResponse as ScrapeCreateResponse, + type ScrapeCreateParams as ScrapeCreateParams, + }; + + export { + Screenshot as Screenshot, + type ScreenshotCreateResponse as ScreenshotCreateResponse, + type ScreenshotCreateParams as ScreenshotCreateParams, + }; + + export { + Snapshot as Snapshot, + type SnapshotCreateResponse as SnapshotCreateResponse, + type SnapshotCreateParams as SnapshotCreateParams, + }; + + export { + Json as Json, + type JsonCreateResponse as JsonCreateResponse, + type JsonCreateParams as JsonCreateParams, + }; + + export { + Links as Links, + type LinkCreateResponse as LinkCreateResponse, + type LinkCreateParams as LinkCreateParams, + }; + + export { + Markdown as Markdown, + type MarkdownCreateResponse as MarkdownCreateResponse, + type MarkdownCreateParams as MarkdownCreateParams, + }; +} diff --git a/src/resources/browser-rendering/content.ts b/src/resources/browser-rendering/content.ts new file mode 100644 index 0000000000..ada1748fdf --- /dev/null +++ b/src/resources/browser-rendering/content.ts @@ -0,0 +1,567 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class Content extends APIResource { + /** + * Fetches rendered HTML content from provided URL or HTML. Check available options + * like `gotoOptions` and `waitFor*` to control page load behaviour. + * + * @example + * ```ts + * const content = + * await client.browserRendering.content.create({ + * account_id: 'account_id', + * url: 'https://www.example.com/', + * }); + * ``` + */ + create(params: ContentCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, cacheTTL, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/browser-rendering/content`, { + query: { cacheTTL }, + body, + ...options, + }) as Core.APIPromise<{ result: ContentCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +/** + * HTML content + */ +export type ContentCreateResponse = string; + +export type ContentCreateParams = ContentCreateParams.Variant0 | ContentCreateParams.Variant1; + +export declare namespace ContentCreateParams { + export interface Variant0 { + /** + * Path param: Account ID. + */ + account_id: string; + + /** + * Body param: URL to navigate to, eg. `https://example.com`. + */ + url: string; + + /** + * Query param: Cache TTL default is 5s. Set to 0 to disable. + */ + cacheTTL?: number; + + /** + * Body param: The maximum duration allowed for the browser action to complete + * after the page has loaded (such as taking screenshots, extracting content, or + * generating PDFs). If this time limit is exceeded, the action stops and returns a + * timeout error. + */ + actionTimeout?: number; + + /** + * Body param: Adds a `