diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74356bbc5d..66d7a52d0d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,10 @@ on: - 'integrated/**' - 'stl-preview-head/**' - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -17,6 +21,7 @@ jobs: timeout-minutes: 10 name: lint 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@v4 @@ -35,6 +40,7 @@ jobs: 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 @@ -70,6 +76,7 @@ jobs: 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@v4 @@ -87,7 +94,7 @@ jobs: 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' + if: github.repository == 'cloudflare/cloudflare-typescript' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork) steps: - uses: actions/checkout@v4 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f4b3cc5134..7aa3d56709 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.4.1" + ".": "4.5.0" } diff --git a/.stats.yml b/.stats.yml index 590d127c2c..8839c77cc5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1752 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b15b44e0efd207de48e7e74e742b0b4b190c74f12a941a1a0ef59a51656a5224.yml -openapi_spec_hash: 83243c9ee06f88d0fa91e9b185d8a42e -config_hash: 8601d43fd5ccaf9e3d08f26748a5a63a +configured_endpoints: 1769 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e53659eea1b4f1fb11addaddb82880c177d8fa3e7a93f0d664a65e43ac526f4.yml +openapi_spec_hash: 3e0f59ac2722028954566a4c850e8849 +config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/CHANGELOG.md b/CHANGELOG.md index b8dd3802fa..cc9fa1398c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,64 @@ # Changelog +## 4.5.0 (2025-07-16) + +Full Changelog: [v4.4.1...v4.5.0](https://github.com/cloudflare/cloudflare-typescript/compare/v4.4.1...v4.5.0) + +### Features + +* **api:** Add DELETE and POST routes for Magic Connector ([9963d9d](https://github.com/cloudflare/cloudflare-typescript/commit/9963d9d8653e1efde8a65571bdf6fa0fd8d6c4ac)) +* **api:** Add Radar Bots and Web Crawlers ([9e82821](https://github.com/cloudflare/cloudflare-typescript/commit/9e8282183e75e16c176e1fe958a7639f111405d0)) +* **api:** api update ([764caca](https://github.com/cloudflare/cloudflare-typescript/commit/764caca0f4209334ac08b0273c181db400c26715)) +* **api:** api update ([c23f828](https://github.com/cloudflare/cloudflare-typescript/commit/c23f82826060ba67a8527cb8f24acaf6aac14c4e)) +* **api:** api update ([89b424d](https://github.com/cloudflare/cloudflare-typescript/commit/89b424d147c4ef3eca13907dc203b3602413cc90)) +* **api:** api update ([8b08c10](https://github.com/cloudflare/cloudflare-typescript/commit/8b08c101c3dfdadcdd41d7245ab6f2654e63a929)) +* **api:** api update ([cae4884](https://github.com/cloudflare/cloudflare-typescript/commit/cae4884a1912316a23ebfa821c4ab63adda44a80)) +* **api:** api update ([0589b23](https://github.com/cloudflare/cloudflare-typescript/commit/0589b23194553c5d09c1356cd644b68aba9a7462)) +* **api:** api update ([06999f3](https://github.com/cloudflare/cloudflare-typescript/commit/06999f36200d1711e625c48ef92514bda4a50782)) +* **api:** api update ([72e72e2](https://github.com/cloudflare/cloudflare-typescript/commit/72e72e25b94efbeaa81500c5d050a2d6d7324a81)) +* **api:** api update ([511790b](https://github.com/cloudflare/cloudflare-typescript/commit/511790b0dc6a4ef688d0c5985a9a3dc7b50a1dbe)) +* **api:** api update ([822a6ca](https://github.com/cloudflare/cloudflare-typescript/commit/822a6ca38c69db6fa78a551fe3368a47d578cfd0)) +* **api:** api update ([99e2090](https://github.com/cloudflare/cloudflare-typescript/commit/99e209062ab9f894022cbf352243380cd071a834)) +* **api:** api update ([01e5785](https://github.com/cloudflare/cloudflare-typescript/commit/01e5785827528323d01f1c956e82b1eac6886c4d)) +* **api:** api update ([47a21fc](https://github.com/cloudflare/cloudflare-typescript/commit/47a21fc0f3e78ce30d73add0c8eb07d0548b3cbf)) +* **api:** api update ([150ee87](https://github.com/cloudflare/cloudflare-typescript/commit/150ee8722272b75525dd1d6cea2fab03ff6f5e5f)) +* **api:** api update ([9f9cb78](https://github.com/cloudflare/cloudflare-typescript/commit/9f9cb78799ebe4b7dea3fe4665716c4893c0904e)) +* **api:** api update ([25c67eb](https://github.com/cloudflare/cloudflare-typescript/commit/25c67ebe32c547e692ffdbde107267098b52e7ca)) +* **api:** api update ([3640b39](https://github.com/cloudflare/cloudflare-typescript/commit/3640b3922c6f7e30075bdfe3aa224cd60f58347d)) +* **api:** api update ([a3556ec](https://github.com/cloudflare/cloudflare-typescript/commit/a3556ec061ef64e96467f50b35333ee5430d5701)) +* **api:** api update ([3fae8c0](https://github.com/cloudflare/cloudflare-typescript/commit/3fae8c09b137827a5d0c721b274c40e022a325b2)) +* **api:** api update ([eb17884](https://github.com/cloudflare/cloudflare-typescript/commit/eb178842dd729e53d832f58e86ce41bd64e70600)) +* **api:** api update ([58ea846](https://github.com/cloudflare/cloudflare-typescript/commit/58ea846c9cc9622a959c354b81d13e108a83a869)) +* **api:** api update ([7c37a85](https://github.com/cloudflare/cloudflare-typescript/commit/7c37a85e50989df912f100a67e383624b2b70fbd)) +* **api:** api update ([99fa93e](https://github.com/cloudflare/cloudflare-typescript/commit/99fa93e063b91d33234384c739d0d492f8c4691b)) +* **api:** api update ([59a17cf](https://github.com/cloudflare/cloudflare-typescript/commit/59a17cf3bd914f6447c46bb27be346ac95717af8)) +* **api:** api update ([cbdd3e8](https://github.com/cloudflare/cloudflare-typescript/commit/cbdd3e82869bac6065a6b888457c10b7e8541f84)) +* **brand_protection:** Add new routes ([0017abd](https://github.com/cloudflare/cloudflare-typescript/commit/0017abded280a493b42e644dabd0f9035577530d)) +* clean up environment call outs ([6bcaa57](https://github.com/cloudflare/cloudflare-typescript/commit/6bcaa575645864a60e614ff567709352f3934771)) +* **client:** add breaking change detection to CI ([bd975b1](https://github.com/cloudflare/cloudflare-typescript/commit/bd975b1c55eeebcce4bbfd9d616a3294edf18864)) +* **zero_trust_dlp:** Added individual resources and new routes ([132b56e](https://github.com/cloudflare/cloudflare-typescript/commit/132b56e00e7c59168161772a5a9fe4049c49e88c)) + + +### Bug Fixes + +* always use multipart/form-data for some endpoints ([d4ce21e](https://github.com/cloudflare/cloudflare-typescript/commit/d4ce21e135415971b6b4578151304289f5b7c4ef)) +* **api:** add missing `items` param ([d9937a1](https://github.com/cloudflare/cloudflare-typescript/commit/d9937a1670133b1a5b0741ffea5e826801299885)) +* **ci:** correct conditional ([5257b08](https://github.com/cloudflare/cloudflare-typescript/commit/5257b08cf295cc66714bd879bbe7907cbf9275ec)) +* **ci:** release-doctor — report correct token name ([c4f2ddf](https://github.com/cloudflare/cloudflare-typescript/commit/c4f2ddfe3a5c3bf5cefaefe347b5a0707c538447)) +* **client:** don't send `Content-Type` for bodyless methods ([cdfc263](https://github.com/cloudflare/cloudflare-typescript/commit/cdfc263036de41c293506f907ab4fe72b7d43135)) + + +### Chores + +* **api:** Skip broken prism test for updating custom DLP entries ([3c50a16](https://github.com/cloudflare/cloudflare-typescript/commit/3c50a163ae99b1a9218945718ca3d6e0054181fa)) +* **api:** skip broken prism tests ([0f0ba6e](https://github.com/cloudflare/cloudflare-typescript/commit/0f0ba6eb27f8efbe13df9b7b2ed9374d1c74dece)) +* **api:** TTL is required on DNS records ([a492965](https://github.com/cloudflare/cloudflare-typescript/commit/a4929653c8c982a5c8fe81d21f315ea4c4d11086)) +* **ci:** enable for pull requests ([6898174](https://github.com/cloudflare/cloudflare-typescript/commit/6898174da5c2bf8e78b503dffeacba7c0bf7a539)) +* **ci:** only run for pushes and fork pull requests ([ed461eb](https://github.com/cloudflare/cloudflare-typescript/commit/ed461eb0f3aa0fd81f48628830735cc70204eaed)) +* **internal:** codegen related update ([6a94ed9](https://github.com/cloudflare/cloudflare-typescript/commit/6a94ed94bfe950bf8193da2762ccf26a3a93065e)) +* make some internal functions async ([4e89649](https://github.com/cloudflare/cloudflare-typescript/commit/4e89649a987ba572081aa7706a2643901c4c494c)) +* mention unit type in timeout docs ([a5ad7f3](https://github.com/cloudflare/cloudflare-typescript/commit/a5ad7f384297aff6bcd491e6cdb22715432aa683)) + ## 4.4.1 (2025-06-16) Full Changelog: [v4.4.0...v4.4.1](https://github.com/cloudflare/cloudflare-typescript/compare/v4.4.0...v4.4.1) diff --git a/README.md b/README.md index 111b5c15e5..379af18bf1 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,7 @@ The full API of this library can be found in [api.md](api.md). import Cloudflare from 'cloudflare'; const client = 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 + apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const zone = await client.zones.create({ @@ -43,8 +42,7 @@ This library includes TypeScript definitions for all request params and response import Cloudflare from 'cloudflare'; const client = 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 + apiToken: process.env['CLOUDFLARE_API_TOKEN'], // This is the default and can be omitted }); const params: Cloudflare.ZoneCreateParams = { diff --git a/api.md b/api.md index 521e1037c9..c9384414c2 100644 --- a/api.md +++ b/api.md @@ -104,7 +104,7 @@ Types: Methods: - client.accounts.tokens.permissionGroups.list({ ...params }) -> PermissionGroupListResponsesSinglePage -- client.accounts.tokens.permissionGroups.get({ ...params }) -> PermissionGroupGetResponsesSinglePage +- client.accounts.tokens.permissionGroups.get({ ...params }) -> PermissionGroupGetResponse ### Value @@ -269,7 +269,7 @@ Types: Methods: -- client.user.tokens.permissionGroups.list() -> PermissionGroupListResponsesSinglePage +- client.user.tokens.permissionGroups.list({ ...params }) -> PermissionGroupListResponsesSinglePage ### Value @@ -2951,16 +2951,24 @@ Methods: Types: -- Info -- RuleMatch -- ScanStatus -- Submit -- URLInfoModelResults +- Info +- RuleMatch +- ScanStatus +- Submit +- URLInfoModelResults Methods: -- client.brandProtection.submit({ ...params }) -> Submit -- client.brandProtection.urlInfo({ ...params }) -> Info +- client.brandProtection.submit({ ...params }) -> Submit +- client.brandProtection.urlInfo({ ...params }) -> Info + +## Queries + +## Matches + +## Logos + +## LogoMatches # Diagnostics @@ -3438,15 +3446,19 @@ Methods: Types: +- ConnectorCreateResponse - ConnectorUpdateResponse - ConnectorListResponse +- ConnectorDeleteResponse - ConnectorEditResponse - ConnectorGetResponse Methods: +- 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 @@ -3895,7 +3907,6 @@ Types: - Redirect - ListCreateResponse - ListUpdateResponse -- ListListResponse - ListDeleteResponse - ListGetResponse @@ -3903,7 +3914,7 @@ Methods: - client.rules.lists.create({ ...params }) -> ListCreateResponse - client.rules.lists.update(listId, { ...params }) -> ListUpdateResponse -- client.rules.lists.list({ ...params }) -> ListListResponse +- client.rules.lists.list({ ...params }) -> ListsListsSinglePage - client.rules.lists.delete(listId, { ...params }) -> ListDeleteResponse - client.rules.lists.get(listId, { ...params }) -> ListGetResponse @@ -3933,7 +3944,7 @@ Methods: - client.rules.lists.items.create(listId, [ ...body ]) -> ItemCreateResponse - client.rules.lists.items.update(listId, [ ...body ]) -> ItemUpdateResponse -- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponse +- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponsesCursorPagination - client.rules.lists.items.delete(listId, { ...params }) -> ItemDeleteResponse - client.rules.lists.items.get(listId, itemId, { ...params }) -> ItemGetResponse @@ -5701,10 +5712,13 @@ Methods: Types: - PredefinedProfile +- PredefinedDeleteResponse Methods: +- client.zeroTrust.dlp.profiles.predefined.create({ ...params }) -> Profile - client.zeroTrust.dlp.profiles.predefined.update(profileId, { ...params }) -> Profile +- client.zeroTrust.dlp.profiles.predefined.delete(profileId, { ...params }) -> PredefinedDeleteResponse | null - client.zeroTrust.dlp.profiles.predefined.get(profileId, { ...params }) -> Profile ### Limits @@ -5721,19 +5735,61 @@ Methods: Types: -- EntryCreateResponse -- EntryUpdateResponse -- EntryListResponse -- EntryDeleteResponse -- EntryGetResponse +- 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 +- 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 +- CustomDeleteResponse + +Methods: + +- client.zeroTrust.dlp.entries.custom.create({ ...params }) -> CustomCreateResponse +- client.zeroTrust.dlp.entries.custom.update(entryId, { ...params }) -> CustomUpdateResponse +- client.zeroTrust.dlp.entries.custom.delete(entryId, { ...params }) -> CustomDeleteResponse | null + +#### Predefined + +Types: + +- PredefinedCreateResponse +- PredefinedUpdateResponse +- PredefinedDeleteResponse + +Methods: + +- client.zeroTrust.dlp.entries.predefined.create({ ...params }) -> PredefinedCreateResponse +- client.zeroTrust.dlp.entries.predefined.update(entryId, { ...params }) -> PredefinedUpdateResponse +- client.zeroTrust.dlp.entries.predefined.delete(entryId, { ...params }) -> PredefinedDeleteResponse | null + +#### Integration + +Types: + +- IntegrationCreateResponse +- IntegrationUpdateResponse +- IntegrationDeleteResponse + +Methods: + +- client.zeroTrust.dlp.entries.integration.create({ ...params }) -> IntegrationCreateResponse +- client.zeroTrust.dlp.entries.integration.update(entryId, { ...params }) -> IntegrationUpdateResponse +- client.zeroTrust.dlp.entries.integration.delete(entryId, { ...params }) -> IntegrationDeleteResponse | null ## Gateway @@ -6387,6 +6443,36 @@ Methods: - client.radar.bgp.ips.timeseries({ ...params }) -> IPTimeseriesResponse +## 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: diff --git a/bin/check-release-environment b/bin/check-release-environment index 40ffb77f52..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[@]} diff --git a/package.json b/package.json index 5eda6809c8..ae9cd435d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "4.4.1", + "version": "4.5.0", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes new file mode 100755 index 0000000000..051507977d --- /dev/null +++ b/scripts/detect-breaking-changes @@ -0,0 +1,757 @@ +#!/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/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/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/hostnames/hostnames.test.ts + tests/api-resources/origin-tls-client-auth/hostnames/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/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/consumers.test.ts + tests/api-resources/queues/messages.test.ts + tests/api-resources/queues/purge.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/diagnostics/diagnostics.test.ts + tests/api-resources/diagnostics/traceroutes.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/ip-lists.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/indicator-feeds/downloads.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/d1/d1.test.ts + tests/api-resources/d1/database.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/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/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/cloudflare-source.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/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/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/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/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/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/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/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/crons.test.ts + tests/api-resources/cloudforce-one/threat-events/datasets/datasets.test.ts + tests/api-resources/cloudforce-one/threat-events/datasets/health.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/cloudforce-one/threat-events/insights.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/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/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.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/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.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/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/src/core.ts b/src/core.ts index 6d59eacdf0..7bdfe012c0 100644 --- a/src/core.ts +++ b/src/core.ts @@ -221,7 +221,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(), 'api-version': this.getAPIVerson(), ...getPlatformHeaders(), @@ -304,10 +304,10 @@ export abstract class APIClient { return null; } - buildRequest( + async buildRequest( inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, - ): { req: RequestInit; url: string; timeout: number } { + ): Promise<{ req: RequestInit; url: string; timeout: number }> { const options = { ...inputOptions }; const { method, path, query, defaultBaseURL, headers: headers = {} } = options; @@ -455,7 +455,9 @@ export abstract class APIClient { await this.prepareOptions(options); - const { req, url, timeout } = this.buildRequest(options, { retryCount: maxRetries - retriesRemaining }); + const { req, url, timeout } = await this.buildRequest(options, { + retryCount: maxRetries - retriesRemaining, + }); await this.prepareRequest(req, { url, options }); diff --git a/src/index.ts b/src/index.ts index b438ddbb2b..112d9389ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -21,7 +21,6 @@ import * as API from './resources/index'; import { AbuseReports } from './resources/abuse-reports'; import { AuditLogs } from './resources/audit-logs'; import { BotManagement } from './resources/bot-management'; -import { BrandProtection } from './resources/brand-protection'; import { ClientCertificates } from './resources/client-certificates'; import { CustomNameservers } from './resources/custom-nameservers'; import { CustomPages } from './resources/custom-pages'; @@ -48,6 +47,7 @@ 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'; @@ -153,6 +153,8 @@ 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 | undefined; diff --git a/src/resources/accounts/tokens/index.ts b/src/resources/accounts/tokens/index.ts index 565049cb1c..e1bfa11013 100644 --- a/src/resources/accounts/tokens/index.ts +++ b/src/resources/accounts/tokens/index.ts @@ -2,7 +2,6 @@ export { PermissionGroupListResponsesSinglePage, - PermissionGroupGetResponsesSinglePage, PermissionGroups, type PermissionGroupListResponse, type PermissionGroupGetResponse, diff --git a/src/resources/accounts/tokens/permission-groups.ts b/src/resources/accounts/tokens/permission-groups.ts index 6981b15a7c..68df6328d8 100644 --- a/src/resources/accounts/tokens/permission-groups.ts +++ b/src/resources/accounts/tokens/permission-groups.ts @@ -22,11 +22,11 @@ export class PermissionGroups extends APIResource { params: PermissionGroupListParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { account_id } = params; + const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/tokens/permission_groups`, PermissionGroupListResponsesSinglePage, - options, + { query, ...options }, ); } @@ -35,31 +35,28 @@ export class PermissionGroups extends APIResource { * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const permissionGroupGetResponse of client.accounts.tokens.permissionGroups.get( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * const permissionGroups = + * await client.accounts.tokens.permissionGroups.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); * ``` */ get( params: PermissionGroupGetParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/tokens/permission_groups`, - PermissionGroupGetResponsesSinglePage, - options, - ); + ): 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 class PermissionGroupGetResponsesSinglePage extends SinglePage {} - export interface PermissionGroupListResponse { /** * Public ID. @@ -82,51 +79,77 @@ export interface PermissionGroupListResponse { >; } -export interface PermissionGroupGetResponse { +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 { /** - * Public ID. + * Path param: Account identifier tag. */ - id?: string; + account_id: string; /** - * Permission Group Name + * Query param: Filter by the name of the permission group. The value must be + * URL-encoded. */ name?: string; /** - * Resources to which the Permission Group is scoped + * Query param: Filter by the scope of the permission group. The value must be + * URL-encoded. */ - scopes?: Array< - | 'com.cloudflare.api.account' - | 'com.cloudflare.api.account.zone' - | 'com.cloudflare.api.user' - | 'com.cloudflare.edge.r2.bucket' - >; + scope?: string; } -export interface PermissionGroupListParams { +export interface PermissionGroupGetParams { /** - * Account identifier tag. + * Path param: Account identifier tag. */ account_id: string; -} -export interface PermissionGroupGetParams { /** - * Account identifier tag. + * Query param: Filter by the name of the permission group. The value must be + * URL-encoded. */ - account_id: string; + name?: string; + + /** + * Query param: Filter by the scope of the permission group. The value must be + * URL-encoded. + */ + scope?: string; } PermissionGroups.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage; -PermissionGroups.PermissionGroupGetResponsesSinglePage = PermissionGroupGetResponsesSinglePage; export declare namespace PermissionGroups { export { type PermissionGroupListResponse as PermissionGroupListResponse, type PermissionGroupGetResponse as PermissionGroupGetResponse, PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, - PermissionGroupGetResponsesSinglePage as PermissionGroupGetResponsesSinglePage, type PermissionGroupListParams as PermissionGroupListParams, type PermissionGroupGetParams as PermissionGroupGetParams, }; diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index 0d10db01ff..964d4dbf9b 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -8,7 +8,6 @@ import * as PermissionGroupsAPI from './permission-groups'; import { PermissionGroupGetParams, PermissionGroupGetResponse, - PermissionGroupGetResponsesSinglePage, PermissionGroupListParams, PermissionGroupListResponse, PermissionGroupListResponsesSinglePage, @@ -39,12 +38,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { - * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': - * '*', - * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': - * '*', - * }, + * resources: { foo: 'string' }, * }, * ], * }); @@ -76,15 +70,9 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { - * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': - * '*', - * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': - * '*', - * }, + * resources: { foo: 'string' }, * }, * ], - * status: 'active', * }, * ); * ``` @@ -376,11 +364,6 @@ export interface TokenUpdateParams { */ policies: Array; - /** - * Body param: Status of the token. - */ - status: 'active' | 'disabled' | 'expired'; - /** * Body param: */ @@ -396,6 +379,11 @@ export interface TokenUpdateParams { * 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 { @@ -459,7 +447,6 @@ export interface TokenVerifyParams { Tokens.PermissionGroups = PermissionGroups; Tokens.PermissionGroupListResponsesSinglePage = PermissionGroupListResponsesSinglePage; -Tokens.PermissionGroupGetResponsesSinglePage = PermissionGroupGetResponsesSinglePage; Tokens.Value = Value; export declare namespace Tokens { @@ -480,7 +467,6 @@ export declare namespace Tokens { type PermissionGroupListResponse as PermissionGroupListResponse, type PermissionGroupGetResponse as PermissionGroupGetResponse, PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, - PermissionGroupGetResponsesSinglePage as PermissionGroupGetResponsesSinglePage, type PermissionGroupListParams as PermissionGroupListParams, type PermissionGroupGetParams as PermissionGroupGetParams, }; diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index 6b9563bcee..4142a8ce6e 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -515,7 +515,7 @@ export interface LogEditParams { /** * Body param: */ - metadata?: Record | null; + metadata?: { [key: string]: string | number | boolean } | null; /** * Body param: diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index de1b370325..f2c856be09 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -659,7 +659,7 @@ export declare namespace AIRunParams { /** * Definitions of each parameter. */ - properties: Record; + properties: { [key: string]: Parameters.Properties }; /** * The type of the parameters object (usually 'object'). @@ -728,7 +728,7 @@ export declare namespace AIRunParams { /** * Definitions of each parameter. */ - properties: Record; + properties: { [key: string]: Parameters.Properties }; /** * The type of the parameters object (usually 'object'). diff --git a/src/resources/alerting/available-alerts.ts b/src/resources/alerting/available-alerts.ts index 3a7fd80ac7..3133d5adf8 100644 --- a/src/resources/alerting/available-alerts.ts +++ b/src/resources/alerting/available-alerts.ts @@ -28,7 +28,7 @@ export class AvailableAlerts extends APIResource { } } -export type AvailableAlertListResponse = Record>; +export type AvailableAlertListResponse = { [key: string]: Array }; export namespace AvailableAlertListResponse { export interface Item { diff --git a/src/resources/alerting/destinations/eligible.ts b/src/resources/alerting/destinations/eligible.ts index 20103897e8..98135394f4 100644 --- a/src/resources/alerting/destinations/eligible.ts +++ b/src/resources/alerting/destinations/eligible.ts @@ -26,7 +26,7 @@ export class Eligible extends APIResource { } } -export type EligibleGetResponse = Record>; +export type EligibleGetResponse = { [key: string]: Array }; export namespace EligibleGetResponse { export interface Item { diff --git a/src/resources/api-gateway/discovery/operations.ts b/src/resources/api-gateway/discovery/operations.ts index 47b73c4178..2ed9c4cc6a 100644 --- a/src/resources/api-gateway/discovery/operations.ts +++ b/src/resources/api-gateway/discovery/operations.ts @@ -87,7 +87,7 @@ export class Operations extends APIResource { } } -export type OperationBulkEditResponse = Record; +export type OperationBulkEditResponse = { [key: string]: OperationBulkEditResponse.item }; export namespace OperationBulkEditResponse { /** @@ -184,7 +184,7 @@ export interface OperationBulkEditParams { /** * Body param: */ - body: Record; + body: { [key: string]: OperationBulkEditParams.Body }; } export namespace OperationBulkEditParams { diff --git a/src/resources/api-gateway/operations/schema-validation.ts b/src/resources/api-gateway/operations/schema-validation.ts index 8c7a2c0614..19466e0d9f 100644 --- a/src/resources/api-gateway/operations/schema-validation.ts +++ b/src/resources/api-gateway/operations/schema-validation.ts @@ -7,14 +7,7 @@ export class SchemaValidation extends APIResource { /** * Updates operation-level schema validation settings on the zone * - * @example - * ```ts - * const schemaValidation = - * await client.apiGateway.operations.schemaValidation.update( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ update( operationId: string, @@ -31,17 +24,7 @@ export class SchemaValidation extends APIResource { /** * Updates multiple operation-level schema validation settings on the zone * - * @example - * ```ts - * const settingsMultipleRequest = - * await client.apiGateway.operations.schemaValidation.edit({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * settings_multiple_request: { - * '3818d821-5901-4147-a474-f5f5aec1d54e': {}, - * 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, - * }, - * }); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ edit( params: SchemaValidationEditParams, @@ -59,14 +42,7 @@ export class SchemaValidation extends APIResource { /** * Retrieves operation-level schema validation settings on the zone * - * @example - * ```ts - * const schemaValidation = - * await client.apiGateway.operations.schemaValidation.get( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ get( operationId: string, @@ -81,7 +57,7 @@ export class SchemaValidation extends APIResource { } } -export type SettingsMultipleRequest = Record; +export type SettingsMultipleRequest = { [key: string]: SettingsMultipleRequest.item }; export namespace SettingsMultipleRequest { /** @@ -102,7 +78,7 @@ export namespace SettingsMultipleRequest { } } -export type SettingsMultipleRequestParam = Record; +export type SettingsMultipleRequestParam = { [key: string]: SettingsMultipleRequestParam.item }; export namespace SettingsMultipleRequestParam { /** diff --git a/src/resources/api-gateway/settings/schema-validation.ts b/src/resources/api-gateway/settings/schema-validation.ts index a6585f8e1f..8b3dbc93f7 100644 --- a/src/resources/api-gateway/settings/schema-validation.ts +++ b/src/resources/api-gateway/settings/schema-validation.ts @@ -8,14 +8,7 @@ export class SchemaValidation extends APIResource { /** * Updates zone level schema validation settings on the zone * - * @example - * ```ts - * const settings = - * await client.apiGateway.settings.schemaValidation.update({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * validation_default_mitigation_action: 'block', - * }); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ update( params: SchemaValidationUpdateParams, @@ -28,13 +21,7 @@ export class SchemaValidation extends APIResource { /** * Updates zone level schema validation settings on the zone * - * @example - * ```ts - * const settings = - * await client.apiGateway.settings.schemaValidation.edit({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ edit( params: SchemaValidationEditParams, @@ -50,13 +37,7 @@ export class SchemaValidation extends APIResource { /** * Retrieves zone level schema validation settings currently set on the zone * - * @example - * ```ts - * const settings = - * await client.apiGateway.settings.schemaValidation.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ get( params: SchemaValidationGetParams, diff --git a/src/resources/api-gateway/user-schemas/hosts.ts b/src/resources/api-gateway/user-schemas/hosts.ts index 659a0e41e2..9f3c20449a 100644 --- a/src/resources/api-gateway/user-schemas/hosts.ts +++ b/src/resources/api-gateway/user-schemas/hosts.ts @@ -8,15 +8,7 @@ export class Hosts extends APIResource { /** * Retrieve schema hosts in a zone * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const hostListResponse of client.apiGateway.userSchemas.hosts.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ list( params: HostListParams, diff --git a/src/resources/api-gateway/user-schemas/operations.ts b/src/resources/api-gateway/user-schemas/operations.ts index fc74b36696..e160ab32ce 100644 --- a/src/resources/api-gateway/user-schemas/operations.ts +++ b/src/resources/api-gateway/user-schemas/operations.ts @@ -9,16 +9,7 @@ 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. * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const operationListResponse of client.apiGateway.userSchemas.operations.list( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ list( schemaId: string, diff --git a/src/resources/api-gateway/user-schemas/user-schemas.ts b/src/resources/api-gateway/user-schemas/user-schemas.ts index 575b0a5a45..f143c9c67d 100644 --- a/src/resources/api-gateway/user-schemas/user-schemas.ts +++ b/src/resources/api-gateway/user-schemas/user-schemas.ts @@ -20,15 +20,7 @@ export class UserSchemas extends APIResource { /** * Upload a schema to a zone * - * @example - * ```ts - * const schemaUpload = - * await client.apiGateway.userSchemas.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * file: fs.createReadStream('path/to/file'), - * kind: 'openapi_v3', - * }); - * ``` + * @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; @@ -43,15 +35,7 @@ export class UserSchemas extends APIResource { /** * Retrieve information about all schemas on a zone * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const publicSchema of client.apiGateway.userSchemas.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ list( params: UserSchemaListParams, @@ -68,14 +52,7 @@ export class UserSchemas extends APIResource { /** * Delete a schema * - * @example - * ```ts - * const userSchema = - * await client.apiGateway.userSchemas.delete( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ delete( schemaId: string, @@ -89,14 +66,7 @@ export class UserSchemas extends APIResource { /** * Enable validation for a schema * - * @example - * ```ts - * const publicSchema = - * await client.apiGateway.userSchemas.edit( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ edit( schemaId: string, @@ -115,14 +85,7 @@ export class UserSchemas extends APIResource { /** * Retrieve information about a specific schema on a zone * - * @example - * ```ts - * const publicSchema = - * await client.apiGateway.userSchemas.get( - * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated Use [Schema Validation API](https://developers.cloudflare.com/api/resources/schema_validation/) instead. */ get( schemaId: string, diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index bc9b69b9c0..5200d8a7d5 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -115,9 +115,10 @@ export class BotManagement extends APIResource { export interface BotFightModeConfiguration { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -190,9 +191,10 @@ export namespace BotFightModeConfiguration { export interface BotFightModeConfigurationParam { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -213,9 +215,10 @@ export interface BotFightModeConfigurationParam { export interface SubscriptionConfiguration { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Automatically update to the newest bot detection models created by Cloudflare as @@ -296,9 +299,10 @@ export namespace SubscriptionConfiguration { export interface SubscriptionConfigurationParam { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Automatically update to the newest bot detection models created by Cloudflare as @@ -327,9 +331,10 @@ export interface SubscriptionConfigurationParam { export interface SuperBotFightModeDefinitelyConfiguration { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -398,9 +403,10 @@ export namespace SuperBotFightModeDefinitelyConfiguration { export interface SuperBotFightModeDefinitelyConfigurationParam { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -438,9 +444,10 @@ export interface SuperBotFightModeDefinitelyConfigurationParam { export interface SuperBotFightModeLikelyConfiguration { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -508,9 +515,10 @@ export namespace SuperBotFightModeLikelyConfiguration { export interface SuperBotFightModeLikelyConfigurationParam { /** - * Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -577,9 +585,10 @@ export declare namespace BotManagementUpdateParams { zone_id: string; /** - * Body param: Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -606,9 +615,10 @@ export declare namespace BotManagementUpdateParams { zone_id: string; /** - * Body param: Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -654,9 +664,10 @@ export declare namespace BotManagementUpdateParams { zone_id: string; /** - * Body param: Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. @@ -708,9 +719,10 @@ export declare namespace BotManagementUpdateParams { zone_id: string; /** - * Body param: Enable rule to block AI Scrapers and Crawlers. + * 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'; + ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; /** * Body param: Automatically update to the newest bot detection models created by diff --git a/src/resources/brand-protection.ts b/src/resources/brand-protection.ts index b161cfe451..43f671a51c 100644 --- a/src/resources/brand-protection.ts +++ b/src/resources/brand-protection.ts @@ -1,249 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '../resource'; -import * as Core from '../core'; - -export class BrandProtection extends APIResource { - /** - * Submit suspicious URL for scanning. - * - * @example - * ```ts - * const submit = await client.brandProtection.submit({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - 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: Submit }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Gets phishing details about a URL. - * - * @example - * ```ts - * const info = await client.brandProtection.urlInfo({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - 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: Info }> - )._thenUnwrap((obj) => obj.result); - } -} - -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?: 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 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 URLInfoModelResults { - /** - * 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 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: Submission URL(s) to filter submission results by. - */ - url?: Array; - - /** - * Query param: Submission ID(s) to filter submission results by. - */ - url_id?: Array; -} - -export declare namespace BrandProtection { - export { - type Info as Info, - type RuleMatch as RuleMatch, - type ScanStatus as ScanStatus, - type Submit as Submit, - type URLInfoModelResults as URLInfoModelResults, - type BrandProtectionSubmitParams as BrandProtectionSubmitParams, - type BrandProtectionURLInfoParams as 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..35614d25f6 --- /dev/null +++ b/src/resources/brand-protection/brand-protection.ts @@ -0,0 +1,275 @@ +// 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 { LogoMatches } from './logo-matches'; +import * as LogosAPI from './logos'; +import { Logos } from './logos'; +import * as MatchesAPI from './matches'; +import { Matches } from './matches'; +import * as QueriesAPI from './queries'; +import { Queries } from './queries'; + +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); + + /** + * Submit suspicious URL for scanning. + * + * @example + * ```ts + * const submit = await client.brandProtection.submit({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + 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: Submit }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets phishing details about a URL. + * + * @example + * ```ts + * const info = await client.brandProtection.urlInfo({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + 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: Info }> + )._thenUnwrap((obj) => obj.result); + } +} + +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?: 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 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 URLInfoModelResults { + /** + * 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 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: Submission URL(s) to filter submission results by. + */ + url?: Array; + + /** + * Query param: Submission ID(s) to filter submission results by. + */ + url_id?: Array; +} + +BrandProtection.Queries = Queries; +BrandProtection.Matches = Matches; +BrandProtection.Logos = Logos; +BrandProtection.LogoMatches = LogoMatches; + +export declare namespace BrandProtection { + export { + type Info as Info, + type RuleMatch as RuleMatch, + type ScanStatus as ScanStatus, + type Submit as Submit, + type URLInfoModelResults as URLInfoModelResults, + type BrandProtectionSubmitParams as BrandProtectionSubmitParams, + type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams, + }; + + export { Queries as Queries }; + + export { Matches as Matches }; + + export { Logos as Logos }; + + export { LogoMatches as LogoMatches }; +} diff --git a/src/resources/brand-protection/index.ts b/src/resources/brand-protection/index.ts new file mode 100644 index 0000000000..48fb0dbe1e --- /dev/null +++ b/src/resources/brand-protection/index.ts @@ -0,0 +1,7 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { BrandProtection } from './brand-protection'; +export { LogoMatches } from './logo-matches'; +export { Logos } from './logos'; +export { Matches } from './matches'; +export { Queries } 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..6739017317 --- /dev/null +++ b/src/resources/brand-protection/logo-matches.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class LogoMatches extends APIResource {} diff --git a/src/resources/brand-protection/logos.ts b/src/resources/brand-protection/logos.ts new file mode 100644 index 0000000000..59e15a9aee --- /dev/null +++ b/src/resources/brand-protection/logos.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class Logos extends APIResource {} diff --git a/src/resources/brand-protection/matches.ts b/src/resources/brand-protection/matches.ts new file mode 100644 index 0000000000..c158fda89e --- /dev/null +++ b/src/resources/brand-protection/matches.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class Matches extends APIResource {} diff --git a/src/resources/brand-protection/queries.ts b/src/resources/brand-protection/queries.ts new file mode 100644 index 0000000000..1794cc0174 --- /dev/null +++ b/src/resources/brand-protection/queries.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class Queries extends APIResource {} diff --git a/src/resources/browser-rendering/content.ts b/src/resources/browser-rendering/content.ts index 1da7dd63be..04f2e597c7 100644 --- a/src/resources/browser-rendering/content.ts +++ b/src/resources/browser-rendering/content.ts @@ -151,7 +151,7 @@ export interface ContentCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index 2ede49afd5..f236ed4200 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -20,7 +20,7 @@ export class Json extends APIResource { } } -export type JsonCreateResponse = Record; +export type JsonCreateResponse = { [key: string]: unknown }; export interface JsonCreateParams { /** @@ -158,7 +158,7 @@ export interface JsonCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: @@ -273,7 +273,7 @@ export namespace JsonCreateParams { * Schema for the response format. More information here: * https://developers.cloudflare.com/workers-ai/json-mode/ */ - schema?: Record; + schema?: { [key: string]: unknown }; } /** diff --git a/src/resources/browser-rendering/links.ts b/src/resources/browser-rendering/links.ts index 546b036f4f..22ad8e0156 100644 --- a/src/resources/browser-rendering/links.ts +++ b/src/resources/browser-rendering/links.ts @@ -147,7 +147,7 @@ export interface LinkCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/browser-rendering/markdown.ts b/src/resources/browser-rendering/markdown.ts index 3d04bf6c5a..a0e9fed844 100644 --- a/src/resources/browser-rendering/markdown.ts +++ b/src/resources/browser-rendering/markdown.ts @@ -154,7 +154,7 @@ export interface MarkdownCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/browser-rendering/pdf.ts b/src/resources/browser-rendering/pdf.ts index 8c0ce2eb76..85a8c91221 100644 --- a/src/resources/browser-rendering/pdf.ts +++ b/src/resources/browser-rendering/pdf.ts @@ -113,6 +113,11 @@ export interface PDFCreateParams { */ html?: string; + /** + * Body param: Check [options](https://pptr.dev/api/puppeteer.pdfoptions). + */ + pdfOptions?: PDFCreateParams.PDFOptions; + /** * Body param: Block undesired requests that match the provided regex patterns, eg. * '/^.\*\.(css)'. @@ -147,7 +152,7 @@ export interface PDFCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: @@ -255,6 +260,106 @@ export namespace PDFCreateParams { | Array<'load' | 'domcontentloaded' | 'networkidle0' | 'networkidle2'>; } + /** + * Check [options](https://pptr.dev/api/puppeteer.pdfoptions). + */ + export interface PDFOptions { + /** + * Whether to show the header and footer. + */ + displayHeaderFooter?: boolean; + + /** + * HTML template for the print footer. + */ + footerTemplate?: string; + + /** + * Paper format. Takes priority over width and height if set. + */ + format?: 'letter' | 'legal' | 'tabloid' | 'ledger' | 'a0' | 'a1' | 'a2' | 'a3' | 'a4' | 'a5' | 'a6'; + + /** + * HTML template for the print header. + */ + headerTemplate?: string; + + /** + * Sets the height of paper. Can be a number or string with unit. + */ + height?: string | number; + + /** + * Whether to print in landscape orientation. + */ + landscape?: boolean; + + /** + * Set the PDF margins. Useful when setting header and footer. + */ + margin?: PDFOptions.Margin; + + /** + * Hides default white background and allows generating pdfs with transparency. + */ + omitBackground?: boolean; + + /** + * Generate document outline. + */ + outline?: boolean; + + /** + * Paper ranges to print, e.g. '1-5, 8, 11-13'. + */ + pageRanges?: string; + + /** + * Give CSS @page size priority over other size declarations. + */ + preferCSSPageSize?: boolean; + + /** + * Set to true to print background graphics. + */ + printBackground?: boolean; + + /** + * Scales the rendering of the web page. Amount must be between 0.1 and 2. + */ + scale?: number; + + /** + * Generate tagged (accessible) PDF. + */ + tagged?: boolean; + + /** + * Timeout in milliseconds. + */ + timeout?: number; + + /** + * Sets the width of paper. Can be a number or string with unit. + */ + width?: string | number; + } + + export namespace PDFOptions { + /** + * Set the PDF margins. Useful when setting header and footer. + */ + export interface Margin { + bottom?: string | number; + + left?: string | number; + + right?: string | number; + + top?: string | number; + } + } + /** * Check [options](https://pptr.dev/api/puppeteer.page.setviewport). */ diff --git a/src/resources/browser-rendering/scrape.ts b/src/resources/browser-rendering/scrape.ts index 21b426d902..37e98e8d62 100644 --- a/src/resources/browser-rendering/scrape.ts +++ b/src/resources/browser-rendering/scrape.ts @@ -213,7 +213,7 @@ export interface ScrapeCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/browser-rendering/screenshot.ts b/src/resources/browser-rendering/screenshot.ts index de6115e964..50217d5d69 100644 --- a/src/resources/browser-rendering/screenshot.ts +++ b/src/resources/browser-rendering/screenshot.ts @@ -186,7 +186,7 @@ export interface ScreenshotCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/browser-rendering/snapshot.ts b/src/resources/browser-rendering/snapshot.ts index 7626807fb4..89a8640628 100644 --- a/src/resources/browser-rendering/snapshot.ts +++ b/src/resources/browser-rendering/snapshot.ts @@ -167,7 +167,7 @@ export interface SnapshotCreateParams { /** * Body param: */ - setExtraHTTPHeaders?: Record; + setExtraHTTPHeaders?: { [key: string]: string }; /** * Body param: diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index 8e3e113e6a..e62dd3c823 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -235,7 +235,7 @@ export declare namespace CachePurgeParams { export namespace CachePurgeSingleFileWithURLAndHeaders { export interface File { - headers?: Record; + headers?: { [key: string]: string }; url?: string; } diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index d21cb6e62d..967c7e19e4 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -94,8 +94,6 @@ export class ThreatEvents extends APIResource { * const threatEvent = * await client.cloudforceOne.threatEvents.create({ * account_id: 'account_id', - * attacker: 'Flying Yeti', - * attackerCountry: 'CN', * category: 'Domain Resolution', * date: '2022-04-01T00:00:00Z', * event: 'An attacker registered the domain domain.com', @@ -172,8 +170,6 @@ export class ThreatEvents extends APIResource { * account_id: 'account_id', * data: [ * { - * attacker: 'Flying Yeti', - * attackerCountry: 'CN', * category: 'Domain Resolution', * date: '2022-04-01T00:00:00Z', * event: @@ -253,8 +249,6 @@ export interface ThreatEventCreateResponse { category: string; - categoryId: number; - date: string; event: string; @@ -312,8 +306,6 @@ export namespace ThreatEventListResponse { category: string; - categoryId: number; - date: string; event: string; @@ -362,66 +354,10 @@ export interface ThreatEventDeleteResponse { uuid: string; } -export type ThreatEventBulkCreateResponse = - Array; - -export namespace ThreatEventBulkCreateResponse { - export interface ThreatEventBulkCreateResponseItem { - id: number; - - accountId: number; - - attacker: string; - - attackerCountry: string; - - category: string; - - categoryId: number; - - date: string; - - event: string; - - indicator: string; - - indicatorType: string; - - indicatorTypeId: number; - - killChain: number; - - mitreAttack: Array; - - numReferenced: number; - - numReferences: number; - - rawId: string; - - referenced: Array; - - referencedIds: Array; - - references: Array; - - referencesIds: Array; - - tags: Array; - - targetCountry: string; - - targetIndustry: string; - - tlp: string; - - uuid: string; - - insight?: string; - - releasabilityId?: string; - } -} +/** + * Number of created bulk events + */ +export type ThreatEventBulkCreateResponse = number; export interface ThreatEventEditResponse { id: number; @@ -434,8 +370,6 @@ export interface ThreatEventEditResponse { category: string; - categoryId: number; - date: string; event: string; @@ -490,8 +424,6 @@ export interface ThreatEventGetResponse { category: string; - categoryId: number; - date: string; event: string; @@ -544,47 +476,47 @@ export interface ThreatEventCreateParams { /** * Body param: */ - attacker: string; + category: string; /** * Body param: */ - attackerCountry: string; + date: string; /** * Body param: */ - category: string; + event: string; /** * Body param: */ - date: string; + indicatorType: string; /** * Body param: */ - event: string; + raw: ThreatEventCreateParams.Raw; /** * Body param: */ - indicatorType: string; + tlp: string; /** * Body param: */ - raw: ThreatEventCreateParams.Raw; + accountId?: number; /** * Body param: */ - tlp: string; + attacker?: string; /** * Body param: */ - accountId?: number; + attackerCountry?: string; /** * Body param: @@ -614,7 +546,7 @@ export interface ThreatEventCreateParams { export namespace ThreatEventCreateParams { export interface Raw { - data: Record | null; + data: { [key: string]: unknown } | null; source?: string; @@ -712,10 +644,6 @@ export interface ThreatEventBulkCreateParams { export namespace ThreatEventBulkCreateParams { export interface Data { - attacker: string; - - attackerCountry: string; - category: string; date: string; @@ -730,6 +658,10 @@ export namespace ThreatEventBulkCreateParams { accountId?: number; + attacker?: string; + + attackerCountry?: string; + datasetId?: string; indicator?: string; @@ -743,7 +675,7 @@ export namespace ThreatEventBulkCreateParams { export namespace Data { export interface Raw { - data: Record | null; + data: { [key: string]: unknown } | null; source?: string; diff --git a/src/resources/custom-hostnames/certificate-pack/certificates.ts b/src/resources/custom-hostnames/certificate-pack/certificates.ts index e6e55e7b30..73b06f3df3 100644 --- a/src/resources/custom-hostnames/certificate-pack/certificates.ts +++ b/src/resources/custom-hostnames/certificate-pack/certificates.ts @@ -99,7 +99,7 @@ export interface CertificateUpdateResponse { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME diff --git a/src/resources/custom-hostnames/custom-hostnames.ts b/src/resources/custom-hostnames/custom-hostnames.ts index f0b47fcd38..36169ef325 100644 --- a/src/resources/custom-hostnames/custom-hostnames.ts +++ b/src/resources/custom-hostnames/custom-hostnames.ts @@ -196,7 +196,7 @@ export interface CustomHostname { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -519,7 +519,7 @@ export interface CustomHostnameCreateResponse { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -820,7 +820,7 @@ export interface CustomHostnameListResponse { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -1128,7 +1128,7 @@ export interface CustomHostnameEditResponse { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -1429,7 +1429,7 @@ export interface CustomHostnameGetResponse { * Unique key/value metadata for this hostname. These are per-hostname (customer) * settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * a valid hostname that’s been added to your DNS zone as an A, AAAA, or CNAME @@ -1728,7 +1728,7 @@ export interface CustomHostnameCreateParams { * Body param: Unique key/value metadata for this hostname. These are per-hostname * (customer) settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; } export namespace CustomHostnameCreateParams { @@ -1890,7 +1890,7 @@ export interface CustomHostnameEditParams { * Body param: Unique key/value metadata for this hostname. These are per-hostname * (customer) settings. */ - custom_metadata?: Record; + custom_metadata?: { [key: string]: string }; /** * Body param: a valid hostname that’s been added to your DNS zone as an A, AAAA, diff --git a/src/resources/dns-firewall/reverse-dns.ts b/src/resources/dns-firewall/reverse-dns.ts index 4658a5db94..ae374ca9b4 100644 --- a/src/resources/dns-firewall/reverse-dns.ts +++ b/src/resources/dns-firewall/reverse-dns.ts @@ -59,14 +59,14 @@ export interface ReverseDNSEditResponse { /** * Map of cluster IP addresses to PTR record contents */ - ptr: Record; + ptr: { [key: string]: string }; } export interface ReverseDNSGetResponse { /** * Map of cluster IP addresses to PTR record contents */ - ptr: Record; + ptr: { [key: string]: string }; } export interface ReverseDNSEditParams { @@ -78,7 +78,7 @@ export interface ReverseDNSEditParams { /** * Body param: Map of cluster IP addresses to PTR record contents */ - ptr?: Record; + ptr?: { [key: string]: string }; } export interface ReverseDNSGetParams { diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 255fc19d37..557af9dfac 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -22,6 +22,7 @@ export class Records extends APIResource { * const recordResponse = await client.dns.records.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'example.com', + * ttl: 3600, * type: 'A', * }); * ``` @@ -52,6 +53,7 @@ export class Records extends APIResource { * { * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'example.com', + * ttl: 3600, * type: 'A', * }, * ); @@ -171,6 +173,7 @@ export class Records extends APIResource { * { * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'example.com', + * ttl: 3600, * type: 'A', * }, * ); @@ -296,6 +299,13 @@ export interface ARecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -327,13 +337,6 @@ export interface ARecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace ARecord { @@ -365,6 +368,13 @@ export interface ARecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -396,13 +406,6 @@ export interface ARecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace ARecordParam { @@ -434,6 +437,13 @@ export interface AAAARecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -465,13 +475,6 @@ export interface AAAARecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace AAAARecord { @@ -503,6 +506,13 @@ export interface AAAARecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -534,13 +544,6 @@ export interface AAAARecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace AAAARecordParam { @@ -636,6 +639,13 @@ export namespace BatchPatch { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTL; + /** * Record type. */ @@ -667,13 +677,6 @@ export namespace BatchPatch { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTL; } export namespace OpenpgpkeyRecord { @@ -875,6 +878,13 @@ export namespace BatchPatchParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTLParam; + /** * Record type. */ @@ -906,13 +916,6 @@ export namespace BatchPatchParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTLParam; } export namespace OpenpgpkeyRecord { @@ -1114,6 +1117,13 @@ export namespace BatchPut { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTL; + /** * Record type. */ @@ -1145,13 +1155,6 @@ export namespace BatchPut { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTL; } export namespace OpenpgpkeyRecord { @@ -1353,6 +1356,13 @@ export namespace BatchPutParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTLParam; + /** * Record type. */ @@ -1384,13 +1394,6 @@ export namespace BatchPutParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTLParam; } export namespace OpenpgpkeyRecord { @@ -1528,6 +1531,13 @@ export interface CAARecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -1564,13 +1574,6 @@ export interface CAARecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace CAARecord { @@ -1622,6 +1625,13 @@ export interface CAARecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -1653,13 +1663,6 @@ export interface CAARecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace CAARecordParam { @@ -1711,6 +1714,13 @@ export interface CERTRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -1747,13 +1757,6 @@ export interface CERTRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace CERTRecord { @@ -1810,6 +1813,13 @@ export interface CERTRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -1841,13 +1851,6 @@ export interface CERTRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace CERTRecordParam { @@ -1904,6 +1907,13 @@ export interface CNAMERecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -1935,13 +1945,6 @@ export interface CNAMERecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace CNAMERecord { @@ -1981,6 +1984,13 @@ export interface CNAMERecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -2012,13 +2022,6 @@ export interface CNAMERecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace CNAMERecordParam { @@ -2058,6 +2061,13 @@ export interface DNSKEYRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -2094,13 +2104,6 @@ export interface DNSKEYRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace DNSKEYRecord { @@ -2157,6 +2160,13 @@ export interface DNSKEYRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -2188,13 +2198,6 @@ export interface DNSKEYRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSKEYRecordParam { @@ -2251,6 +2254,13 @@ export interface DSRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -2287,13 +2297,6 @@ export interface DSRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace DSRecord { @@ -2350,6 +2353,13 @@ export interface DSRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -2381,13 +2391,6 @@ export interface DSRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace DSRecordParam { @@ -2444,6 +2447,13 @@ export interface HTTPSRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -2480,13 +2490,6 @@ export interface HTTPSRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace HTTPSRecord { @@ -2538,6 +2541,13 @@ export interface HTTPSRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -2569,13 +2579,6 @@ export interface HTTPSRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace HTTPSRecordParam { @@ -2627,6 +2630,13 @@ export interface LOCRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -2663,13 +2673,6 @@ export interface LOCRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace LOCRecord { @@ -2767,8 +2770,15 @@ export interface LOCRecordParam { name: string; /** - * Record type. - */ + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + + /** + * Record type. + */ type: 'LOC'; /** @@ -2797,13 +2807,6 @@ export interface LOCRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace LOCRecordParam { @@ -2900,6 +2903,13 @@ export interface MXRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -2937,13 +2947,6 @@ export interface MXRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace MXRecord { @@ -2975,6 +2978,13 @@ export interface MXRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -3012,13 +3022,6 @@ export interface MXRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace MXRecordParam { @@ -3050,6 +3053,13 @@ export interface NAPTRRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -3086,13 +3096,6 @@ export interface NAPTRRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace NAPTRRecord { @@ -3159,6 +3162,13 @@ export interface NAPTRRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -3190,13 +3200,6 @@ export interface NAPTRRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace NAPTRRecordParam { @@ -3263,6 +3266,13 @@ export interface NSRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -3294,13 +3304,6 @@ export interface NSRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace NSRecord { @@ -3332,6 +3335,13 @@ export interface NSRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -3363,13 +3373,6 @@ export interface NSRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace NSRecordParam { @@ -3401,6 +3404,13 @@ export interface PTRRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -3432,13 +3442,6 @@ export interface PTRRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace PTRRecord { @@ -3470,6 +3473,13 @@ export interface PTRRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -3501,13 +3511,6 @@ export interface PTRRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace PTRRecordParam { @@ -3563,6 +3566,13 @@ export namespace Record { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTL; + /** * Record type. */ @@ -3594,13 +3604,6 @@ export namespace Record { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTL; } export namespace Openpgpkey { @@ -4514,6 +4517,13 @@ export interface SMIMEARecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -4550,13 +4560,6 @@ export interface SMIMEARecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace SMIMEARecord { @@ -4613,6 +4616,13 @@ export interface SMIMEARecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -4644,13 +4654,6 @@ export interface SMIMEARecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace SMIMEARecordParam { @@ -4707,6 +4710,13 @@ export interface SRVRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -4744,13 +4754,6 @@ export interface SRVRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace SRVRecord { @@ -4808,6 +4811,13 @@ export interface SRVRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -4839,13 +4849,6 @@ export interface SRVRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace SRVRecordParam { @@ -4903,6 +4906,13 @@ export interface SSHFPRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -4939,13 +4949,6 @@ export interface SSHFPRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace SSHFPRecord { @@ -4997,6 +5000,13 @@ export interface SSHFPRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -5028,13 +5038,6 @@ export interface SSHFPRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace SSHFPRecordParam { @@ -5086,6 +5089,13 @@ export interface SVCBRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -5122,13 +5132,6 @@ export interface SVCBRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace SVCBRecord { @@ -5180,6 +5183,13 @@ export interface SVCBRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -5211,13 +5221,6 @@ export interface SVCBRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace SVCBRecordParam { @@ -5269,6 +5272,13 @@ export interface TLSARecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -5305,13 +5315,6 @@ export interface TLSARecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace TLSARecord { @@ -5368,6 +5371,13 @@ export interface TLSARecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -5399,13 +5409,6 @@ export interface TLSARecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace TLSARecordParam { @@ -5476,6 +5479,13 @@ export interface TXTRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -5512,13 +5522,6 @@ export interface TXTRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace TXTRecord { @@ -5551,7 +5554,14 @@ export interface TXTRecordParam { name: string; /** - * Record type. + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + + /** + * Record type. */ type: 'TXT'; @@ -5586,13 +5596,6 @@ export interface TXTRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace TXTRecordParam { @@ -5624,6 +5627,13 @@ export interface URIRecord { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTL; + /** * Record type. */ @@ -5666,13 +5676,6 @@ export interface URIRecord { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTL; } export namespace URIRecord { @@ -5719,6 +5722,13 @@ export interface URIRecordParam { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: TTLParam; + /** * Record type. */ @@ -5756,13 +5766,6 @@ export interface URIRecordParam { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: TTLParam; } export namespace URIRecordParam { @@ -5884,6 +5887,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -5916,13 +5926,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace ARecord { @@ -5959,6 +5962,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -5991,13 +6001,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace AAAARecord { @@ -6034,6 +6037,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6066,13 +6076,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CNAMERecord { @@ -6117,6 +6120,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6155,13 +6165,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace MXRecord { @@ -6198,6 +6201,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6230,13 +6240,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NSRecord { @@ -6273,6 +6276,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6306,13 +6316,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSRecordsOpenpgpkeyRecord { @@ -6349,6 +6352,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6381,13 +6391,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace PTRRecord { @@ -6424,6 +6427,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6461,13 +6471,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TXTRecord { @@ -6504,6 +6507,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6536,13 +6546,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CAARecord { @@ -6599,6 +6602,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6631,13 +6641,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CERTRecord { @@ -6699,6 +6702,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6731,13 +6741,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSKEYRecord { @@ -6799,6 +6802,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6831,13 +6841,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DSRecord { @@ -6899,6 +6902,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -6931,13 +6941,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace HTTPSRecord { @@ -6994,6 +6997,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7026,13 +7036,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace LOCRecord { @@ -7134,6 +7137,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7166,13 +7176,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NAPTRRecord { @@ -7244,6 +7247,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7276,13 +7286,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SMIMEARecord { @@ -7344,6 +7347,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7376,13 +7386,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SRVRecord { @@ -7445,6 +7448,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7477,13 +7487,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SSHFPRecord { @@ -7541,9 +7544,16 @@ export declare namespace RecordCreateParams { name: string; /** - * Body param: Record type. - */ - type: 'SVCB'; + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + + /** + * Body param: Record type. + */ + type: 'SVCB'; /** * Body param: Comments or notes about the DNS record. This field has no effect on @@ -7572,13 +7582,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SVCBRecord { @@ -7635,6 +7638,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7667,13 +7677,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TLSARecord { @@ -7735,6 +7738,13 @@ export declare namespace RecordCreateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7773,13 +7783,6 @@ export declare namespace RecordCreateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace URIRecord { @@ -7856,6 +7859,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7888,13 +7898,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace ARecord { @@ -7931,6 +7934,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -7963,13 +7973,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace AAAARecord { @@ -8006,6 +8009,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8038,13 +8048,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CNAMERecord { @@ -8089,6 +8092,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8127,13 +8137,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace MXRecord { @@ -8170,6 +8173,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8202,13 +8212,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NSRecord { @@ -8245,6 +8248,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8278,13 +8288,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSRecordsOpenpgpkeyRecord { @@ -8321,6 +8324,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8353,13 +8363,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace PTRRecord { @@ -8396,6 +8399,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8433,13 +8443,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TXTRecord { @@ -8476,6 +8479,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8508,13 +8518,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CAARecord { @@ -8571,6 +8574,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8603,13 +8613,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CERTRecord { @@ -8671,6 +8674,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8703,13 +8713,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSKEYRecord { @@ -8771,6 +8774,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8803,13 +8813,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DSRecord { @@ -8871,6 +8874,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8903,13 +8913,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace HTTPSRecord { @@ -8966,6 +8969,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -8998,13 +9008,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace LOCRecord { @@ -9106,6 +9109,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9138,13 +9148,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NAPTRRecord { @@ -9216,6 +9219,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9248,13 +9258,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SMIMEARecord { @@ -9316,6 +9319,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9348,13 +9358,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SRVRecord { @@ -9417,6 +9420,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9449,13 +9459,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SSHFPRecord { @@ -9513,7 +9516,14 @@ export declare namespace RecordUpdateParams { name: string; /** - * Body param: Record type. + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + + /** + * Body param: Record type. */ type: 'SVCB'; @@ -9544,13 +9554,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SVCBRecord { @@ -9607,6 +9610,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9639,13 +9649,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TLSARecord { @@ -9707,6 +9710,13 @@ export declare namespace RecordUpdateParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -9745,13 +9755,6 @@ export declare namespace RecordUpdateParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace URIRecord { @@ -10078,6 +10081,13 @@ export namespace RecordBatchParams { */ name: string; + /** + * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. + * Value must be between 60 and 86400, with the minimum reduced to 30 for + * Enterprise zones. + */ + ttl: RecordsAPI.TTLParam; + /** * Record type. */ @@ -10109,13 +10119,6 @@ export namespace RecordBatchParams { * Custom tags for the DNS record. This field has no effect on DNS responses. */ tags?: Array; - - /** - * Time To Live (TTL) of the DNS record in seconds. Setting to 1 means 'automatic'. - * Value must be between 60 and 86400, with the minimum reduced to 30 for - * Enterprise zones. - */ - ttl?: RecordsAPI.TTLParam; } export namespace DNSRecordsOpenpgpkeyRecord { @@ -10177,6 +10180,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10209,13 +10219,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace ARecord { @@ -10252,6 +10255,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10284,13 +10294,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace AAAARecord { @@ -10327,6 +10330,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10359,13 +10369,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CNAMERecord { @@ -10410,6 +10413,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10448,13 +10458,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace MXRecord { @@ -10491,6 +10494,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10523,13 +10533,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NSRecord { @@ -10566,6 +10569,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10599,13 +10609,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSRecordsOpenpgpkeyRecord { @@ -10642,6 +10645,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10674,13 +10684,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace PTRRecord { @@ -10717,6 +10720,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10754,13 +10764,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TXTRecord { @@ -10797,6 +10800,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10829,13 +10839,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CAARecord { @@ -10892,6 +10895,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -10924,13 +10934,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace CERTRecord { @@ -10992,6 +10995,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11024,13 +11034,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DNSKEYRecord { @@ -11092,6 +11095,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11124,13 +11134,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace DSRecord { @@ -11192,6 +11195,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11224,13 +11234,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace HTTPSRecord { @@ -11287,6 +11290,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11319,13 +11329,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace LOCRecord { @@ -11427,6 +11430,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11459,13 +11469,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace NAPTRRecord { @@ -11537,6 +11540,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11569,13 +11579,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SMIMEARecord { @@ -11637,6 +11640,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11669,13 +11679,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SRVRecord { @@ -11738,6 +11741,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11770,13 +11780,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SSHFPRecord { @@ -11833,6 +11836,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11865,13 +11875,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace SVCBRecord { @@ -11928,6 +11931,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -11960,13 +11970,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace TLSARecord { @@ -12028,6 +12031,13 @@ export declare namespace RecordEditParams { */ name: string; + /** + * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means + * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 + * for Enterprise zones. + */ + ttl: TTLParam; + /** * Body param: Record type. */ @@ -12066,13 +12076,6 @@ export declare namespace RecordEditParams { * responses. */ tags?: Array; - - /** - * Body param: Time To Live (TTL) of the DNS record in seconds. Setting to 1 means - * 'automatic'. Value must be between 60 and 86400, with the minimum reduced to 30 - * for Enterprise zones. - */ - ttl?: TTLParam; } export namespace URIRecord { diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index e25e01d2d3..cdc7e9fe3c 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -169,6 +169,11 @@ export interface InvestigateListResponse { export namespace InvestigateListResponse { export interface Properties { + allowlisted_pattern_type?: string; + + /** + * @deprecated + */ whitelisted_pattern_type?: string; } @@ -257,6 +262,11 @@ export interface InvestigateGetResponse { export namespace InvestigateGetResponse { export interface Properties { + allowlisted_pattern_type?: string; + + /** + * @deprecated + */ whitelisted_pattern_type?: string; } diff --git a/src/resources/email-security/investigate/move.ts b/src/resources/email-security/investigate/move.ts index a7fb7fa017..b898b76420 100644 --- a/src/resources/email-security/investigate/move.ts +++ b/src/resources/email-security/investigate/move.ts @@ -72,33 +72,33 @@ export class MoveBulkResponsesSinglePage extends SinglePage {} export interface MoveCreateResponse { completed_timestamp: string; - destination: string; - item_count: number; - message_id: string; + destination?: string | null; + + message_id?: string | null; - operation: string; + operation?: string | null; - recipient: string; + recipient?: string | null; - status: string; + status?: string | null; } export interface MoveBulkResponse { completed_timestamp: string; - destination: string; - item_count: number; - message_id: string; + destination?: string | null; + + message_id?: string | null; - operation: string; + operation?: string | null; - recipient: string; + recipient?: string | null; - status: string; + status?: string | null; } export interface MoveCreateParams { diff --git a/src/resources/email-security/settings/domains.ts b/src/resources/email-security/settings/domains.ts index 9a738ad76f..0d5b913403 100644 --- a/src/resources/email-security/settings/domains.ts +++ b/src/resources/email-security/settings/domains.ts @@ -428,7 +428,7 @@ export interface DomainEditParams { /** * Body param: */ - domain?: string | null; + domain?: string; /** * Body param: @@ -454,12 +454,12 @@ export interface DomainEditParams { /** * Body param: */ - integration_id?: string | null; + integration_id?: string; /** * Body param: */ - lookback_hops?: number | null; + lookback_hops?: number; /** * Body param: diff --git a/src/resources/email-security/settings/trusted-domains.ts b/src/resources/email-security/settings/trusted-domains.ts index 430b949d40..d015ff7252 100644 --- a/src/resources/email-security/settings/trusted-domains.ts +++ b/src/resources/email-security/settings/trusted-domains.ts @@ -424,30 +424,30 @@ export interface TrustedDomainEditParams { /** * Body param: */ - comments?: string | null; + comments?: string; /** * Body param: Select to prevent recently registered domains from triggering a * Suspicious or Malicious disposition. */ - is_recent?: boolean | null; + is_recent?: boolean; /** * Body param: */ - is_regex?: boolean | null; + is_regex?: boolean; /** * Body param: Select for partner or other approved domains that have similar * spelling to your connected domains. Prevents listed domains from triggering a * Spoof disposition. */ - is_similarity?: boolean | null; + is_similarity?: boolean; /** * Body param: */ - pattern?: string | null; + pattern?: string; } export interface TrustedDomainGetParams { diff --git a/src/resources/firewall/lockdowns.ts b/src/resources/firewall/lockdowns.ts index cce23bc361..483ab5af4e 100644 --- a/src/resources/firewall/lockdowns.ts +++ b/src/resources/firewall/lockdowns.ts @@ -271,8 +271,8 @@ export interface LockdownCreateParams { urls: Array; /** - * Body param: An informative summary of the rate limit. This value is sanitized - * and any tags will be removed. + * Body param: An informative summary of the rule. This value is sanitized and any + * tags will be removed. */ description?: string; diff --git a/src/resources/firewall/ua-rules.ts b/src/resources/firewall/ua-rules.ts index af997cc365..f01d578705 100644 --- a/src/resources/firewall/ua-rules.ts +++ b/src/resources/firewall/ua-rules.ts @@ -133,9 +133,97 @@ export class UARules extends APIResource { export class UARuleListResponsesV4PagePaginationArray extends V4PagePaginationArray {} -export type UARuleCreateResponse = unknown | string | null; +export interface UARuleCreateResponse { + /** + * The unique identifier of the User Agent Blocking rule. + */ + id?: string; + + /** + * The configuration object for the current rule. + */ + configuration?: UARuleCreateResponse.Configuration; + + /** + * An informative summary of the rule. + */ + description?: string; + + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge'; + + /** + * When true, indicates that the rule is currently paused. + */ + paused?: boolean; +} + +export namespace UARuleCreateResponse { + /** + * The configuration object for the current rule. + */ + export interface Configuration { + /** + * The configuration target for this rule. You must set the target to `ua` for User + * Agent Blocking rules. + */ + target?: string; -export type UARuleUpdateResponse = unknown | string | null; + /** + * The exact user agent string to match. This value will be compared to the + * received `User-Agent` HTTP header value. + */ + value?: string; + } +} + +export interface UARuleUpdateResponse { + /** + * The unique identifier of the User Agent Blocking rule. + */ + id?: string; + + /** + * The configuration object for the current rule. + */ + configuration?: UARuleUpdateResponse.Configuration; + + /** + * An informative summary of the rule. + */ + description?: string; + + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge'; + + /** + * When true, indicates that the rule is currently paused. + */ + paused?: boolean; +} + +export namespace UARuleUpdateResponse { + /** + * The configuration object for the current rule. + */ + export interface Configuration { + /** + * The configuration target for this rule. You must set the target to `ua` for User + * Agent Blocking rules. + */ + target?: string; + + /** + * The exact user agent string to match. This value will be compared to the + * received `User-Agent` HTTP header value. + */ + value?: string; + } +} export interface UARuleListResponse { /** @@ -188,9 +276,92 @@ export interface UARuleDeleteResponse { * The unique identifier of the User Agent Blocking rule. */ id?: string; + + /** + * The configuration object for the current rule. + */ + configuration?: UARuleDeleteResponse.Configuration; + + /** + * An informative summary of the rule. + */ + description?: string; + + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge'; + + /** + * When true, indicates that the rule is currently paused. + */ + paused?: boolean; +} + +export namespace UARuleDeleteResponse { + /** + * The configuration object for the current rule. + */ + export interface Configuration { + /** + * The configuration target for this rule. You must set the target to `ua` for User + * Agent Blocking rules. + */ + target?: string; + + /** + * The exact user agent string to match. This value will be compared to the + * received `User-Agent` HTTP header value. + */ + value?: string; + } +} + +export interface UARuleGetResponse { + /** + * The unique identifier of the User Agent Blocking rule. + */ + id?: string; + + /** + * The configuration object for the current rule. + */ + configuration?: UARuleGetResponse.Configuration; + + /** + * An informative summary of the rule. + */ + description?: string; + + /** + * The action to apply to a matched request. + */ + mode?: 'block' | 'challenge' | 'js_challenge' | 'managed_challenge'; + + /** + * When true, indicates that the rule is currently paused. + */ + paused?: boolean; } -export type UARuleGetResponse = unknown | string | null; +export namespace UARuleGetResponse { + /** + * The configuration object for the current rule. + */ + export interface Configuration { + /** + * The configuration target for this rule. You must set the target to `ua` for User + * Agent Blocking rules. + */ + target?: string; + + /** + * The exact user agent string to match. This value will be compared to the + * received `User-Agent` HTTP header value. + */ + value?: string; + } +} export interface UARuleCreateParams { /** @@ -207,6 +378,17 @@ export interface UARuleCreateParams { * Body param: The action to apply to a matched request. */ mode: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; + + /** + * Body param: An informative summary of the rule. This value is sanitized and any + * tags will be removed. + */ + description?: string; + + /** + * Body param: When true, indicates that the rule is currently paused. + */ + paused?: boolean; } export namespace UARuleCreateParams { @@ -244,6 +426,17 @@ export interface UARuleUpdateParams { * Body param: The action to apply to a matched request. */ mode: 'block' | 'challenge' | 'whitelist' | 'js_challenge' | 'managed_challenge'; + + /** + * Body param: An informative summary of the rule. This value is sanitized and any + * tags will be removed. + */ + description?: string; + + /** + * Body param: When true, indicates that the rule is currently paused. + */ + paused?: boolean; } export interface UARuleListParams extends V4PagePaginationArrayParams { @@ -258,14 +451,14 @@ export interface UARuleListParams extends V4PagePaginationArrayParams { description?: string; /** - * Query param: A string to search for in the description of existing rules. + * Query param: When true, indicates that the rule is currently paused. */ - description_search?: string; + paused?: boolean; /** * Query param: A string to search for in the user agent values of existing rules. */ - ua_search?: string; + user_agent?: string; } export interface UARuleDeleteParams { diff --git a/src/resources/firewall/waf/overrides.ts b/src/resources/firewall/waf/overrides.ts index b6d57fefae..ab4b27433a 100644 --- a/src/resources/firewall/waf/overrides.ts +++ b/src/resources/firewall/waf/overrides.ts @@ -129,10 +129,10 @@ export interface Override { * creating a new URI-based WAF override, you must provide a `groups` object or a * `rules` object. */ - groups?: Record; + groups?: { [key: string]: unknown }; /** - * When true, indicates that the WAF package is currently paused. + * When true, indicates that the rule is currently paused. */ paused?: boolean; @@ -239,7 +239,7 @@ export interface RewriteActionParam { * group that this WAF rule belongs to. When creating a new URI-based WAF override, * you must provide a `groups` object or a `rules` object. */ -export type WAFRule = Record; +export type WAFRule = { [key: string]: 'challenge' | 'block' | 'simulate' | 'disable' | 'default' }; /** * An object that allows you to override the action of specific WAF rules. Each key @@ -248,7 +248,7 @@ export type WAFRule = Record; +export type WAFRuleParam = { [key: string]: 'challenge' | 'block' | 'simulate' | 'disable' | 'default' }; export interface OverrideDeleteResponse { /** diff --git a/src/resources/healthchecks/healthchecks.ts b/src/resources/healthchecks/healthchecks.ts index fbcb7e6fa2..d750fefb9c 100644 --- a/src/resources/healthchecks/healthchecks.ts +++ b/src/resources/healthchecks/healthchecks.ts @@ -339,7 +339,7 @@ export interface HTTPConfiguration { * The HTTP request headers to send in the health check. It is recommended you set * a Host header by default. The User-Agent header cannot be overridden. */ - header?: Record> | null; + header?: { [key: string]: Array } | null; /** * The HTTP method to use for the health check. @@ -388,7 +388,7 @@ export interface HTTPConfigurationParam { * The HTTP request headers to send in the health check. It is recommended you set * a Host header by default. The User-Agent header cannot be overridden. */ - header?: Record> | null; + header?: { [key: string]: Array } | null; /** * The HTTP method to use for the health check. diff --git a/src/resources/hyperdrive/configs.ts b/src/resources/hyperdrive/configs.ts index 136deadf40..3a94797b6c 100644 --- a/src/resources/hyperdrive/configs.ts +++ b/src/resources/hyperdrive/configs.ts @@ -207,6 +207,12 @@ export interface ConfigCreateParams { * Body param: */ mtls?: ConfigCreateParams.MTLS; + + /** + * Body param: The (soft) maximum number of connections the Hyperdrive is allowed + * to make to the origin database. + */ + origin_connection_limit?: number; } export namespace ConfigCreateParams { @@ -356,6 +362,12 @@ export interface ConfigUpdateParams { * Body param: */ mtls?: ConfigUpdateParams.MTLS; + + /** + * Body param: The (soft) maximum number of connections the Hyperdrive is allowed + * to make to the origin database. + */ + origin_connection_limit?: number; } export namespace ConfigUpdateParams { @@ -520,6 +532,12 @@ export interface ConfigEditParams { | ConfigEditParams.HyperdriveHyperdriveDatabase | ConfigEditParams.HyperdriveInternetOrigin | ConfigEditParams.HyperdriveOverAccessOrigin; + + /** + * Body param: The (soft) maximum number of connections the Hyperdrive is allowed + * to make to the origin database. + */ + origin_connection_limit?: number; } export namespace ConfigEditParams { diff --git a/src/resources/hyperdrive/hyperdrive.ts b/src/resources/hyperdrive/hyperdrive.ts index 17ec4f181b..7554a2e74a 100644 --- a/src/resources/hyperdrive/hyperdrive.ts +++ b/src/resources/hyperdrive/hyperdrive.ts @@ -102,6 +102,12 @@ export interface Hyperdrive { modified_on?: string; mtls?: Hyperdrive.MTLS; + + /** + * The (soft) maximum number of connections the Hyperdrive is allowed to make to + * the origin database. + */ + origin_connection_limit?: number; } export namespace Hyperdrive { diff --git a/src/resources/images/v1/v1.ts b/src/resources/images/v1/v1.ts index de26ea6cc8..cb64db9ee9 100644 --- a/src/resources/images/v1/v1.ts +++ b/src/resources/images/v1/v1.ts @@ -191,10 +191,15 @@ export interface V1CreateParams { */ account_id: string; + /** + * Body param: An optional custom unique identifier for your image. + */ + id?: string; + /** * Body param: An image binary data. Only needed when type is uploading a file. */ - file?: unknown; + file?: Core.Uploadable; /** * Body param: User modifiable key-value store. Can use used for keeping references diff --git a/src/resources/index.ts b/src/resources/index.ts index 6b2f26215c..ac499e1b7f 100644 --- a/src/resources/index.ts +++ b/src/resources/index.ts @@ -14,7 +14,7 @@ export { AuditLogs } from './audit-logs'; export { Billing } from './billing/billing'; export { BotManagement } from './bot-management'; export { BotnetFeed } from './botnet-feed/botnet-feed'; -export { BrandProtection } from './brand-protection'; +export { BrandProtection } from './brand-protection/brand-protection'; export { BrowserRendering } from './browser-rendering/browser-rendering'; export { Cache } from './cache/cache'; export { Calls } from './calls/calls'; diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index dafd863fea..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -53,10 +53,9 @@ export class Keys extends APIResource { } /** - * Get multiple KV pairs from the namespace. Body should contain keys to retrieve - * at most 100. Keys must contain text-based values. If value is json, it can be - * requested to return in JSON, instead of string. Metadata can be return if - * withMetadata is true. + * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based + * values. JSON values can optionally be parsed instead of being returned as a + * string value. Metadata can be included if `withMetadata` is true. * * @deprecated Please use kv.namespaces.bulk_get instead */ @@ -118,15 +117,12 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: Record; + metadata?: unknown; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -143,33 +139,27 @@ export type KeyBulkGetResponse = export namespace KeyBulkGetResponse { export interface WorkersKVBulkGetResult { /** - * Requested keys are paired with their values in an object + * Requested keys are paired with their values in an object. */ - values?: Record>; + values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; } export interface WorkersKVBulkGetResultWithMetadata { /** - * Requested keys are paired with their values and metadata in an object + * Requested keys are paired with their values and metadata in an object. */ - values?: Record; + values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; } export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key - */ - metadata: Record | null; + metadata: unknown; - /** - * The value associated with the key - */ - value: string | number | boolean | Record; + value: unknown; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ expiration?: number; } @@ -178,7 +168,7 @@ export namespace KeyBulkGetResponse { export interface KeyBulkUpdateResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -190,20 +180,20 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorLimitPaginationParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: A string prefix used to filter down which keys will be returned. - * Exact matches and any key names that begin with the prefix will be returned. + * Query param: Filters returned keys by a name prefix. Exact matches and any key + * names that begin with the prefix will be returned. */ prefix?: string; } export interface KeyBulkDeleteParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -215,29 +205,29 @@ export interface KeyBulkDeleteParams { export interface KeyBulkGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Body param: Array of keys to retrieve (maximum 100) + * Body param: Array of keys to retrieve (maximum of 100). */ keys: Array; /** - * Body param: Whether to parse JSON values in the response + * Body param: Whether to parse JSON values in the response. */ type?: 'text' | 'json'; /** - * Body param: Whether to include metadata in the response + * Body param: Whether to include metadata in the response. */ withMetadata?: boolean; } export interface KeyBulkUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -250,39 +240,35 @@ export interface KeyBulkUpdateParams { export namespace KeyBulkUpdateParams { export interface Body { /** - * Whether or not the server should base64 decode the value before storing it. - * Useful for writing values that wouldn't otherwise be valid JSON strings, such as - * images. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - base64?: boolean; + key: string; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - expiration?: number; + value: string; /** - * The number of seconds for which the key should be visible before it expires. At - * least 60. + * Indicates whether or not the server should base64 decode the value before + * storing it. Useful for writing values that wouldn't otherwise be valid JSON + * strings, such as images. */ - expiration_ttl?: number; + base64?: boolean; /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ - key?: string; + expiration?: number; /** - * Arbitrary JSON that is associated with a key. + * Expires the key after a number of seconds. Must be at least 60. */ - metadata?: Record; + expiration_ttl?: number; - /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. - */ - value?: string; + metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 1c885abbd0..53db763063 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,14 +34,11 @@ export class Metadata extends APIResource { } } -/** - * Arbitrary JSON that is associated with a key. - */ -export type MetadataGetResponse = Record; +export type MetadataGetResponse = unknown; export interface MetadataGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 6fc79c5e77..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -164,10 +164,9 @@ export class Namespaces extends APIResource { } /** - * Get multiple KV pairs from the namespace. Body should contain keys to retrieve - * at most 100. Keys must contain text-based values. If value is json, it can be - * requested to return in JSON, instead of string. Metadata can be return if - * withMetadata is true. + * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based + * values. JSON values can optionally be parsed instead of being returned as a + * string value. Metadata can be included if `withMetadata` is true. * * @example * ```ts @@ -208,7 +207,7 @@ export class Namespaces extends APIResource { * '0f2ac74b498b48028cb68387c421e279', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: [{}], + * body: [{ key: 'My-Key', value: 'Some string' }], * }, * ); * ``` @@ -282,7 +281,7 @@ export interface NamespaceDeleteResponse {} export interface NamespaceBulkDeleteResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -299,33 +298,27 @@ export type NamespaceBulkGetResponse = export namespace NamespaceBulkGetResponse { export interface WorkersKVBulkGetResult { /** - * Requested keys are paired with their values in an object + * Requested keys are paired with their values in an object. */ - values?: Record>; + values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; } export interface WorkersKVBulkGetResultWithMetadata { /** - * Requested keys are paired with their values and metadata in an object + * Requested keys are paired with their values and metadata in an object. */ - values?: Record; + values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; } export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key - */ - metadata: Record | null; + metadata: unknown; - /** - * The value associated with the key - */ - value: string | number | boolean | Record; + value: unknown; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ expiration?: number; } @@ -334,7 +327,7 @@ export namespace NamespaceBulkGetResponse { export interface NamespaceBulkUpdateResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -346,7 +339,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -358,7 +351,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -370,7 +363,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -387,14 +380,14 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { export interface NamespaceDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface NamespaceBulkDeleteParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -406,29 +399,29 @@ export interface NamespaceBulkDeleteParams { export interface NamespaceBulkGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Body param: Array of keys to retrieve (maximum 100) + * Body param: Array of keys to retrieve (maximum of 100). */ keys: Array; /** - * Body param: Whether to parse JSON values in the response + * Body param: Whether to parse JSON values in the response. */ type?: 'text' | 'json'; /** - * Body param: Whether to include metadata in the response + * Body param: Whether to include metadata in the response. */ withMetadata?: boolean; } export interface NamespaceBulkUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -441,45 +434,41 @@ export interface NamespaceBulkUpdateParams { export namespace NamespaceBulkUpdateParams { export interface Body { /** - * Whether or not the server should base64 decode the value before storing it. - * Useful for writing values that wouldn't otherwise be valid JSON strings, such as - * images. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - base64?: boolean; + key: string; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - expiration?: number; + value: string; /** - * The number of seconds for which the key should be visible before it expires. At - * least 60. + * Indicates whether or not the server should base64 decode the value before + * storing it. Useful for writing values that wouldn't otherwise be valid JSON + * strings, such as images. */ - expiration_ttl?: number; + base64?: boolean; /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ - key?: string; + expiration?: number; /** - * Arbitrary JSON that is associated with a key. + * Expires the key after a number of seconds. Must be at least 60. */ - metadata?: Record; + expiration_ttl?: number; - /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. - */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index a240802fea..03752a92d4 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -22,7 +22,6 @@ export class Values extends APIResource { * 'My-Key', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * metadata: '{"someMetadataKey": "someMetadataValue"}', * value: 'Some Value', * }, * ); @@ -38,12 +37,7 @@ export class Values extends APIResource { return ( this._client.put( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - Core.maybeMultipartFormRequestOptions({ - query: { expiration, expiration_ttl }, - body, - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -119,43 +113,42 @@ export interface ValueDeleteResponse {} export interface ValueUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; - /** - * Body param: Arbitrary JSON to be associated with a key/value pair. - */ - metadata: string; - /** * Body param: A byte sequence to be stored, up to 25 MiB in length. */ value: string; /** - * Query param: The time, measured in number of seconds since the UNIX epoch, at - * which the key should expire. + * Query param: Expires the key at a certain time, measured in number of seconds + * since the UNIX epoch. */ expiration?: number; /** - * Query param: The number of seconds for which the key should be visible before it - * expires. At least 60. + * Query param: Expires the key after a number of seconds. Must be at least 60. */ expiration_ttl?: number; + + /** + * Body param: + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/load-balancers.ts b/src/resources/load-balancers/load-balancers.ts index 2ae64190ca..b0c4847381 100644 --- a/src/resources/load-balancers/load-balancers.ts +++ b/src/resources/load-balancers/load-balancers.ts @@ -384,7 +384,7 @@ export interface LoadBalancer { * back to using the corresponding region_pool mapping if it exists else to * default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; created_on?: string; @@ -435,7 +435,7 @@ export interface LoadBalancer { * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Whether the hostname should be gray clouded (false) or orange clouded (true). @@ -459,7 +459,7 @@ export interface LoadBalancer { * priority) for the given region. Any regions not explicitly defined will fall * back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * BETA Field Not General Access: A list of rules for this load balancer to @@ -877,7 +877,7 @@ export interface RandomSteering { * A mapping of pool IDs to custom weights. The weight is relative to other pools * in the load balancer. */ - pool_weights?: Record; + pool_weights?: { [key: string]: number }; } /** @@ -901,7 +901,7 @@ export interface RandomSteeringParam { * A mapping of pool IDs to custom weights. The weight is relative to other pools * in the load balancer. */ - pool_weights?: Record; + pool_weights?: { [key: string]: number }; } /** @@ -1005,7 +1005,7 @@ export namespace Rules { * back to using the corresponding region_pool mapping if it exists else to * default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; /** * A list of pool IDs ordered by their failover priority. Pools defined here are @@ -1030,7 +1030,7 @@ export namespace Rules { * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Configures pool weights. @@ -1049,7 +1049,7 @@ export namespace Rules { * priority) for the given region. Any regions not explicitly defined will fall * back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * Specifies the type of session affinity the load balancer should use unless @@ -1232,7 +1232,7 @@ export namespace RulesParam { * back to using the corresponding region_pool mapping if it exists else to * default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; /** * A list of pool IDs ordered by their failover priority. Pools defined here are @@ -1257,7 +1257,7 @@ export namespace RulesParam { * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Configures pool weights. @@ -1276,7 +1276,7 @@ export namespace RulesParam { * priority) for the given region. Any regions not explicitly defined will fall * back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * Specifies the type of session affinity the load balancer should use unless @@ -1659,7 +1659,7 @@ export interface LoadBalancerCreateParams { * will fall back to using the corresponding region_pool mapping if it exists else * to default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; /** * Body param: Object description. @@ -1683,7 +1683,7 @@ export interface LoadBalancerCreateParams { * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Body param: Whether the hostname should be gray clouded (false) or orange @@ -1708,7 +1708,7 @@ export interface LoadBalancerCreateParams { * failover priority) for the given region. Any regions not explicitly defined will * fall back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * Body param: BETA Field Not General Access: A list of rules for this load @@ -1838,7 +1838,7 @@ export interface LoadBalancerUpdateParams { * will fall back to using the corresponding region_pool mapping if it exists else * to default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; /** * Body param: Object description. @@ -1867,7 +1867,7 @@ export interface LoadBalancerUpdateParams { * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Body param: Whether the hostname should be gray clouded (false) or orange @@ -1892,7 +1892,7 @@ export interface LoadBalancerUpdateParams { * failover priority) for the given region. Any regions not explicitly defined will * fall back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * Body param: BETA Field Not General Access: A list of rules for this load @@ -2011,7 +2011,7 @@ export interface LoadBalancerEditParams { * will fall back to using the corresponding region_pool mapping if it exists else * to default_pools. */ - country_pools?: Record>; + country_pools?: { [key: string]: Array }; /** * Body param: A list of pool IDs ordered by their failover priority. Pools defined @@ -2054,7 +2054,7 @@ export interface LoadBalancerEditParams { * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. */ - pop_pools?: Record>; + pop_pools?: { [key: string]: Array }; /** * Body param: Whether the hostname should be gray clouded (false) or orange @@ -2079,7 +2079,7 @@ export interface LoadBalancerEditParams { * failover priority) for the given region. Any regions not explicitly defined will * fall back to using default_pools. */ - region_pools?: Record>; + region_pools?: { [key: string]: Array }; /** * Body param: BETA Field Not General Access: A list of rules for this load diff --git a/src/resources/load-balancers/monitors/monitors.ts b/src/resources/load-balancers/monitors/monitors.ts index 2197a6fd3f..304af32535 100644 --- a/src/resources/load-balancers/monitors/monitors.ts +++ b/src/resources/load-balancers/monitors/monitors.ts @@ -213,7 +213,7 @@ export interface Monitor { * a Host header by default. The User-Agent header cannot be overridden. This * parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * The interval between each health check. Shorter intervals may improve failover @@ -323,7 +323,7 @@ export interface MonitorCreateParams { * recommended you set a Host header by default. The User-Agent header cannot be * overridden. This parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * Body param: The interval between each health check. Shorter intervals may @@ -429,7 +429,7 @@ export interface MonitorUpdateParams { * recommended you set a Host header by default. The User-Agent header cannot be * overridden. This parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * Body param: The interval between each health check. Shorter intervals may @@ -549,7 +549,7 @@ export interface MonitorEditParams { * recommended you set a Host header by default. The User-Agent header cannot be * overridden. This parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * Body param: The interval between each health check. Shorter intervals may diff --git a/src/resources/load-balancers/monitors/previews.ts b/src/resources/load-balancers/monitors/previews.ts index 61acd9fe5b..857933228d 100644 --- a/src/resources/load-balancers/monitors/previews.ts +++ b/src/resources/load-balancers/monitors/previews.ts @@ -36,7 +36,7 @@ export interface PreviewCreateResponse { /** * Monitored pool IDs mapped to their respective names. */ - pools?: Record; + pools?: { [key: string]: string }; preview_id?: string; } @@ -94,7 +94,7 @@ export interface PreviewCreateParams { * recommended you set a Host header by default. The User-Agent header cannot be * overridden. This parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * Body param: The interval between each health check. Shorter intervals may diff --git a/src/resources/load-balancers/pools/health.ts b/src/resources/load-balancers/pools/health.ts index 4b7bf8909b..1af81d09e1 100644 --- a/src/resources/load-balancers/pools/health.ts +++ b/src/resources/load-balancers/pools/health.ts @@ -61,7 +61,7 @@ export interface HealthCreateResponse { /** * Monitored pool IDs mapped to their respective names. */ - pools?: Record; + pools?: { [key: string]: string }; preview_id?: string; } @@ -179,7 +179,7 @@ export interface HealthCreateParams { * recommended you set a Host header by default. The User-Agent header cannot be * overridden. This parameter is only valid for HTTP and HTTPS monitors. */ - header?: Record>; + header?: { [key: string]: Array }; /** * Body param: The interval between each health check. Shorter intervals may diff --git a/src/resources/load-balancers/previews.ts b/src/resources/load-balancers/previews.ts index aaff87291f..b6c786f552 100644 --- a/src/resources/load-balancers/previews.ts +++ b/src/resources/load-balancers/previews.ts @@ -33,13 +33,13 @@ export class Previews extends APIResource { /** * Resulting health data from a preview operation. */ -export type PreviewGetResponse = Record; +export type PreviewGetResponse = { [key: string]: PreviewGetResponse.item }; export namespace PreviewGetResponse { export interface item { healthy?: boolean; - origins?: Array>; + origins?: Array<{ [key: string]: item.load_balancing_origin_health_data }>; } export namespace item { diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index 01bfb2c403..fa64a74139 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -15,6 +15,26 @@ export class Jobs extends APIResource { * const logpushJob = await client.logpush.jobs.create({ * destination_conf: 's3://mybucket/logs?region=us-west-2', * account_id: 'account_id', + * dataset: 'gateway_dns', + * filter: + * '{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}', + * max_upload_bytes: 5000000, + * max_upload_interval_seconds: 30, + * max_upload_records: 1000, + * name: 'example.com', + * output_options: { + * 'CVE-2021-44228': false, + * batch_prefix: '', + * batch_suffix: '', + * field_delimiter: ',', + * field_names: ['Datetime', 'DstIP', 'SrcIP'], + * output_type: 'ndjson', + * record_delimiter: '', + * record_prefix: '{', + * record_suffix: '}\n', + * sample_rate: 1, + * timestamp_format: 'unixnano', + * }, * }); * ``` */ @@ -51,6 +71,25 @@ export class Jobs extends APIResource { * ```ts * const logpushJob = await client.logpush.jobs.update(1, { * account_id: 'account_id', + * destination_conf: 's3://mybucket/logs?region=us-west-2', + * filter: + * '{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}', + * max_upload_bytes: 5000000, + * max_upload_interval_seconds: 30, + * max_upload_records: 1000, + * output_options: { + * 'CVE-2021-44228': false, + * batch_prefix: '', + * batch_suffix: '', + * field_delimiter: ',', + * field_names: ['Datetime', 'DstIP', 'SrcIP'], + * output_type: 'ndjson', + * record_delimiter: '', + * record_prefix: '{', + * record_suffix: '}\n', + * sample_rate: 1, + * timestamp_format: 'unixnano', + * }, * }); * ``` */ @@ -302,10 +341,9 @@ export interface LogpushJob { /** * The kind parameter (optional) is used to differentiate between Logpush and Edge - * Log Delivery jobs. Currently, Edge Log Delivery is only supported for the - * `http_requests` dataset. + * Log Delivery jobs (when supported by the dataset). */ - kind?: 'edge'; + kind?: '' | 'edge'; /** * Records the last time for which logs have been successfully pushed. If the last @@ -335,27 +373,25 @@ export interface LogpushJob { * The maximum uncompressed file size of a batch of logs. This setting value must * be between `5 MB` and `1 GB`, or `0` to disable it. Note that you cannot set a * minimum file size; this means that log files may be much smaller than this batch - * size. This parameter is not available for jobs with `edge` as its kind. + * size. */ - max_upload_bytes?: number | null; + max_upload_bytes?: 0 | unknown | null; /** * The maximum interval in seconds for log batches. This setting must be between 30 * and 300 seconds (5 minutes), or `0` to disable it. Note that you cannot specify * a minimum interval for log batches; this means that log files may be sent in - * shorter intervals than this. This parameter is only used for jobs with `edge` as - * its kind. + * shorter intervals than this. */ - max_upload_interval_seconds?: number | null; + max_upload_interval_seconds?: 0 | unknown | null; /** * The maximum number of log lines per batch. This setting must be between 1000 and * 1,000,000 lines, or `0` to disable it. Note that you cannot specify a minimum * number of log lines per batch; this means that log files may contain many fewer - * lines than this. This parameter is not available for jobs with `edge` as its - * kind. + * lines than this. */ - max_upload_records?: number | null; + max_upload_records?: 0 | unknown | null; /** * Optional human readable job name. Not unique. Cloudflare suggests that you set @@ -605,10 +641,9 @@ export interface JobCreateParams { /** * Body param: The kind parameter (optional) is used to differentiate between - * Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only - * supported for the `http_requests` dataset. + * Logpush and Edge Log Delivery jobs (when supported by the dataset). */ - kind?: 'edge'; + kind?: '' | 'edge'; /** * @deprecated Body param: This field is deprecated. Use `output_options` instead. @@ -623,28 +658,25 @@ export interface JobCreateParams { * Body param: The maximum uncompressed file size of a batch of logs. This setting * value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you * cannot set a minimum file size; this means that log files may be much smaller - * than this batch size. This parameter is not available for jobs with `edge` as - * its kind. + * than this batch size. */ - max_upload_bytes?: number | null; + max_upload_bytes?: 0 | unknown | null; /** * Body param: The maximum interval in seconds for log batches. This setting must * be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you * cannot specify a minimum interval for log batches; this means that log files may - * be sent in shorter intervals than this. This parameter is only used for jobs - * with `edge` as its kind. + * be sent in shorter intervals than this. */ - max_upload_interval_seconds?: number | null; + max_upload_interval_seconds?: 0 | unknown | null; /** * Body param: The maximum number of log lines per batch. This setting must be * between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot * specify a minimum number of log lines per batch; this means that log files may - * contain many fewer lines than this. This parameter is not available for jobs - * with `edge` as its kind. + * contain many fewer lines than this. */ - max_upload_records?: number | null; + max_upload_records?: 0 | unknown | null; /** * Body param: Optional human readable job name. Not unique. Cloudflare suggests @@ -708,10 +740,9 @@ export interface JobUpdateParams { /** * Body param: The kind parameter (optional) is used to differentiate between - * Logpush and Edge Log Delivery jobs. Currently, Edge Log Delivery is only - * supported for the `http_requests` dataset. + * Logpush and Edge Log Delivery jobs (when supported by the dataset). */ - kind?: 'edge'; + kind?: '' | 'edge'; /** * @deprecated Body param: This field is deprecated. Use `output_options` instead. @@ -726,28 +757,25 @@ export interface JobUpdateParams { * Body param: The maximum uncompressed file size of a batch of logs. This setting * value must be between `5 MB` and `1 GB`, or `0` to disable it. Note that you * cannot set a minimum file size; this means that log files may be much smaller - * than this batch size. This parameter is not available for jobs with `edge` as - * its kind. + * than this batch size. */ - max_upload_bytes?: number | null; + max_upload_bytes?: 0 | unknown | null; /** * Body param: The maximum interval in seconds for log batches. This setting must * be between 30 and 300 seconds (5 minutes), or `0` to disable it. Note that you * cannot specify a minimum interval for log batches; this means that log files may - * be sent in shorter intervals than this. This parameter is only used for jobs - * with `edge` as its kind. + * be sent in shorter intervals than this. */ - max_upload_interval_seconds?: number | null; + max_upload_interval_seconds?: 0 | unknown | null; /** * Body param: The maximum number of log lines per batch. This setting must be * between 1000 and 1,000,000 lines, or `0` to disable it. Note that you cannot * specify a minimum number of log lines per batch; this means that log files may - * contain many fewer lines than this. This parameter is not available for jobs - * with `edge` as its kind. + * contain many fewer lines than this. */ - max_upload_records?: number | null; + max_upload_records?: 0 | unknown | null; /** * Body param: Optional human readable job name. Not unique. Cloudflare suggests diff --git a/src/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.ts b/src/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.ts index bb2274751a..584a9745ed 100644 --- a/src/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.ts +++ b/src/resources/magic-cloud-networking/catalog-syncs/catalog-syncs.ts @@ -154,7 +154,7 @@ export interface CatalogSyncCreateResponse { update_mode: 'AUTO' | 'MANUAL'; - errors?: Record; + errors?: { [key: string]: CatalogSyncCreateResponse.Errors }; includes_discoveries_until?: string; @@ -362,7 +362,7 @@ export interface CatalogSyncUpdateResponse { update_mode: 'AUTO' | 'MANUAL'; - errors?: Record; + errors?: { [key: string]: CatalogSyncUpdateResponse.Errors }; includes_discoveries_until?: string; @@ -570,7 +570,7 @@ export interface CatalogSyncListResponse { update_mode: 'AUTO' | 'MANUAL'; - errors?: Record; + errors?: { [key: string]: CatalogSyncListResponse.Errors }; includes_discoveries_until?: string; @@ -782,7 +782,7 @@ export interface CatalogSyncEditResponse { update_mode: 'AUTO' | 'MANUAL'; - errors?: Record; + errors?: { [key: string]: CatalogSyncEditResponse.Errors }; includes_discoveries_until?: string; @@ -990,7 +990,7 @@ export interface CatalogSyncGetResponse { update_mode: 'AUTO' | 'MANUAL'; - errors?: Record; + errors?: { [key: string]: CatalogSyncGetResponse.Errors }; includes_discoveries_until?: string; diff --git a/src/resources/magic-cloud-networking/on-ramps/on-ramps.ts b/src/resources/magic-cloud-networking/on-ramps/on-ramps.ts index db0b89d6c0..826c547113 100644 --- a/src/resources/magic-cloud-networking/on-ramps/on-ramps.ts +++ b/src/resources/magic-cloud-networking/on-ramps/on-ramps.ts @@ -199,7 +199,7 @@ export interface OnRampCreateResponse { post_apply_monthly_cost_estimate?: OnRampCreateResponse.PostApplyMonthlyCostEstimate; - post_apply_resources?: Record; + post_apply_resources?: { [key: string]: OnRampCreateResponse.PostApplyResources }; post_apply_resources_unavailable?: boolean; @@ -209,7 +209,7 @@ export interface OnRampCreateResponse { vpc?: string; - vpcs_by_id?: Record; + vpcs_by_id?: { [key: string]: OnRampCreateResponse.VPCsByID }; /** * The list of vpc IDs for which resource details failed to generate. @@ -348,7 +348,7 @@ export namespace OnRampCreateResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -360,11 +360,11 @@ export namespace OnRampCreateResponse { native_id: string; - observations: Record; + observations: { [key: string]: PostApplyResources.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -431,9 +431,9 @@ export namespace OnRampCreateResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -941,7 +941,7 @@ export namespace OnRampCreateResponse { tunnels: Array; - lifecycle_errors?: Record; + lifecycle_errors?: { [key: string]: Status.LifecycleErrors }; } export namespace Status { @@ -1145,7 +1145,7 @@ export namespace OnRampCreateResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -1157,11 +1157,11 @@ export namespace OnRampCreateResponse { native_id: string; - observations: Record; + observations: { [key: string]: VPCsByID.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -1228,9 +1228,9 @@ export namespace OnRampCreateResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -1757,7 +1757,7 @@ export interface OnRampUpdateResponse { post_apply_monthly_cost_estimate?: OnRampUpdateResponse.PostApplyMonthlyCostEstimate; - post_apply_resources?: Record; + post_apply_resources?: { [key: string]: OnRampUpdateResponse.PostApplyResources }; post_apply_resources_unavailable?: boolean; @@ -1767,7 +1767,7 @@ export interface OnRampUpdateResponse { vpc?: string; - vpcs_by_id?: Record; + vpcs_by_id?: { [key: string]: OnRampUpdateResponse.VPCsByID }; /** * The list of vpc IDs for which resource details failed to generate. @@ -1906,7 +1906,7 @@ export namespace OnRampUpdateResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -1918,11 +1918,11 @@ export namespace OnRampUpdateResponse { native_id: string; - observations: Record; + observations: { [key: string]: PostApplyResources.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -1989,9 +1989,9 @@ export namespace OnRampUpdateResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -2499,7 +2499,7 @@ export namespace OnRampUpdateResponse { tunnels: Array; - lifecycle_errors?: Record; + lifecycle_errors?: { [key: string]: Status.LifecycleErrors }; } export namespace Status { @@ -2703,7 +2703,7 @@ export namespace OnRampUpdateResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -2715,11 +2715,11 @@ export namespace OnRampUpdateResponse { native_id: string; - observations: Record; + observations: { [key: string]: VPCsByID.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -2786,9 +2786,9 @@ export namespace OnRampUpdateResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -3315,7 +3315,7 @@ export interface OnRampListResponse { post_apply_monthly_cost_estimate?: OnRampListResponse.PostApplyMonthlyCostEstimate; - post_apply_resources?: Record; + post_apply_resources?: { [key: string]: OnRampListResponse.PostApplyResources }; post_apply_resources_unavailable?: boolean; @@ -3325,7 +3325,7 @@ export interface OnRampListResponse { vpc?: string; - vpcs_by_id?: Record; + vpcs_by_id?: { [key: string]: OnRampListResponse.VPCsByID }; /** * The list of vpc IDs for which resource details failed to generate. @@ -3464,7 +3464,7 @@ export namespace OnRampListResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -3476,11 +3476,11 @@ export namespace OnRampListResponse { native_id: string; - observations: Record; + observations: { [key: string]: PostApplyResources.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -3547,9 +3547,9 @@ export namespace OnRampListResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -4057,7 +4057,7 @@ export namespace OnRampListResponse { tunnels: Array; - lifecycle_errors?: Record; + lifecycle_errors?: { [key: string]: Status.LifecycleErrors }; } export namespace Status { @@ -4261,7 +4261,7 @@ export namespace OnRampListResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -4273,11 +4273,11 @@ export namespace OnRampListResponse { native_id: string; - observations: Record; + observations: { [key: string]: VPCsByID.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -4344,9 +4344,9 @@ export namespace OnRampListResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -5247,7 +5247,7 @@ export interface OnRampEditResponse { post_apply_monthly_cost_estimate?: OnRampEditResponse.PostApplyMonthlyCostEstimate; - post_apply_resources?: Record; + post_apply_resources?: { [key: string]: OnRampEditResponse.PostApplyResources }; post_apply_resources_unavailable?: boolean; @@ -5257,7 +5257,7 @@ export interface OnRampEditResponse { vpc?: string; - vpcs_by_id?: Record; + vpcs_by_id?: { [key: string]: OnRampEditResponse.VPCsByID }; /** * The list of vpc IDs for which resource details failed to generate. @@ -5396,7 +5396,7 @@ export namespace OnRampEditResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -5408,11 +5408,11 @@ export namespace OnRampEditResponse { native_id: string; - observations: Record; + observations: { [key: string]: PostApplyResources.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -5479,9 +5479,9 @@ export namespace OnRampEditResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -5989,7 +5989,7 @@ export namespace OnRampEditResponse { tunnels: Array; - lifecycle_errors?: Record; + lifecycle_errors?: { [key: string]: Status.LifecycleErrors }; } export namespace Status { @@ -6193,7 +6193,7 @@ export namespace OnRampEditResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -6205,11 +6205,11 @@ export namespace OnRampEditResponse { native_id: string; - observations: Record; + observations: { [key: string]: VPCsByID.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -6276,9 +6276,9 @@ export namespace OnRampEditResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -6805,7 +6805,7 @@ export interface OnRampGetResponse { post_apply_monthly_cost_estimate?: OnRampGetResponse.PostApplyMonthlyCostEstimate; - post_apply_resources?: Record; + post_apply_resources?: { [key: string]: OnRampGetResponse.PostApplyResources }; post_apply_resources_unavailable?: boolean; @@ -6815,7 +6815,7 @@ export interface OnRampGetResponse { vpc?: string; - vpcs_by_id?: Record; + vpcs_by_id?: { [key: string]: OnRampGetResponse.VPCsByID }; /** * The list of vpc IDs for which resource details failed to generate. @@ -6954,7 +6954,7 @@ export namespace OnRampGetResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -6966,11 +6966,11 @@ export namespace OnRampGetResponse { native_id: string; - observations: Record; + observations: { [key: string]: PostApplyResources.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -7037,9 +7037,9 @@ export namespace OnRampGetResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -7547,7 +7547,7 @@ export namespace OnRampGetResponse { tunnels: Array; - lifecycle_errors?: Record; + lifecycle_errors?: { [key: string]: Status.LifecycleErrors }; } export namespace Status { @@ -7751,7 +7751,7 @@ export namespace OnRampGetResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -7763,11 +7763,11 @@ export namespace OnRampGetResponse { native_id: string; - observations: Record; + observations: { [key: string]: VPCsByID.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -7834,9 +7834,9 @@ export namespace OnRampGetResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; diff --git a/src/resources/magic-cloud-networking/resources.ts b/src/resources/magic-cloud-networking/resources.ts index 82986e7457..11446e8bbd 100644 --- a/src/resources/magic-cloud-networking/resources.ts +++ b/src/resources/magic-cloud-networking/resources.ts @@ -77,7 +77,7 @@ export interface ResourceListResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -89,11 +89,11 @@ export interface ResourceListResponse { native_id: string; - observations: Record; + observations: { [key: string]: ResourceListResponse.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -160,9 +160,9 @@ export interface ResourceListResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; @@ -654,7 +654,7 @@ export interface ResourceGetResponse { cloud_type: 'AWS' | 'AZURE' | 'GOOGLE' | 'CLOUDFLARE'; - config: Record; + config: { [key: string]: unknown }; deployment_provider: string; @@ -666,11 +666,11 @@ export interface ResourceGetResponse { native_id: string; - observations: Record; + observations: { [key: string]: ResourceGetResponse.Observations }; provider_ids: Array; - provider_names_by_id: Record; + provider_names_by_id: { [key: string]: string }; region: string; @@ -737,9 +737,9 @@ export interface ResourceGetResponse { sections: Array; - state: Record; + state: { [key: string]: unknown }; - tags: Record; + tags: { [key: string]: string }; updated_at: string; diff --git a/src/resources/magic-transit/connectors/connectors.ts b/src/resources/magic-transit/connectors/connectors.ts index a830517c41..c7f3bde0de 100644 --- a/src/resources/magic-transit/connectors/connectors.ts +++ b/src/resources/magic-transit/connectors/connectors.ts @@ -24,6 +24,30 @@ export class Connectors extends APIResource { events: EventsAPI.Events = new EventsAPI.Events(this._client); snapshots: SnapshotsAPI.Snapshots = new SnapshotsAPI.Snapshots(this._client); + /** + * Add a connector to your account + * + * @example + * ```ts + * const connector = + * await client.magicTransit.connectors.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * device: {}, + * }); + * ``` + */ + create( + params: ConnectorCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/magic/connectors`, { body, ...options }) as Core.APIPromise<{ + result: ConnectorCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Replace Connector * @@ -76,7 +100,33 @@ export class Connectors extends APIResource { } /** - * Update Connector + * Remove a connector from your account + * + * @example + * ```ts + * const connector = + * await client.magicTransit.connectors.delete( + * 'connector_id', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + connectorId: string, + params: ConnectorDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/magic/connectors/${connectorId}`, + options, + ) as Core.APIPromise<{ result: ConnectorDeleteResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Edit Connector to update specific properties * * @example * ```ts @@ -128,6 +178,36 @@ export class Connectors extends APIResource { export class ConnectorListResponsesSinglePage extends SinglePage {} +export interface ConnectorCreateResponse { + id: string; + + activated: boolean; + + interrupt_window_duration_hours: number; + + interrupt_window_hour_of_day: number; + + last_updated: string; + + notes: string; + + timezone: string; + + device?: ConnectorCreateResponse.Device; + + last_heartbeat?: string; + + last_seen_version?: string; +} + +export namespace ConnectorCreateResponse { + export interface Device { + id: string; + + serial_number?: string; + } +} + export interface ConnectorUpdateResponse { id: string; @@ -188,6 +268,36 @@ export namespace ConnectorListResponse { } } +export interface ConnectorDeleteResponse { + id: string; + + activated: boolean; + + interrupt_window_duration_hours: number; + + interrupt_window_hour_of_day: number; + + last_updated: string; + + notes: string; + + timezone: string; + + device?: ConnectorDeleteResponse.Device; + + last_heartbeat?: string; + + last_seen_version?: string; +} + +export namespace ConnectorDeleteResponse { + export interface Device { + id: string; + + serial_number?: string; + } +} + export interface ConnectorEditResponse { id: string; @@ -248,6 +358,51 @@ export namespace ConnectorGetResponse { } } +export interface ConnectorCreateParams { + /** + * Path param: Account identifier + */ + account_id: string; + + /** + * Body param: + */ + device: ConnectorCreateParams.Device; + + /** + * Body param: + */ + activated?: boolean; + + /** + * Body param: + */ + interrupt_window_duration_hours?: number; + + /** + * Body param: + */ + interrupt_window_hour_of_day?: number; + + /** + * Body param: + */ + notes?: string; + + /** + * Body param: + */ + timezone?: string; +} + +export namespace ConnectorCreateParams { + export interface Device { + id?: string; + + serial_number?: string; + } +} + export interface ConnectorUpdateParams { /** * Path param: Account identifier @@ -287,6 +442,13 @@ export interface ConnectorListParams { account_id: string; } +export interface ConnectorDeleteParams { + /** + * Account identifier + */ + account_id: string; +} + export interface ConnectorEditParams { /** * Path param: Account identifier @@ -332,13 +494,17 @@ Connectors.Snapshots = Snapshots; export declare namespace Connectors { export { + type ConnectorCreateResponse as ConnectorCreateResponse, type ConnectorUpdateResponse as ConnectorUpdateResponse, type ConnectorListResponse as ConnectorListResponse, + type ConnectorDeleteResponse as ConnectorDeleteResponse, type ConnectorEditResponse as ConnectorEditResponse, type ConnectorGetResponse as ConnectorGetResponse, ConnectorListResponsesSinglePage as ConnectorListResponsesSinglePage, + type ConnectorCreateParams as ConnectorCreateParams, type ConnectorUpdateParams as ConnectorUpdateParams, type ConnectorListParams as ConnectorListParams, + type ConnectorDeleteParams as ConnectorDeleteParams, type ConnectorEditParams as ConnectorEditParams, type ConnectorGetParams as ConnectorGetParams, }; diff --git a/src/resources/magic-transit/connectors/index.ts b/src/resources/magic-transit/connectors/index.ts index 5c3638aece..9da1460f4e 100644 --- a/src/resources/magic-transit/connectors/index.ts +++ b/src/resources/magic-transit/connectors/index.ts @@ -3,12 +3,16 @@ export { ConnectorListResponsesSinglePage, Connectors, + type ConnectorCreateResponse, type ConnectorUpdateResponse, type ConnectorListResponse, + type ConnectorDeleteResponse, type ConnectorEditResponse, type ConnectorGetResponse, + type ConnectorCreateParams, type ConnectorUpdateParams, type ConnectorListParams, + type ConnectorDeleteParams, type ConnectorEditParams, type ConnectorGetParams, } from './connectors'; diff --git a/src/resources/magic-transit/index.ts b/src/resources/magic-transit/index.ts index 6525bbf5cc..e0faedd2f4 100644 --- a/src/resources/magic-transit/index.ts +++ b/src/resources/magic-transit/index.ts @@ -28,12 +28,16 @@ export { export { ConnectorListResponsesSinglePage, Connectors, + type ConnectorCreateResponse, type ConnectorUpdateResponse, type ConnectorListResponse, + type ConnectorDeleteResponse, type ConnectorEditResponse, type ConnectorGetResponse, + type ConnectorCreateParams, type ConnectorUpdateParams, type ConnectorListParams, + type ConnectorDeleteParams, type ConnectorEditParams, type ConnectorGetParams, } from './connectors/index'; diff --git a/src/resources/magic-transit/magic-transit.ts b/src/resources/magic-transit/magic-transit.ts index b1e43090f2..7df3422f34 100644 --- a/src/resources/magic-transit/magic-transit.ts +++ b/src/resources/magic-transit/magic-transit.ts @@ -84,6 +84,10 @@ import { } from './routes'; import * as ConnectorsAPI from './connectors/connectors'; import { + ConnectorCreateParams, + ConnectorCreateResponse, + ConnectorDeleteParams, + ConnectorDeleteResponse, ConnectorEditParams, ConnectorEditResponse, ConnectorGetParams, @@ -367,13 +371,17 @@ export declare namespace MagicTransit { export { Connectors as Connectors, + type ConnectorCreateResponse as ConnectorCreateResponse, type ConnectorUpdateResponse as ConnectorUpdateResponse, type ConnectorListResponse as ConnectorListResponse, + type ConnectorDeleteResponse as ConnectorDeleteResponse, type ConnectorEditResponse as ConnectorEditResponse, type ConnectorGetResponse as ConnectorGetResponse, ConnectorListResponsesSinglePage as ConnectorListResponsesSinglePage, + type ConnectorCreateParams as ConnectorCreateParams, type ConnectorUpdateParams as ConnectorUpdateParams, type ConnectorListParams as ConnectorListParams, + type ConnectorDeleteParams as ConnectorDeleteParams, type ConnectorEditParams as ConnectorEditParams, type ConnectorGetParams as ConnectorGetParams, }; diff --git a/src/resources/magic-transit/sites/lans.ts b/src/resources/magic-transit/sites/lans.ts index 2abf4ddc27..e4c7823a1a 100644 --- a/src/resources/magic-transit/sites/lans.ts +++ b/src/resources/magic-transit/sites/lans.ts @@ -209,7 +209,7 @@ export interface DHCPServer { /** * Mapping of MAC addresses to IP addresses */ - reservations?: Record; + reservations?: { [key: string]: string }; } export interface DHCPServerParam { @@ -233,7 +233,7 @@ export interface DHCPServerParam { /** * Mapping of MAC addresses to IP addresses */ - reservations?: Record; + reservations?: { [key: string]: string }; } export interface LAN { diff --git a/src/resources/page-rules.ts b/src/resources/page-rules.ts index 2e07ac5cea..9d52c828c4 100644 --- a/src/resources/page-rules.ts +++ b/src/resources/page-rules.ts @@ -437,7 +437,7 @@ export namespace PageRule { * seconds or one of the following strings: no-store (equivalent to -1), no-cache * (equivalent to 0). */ - value?: Record; + value?: { [key: string]: 'no-cache' | 'no-store' | number }; } export interface DisableApps { @@ -920,7 +920,7 @@ export namespace PageRuleCreateParams { * seconds or one of the following strings: no-store (equivalent to -1), no-cache * (equivalent to 0). */ - value?: Record; + value?: { [key: string]: 'no-cache' | 'no-store' | number }; } export interface DisableApps { @@ -1328,7 +1328,7 @@ export namespace PageRuleUpdateParams { * seconds or one of the following strings: no-store (equivalent to -1), no-cache * (equivalent to 0). */ - value?: Record; + value?: { [key: string]: 'no-cache' | 'no-store' | number }; } export interface DisableApps { @@ -1771,7 +1771,7 @@ export namespace PageRuleEditParams { * seconds or one of the following strings: no-store (equivalent to -1), no-cache * (equivalent to 0). */ - value?: Record; + value?: { [key: string]: 'no-cache' | 'no-store' | number }; } export interface DisableApps { diff --git a/src/resources/pages/projects/projects.ts b/src/resources/pages/projects/projects.ts index fd63539c01..01225591dc 100644 --- a/src/resources/pages/projects/projects.ts +++ b/src/resources/pages/projects/projects.ts @@ -207,7 +207,9 @@ export interface Deployment { /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record; + env_vars?: { + [key: string]: Deployment.PagesPlainTextEnvVar | null | Deployment.PagesSecretTextEnvVar | null; + }; /** * Type of deploy. @@ -500,17 +502,17 @@ export namespace Project { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Preview.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Preview.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -525,32 +527,34 @@ export namespace Project { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Preview.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Preview.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record; + env_vars?: { + [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Preview.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Preview.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -560,22 +564,22 @@ export namespace Project { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Preview.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Preview.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Preview.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; } export namespace Preview { @@ -739,17 +743,17 @@ export namespace Project { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Production.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Production.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Production.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -764,35 +768,34 @@ export namespace Project { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Production.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Production.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record< - string, - Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null - >; + env_vars?: { + [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Production.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Production.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -802,22 +805,22 @@ export namespace Project { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Production.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Production.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Production.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; } export namespace Production { @@ -1129,17 +1132,17 @@ export namespace ProjectCreateParams { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Preview.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Preview.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -1154,32 +1157,34 @@ export namespace ProjectCreateParams { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Preview.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Preview.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record; + env_vars?: { + [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Preview.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Preview.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -1189,22 +1194,22 @@ export namespace ProjectCreateParams { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Preview.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Preview.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Preview.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; } export namespace Preview { @@ -1368,17 +1373,17 @@ export namespace ProjectCreateParams { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Production.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Production.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Production.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -1393,35 +1398,34 @@ export namespace ProjectCreateParams { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Production.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Production.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record< - string, - Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null - >; + env_vars?: { + [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Production.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Production.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -1431,22 +1435,22 @@ export namespace ProjectCreateParams { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Production.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Production.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Production.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; } export namespace Production { @@ -1743,17 +1747,17 @@ export namespace ProjectEditParams { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Preview.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Preview.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Preview.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -1768,32 +1772,34 @@ export namespace ProjectEditParams { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Preview.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Preview.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record; + env_vars?: { + [key: string]: Preview.PagesPlainTextEnvVar | null | Preview.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Preview.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Preview.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Preview.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -1803,22 +1809,22 @@ export namespace ProjectEditParams { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Preview.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Preview.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Preview.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Preview.VectorizeBindings | null } | null; } export namespace Preview { @@ -1982,17 +1988,17 @@ export namespace ProjectEditParams { /** * Constellation bindings used for Pages Functions. */ - ai_bindings?: Record | null; + ai_bindings?: { [key: string]: Production.AIBindings | null } | null; /** * Analytics Engine bindings used for Pages Functions. */ - analytics_engine_datasets?: Record | null; + analytics_engine_datasets?: { [key: string]: Production.AnalyticsEngineDatasets | null } | null; /** * Browser bindings used for Pages Functions. */ - browsers?: Record | null; + browsers?: { [key: string]: Production.Browsers | null } | null; /** * Compatibility date used for Pages Functions. @@ -2007,35 +2013,34 @@ export namespace ProjectEditParams { /** * D1 databases used for Pages Functions. */ - d1_databases?: Record | null; + d1_databases?: { [key: string]: Production.D1Databases | null } | null; /** * Durable Object namespaces used for Pages Functions. */ - durable_object_namespaces?: Record | null; + durable_object_namespaces?: { [key: string]: Production.DurableObjectNamespaces | null } | null; /** * Environment variables used for builds and Pages Functions. */ - env_vars?: Record< - string, - Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null - >; + env_vars?: { + [key: string]: Production.PagesPlainTextEnvVar | null | Production.PagesSecretTextEnvVar | null; + }; /** * Hyperdrive bindings used for Pages Functions. */ - hyperdrive_bindings?: Record | null; + hyperdrive_bindings?: { [key: string]: Production.HyperdriveBindings | null } | null; /** * KV namespaces used for Pages Functions. */ - kv_namespaces?: Record | null; + kv_namespaces?: { [key: string]: Production.KVNamespaces | null } | null; /** * mTLS bindings used for Pages Functions. */ - mtls_certificates?: Record | null; + mtls_certificates?: { [key: string]: Production.MTLSCertificates | null } | null; /** * Placement setting used for Pages Functions. @@ -2045,22 +2050,22 @@ export namespace ProjectEditParams { /** * Queue Producer bindings used for Pages Functions. */ - queue_producers?: Record | null; + queue_producers?: { [key: string]: Production.QueueProducers | null } | null; /** * R2 buckets used for Pages Functions. */ - r2_buckets?: Record | null; + r2_buckets?: { [key: string]: Production.R2Buckets | null } | null; /** * Services used for Pages Functions. */ - services?: Record | null; + services?: { [key: string]: Production.Services | null } | null; /** * Vectorize bindings used for Pages Functions. */ - vectorize_bindings?: Record | null; + vectorize_bindings?: { [key: string]: Production.VectorizeBindings | null } | null; } export namespace Production { diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 01675bcb77..913238870d 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -40,7 +40,7 @@ export interface SummaryUserAgentResponse { */ meta: SummaryUserAgentResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryUserAgentResponse { diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index 3c7bde58ff..d53516af97 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -62,7 +62,7 @@ export interface SummaryModelResponse { */ meta: SummaryModelResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryModelResponse { @@ -159,7 +159,7 @@ export interface SummaryTaskResponse { */ meta: SummaryTaskResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryTaskResponse { diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index d1cc5eff44..5898de7862 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -620,7 +620,7 @@ export interface SummaryQueryTypeResponse { */ meta: SummaryQueryTypeResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryQueryTypeResponse { @@ -717,7 +717,7 @@ export interface SummaryResponseCodesResponse { */ meta: SummaryResponseCodesResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryResponseCodesResponse { diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index fa1357a056..707a682c97 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -458,7 +458,7 @@ export interface SummaryIndustryResponse { */ meta: SummaryIndustryResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryIndustryResponse { @@ -783,7 +783,7 @@ export interface SummaryVectorResponse { */ meta: SummaryVectorResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryVectorResponse { @@ -880,7 +880,7 @@ export interface SummaryVerticalResponse { */ meta: SummaryVerticalResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryVerticalResponse { diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index d001f28278..20c20213b3 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -212,7 +212,7 @@ export interface SummaryHTTPMethodResponse { */ meta: SummaryHTTPMethodResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryHTTPMethodResponse { @@ -414,7 +414,7 @@ export interface SummaryIndustryResponse { */ meta: SummaryIndustryResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryIndustryResponse { @@ -614,7 +614,7 @@ export interface SummaryManagedRulesResponse { */ meta: SummaryManagedRulesResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryManagedRulesResponse { @@ -711,7 +711,7 @@ export interface SummaryMitigationProductResponse { */ meta: SummaryMitigationProductResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryMitigationProductResponse { @@ -808,7 +808,7 @@ export interface SummaryVerticalResponse { */ meta: SummaryVerticalResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryVerticalResponse { diff --git a/src/resources/radar/bots.ts b/src/resources/radar/bots.ts new file mode 100644 index 0000000000..6228f4a332 --- /dev/null +++ b/src/resources/radar/bots.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './bots/index'; diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts new file mode 100644 index 0000000000..140ad5b529 --- /dev/null +++ b/src/resources/radar/bots/bots.ts @@ -0,0 +1,927 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as WebCrawlersAPI from './web-crawlers'; +import { + WebCrawlerSummaryParams, + WebCrawlerSummaryResponse, + WebCrawlerTimeseriesGroupsParams, + WebCrawlerTimeseriesGroupsResponse, + WebCrawlers, +} from './web-crawlers'; + +export class Bots extends APIResource { + webCrawlers: WebCrawlersAPI.WebCrawlers = new WebCrawlersAPI.WebCrawlers(this._client); + + /** + * Retrieves a list of bots. + * + * @example + * ```ts + * const bots = await client.radar.bots.list(); + * ``` + */ + list(query?: BotListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: BotListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/bots', { query, ...options }) as Core.APIPromise<{ result: BotListResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested bot information. + * + * @example + * ```ts + * const bot = await client.radar.bots.get('gptbot'); + * ``` + */ + get(botSlug: string, query?: BotGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(botSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + botSlug: string, + query: BotGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(botSlug, {}, query); + } + return ( + this._client.get(`/radar/bots/${botSlug}`, { query, ...options }) as Core.APIPromise<{ + result: BotGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves an aggregated summary of bots HTTP requests grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.bots.summary('BOT'); + * ``` + */ + summary( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + query?: BotSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + query: BotSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: BotSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves bots HTTP request volume over time. + * + * @example + * ```ts + * const response = await client.radar.bots.timeseries(); + * ``` + */ + timeseries( + query?: BotTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: BotTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: BotTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = await client.radar.bots.timeseriesGroups( + * 'BOT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + query?: BotTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'BOT' | 'BOT_OPERATOR' | 'BOT_CATEGORY', + query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BotListResponse { + bots: Array; +} + +export namespace BotListResponse { + export interface Bot { + /** + * The category of the bot. + */ + category: string; + + /** + * A summary for the bot (e.g., purpose). + */ + description: string; + + /** + * The name of the bot. + */ + name: string; + + /** + * The organization that owns and operates the bot. + */ + operator: string; + + /** + * A kebab-case identifier derived from the bot name. + */ + slug: string; + } +} + +export interface BotGetResponse { + bot: BotGetResponse.Bot; +} + +export namespace BotGetResponse { + export interface Bot { + /** + * The category of the bot. + */ + category: string; + + /** + * A summary for the bot (e.g., purpose). + */ + description: string; + + /** + * The name of the bot. + */ + name: string; + + /** + * The organization that owns and operates the bot. + */ + operator: string; + + /** + * The link to the bot documentation. + */ + operatorUrl: string; + + /** + * A kebab-case identifier derived from the bot name. + */ + slug: string; + + userAgentPatterns: Array; + + userAgents: Array; + } +} + +export interface BotSummaryResponse { + /** + * Metadata for the results. + */ + meta: BotSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace BotSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo | null; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface BotTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesResponse.Meta; + + [k: string]: + | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | BotTimeseriesResponse.Meta + | undefined; +} + +export namespace BotTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesGroupsResponse.Meta; + + serie_0: BotTimeseriesGroupsResponse.Serie0; +} + +export namespace BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface BotListParams { + /** + * Filters results by bot category. + */ + botCategory?: + | 'SEARCH_ENGINE_CRAWLER' + | 'SEARCH_ENGINE_OPTIMIZATION' + | 'MONITORING_AND_ANALYTICS' + | 'ADVERTISING_AND_MARKETING' + | 'SOCIAL_MEDIA_MARKETING' + | 'PAGE_PREVIEW' + | 'ACADEMIC_RESEARCH' + | 'SECURITY' + | 'ACCESSIBILITY' + | 'WEBHOOKS' + | 'FEED_FETCHER' + | 'AI_CRAWLER' + | 'AGGREGATOR' + | 'AI_ASSISTANT' + | 'AI_SEARCH' + | 'ARCHIVER'; + + /** + * Filters results by bot operator. + */ + botOperator?: string; + + /** + * Filters results by bot verification status. + */ + botVerificationStatus?: 'VERIFIED'; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface BotGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export interface BotSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot name. + */ + bot?: Array; + + /** + * Filters results by bot category. + */ + botCategory?: Array< + | 'SEARCH_ENGINE_CRAWLER' + | 'SEARCH_ENGINE_OPTIMIZATION' + | 'MONITORING_AND_ANALYTICS' + | 'ADVERTISING_AND_MARKETING' + | 'SOCIAL_MEDIA_MARKETING' + | 'PAGE_PREVIEW' + | 'ACADEMIC_RESEARCH' + | 'SECURITY' + | 'ACCESSIBILITY' + | 'WEBHOOKS' + | 'FEED_FETCHER' + | 'AI_CRAWLER' + | 'AGGREGATOR' + | 'AI_ASSISTANT' + | 'AI_SEARCH' + | 'ARCHIVER' + >; + + /** + * Filters results by bot operator. + */ + botOperator?: Array; + + /** + * Filters results by bot verification status (Verified vs. Unverified). + */ + botVerificationStatus?: Array<'VERIFIED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface BotTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot name. + */ + bot?: Array; + + /** + * Filters results by bot category. + */ + botCategory?: Array< + | 'SEARCH_ENGINE_CRAWLER' + | 'SEARCH_ENGINE_OPTIMIZATION' + | 'MONITORING_AND_ANALYTICS' + | 'ADVERTISING_AND_MARKETING' + | 'SOCIAL_MEDIA_MARKETING' + | 'PAGE_PREVIEW' + | 'ACADEMIC_RESEARCH' + | 'SECURITY' + | 'ACCESSIBILITY' + | 'WEBHOOKS' + | 'FEED_FETCHER' + | 'AI_CRAWLER' + | 'AGGREGATOR' + | 'AI_ASSISTANT' + | 'AI_SEARCH' + | 'ARCHIVER' + >; + + /** + * Filters results by bot operator. + */ + botOperator?: Array; + + /** + * Filters results by bot verification status (Verified vs. Unverified). + */ + botVerificationStatus?: Array<'VERIFIED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface BotTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by bot name. + */ + bot?: Array; + + /** + * Filters results by bot category. + */ + botCategory?: Array< + | 'SEARCH_ENGINE_CRAWLER' + | 'SEARCH_ENGINE_OPTIMIZATION' + | 'MONITORING_AND_ANALYTICS' + | 'ADVERTISING_AND_MARKETING' + | 'SOCIAL_MEDIA_MARKETING' + | 'PAGE_PREVIEW' + | 'ACADEMIC_RESEARCH' + | 'SECURITY' + | 'ACCESSIBILITY' + | 'WEBHOOKS' + | 'FEED_FETCHER' + | 'AI_CRAWLER' + | 'AGGREGATOR' + | 'AI_ASSISTANT' + | 'AI_SEARCH' + | 'ARCHIVER' + >; + + /** + * Filters results by bot operator. + */ + botOperator?: Array; + + /** + * Filters results by bot verification status (Verified vs. Unverified). + */ + botVerificationStatus?: Array<'VERIFIED'>; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +Bots.WebCrawlers = WebCrawlers; + +export declare namespace Bots { + export { + type BotListResponse as BotListResponse, + type BotGetResponse as BotGetResponse, + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotListParams as BotListParams, + type BotGetParams as BotGetParams, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; + + export { + WebCrawlers as WebCrawlers, + type WebCrawlerSummaryResponse as WebCrawlerSummaryResponse, + type WebCrawlerTimeseriesGroupsResponse as WebCrawlerTimeseriesGroupsResponse, + type WebCrawlerSummaryParams as WebCrawlerSummaryParams, + type WebCrawlerTimeseriesGroupsParams as WebCrawlerTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/bots/index.ts b/src/resources/radar/bots/index.ts new file mode 100644 index 0000000000..b5847d217f --- /dev/null +++ b/src/resources/radar/bots/index.ts @@ -0,0 +1,22 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Bots, + type BotListResponse, + type BotGetResponse, + type BotSummaryResponse, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotListParams, + type BotGetParams, + type BotSummaryParams, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots'; +export { + WebCrawlers, + type WebCrawlerSummaryResponse, + type WebCrawlerTimeseriesGroupsResponse, + type WebCrawlerSummaryParams, + type WebCrawlerTimeseriesGroupsParams, +} from './web-crawlers'; diff --git a/src/resources/radar/bots/web-crawlers.ts b/src/resources/radar/bots/web-crawlers.ts new file mode 100644 index 0000000000..d7c9f610a3 --- /dev/null +++ b/src/resources/radar/bots/web-crawlers.ts @@ -0,0 +1,384 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class WebCrawlers extends APIResource { + /** + * Retrieves an aggregated summary of HTTP requests from crawlers, grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.bots.webCrawlers.summary('USER_AGENT'); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + query?: WebCrawlerSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + query: WebCrawlerSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/bots/crawlers/summary/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: WebCrawlerSummaryResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from crawlers, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.bots.webCrawlers.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + query?: WebCrawlerTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'REFERER' | 'CRAWL_REFER_RATIO', + query: WebCrawlerTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/bots/crawlers/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: WebCrawlerTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface WebCrawlerSummaryResponse { + /** + * Metadata for the results. + */ + meta: WebCrawlerSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace WebCrawlerSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo | null; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface WebCrawlerTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: WebCrawlerTimeseriesGroupsResponse.Meta; + + serie_0: WebCrawlerTimeseriesGroupsResponse.Serie0; +} + +export namespace WebCrawlerTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface WebCrawlerSummaryParams { + /** + * Filters results by bot operator. + */ + botOperator?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface WebCrawlerTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by bot operator. + */ + botOperator?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace WebCrawlers { + export { + type WebCrawlerSummaryResponse as WebCrawlerSummaryResponse, + type WebCrawlerTimeseriesGroupsResponse as WebCrawlerTimeseriesGroupsResponse, + type WebCrawlerSummaryParams as WebCrawlerSummaryParams, + type WebCrawlerTimeseriesGroupsParams as WebCrawlerTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 0e795a12aa..414edd9bf8 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -1069,7 +1069,7 @@ export interface SummaryQueryTypeResponse { */ meta: SummaryQueryTypeResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryQueryTypeResponse { @@ -1166,7 +1166,7 @@ export interface SummaryResponseCodeResponse { */ meta: SummaryResponseCodeResponse.Meta; - summary_0: Record; + summary_0: { [key: string]: string }; } export namespace SummaryResponseCodeResponse { diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 0096722b9a..97c681b4d6 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -118,11 +118,6 @@ export namespace ASNListResponse { aka?: string; - /** - * Deprecated field. Please use 'aka'. - */ - nameLong?: string; - orgName?: string; website?: string; @@ -159,11 +154,6 @@ export namespace ASNGetResponse { website: string; aka?: string; - - /** - * Deprecated field. Please use 'aka'. - */ - nameLong?: string; } export namespace ASN { @@ -232,11 +222,6 @@ export namespace ASNIPResponse { website: string; aka?: string; - - /** - * Deprecated field. Please use 'aka'. - */ - nameLong?: string; } export namespace ASN { diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index af992d40d1..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -5,6 +5,19 @@ export { AS112, type AS112TimeseriesResponse, type AS112TimeseriesParams } from export { Annotations, type AnnotationListResponse, type AnnotationListParams } from './annotations/index'; export { Attacks } from './attacks/index'; export { BGP, type BGPTimeseriesResponse, type BGPTimeseriesParams } from './bgp/index'; +export { + Bots, + type BotListResponse, + type BotGetResponse, + type BotSummaryResponse, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotListParams, + type BotGetParams, + type BotSummaryParams, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index cd8889379f..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -30,6 +30,20 @@ import * as AttacksAPI from './attacks/attacks'; import { Attacks } from './attacks/attacks'; import * as BGPAPI from './bgp/bgp'; import { BGP, BGPTimeseriesParams, BGPTimeseriesResponse } from './bgp/bgp'; +import * as BotsAPI from './bots/bots'; +import { + BotGetParams, + BotGetResponse, + BotListParams, + BotListResponse, + BotSummaryParams, + BotSummaryResponse, + BotTimeseriesGroupsParams, + BotTimeseriesGroupsResponse, + BotTimeseriesParams, + BotTimeseriesResponse, + Bots, +} from './bots/bots'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -73,6 +87,7 @@ export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); + bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); @@ -100,6 +115,7 @@ export class Radar extends APIResource { Radar.AI = AI; Radar.Annotations = Annotations; Radar.BGP = BGP; +Radar.Bots = Bots; Radar.Datasets = Datasets; Radar.DNS = DNS; Radar.Netflows = Netflows; @@ -132,6 +148,20 @@ export declare namespace Radar { type BGPTimeseriesParams as BGPTimeseriesParams, }; + export { + Bots as Bots, + type BotListResponse as BotListResponse, + type BotGetResponse as BotGetResponse, + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotListParams as BotListParams, + type BotGetParams as BotGetParams, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; + export { Datasets as Datasets, type DatasetListResponse as DatasetListResponse, diff --git a/src/resources/radar/search.ts b/src/resources/radar/search.ts index 78c067af4b..cab2690c3d 100644 --- a/src/resources/radar/search.ts +++ b/src/resources/radar/search.ts @@ -5,7 +5,7 @@ import * as Core from '../../core'; export class Search extends APIResource { /** - * Searches for locations, autonomous systems, and reports. + * Searches for locations, autonomous systems, reports, and bots. * * @example * ```ts @@ -46,7 +46,7 @@ export interface SearchGlobalParams { /** * Search types excluded from results. */ - exclude?: Array<'ASNS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; + exclude?: Array<'ASNS' | 'BOTS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; /** * Format in which results will be returned. @@ -56,7 +56,7 @@ export interface SearchGlobalParams { /** * Search types included in results. */ - include?: Array<'ASNS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; + include?: Array<'ASNS' | 'BOTS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; /** * Limits the number of objects returned in the response. diff --git a/src/resources/radar/verified-bots/top.ts b/src/resources/radar/verified-bots/top.ts index ae351398e9..405d7576c1 100644 --- a/src/resources/radar/verified-bots/top.ts +++ b/src/resources/radar/verified-bots/top.ts @@ -8,10 +8,7 @@ export class Top extends APIResource { /** * Retrieves the top verified bots by HTTP requests, with owner and category. * - * @example - * ```ts - * const response = await client.radar.verifiedBots.top.bots(); - * ``` + * @deprecated Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead. */ bots(query?: TopBotsParams, options?: Core.RequestOptions): Core.APIPromise; bots(options?: Core.RequestOptions): Core.APIPromise; @@ -33,11 +30,7 @@ export class Top extends APIResource { * Retrieves the top verified bot categories by HTTP requests, along with their * corresponding percentage, over the total verified bot HTTP requests. * - * @example - * ```ts - * const response = - * await client.radar.verifiedBots.top.categories(); - * ``` + * @deprecated Use [Radar Bots API](https://developers.cloudflare.com/api/resources/radar/subresources/bots/) instead. */ categories( query?: TopCategoriesParams, diff --git a/src/resources/rate-limits.ts b/src/resources/rate-limits.ts index fef4d9c2b7..ff3198422b 100644 --- a/src/resources/rate-limits.ts +++ b/src/resources/rate-limits.ts @@ -129,8 +129,8 @@ export interface RateLimit { bypass?: Array; /** - * An informative summary of the rate limit. This value is sanitized and any tags - * will be removed. + * An informative summary of the rule. This value is sanitized and any tags will be + * removed. */ description?: string; @@ -306,8 +306,8 @@ export interface RateLimitDeleteResponse { bypass?: Array; /** - * An informative summary of the rate limit. This value is sanitized and any tags - * will be removed. + * An informative summary of the rule. This value is sanitized and any tags will be + * removed. */ description?: string; diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 5aa4e95df7..375d8ee6e9 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -136,12 +136,12 @@ export interface TraceCreateParams { /** * Body param: Cookies added to tracing request */ - cookies?: Record; + cookies?: { [key: string]: string }; /** * Body param: Headers added to tracing request */ - headers?: Record; + headers?: { [key: string]: string }; /** * Body param: HTTP Protocol of tracing request diff --git a/src/resources/rules/index.ts b/src/resources/rules/index.ts index 26d9417a6d..ef70af73eb 100644 --- a/src/resources/rules/index.ts +++ b/src/resources/rules/index.ts @@ -1,13 +1,13 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { + ListsListsSinglePage, Lists, type Hostname, type ListsList, type Redirect, type ListCreateResponse, type ListUpdateResponse, - type ListListResponse, type ListDeleteResponse, type ListGetResponse, type ListCreateParams, diff --git a/src/resources/rules/lists/bulk-operations.ts b/src/resources/rules/lists/bulk-operations.ts index e7e88d90f1..c70c6e049d 100644 --- a/src/resources/rules/lists/bulk-operations.ts +++ b/src/resources/rules/lists/bulk-operations.ts @@ -35,54 +35,26 @@ export class BulkOperations extends APIResource { } } -export type BulkOperationGetResponse = - | BulkOperationGetResponse.UnionMember0 - | BulkOperationGetResponse.UnionMember1; - -export namespace BulkOperationGetResponse { - export interface UnionMember0 { - /** - * The unique operation ID of the asynchronous action. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the operation was completed. - */ - completed?: string; - - /** - * A message describing the error when the status is `failed`. - */ - error?: string; - - /** - * The current status of the asynchronous operation. - */ - status?: 'pending' | 'running' | 'completed' | 'failed'; - } - - export interface UnionMember1 { - /** - * The unique operation ID of the asynchronous action. - */ - id?: string; +export interface BulkOperationGetResponse { + /** + * The unique operation ID of the asynchronous action. + */ + id: string; - /** - * The RFC 3339 timestamp of when the operation was completed. - */ - completed?: string; + /** + * The current status of the asynchronous operation. + */ + status: 'pending' | 'running' | 'completed' | 'failed'; - /** - * A message describing the error when the status is `failed`. - */ - error?: string; + /** + * The RFC 3339 timestamp of when the operation was completed. + */ + completed?: string; - /** - * The current status of the asynchronous operation. - */ - status?: 'pending' | 'running' | 'completed' | 'failed'; - } + /** + * A message describing the error when the status is `failed`. + */ + error?: string; } export interface BulkOperationGetParams { diff --git a/src/resources/rules/lists/index.ts b/src/resources/rules/lists/index.ts index 43fa0359a3..cb26b317dd 100644 --- a/src/resources/rules/lists/index.ts +++ b/src/resources/rules/lists/index.ts @@ -6,6 +6,7 @@ export { type BulkOperationGetParams, } from './bulk-operations'; export { + ItemListResponsesCursorPagination, Items, type ListCursor, type ListItem, @@ -21,13 +22,13 @@ export { type ItemGetParams, } from './items'; export { + ListsListsSinglePage, Lists, type Hostname, type ListsList, type Redirect, type ListCreateResponse, type ListUpdateResponse, - type ListListResponse, type ListDeleteResponse, type ListGetResponse, type ListCreateParams, diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 995ed0e3a2..6cd68b12a7 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -3,14 +3,14 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ListsAPI from './lists'; +import { CursorPagination, type CursorPaginationParams } from '../../../pagination'; export class Items extends APIResource { /** * Appends new items to the list. * * This operation is asynchronous. To get current the operation status, invoke the - * [Get bulk operation status](/operations/lists-get-bulk-operation-status) - * endpoint with the returned `operation_id`. + * `Get bulk operation status` endpoint with the returned `operation_id`. * * @example * ```ts @@ -42,8 +42,7 @@ export class Items extends APIResource { * list. * * This operation is asynchronous. To get current the operation status, invoke the - * [Get bulk operation status](/operations/lists-get-bulk-operation-status) - * endpoint with the returned `operation_id`. + * `Get bulk operation status` endpoint with the returned `operation_id`. * * @example * ```ts @@ -75,32 +74,33 @@ export class Items extends APIResource { * * @example * ```ts - * const items = await client.rules.lists.items.list( + * // Automatically fetches more pages as needed. + * for await (const itemListResponse of client.rules.lists.items.list( * '2c0fc9fa937b11eaa1b71c4d701ab86e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ list( listId: string, params: ItemListParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/rules/lists/${listId}/items`, { - query, - ...options, - }) as Core.APIPromise<{ result: ItemListResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/rules/lists/${listId}/items`, + ItemListResponsesCursorPagination, + { query, ...options }, + ); } /** * Removes one or more items from a list. * * This operation is asynchronous. To get current the operation status, invoke the - * [Get bulk operation status](/operations/lists-get-bulk-operation-status) - * endpoint with the returned `operation_id`. + * `Get bulk operation status` endpoint with the returned `operation_id`. * * @example * ```ts @@ -115,11 +115,12 @@ export class Items extends APIResource { params: ItemDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; + const { account_id, ...body } = params; return ( - this._client.delete(`/accounts/${account_id}/rules/lists/${listId}/items`, options) as Core.APIPromise<{ - result: ItemDeleteResponse; - }> + this._client.delete(`/accounts/${account_id}/rules/lists/${listId}/items`, { + body, + ...options, + }) as Core.APIPromise<{ result: ItemDeleteResponse }> )._thenUnwrap((obj) => obj.result); } @@ -151,176 +152,126 @@ export class Items extends APIResource { } } +export class ItemListResponsesCursorPagination extends CursorPagination {} + export interface ListCursor { after?: string; before?: string; } -export type ListItem = ListItem.OperationID | ListItem.OperationID; - -export namespace ListItem { - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } - - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } -} - -export type ItemCreateResponse = ItemCreateResponse.OperationID | ItemCreateResponse.OperationID; - -export namespace ItemCreateResponse { - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } - - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } +export interface ListItem { + /** + * The unique operation ID of the asynchronous action. + */ + operation_id?: string; } -export type ItemUpdateResponse = ItemUpdateResponse.OperationID | ItemUpdateResponse.OperationID; - -export namespace ItemUpdateResponse { - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } - - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } +export interface ItemCreateResponse { + /** + * The unique operation ID of the asynchronous action. + */ + operation_id?: string; } -export type ItemListResponse = unknown | Array; - -export type ItemDeleteResponse = ItemDeleteResponse.OperationID | ItemDeleteResponse.OperationID; - -export namespace ItemDeleteResponse { - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } - - export interface OperationID { - /** - * The unique operation ID of the asynchronous action. - */ - operation_id?: string; - } +export interface ItemUpdateResponse { + /** + * The unique operation ID of the asynchronous action. + */ + operation_id?: string; } -export type ItemGetResponse = ItemGetResponse.UnionMember0 | ItemGetResponse.UnionMember1; +export interface ItemListResponse { + /** + * The unique ID of the list. + */ + id?: string; -export namespace ItemGetResponse { - export interface UnionMember0 { - /** - * The unique ID of the list. - */ - id?: string; + /** + * Defines a non-negative 32 bit integer. + */ + asn?: number; - /** - * Defines a non-negative 32 bit integer. - */ - asn?: number; + /** + * Defines an informative summary of the list item. + */ + comment?: string; - /** - * Defines an informative summary of the list item. - */ - comment?: string; + /** + * The RFC 3339 timestamp of when the item was created. + */ + created_on?: string; - /** - * The RFC 3339 timestamp of when the item was created. - */ - created_on?: string; + /** + * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + * 0 to 9, wildcards (\*), and the hyphen (-). + */ + hostname?: ListsAPI.Hostname; - /** - * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - * 0 to 9, wildcards (\*), and the hyphen (-). - */ - hostname?: ListsAPI.Hostname; + /** + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip?: string; - /** - * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - * maximum of /64. - */ - ip?: string; + /** + * The RFC 3339 timestamp of when the item was last modified. + */ + modified_on?: string; - /** - * The RFC 3339 timestamp of when the item was last modified. - */ - modified_on?: string; + /** + * The definition of the redirect. + */ + redirect?: ListsAPI.Redirect; +} - /** - * The definition of the redirect. - */ - redirect?: ListsAPI.Redirect; - } +export interface ItemDeleteResponse { + /** + * The unique operation ID of the asynchronous action. + */ + operation_id?: string; +} - export interface UnionMember1 { - /** - * The unique ID of the list. - */ - id?: string; +export interface ItemGetResponse { + /** + * The unique ID of the list. + */ + id?: string; - /** - * Defines a non-negative 32 bit integer. - */ - asn?: number; + /** + * Defines a non-negative 32 bit integer. + */ + asn?: number; - /** - * Defines an informative summary of the list item. - */ - comment?: string; + /** + * Defines an informative summary of the list item. + */ + comment?: string; - /** - * The RFC 3339 timestamp of when the item was created. - */ - created_on?: string; + /** + * The RFC 3339 timestamp of when the item was created. + */ + created_on?: string; - /** - * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - * 0 to 9, wildcards (\*), and the hyphen (-). - */ - hostname?: ListsAPI.Hostname; + /** + * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + * 0 to 9, wildcards (\*), and the hyphen (-). + */ + hostname?: ListsAPI.Hostname; - /** - * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - * maximum of /64. - */ - ip?: string; + /** + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip?: string; - /** - * The RFC 3339 timestamp of when the item was last modified. - */ - modified_on?: string; + /** + * The RFC 3339 timestamp of when the item was last modified. + */ + modified_on?: string; - /** - * The definition of the redirect. - */ - redirect?: ListsAPI.Redirect; - } + /** + * The definition of the redirect. + */ + redirect?: ListsAPI.Redirect; } export interface ItemCreateParams { @@ -354,8 +305,7 @@ export namespace ItemCreateParams { hostname?: ListsAPI.HostnameParam; /** - * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - * maximum of /64. + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. */ ip?: string; @@ -397,8 +347,7 @@ export namespace ItemUpdateParams { hostname?: ListsAPI.HostnameParam; /** - * An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a - * maximum of /64. + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. */ ip?: string; @@ -409,26 +358,12 @@ export namespace ItemUpdateParams { } } -export interface ItemListParams { +export interface ItemListParams extends CursorPaginationParams { /** * Path param: Defines an identifier. */ account_id: string; - /** - * Query param: The pagination cursor. An opaque string token indicating the - * position from which to continue when requesting the next/previous set of - * records. Cursor values are provided under `result_info.cursors` in the response. - * You should make no assumptions about a cursor's content or length. - */ - cursor?: string; - - /** - * Query param: Amount of results to include in each paginated response. A - * non-negative 32 bit integer. - */ - per_page?: number; - /** * Query param: A search query to filter returned items. Its meaning depends on the * list type: IP addresses must start with the provided string, hostnames and bulk @@ -439,9 +374,18 @@ export interface ItemListParams { export interface ItemDeleteParams { /** - * Defines an identifier. + * Path param: Defines an identifier. */ account_id: string; + + /** + * Body param: + */ + items?: Array; +} + +export namespace ItemDeleteParams { + export interface Item {} } export interface ItemGetParams { @@ -451,6 +395,8 @@ export interface ItemGetParams { account_id: string; } +Items.ItemListResponsesCursorPagination = ItemListResponsesCursorPagination; + export declare namespace Items { export { type ListCursor as ListCursor, @@ -460,6 +406,7 @@ export declare namespace Items { type ItemListResponse as ItemListResponse, type ItemDeleteResponse as ItemDeleteResponse, type ItemGetResponse as ItemGetResponse, + ItemListResponsesCursorPagination as ItemListResponsesCursorPagination, type ItemCreateParams as ItemCreateParams, type ItemUpdateParams as ItemUpdateParams, type ItemListParams as ItemListParams, diff --git a/src/resources/rules/lists/lists.ts b/src/resources/rules/lists/lists.ts index 0102b5b3f9..b080b6eae3 100644 --- a/src/resources/rules/lists/lists.ts +++ b/src/resources/rules/lists/lists.ts @@ -14,12 +14,14 @@ import { ItemGetResponse, ItemListParams, ItemListResponse, + ItemListResponsesCursorPagination, ItemUpdateParams, ItemUpdateResponse, Items, ListCursor, ListItem, } from './items'; +import { SinglePage } from '../../../pagination'; export class Lists extends APIResource { bulkOperations: BulkOperationsAPI.BulkOperations = new BulkOperationsAPI.BulkOperations(this._client); @@ -76,18 +78,20 @@ export class Lists extends APIResource { * * @example * ```ts - * const lists = await client.rules.lists.list({ + * // Automatically fetches more pages as needed. + * for await (const listsList of client.rules.lists.list({ * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); + * })) { + * // ... + * } * ``` */ - list(params: ListListParams, options?: Core.RequestOptions): Core.APIPromise { + list( + params: ListListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/rules/lists`, options) as Core.APIPromise<{ - result: ListListResponse; - }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList(`/accounts/${account_id}/rules/lists`, ListsListsSinglePage, options); } /** @@ -139,6 +143,8 @@ export class Lists extends APIResource { } } +export class ListsListsSinglePage extends SinglePage {} + /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). @@ -236,294 +242,140 @@ export interface RedirectParam { subpath_matching?: boolean; } -export type ListCreateResponse = ListCreateResponse.UnionMember0 | ListCreateResponse.UnionMember1; - -export namespace ListCreateResponse { - export interface UnionMember0 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } +export interface ListCreateResponse { + /** + * The unique ID of the list. + */ + id?: string; - export interface UnionMember1 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } -} + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on?: string; -export type ListUpdateResponse = ListUpdateResponse.UnionMember0 | ListUpdateResponse.UnionMember1; - -export namespace ListUpdateResponse { - export interface UnionMember0 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } + /** + * An informative summary of the list. + */ + description?: string; - export interface UnionMember1 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } + /** + * The type of the list. Each type supports specific list items (IP addresses, + * ASNs, hostnames or redirects). + */ + kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on?: string; + + /** + * An informative name for the list. Use this name in filter and rule expressions. + */ + name?: string; + + /** + * The number of items in the list. + */ + num_items?: number; + + /** + * The number of [filters](/operations/filters-list-filters) referencing the list. + */ + num_referencing_filters?: number; } -export type ListListResponse = unknown | Array; +export interface ListUpdateResponse { + /** + * The unique ID of the list. + */ + id?: string; -export type ListDeleteResponse = ListDeleteResponse.ID | ListDeleteResponse.ID; + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on?: string; -export namespace ListDeleteResponse { - export interface ID { - /** - * Defines the unique ID of the item in the List. - */ - id?: string; - } + /** + * An informative summary of the list. + */ + description?: string; - export interface ID { - /** - * Defines the unique ID of the item in the List. - */ - id?: string; - } + /** + * The type of the list. Each type supports specific list items (IP addresses, + * ASNs, hostnames or redirects). + */ + kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on?: string; + + /** + * An informative name for the list. Use this name in filter and rule expressions. + */ + name?: string; + + /** + * The number of items in the list. + */ + num_items?: number; + + /** + * The number of [filters](/operations/filters-list-filters) referencing the list. + */ + num_referencing_filters?: number; } -export type ListGetResponse = ListGetResponse.UnionMember0 | ListGetResponse.UnionMember1; - -export namespace ListGetResponse { - export interface UnionMember0 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } +export interface ListDeleteResponse { + /** + * Defines the unique ID of the item in the List. + */ + id?: string; +} - export interface UnionMember1 { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * The RFC 3339 timestamp of when the list was created. - */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; - - /** - * The type of the list. Each type supports specific list items (IP addresses, - * ASNs, hostnames or redirects). - */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; - - /** - * The RFC 3339 timestamp of when the list was last modified. - */ - modified_on?: string; - - /** - * An informative name for the list. Use this name in filter and rule expressions. - */ - name?: string; - - /** - * The number of items in the list. - */ - num_items?: number; - - /** - * The number of [filters](/operations/filters-list-filters) referencing the list. - */ - num_referencing_filters?: number; - } +export interface ListGetResponse { + /** + * The unique ID of the list. + */ + id?: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on?: string; + + /** + * An informative summary of the list. + */ + description?: string; + + /** + * The type of the list. Each type supports specific list items (IP addresses, + * ASNs, hostnames or redirects). + */ + kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on?: string; + + /** + * An informative name for the list. Use this name in filter and rule expressions. + */ + name?: string; + + /** + * The number of items in the list. + */ + num_items?: number; + + /** + * The number of [filters](/operations/filters-list-filters) referencing the list. + */ + num_referencing_filters?: number; } export interface ListCreateParams { @@ -583,8 +435,10 @@ export interface ListGetParams { account_id: string; } +Lists.ListsListsSinglePage = ListsListsSinglePage; Lists.BulkOperations = BulkOperations; Lists.Items = Items; +Lists.ItemListResponsesCursorPagination = ItemListResponsesCursorPagination; export declare namespace Lists { export { @@ -593,9 +447,9 @@ export declare namespace Lists { type Redirect as Redirect, type ListCreateResponse as ListCreateResponse, type ListUpdateResponse as ListUpdateResponse, - type ListListResponse as ListListResponse, type ListDeleteResponse as ListDeleteResponse, type ListGetResponse as ListGetResponse, + ListsListsSinglePage as ListsListsSinglePage, type ListCreateParams as ListCreateParams, type ListUpdateParams as ListUpdateParams, type ListListParams as ListListParams, @@ -618,6 +472,7 @@ export declare namespace Lists { type ItemListResponse as ItemListResponse, type ItemDeleteResponse as ItemDeleteResponse, type ItemGetResponse as ItemGetResponse, + ItemListResponsesCursorPagination as ItemListResponsesCursorPagination, type ItemCreateParams as ItemCreateParams, type ItemUpdateParams as ItemUpdateParams, type ItemListParams as ItemListParams, diff --git a/src/resources/rules/rules.ts b/src/resources/rules/rules.ts index c9d80fdc91..b453132086 100644 --- a/src/resources/rules/rules.ts +++ b/src/resources/rules/rules.ts @@ -11,11 +11,11 @@ import { ListGetParams, ListGetResponse, ListListParams, - ListListResponse, ListUpdateParams, ListUpdateResponse, Lists, ListsList, + ListsListsSinglePage, Redirect, } from './lists/lists'; @@ -24,6 +24,7 @@ export class Rules extends APIResource { } Rules.Lists = Lists; +Rules.ListsListsSinglePage = ListsListsSinglePage; export declare namespace Rules { export { @@ -33,9 +34,9 @@ export declare namespace Rules { type Redirect as Redirect, type ListCreateResponse as ListCreateResponse, type ListUpdateResponse as ListUpdateResponse, - type ListListResponse as ListListResponse, type ListDeleteResponse as ListDeleteResponse, type ListGetResponse as ListGetResponse, + ListsListsSinglePage as ListsListsSinglePage, type ListCreateParams as ListCreateParams, type ListUpdateParams as ListUpdateParams, type ListListParams as ListListParams, diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index d321812928..1bb54af0c9 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -3215,14 +3215,14 @@ export namespace RewriteRule { /** * Map of request headers to modify. */ - headers?: Record< - string, - | ActionParameters.RemoveHeader - | ActionParameters.AddStaticHeader - | ActionParameters.SetStaticHeader - | ActionParameters.AddDynamicHeader - | ActionParameters.SetDynamicHeader - >; + headers?: { + [key: string]: + | ActionParameters.RemoveHeader + | ActionParameters.AddStaticHeader + | ActionParameters.SetStaticHeader + | ActionParameters.AddDynamicHeader + | ActionParameters.SetDynamicHeader; + }; /** * URI to rewrite the request to. @@ -3429,14 +3429,14 @@ export namespace RewriteRuleParam { /** * Map of request headers to modify. */ - headers?: Record< - string, - | ActionParameters.RemoveHeader - | ActionParameters.AddStaticHeader - | ActionParameters.SetStaticHeader - | ActionParameters.AddDynamicHeader - | ActionParameters.SetDynamicHeader - >; + headers?: { + [key: string]: + | ActionParameters.RemoveHeader + | ActionParameters.AddStaticHeader + | ActionParameters.SetStaticHeader + | ActionParameters.AddDynamicHeader + | ActionParameters.SetDynamicHeader; + }; /** * URI to rewrite the request to. @@ -4930,7 +4930,7 @@ export namespace SetCacheSettingsRule { * whether any of the values provided are contained in the request header value is * used in building the cache key. */ - contains?: Record>; + contains?: { [key: string]: Array }; /** * Whether or not to include the origin header. A value of true will exclude the @@ -5446,7 +5446,7 @@ export namespace SetCacheSettingsRuleParam { * whether any of the values provided are contained in the request header value is * used in building the cache key. */ - contains?: Record>; + contains?: { [key: string]: Array }; /** * Whether or not to include the origin header. A value of true will exclude the @@ -6288,7 +6288,7 @@ export namespace SkipRule { * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the * execution of. This option is incompatible with the ruleset option. */ - rules?: Record>; + rules?: { [key: string]: Array }; /** * A ruleset to skip the execution of. This option is incompatible with the @@ -6442,7 +6442,7 @@ export namespace SkipRuleParam { * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the * execution of. This option is incompatible with the ruleset option. */ - rules?: Record>; + rules?: { [key: string]: Array }; /** * A ruleset to skip the execution of. This option is incompatible with the @@ -9233,14 +9233,14 @@ export declare namespace RuleCreateParams { /** * Map of request headers to modify. */ - headers?: Record< - string, - | ActionParameters.RemoveHeader - | ActionParameters.AddStaticHeader - | ActionParameters.SetStaticHeader - | ActionParameters.AddDynamicHeader - | ActionParameters.SetDynamicHeader - >; + headers?: { + [key: string]: + | ActionParameters.RemoveHeader + | ActionParameters.AddStaticHeader + | ActionParameters.SetStaticHeader + | ActionParameters.AddDynamicHeader + | ActionParameters.SetDynamicHeader; + }; /** * URI to rewrite the request to. @@ -10374,7 +10374,7 @@ export declare namespace RuleCreateParams { * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the * execution of. This option is incompatible with the ruleset option. */ - rules?: Record>; + rules?: { [key: string]: Array }; /** * A ruleset to skip the execution of. This option is incompatible with the @@ -10748,7 +10748,7 @@ export declare namespace RuleCreateParams { * whether any of the values provided are contained in the request header value is * used in building the cache key. */ - contains?: Record>; + contains?: { [key: string]: Array }; /** * Whether or not to include the origin header. A value of true will exclude the @@ -13375,14 +13375,14 @@ export declare namespace RuleEditParams { /** * Map of request headers to modify. */ - headers?: Record< - string, - | ActionParameters.RemoveHeader - | ActionParameters.AddStaticHeader - | ActionParameters.SetStaticHeader - | ActionParameters.AddDynamicHeader - | ActionParameters.SetDynamicHeader - >; + headers?: { + [key: string]: + | ActionParameters.RemoveHeader + | ActionParameters.AddStaticHeader + | ActionParameters.SetStaticHeader + | ActionParameters.AddDynamicHeader + | ActionParameters.SetDynamicHeader; + }; /** * URI to rewrite the request to. @@ -14516,7 +14516,7 @@ export declare namespace RuleEditParams { * A mapping of ruleset IDs to a list of rule IDs in that ruleset to skip the * execution of. This option is incompatible with the ruleset option. */ - rules?: Record>; + rules?: { [key: string]: Array }; /** * A ruleset to skip the execution of. This option is incompatible with the @@ -14890,7 +14890,7 @@ export declare namespace RuleEditParams { * whether any of the values provided are contained in the request header value is * used in building the cache key. */ - contains?: Record>; + contains?: { [key: string]: Array }; /** * Whether or not to include the origin header. A value of true will exclude the diff --git a/src/resources/schema-validation/settings/operations.ts b/src/resources/schema-validation/settings/operations.ts index f5172b8d29..2ee8cd95f2 100644 --- a/src/resources/schema-validation/settings/operations.ts +++ b/src/resources/schema-validation/settings/operations.ts @@ -192,7 +192,7 @@ export interface OperationDeleteResponse { /** * Operation ID to per operation setting mapping */ -export type OperationBulkEditResponse = Record; +export type OperationBulkEditResponse = { [key: string]: OperationBulkEditResponse.item }; export namespace OperationBulkEditResponse { export interface item { @@ -276,7 +276,7 @@ export interface OperationBulkEditParams { /** * Body param: */ - body: Record; + body: { [key: string]: OperationBulkEditParams.Body }; } export namespace OperationBulkEditParams { diff --git a/src/resources/shared.ts b/src/resources/shared.ts index f5263b5536..f6bea7bc14 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -274,7 +274,7 @@ export interface LoadBalancerPreview { /** * Monitored pool IDs mapped to their respective names. */ - pools?: Record; + pools?: { [key: string]: string }; preview_id?: string; } @@ -890,7 +890,7 @@ export interface TokenPolicy { /** * A list of resource names that the policy applies to. */ - resources: Record; + resources: { [key: string]: string | { [key: string]: string } }; } export namespace TokenPolicy { @@ -941,7 +941,7 @@ export interface TokenPolicyParam { /** * A list of resource names that the policy applies to. */ - resources: Record; + resources: { [key: string]: string | { [key: string]: string } }; } export namespace TokenPolicyParam { diff --git a/src/resources/spectrum/analytics/events/bytimes.ts b/src/resources/spectrum/analytics/events/bytimes.ts index e9ec79a74f..2cab5a958c 100644 --- a/src/resources/spectrum/analytics/events/bytimes.ts +++ b/src/resources/spectrum/analytics/events/bytimes.ts @@ -34,12 +34,12 @@ export interface BytimeGetResponse { /** * Maximum result for each selected metrics across all data. */ - max: Record; + max: { [key: string]: number }; /** * Minimum result for each selected metrics across all data. */ - min: Record; + min: { [key: string]: number }; query: BytimeGetResponse.Query; @@ -51,7 +51,7 @@ export interface BytimeGetResponse { /** * Total result for each selected metrics across all data. */ - totals: Record; + totals: { [key: string]: number }; /** * List of time interval buckets: [start, end] diff --git a/src/resources/spectrum/analytics/events/summaries.ts b/src/resources/spectrum/analytics/events/summaries.ts index 6001e0eba7..cb4d2eb42b 100644 --- a/src/resources/spectrum/analytics/events/summaries.ts +++ b/src/resources/spectrum/analytics/events/summaries.ts @@ -34,12 +34,12 @@ export interface SummaryGetResponse { /** * Maximum result for each selected metrics across all data. */ - max: Record; + max: { [key: string]: number }; /** * Minimum result for each selected metrics across all data. */ - min: Record; + min: { [key: string]: number }; query: SummaryGetResponse.Query; @@ -51,7 +51,7 @@ export interface SummaryGetResponse { /** * Total result for each selected metrics across all data. */ - totals: Record; + totals: { [key: string]: number }; /** * List of time interval buckets: [start, end] diff --git a/src/resources/url-scanner/scans.ts b/src/resources/url-scanner/scans.ts index 1d30d058a0..20506e24bd 100644 --- a/src/resources/url-scanner/scans.ts +++ b/src/resources/url-scanner/scans.ts @@ -1538,7 +1538,7 @@ export interface ScanCreateParams { /** * Body param: Set custom headers. */ - customHeaders?: Record; + customHeaders?: { [key: string]: string }; /** * Body param: @@ -1598,7 +1598,7 @@ export namespace ScanBulkCreateParams { /** * Set custom headers. */ - customHeaders?: Record; + customHeaders?: { [key: string]: string }; referer?: string; diff --git a/src/resources/user/tokens/index.ts b/src/resources/user/tokens/index.ts index 2c4a8edb0b..5c1a66039e 100644 --- a/src/resources/user/tokens/index.ts +++ b/src/resources/user/tokens/index.ts @@ -4,6 +4,7 @@ export { PermissionGroupListResponsesSinglePage, PermissionGroups, type PermissionGroupListResponse, + type PermissionGroupListParams, } from './permission-groups'; export { Tokens, diff --git a/src/resources/user/tokens/permission-groups.ts b/src/resources/user/tokens/permission-groups.ts index 4e929b92a6..a636d15166 100644 --- a/src/resources/user/tokens/permission-groups.ts +++ b/src/resources/user/tokens/permission-groups.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import { SinglePage } from '../../../pagination'; @@ -17,13 +18,23 @@ export class PermissionGroups extends APIResource { * ``` */ list( + query?: PermissionGroupListParams, + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; + list( + query: PermissionGroupListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.PagePromise { - return this._client.getAPIList( - '/user/tokens/permission_groups', - PermissionGroupListResponsesSinglePage, - options, - ); + if (isRequestOptions(query)) { + return this.list({}, query); + } + return this._client.getAPIList('/user/tokens/permission_groups', PermissionGroupListResponsesSinglePage, { + query, + ...options, + }); } } @@ -51,11 +62,24 @@ export interface PermissionGroupListResponse { >; } +export interface PermissionGroupListParams { + /** + * Filter by the name of the permission group. The value must be URL-encoded. + */ + name?: string; + + /** + * 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, PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, + type PermissionGroupListParams as PermissionGroupListParams, }; } diff --git a/src/resources/user/tokens/tokens.ts b/src/resources/user/tokens/tokens.ts index 92297d3521..9f9e3ddc28 100644 --- a/src/resources/user/tokens/tokens.ts +++ b/src/resources/user/tokens/tokens.ts @@ -7,6 +7,7 @@ import * as Shared from '../../shared'; import { TokensV4PagePaginationArray } from '../../shared'; import * as PermissionGroupsAPI from './permission-groups'; import { + PermissionGroupListParams, PermissionGroupListResponse, PermissionGroupListResponsesSinglePage, PermissionGroups, @@ -35,12 +36,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { - * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': - * '*', - * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': - * '*', - * }, + * resources: { foo: 'string' }, * }, * ], * }); @@ -70,15 +66,9 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { - * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': - * '*', - * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': - * '*', - * }, + * resources: { foo: 'string' }, * }, * ], - * status: 'active', * }, * ); * ``` @@ -343,11 +333,6 @@ export interface TokenUpdateParams { */ policies: Array; - /** - * Status of the token. - */ - status: 'active' | 'disabled' | 'expired'; - condition?: TokenUpdateParams.Condition; /** @@ -360,6 +345,11 @@ export interface TokenUpdateParams { * The time before which the token MUST NOT be accepted for processing. */ not_before?: string; + + /** + * Status of the token. + */ + status?: 'active' | 'disabled' | 'expired'; } export namespace TokenUpdateParams { @@ -413,6 +403,7 @@ export declare namespace Tokens { PermissionGroups as PermissionGroups, type PermissionGroupListResponse as PermissionGroupListResponse, PermissionGroupListResponsesSinglePage as PermissionGroupListResponsesSinglePage, + type PermissionGroupListParams as PermissionGroupListParams, }; export { Value as Value, type ValueUpdateParams as ValueUpdateParams }; diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.ts index 6f64b5d318..617b87cc42 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/asset-upload.ts @@ -60,7 +60,7 @@ export interface AssetUploadCreateParams { * Body param: A manifest ([path]: {hash, size}) map of files to upload. As an * example, `/blog/hello-world.html` would be a valid path key. */ - manifest: Record; + manifest: { [key: string]: AssetUploadCreateParams.Manifest }; } export namespace AssetUploadCreateParams { diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index b23416fe83..5d38a78b6c 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -276,7 +276,7 @@ export interface ScriptUpdateParams { */ metadata: ScriptUpdateParams.Metadata; - files?: Record; + files?: { [key: string]: Core.Uploadable }; } export namespace ScriptUpdateParams { @@ -444,7 +444,14 @@ export namespace ScriptUpdateParams { * or '!/'. At least one non-negative rule must be provided, and negative rules * have higher precedence than non-negative rules. */ - run_worker_first?: Array; + run_worker_first?: Array | boolean; + + /** + * @deprecated When true and the incoming request matches an asset, that will be + * served instead of invoking the Worker script. When false, requests will always + * invoke the Worker script. + */ + serve_directly?: boolean; } } diff --git a/src/resources/workers/assets/upload.ts b/src/resources/workers/assets/upload.ts index f17180cb59..37a376320f 100644 --- a/src/resources/workers/assets/upload.ts +++ b/src/resources/workers/assets/upload.ts @@ -50,7 +50,7 @@ export interface UploadCreateParams { /** * Body param: */ - body: Record; + body: { [key: string]: string }; } export declare namespace Upload { diff --git a/src/resources/workers/observability/telemetry.ts b/src/resources/workers/observability/telemetry.ts index 94a7c28f18..9467608603 100644 --- a/src/resources/workers/observability/telemetry.ts +++ b/src/resources/workers/observability/telemetry.ts @@ -118,7 +118,7 @@ export interface TelemetryQueryResponse { events?: TelemetryQueryResponse.Events; - invocations?: Record>; + invocations?: { [key: string]: Array }; patterns?: Array; } @@ -669,19 +669,19 @@ export namespace TelemetryQueryResponse { entrypoint?: string; - event?: Record< - string, - | string - | number - | boolean - | Record< - string, - | string - | number - | boolean - | Record | string | number | boolean> - > - >; + event?: { + [key: string]: + | string + | number + | boolean + | { + [key: string]: + | string + | number + | boolean + | { [key: string]: Array | string | number | boolean }; + }; + }; executionModel?: 'durableObject' | 'stateless'; @@ -729,7 +729,7 @@ export namespace TelemetryQueryResponse { entrypoint?: string; - event?: Record; + event?: { [key: string]: string | number | boolean }; executionModel?: 'durableObject' | 'stateless'; @@ -784,7 +784,7 @@ export namespace TelemetryQueryResponse { /** * Groups in the query results. */ - groups?: Record; + groups?: { [key: string]: string | number | boolean }; } export namespace Data { @@ -921,19 +921,19 @@ export namespace TelemetryQueryResponse { entrypoint?: string; - event?: Record< - string, - | string - | number - | boolean - | Record< - string, - | string - | number - | boolean - | Record | string | number | boolean> - > - >; + event?: { + [key: string]: + | string + | number + | boolean + | { + [key: string]: + | string + | number + | boolean + | { [key: string]: Array | string | number | boolean }; + }; + }; executionModel?: 'durableObject' | 'stateless'; @@ -981,7 +981,7 @@ export namespace TelemetryQueryResponse { entrypoint?: string; - event?: Record; + event?: { [key: string]: string | number | boolean }; executionModel?: 'durableObject' | 'stateless'; diff --git a/src/resources/workers/scripts/assets/upload.ts b/src/resources/workers/scripts/assets/upload.ts index 5cb7fb9078..0f67694228 100644 --- a/src/resources/workers/scripts/assets/upload.ts +++ b/src/resources/workers/scripts/assets/upload.ts @@ -58,7 +58,7 @@ export interface UploadCreateParams { * Body param: A manifest ([path]: {hash, size}) map of files to upload. As an * example, `/blog/hello-world.html` would be a valid path key. */ - manifest: Record; + manifest: { [key: string]: UploadCreateParams.Manifest }; } export namespace UploadCreateParams { diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 6df2209ef0..684ea4d3f0 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -457,7 +457,7 @@ export interface ScriptUpdateParams { */ metadata: ScriptUpdateParams.Metadata; - files?: Record; + files?: { [key: string]: Core.Uploadable }; } export namespace ScriptUpdateParams { @@ -625,7 +625,14 @@ export namespace ScriptUpdateParams { * or '!/'. At least one non-negative rule must be provided, and negative rules * have higher precedence than non-negative rules. */ - run_worker_first?: Array; + run_worker_first?: Array | boolean; + + /** + * @deprecated When true and the incoming request matches an asset, that will be + * served instead of invoking the Worker script. When false, requests will always + * invoke the Worker script. + */ + serve_directly?: boolean; } } diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts index e334dd2e3f..117054a689 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -318,6 +318,11 @@ export interface InstanceCreateParams { */ instance_id?: string; + /** + * Body param: + */ + instance_retention?: unknown; + /** * Body param: */ @@ -370,6 +375,8 @@ export namespace InstanceBulkParams { export interface Body { instance_id?: string; + instance_retention?: unknown; + params?: unknown; } } diff --git a/src/resources/zaraz/config.ts b/src/resources/zaraz/config.ts index 8ff5e10b78..0fda4dd60c 100644 --- a/src/resources/zaraz/config.ts +++ b/src/resources/zaraz/config.ts @@ -82,23 +82,25 @@ export interface Configuration { * Tools set up under Zaraz configuration, where key is the alpha-numeric tool ID * and value is the tool configuration object. */ - tools: Record; + tools: { [key: string]: Configuration.ZarazManagedComponent | Configuration.Worker }; /** * Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: { [key: string]: Configuration.Triggers }; /** * Variables set up under Zaraz configuration, where key is the variable * alpha-numeric ID and value is the variable configuration. Values of variables of * type secret are not included. */ - variables: Record< - string, - Configuration.ZarazStringVariable | Configuration.ZarazSecretVariable | Configuration.ZarazWorkerVariable - >; + variables: { + [key: string]: + | Configuration.ZarazStringVariable + | Configuration.ZarazSecretVariable + | Configuration.ZarazWorkerVariable; + }; /** * Zaraz internal version of the config. @@ -222,7 +224,7 @@ export namespace Configuration { /** * Default fields for tool's actions */ - defaultFields: Record; + defaultFields: { [key: string]: string | boolean }; /** * Whether tool is enabled @@ -242,14 +244,14 @@ export namespace Configuration { /** * Tool's settings */ - settings: Record; + settings: { [key: string]: string | boolean }; type: 'component'; /** * Actions configured on a tool. Either this or neoEvents field is required. */ - actions?: Record; + actions?: { [key: string]: ZarazAPI.NeoEvent }; /** * Default consent purpose ID @@ -289,7 +291,7 @@ export namespace Configuration { /** * Default fields for tool's actions */ - defaultFields: Record; + defaultFields: { [key: string]: string | boolean }; /** * Whether tool is enabled @@ -309,7 +311,7 @@ export namespace Configuration { /** * Tool's settings */ - settings: Record; + settings: { [key: string]: string | boolean }; type: 'custom-mc'; @@ -321,7 +323,7 @@ export namespace Configuration { /** * Actions configured on a tool. Either this or neoEvents field is required. */ - actions?: Record; + actions?: { [key: string]: ZarazAPI.NeoEvent }; /** * Default consent purpose ID @@ -699,7 +701,7 @@ export namespace Configuration { /** * Object where keys are language codes */ - consentModalIntroHTMLWithTranslations?: Record; + consentModalIntroHTMLWithTranslations?: { [key: string]: string }; cookieName?: string; @@ -714,12 +716,12 @@ export namespace Configuration { /** * Object where keys are purpose alpha-numeric IDs */ - purposes?: Record; + purposes?: { [key: string]: Consent.Purposes }; /** * Object where keys are purpose alpha-numeric IDs */ - purposesWithTranslations?: Record; + purposesWithTranslations?: { [key: string]: Consent.PurposesWithTranslations }; tcfCompliant?: boolean; } @@ -735,12 +737,12 @@ export namespace Configuration { /** * Object where keys are language codes */ - description: Record; + description: { [key: string]: string }; /** * Object where keys are language codes */ - name: Record; + name: { [key: string]: string }; order: number; } @@ -772,25 +774,25 @@ export interface ConfigUpdateParams { * Body param: Tools set up under Zaraz configuration, where key is the * alpha-numeric tool ID and value is the tool configuration object. */ - tools: Record; + tools: { [key: string]: ConfigUpdateParams.ZarazManagedComponent | ConfigUpdateParams.Worker }; /** * Body param: Triggers set up under Zaraz configuration, where key is the trigger * alpha-numeric ID and value is the trigger configuration. */ - triggers: Record; + triggers: { [key: string]: ConfigUpdateParams.Triggers }; /** * Body param: Variables set up under Zaraz configuration, where key is the * variable alpha-numeric ID and value is the variable configuration. Values of * variables of type secret are not included. */ - variables: Record< - string, - | ConfigUpdateParams.ZarazStringVariable - | ConfigUpdateParams.ZarazSecretVariable - | ConfigUpdateParams.ZarazWorkerVariable - >; + variables: { + [key: string]: + | ConfigUpdateParams.ZarazStringVariable + | ConfigUpdateParams.ZarazSecretVariable + | ConfigUpdateParams.ZarazWorkerVariable; + }; /** * Body param: Zaraz internal version of the config. @@ -914,7 +916,7 @@ export namespace ConfigUpdateParams { /** * Default fields for tool's actions */ - defaultFields: Record; + defaultFields: { [key: string]: string | boolean }; /** * Whether tool is enabled @@ -934,14 +936,14 @@ export namespace ConfigUpdateParams { /** * Tool's settings */ - settings: Record; + settings: { [key: string]: string | boolean }; type: 'component'; /** * Actions configured on a tool. Either this or neoEvents field is required. */ - actions?: Record; + actions?: { [key: string]: ZarazAPI.NeoEventParam }; /** * Default consent purpose ID @@ -981,7 +983,7 @@ export namespace ConfigUpdateParams { /** * Default fields for tool's actions */ - defaultFields: Record; + defaultFields: { [key: string]: string | boolean }; /** * Whether tool is enabled @@ -1001,7 +1003,7 @@ export namespace ConfigUpdateParams { /** * Tool's settings */ - settings: Record; + settings: { [key: string]: string | boolean }; type: 'custom-mc'; @@ -1013,7 +1015,7 @@ export namespace ConfigUpdateParams { /** * Actions configured on a tool. Either this or neoEvents field is required. */ - actions?: Record; + actions?: { [key: string]: ZarazAPI.NeoEventParam }; /** * Default consent purpose ID @@ -1391,7 +1393,7 @@ export namespace ConfigUpdateParams { /** * Object where keys are language codes */ - consentModalIntroHTMLWithTranslations?: Record; + consentModalIntroHTMLWithTranslations?: { [key: string]: string }; cookieName?: string; @@ -1406,12 +1408,12 @@ export namespace ConfigUpdateParams { /** * Object where keys are purpose alpha-numeric IDs */ - purposes?: Record; + purposes?: { [key: string]: Consent.Purposes }; /** * Object where keys are purpose alpha-numeric IDs */ - purposesWithTranslations?: Record; + purposesWithTranslations?: { [key: string]: Consent.PurposesWithTranslations }; tcfCompliant?: boolean; } @@ -1427,12 +1429,12 @@ export namespace ConfigUpdateParams { /** * Object where keys are language codes */ - description: Record; + description: { [key: string]: string }; /** * Object where keys are language codes */ - name: Record; + name: { [key: string]: string }; order: number; } diff --git a/src/resources/zaraz/history/configs.ts b/src/resources/zaraz/history/configs.ts index 96f26e2e29..fd62f0fc26 100644 --- a/src/resources/zaraz/history/configs.ts +++ b/src/resources/zaraz/history/configs.ts @@ -30,7 +30,7 @@ export class Configs extends APIResource { /** * Object where keys are numericc onfiguration IDs */ -export type ConfigGetResponse = Record; +export type ConfigGetResponse = { [key: string]: ConfigGetResponse.item }; export namespace ConfigGetResponse { export interface item { diff --git a/src/resources/zaraz/zaraz.ts b/src/resources/zaraz/zaraz.ts index 55f8db004c..8124ed96f3 100644 --- a/src/resources/zaraz/zaraz.ts +++ b/src/resources/zaraz/zaraz.ts @@ -55,34 +55,34 @@ export interface ButtonTextTranslation { /** * Object where keys are language codes */ - accept_all: Record; + accept_all: { [key: string]: string }; /** * Object where keys are language codes */ - confirm_my_choices: Record; + confirm_my_choices: { [key: string]: string }; /** * Object where keys are language codes */ - reject_all: Record; + reject_all: { [key: string]: string }; } export interface ButtonTextTranslationParam { /** * Object where keys are language codes */ - accept_all: Record; + accept_all: { [key: string]: string }; /** * Object where keys are language codes */ - confirm_my_choices: Record; + confirm_my_choices: { [key: string]: string }; /** * Object where keys are language codes */ - reject_all: Record; + reject_all: { [key: string]: string }; } export interface NeoEvent { diff --git a/src/resources/zero-trust/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 743992d3f5..6fcb92daab 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -757,7 +757,7 @@ export namespace Application { /** * A mapping from IdP ID to attribute name. */ - name_by_idp?: Record; + name_by_idp?: { [key: string]: string }; } } } @@ -1887,7 +1887,7 @@ export namespace OIDCSaaSApp { /** * A mapping from IdP ID to claim name. */ - name_by_idp?: Record; + name_by_idp?: { [key: string]: string }; } } @@ -2012,7 +2012,7 @@ export namespace OIDCSaaSAppParam { /** * A mapping from IdP ID to claim name. */ - name_by_idp?: Record; + name_by_idp?: { [key: string]: string }; } } @@ -5258,7 +5258,7 @@ export namespace ApplicationCreateResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -5636,7 +5636,7 @@ export namespace ApplicationCreateResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -8546,7 +8546,7 @@ export namespace ApplicationUpdateResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -8924,7 +8924,7 @@ export namespace ApplicationUpdateResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -11834,7 +11834,7 @@ export namespace ApplicationListResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -12212,7 +12212,7 @@ export namespace ApplicationListResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -15129,7 +15129,7 @@ export namespace ApplicationGetResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -15507,7 +15507,7 @@ export namespace ApplicationGetResponse { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -18319,7 +18319,7 @@ export declare namespace ApplicationCreateParams { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -18601,7 +18601,7 @@ export declare namespace ApplicationCreateParams { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -21394,7 +21394,7 @@ export declare namespace ApplicationUpdateParams { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } export interface Policy { @@ -21676,7 +21676,7 @@ export declare namespace ApplicationUpdateParams { /** * Contains a map of target attribute keys to target attribute values. */ - target_attributes: Record>; + target_attributes: { [key: string]: Array }; } /** @@ -21917,6 +21917,12 @@ export interface ApplicationListParams { */ domain?: string; + /** + * Query param: True for only exact string matches against passed name/domain query + * parameters. + */ + exact?: boolean; + /** * Query param: The name of the app. */ diff --git a/src/resources/zero-trust/access/applications/policies.ts b/src/resources/zero-trust/access/applications/policies.ts index 87e7d1197f..cf5717f666 100644 --- a/src/resources/zero-trust/access/applications/policies.ts +++ b/src/resources/zero-trust/access/applications/policies.ts @@ -329,6 +329,7 @@ export type AccessRule = | IPRule | OktaGroupRule | SAMLGroupRule + | AccessRule.AccessOIDCClaimRule | ServiceTokenRule; export namespace AccessRule { @@ -389,6 +390,32 @@ export namespace AccessRule { id: string; } } + + /** + * Matches an OIDC claim. Requires an OIDC identity provider. + */ + export interface AccessOIDCClaimRule { + oidc: AccessOIDCClaimRule.OIDC; + } + + export namespace AccessOIDCClaimRule { + export interface OIDC { + /** + * The name of the OIDC claim. + */ + claim_name: string; + + /** + * The OIDC claim value to look for. + */ + claim_value: string; + + /** + * The ID of your OIDC identity provider. + */ + identity_provider_id: string; + } + } } /** @@ -416,6 +443,7 @@ export type AccessRuleParam = | IPRuleParam | OktaGroupRuleParam | SAMLGroupRuleParam + | AccessRuleParam.AccessOIDCClaimRule | ServiceTokenRuleParam; export namespace AccessRuleParam { @@ -476,6 +504,32 @@ export namespace AccessRuleParam { id: string; } } + + /** + * Matches an OIDC claim. Requires an OIDC identity provider. + */ + export interface AccessOIDCClaimRule { + oidc: AccessOIDCClaimRule.OIDC; + } + + export namespace AccessOIDCClaimRule { + export interface OIDC { + /** + * The name of the OIDC claim. + */ + claim_name: string; + + /** + * The OIDC claim value to look for. + */ + claim_value: string; + + /** + * The ID of your OIDC identity provider. + */ + identity_provider_id: string; + } + } } /** diff --git a/src/resources/zero-trust/access/users/active-sessions.ts b/src/resources/zero-trust/access/users/active-sessions.ts index d4725b4eb1..99cf2be542 100644 --- a/src/resources/zero-trust/access/users/active-sessions.ts +++ b/src/resources/zero-trust/access/users/active-sessions.ts @@ -74,7 +74,7 @@ export interface ActiveSessionListResponse { export namespace ActiveSessionListResponse { export interface Metadata { - apps?: Record; + apps?: { [key: string]: Metadata.Apps }; expires?: number; @@ -107,9 +107,9 @@ export interface ActiveSessionGetResponse { device_id?: string; - device_sessions?: Record; + device_sessions?: { [key: string]: ActiveSessionGetResponse.DeviceSessions }; - devicePosture?: Record; + devicePosture?: { [key: string]: ActiveSessionGetResponse.DevicePosture }; email?: string; diff --git a/src/resources/zero-trust/access/users/last-seen-identity.ts b/src/resources/zero-trust/access/users/last-seen-identity.ts index 19eba5cceb..e76726101d 100644 --- a/src/resources/zero-trust/access/users/last-seen-identity.ts +++ b/src/resources/zero-trust/access/users/last-seen-identity.ts @@ -41,9 +41,9 @@ export interface Identity { device_id?: string; - device_sessions?: Record; + device_sessions?: { [key: string]: Identity.DeviceSessions }; - devicePosture?: Record; + devicePosture?: { [key: string]: Identity.DevicePosture }; email?: string; diff --git a/src/resources/zero-trust/devices/devices_.ts b/src/resources/zero-trust/devices/devices_.ts index 68612470ea..09b0b2a207 100644 --- a/src/resources/zero-trust/devices/devices_.ts +++ b/src/resources/zero-trust/devices/devices_.ts @@ -385,7 +385,7 @@ export interface DeviceListParams extends CursorPaginationParams { search?: string; /** - * Query param: Filters by the last_seen timestamp - returns only devices last seen + * Query param: Filter by the last_seen timestamp - returns only devices last seen * after this timestamp. */ seen_after?: string; diff --git a/src/resources/zero-trust/devices/dex-tests.ts b/src/resources/zero-trust/devices/dex-tests.ts index a61068b100..4446969263 100644 --- a/src/resources/zero-trust/devices/dex-tests.ts +++ b/src/resources/zero-trust/devices/dex-tests.ts @@ -63,7 +63,7 @@ export class DEXTests extends APIResource { } /** - * Fetch all DEX tests. + * Fetch all DEX tests * * @example * ```ts diff --git a/src/resources/zero-trust/devices/override-codes.ts b/src/resources/zero-trust/devices/override-codes.ts index a30490d509..e97be7dab4 100644 --- a/src/resources/zero-trust/devices/override-codes.ts +++ b/src/resources/zero-trust/devices/override-codes.ts @@ -62,7 +62,7 @@ export class OverrideCodeListResponsesSinglePage extends SinglePage; + disable_for_time?: { [key: string]: string }; } export interface OverrideCodeListParams { diff --git a/src/resources/zero-trust/devices/registrations.ts b/src/resources/zero-trust/devices/registrations.ts index fc98d6f28c..f332c32698 100644 --- a/src/resources/zero-trust/devices/registrations.ts +++ b/src/resources/zero-trust/devices/registrations.ts @@ -391,14 +391,14 @@ export interface RegistrationListParams extends CursorPaginationParams { search?: string; /** - * Query param: Filters by the last_seen timestamp - returns only registrations - * last seen after this timestamp. + * Query param: Filter by the last_seen timestamp - returns only registrations last + * seen after this timestamp. */ seen_after?: string; /** - * Query param: Filters by the last_seen timestamp - returns only registrations - * last seen before this timestamp. + * Query param: Filter by the last_seen timestamp - returns only registrations last + * seen before this timestamp. */ seen_before?: string; diff --git a/src/resources/zero-trust/dex/commands/commands.ts b/src/resources/zero-trust/dex/commands/commands.ts index 99b5ec826c..d5303a578e 100644 --- a/src/resources/zero-trust/dex/commands/commands.ts +++ b/src/resources/zero-trust/dex/commands/commands.ts @@ -96,7 +96,7 @@ export namespace CommandCreateResponse { /** * Command arguments */ - args?: Record; + args?: { [key: string]: string }; /** * Identifier for the device associated with the command diff --git a/src/resources/zero-trust/dlp/datasets/datasets.ts b/src/resources/zero-trust/dlp/datasets/datasets.ts index 940d549aaf..ef7b0cb2cc 100644 --- a/src/resources/zero-trust/dlp/datasets/datasets.ts +++ b/src/resources/zero-trust/dlp/datasets/datasets.ts @@ -145,7 +145,7 @@ export interface Dataset { secret: boolean; - status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; /** * When the dataset was last updated. @@ -172,13 +172,13 @@ export namespace Dataset { num_cells: number; - upload_status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } export interface Upload { num_cells: number; - status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; version: number; } diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index bf97223e9b..32b2097543 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -91,7 +91,7 @@ export namespace NewVersion { num_cells: number; - upload_status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } } diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index f3e90df723..4cbeffadc1 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -52,7 +52,7 @@ export interface EntryCreateResponse { num_cells: number; - upload_status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } export interface EntryCreateParams { diff --git a/src/resources/zero-trust/dlp/datasets/versions/versions.ts b/src/resources/zero-trust/dlp/datasets/versions/versions.ts index 3786bf12b3..a97887e4a8 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/versions.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/versions.ts @@ -55,7 +55,7 @@ export interface VersionCreateResponse { num_cells: number; - upload_status: 'empty' | 'uploading' | 'processing' | 'failed' | 'complete'; + upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } export interface VersionCreateParams { diff --git a/src/resources/zero-trust/dlp/dlp.ts b/src/resources/zero-trust/dlp/dlp.ts index 292fccd178..c7f94ac07f 100644 --- a/src/resources/zero-trust/dlp/dlp.ts +++ b/src/resources/zero-trust/dlp/dlp.ts @@ -1,21 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as EntriesAPI from './entries'; -import { - Entries, - EntryCreateParams, - EntryCreateResponse, - EntryDeleteParams, - EntryDeleteResponse, - EntryGetParams, - EntryGetResponse, - EntryListParams, - EntryListResponse, - EntryListResponsesSinglePage, - EntryUpdateParams, - EntryUpdateResponse, -} from './entries'; import * as LimitsAPI from './limits'; import { LimitListParams, LimitListResponse, Limits } from './limits'; import * as PatternsAPI from './patterns'; @@ -43,6 +28,21 @@ import { } from './datasets/datasets'; import * as EmailAPI from './email/email'; import { Email } from './email/email'; +import * as EntriesAPI from './entries/entries'; +import { + Entries, + EntryCreateParams, + EntryCreateResponse, + EntryDeleteParams, + EntryDeleteResponse, + EntryGetParams, + EntryGetResponse, + EntryListParams, + EntryListResponse, + EntryListResponsesSinglePage, + EntryUpdateParams, + EntryUpdateResponse, +} from './entries/entries'; import * as ProfilesAPI from './profiles/profiles'; import { ContextAwareness, diff --git a/src/resources/zero-trust/dlp/email/rules.ts b/src/resources/zero-trust/dlp/email/rules.ts index 5fa4b7d1a5..32a380ffc2 100644 --- a/src/resources/zero-trust/dlp/email/rules.ts +++ b/src/resources/zero-trust/dlp/email/rules.ts @@ -515,7 +515,7 @@ export interface RuleBulkEditParams { /** * Body param: */ - new_priorities: Record; + new_priorities: { [key: string]: number }; } export interface RuleGetParams { diff --git a/src/resources/zero-trust/dlp/entries.ts b/src/resources/zero-trust/dlp/entries.ts index f696d7d2d0..5d5972ec7d 100644 --- a/src/resources/zero-trust/dlp/entries.ts +++ b/src/resources/zero-trust/dlp/entries.ts @@ -1,660 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -import * as CustomAPI from './profiles/custom'; -import { SinglePage } from '../../../pagination'; - -export class Entries extends APIResource { - /** - * Creates a DLP custom entry. - * - * @example - * ```ts - * const entry = await client.zeroTrust.dlp.entries.create({ - * account_id: 'account_id', - * enabled: true, - * name: 'name', - * pattern: { regex: 'regex' }, - * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * }); - * ``` - */ - create(params: EntryCreateParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/dlp/entries`, { body, ...options }) as Core.APIPromise<{ - result: EntryCreateResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Updates a DLP entry. - * - * @example - * ```ts - * const entry = await client.zeroTrust.dlp.entries.update( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * name: 'name', - * pattern: { regex: 'regex' }, - * type: 'custom', - * }, - * ); - * ``` - */ - update( - entryId: string, - params: EntryUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/dlp/entries/${entryId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: EntryUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Lists all DLP entries in an account. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const entryListResponse of client.zeroTrust.dlp.entries.list( - * { account_id: 'account_id' }, - * )) { - * // ... - * } - * ``` - */ - list( - params: EntryListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/dlp/entries`, - EntryListResponsesSinglePage, - options, - ); - } - - /** - * Deletes a DLP custom entry. - * - * @example - * ```ts - * const entry = await client.zeroTrust.dlp.entries.delete( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); - * ``` - */ - delete( - entryId: string, - params: EntryDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete(`/accounts/${account_id}/dlp/entries/${entryId}`, options) as Core.APIPromise<{ - result: EntryDeleteResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Fetches a DLP entry by ID. - * - * @example - * ```ts - * const entry = await client.zeroTrust.dlp.entries.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); - * ``` - */ - get( - entryId: string, - params: EntryGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options) as Core.APIPromise<{ - result: EntryGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class EntryListResponsesSinglePage extends SinglePage {} - -export interface EntryCreateResponse { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - pattern: CustomAPI.Pattern; - - updated_at: string; - - profile_id?: string | null; -} - -export type EntryUpdateResponse = - | EntryUpdateResponse.CustomEntry - | EntryUpdateResponse.PredefinedEntry - | EntryUpdateResponse.IntegrationEntry - | EntryUpdateResponse.ExactDataEntry - | EntryUpdateResponse.DocumentTemplateEntry - | EntryUpdateResponse.WordListEntry; - -export namespace EntryUpdateResponse { - export interface CustomEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - pattern: CustomAPI.Pattern; - - type: 'custom'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface PredefinedEntry { - id: string; - - confidence: PredefinedEntry.Confidence; - - enabled: boolean; - - name: string; - - type: 'predefined'; - - profile_id?: string | null; - } - - export namespace PredefinedEntry { - export interface Confidence { - /** - * Indicates whether this entry has AI remote service validation. - */ - ai_context_available: boolean; - - /** - * Indicates whether this entry has any form of validation that is not an AI remote - * service. - */ - available: boolean; - } - } - - export interface IntegrationEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'integration'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface ExactDataEntry { - id: string; - - /** - * Only applies to custom word lists. Determines if the words should be matched in - * a case-sensitive manner Cannot be set to false if secret is true - */ - case_sensitive: boolean; - - created_at: string; - - enabled: boolean; - - name: string; - - secret: boolean; - - type: 'exact_data'; - - updated_at: string; - } - - export interface DocumentTemplateEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'document_template'; - - updated_at: string; - } - - export interface WordListEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'word_list'; - - updated_at: string; - - word_list: unknown; - - profile_id?: string | null; - } -} - -export type EntryListResponse = - | EntryListResponse.CustomEntry - | EntryListResponse.PredefinedEntry - | EntryListResponse.IntegrationEntry - | EntryListResponse.ExactDataEntry - | EntryListResponse.DocumentTemplateEntry - | EntryListResponse.WordListEntry; - -export namespace EntryListResponse { - export interface CustomEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - pattern: CustomAPI.Pattern; - - type: 'custom'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface PredefinedEntry { - id: string; - - confidence: PredefinedEntry.Confidence; - - enabled: boolean; - - name: string; - - type: 'predefined'; - - profile_id?: string | null; - } - - export namespace PredefinedEntry { - export interface Confidence { - /** - * Indicates whether this entry has AI remote service validation. - */ - ai_context_available: boolean; - - /** - * Indicates whether this entry has any form of validation that is not an AI remote - * service. - */ - available: boolean; - } - } - - export interface IntegrationEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'integration'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface ExactDataEntry { - id: string; - - /** - * Only applies to custom word lists. Determines if the words should be matched in - * a case-sensitive manner Cannot be set to false if secret is true - */ - case_sensitive: boolean; - - created_at: string; - - enabled: boolean; - - name: string; - - secret: boolean; - - type: 'exact_data'; - - updated_at: string; - } - - export interface DocumentTemplateEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'document_template'; - - updated_at: string; - } - - export interface WordListEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'word_list'; - - updated_at: string; - - word_list: unknown; - - profile_id?: string | null; - } -} - -export type EntryDeleteResponse = unknown; - -export type EntryGetResponse = - | EntryGetResponse.CustomEntry - | EntryGetResponse.PredefinedEntry - | EntryGetResponse.IntegrationEntry - | EntryGetResponse.ExactDataEntry - | EntryGetResponse.DocumentTemplateEntry - | EntryGetResponse.WordListEntry; - -export namespace EntryGetResponse { - export interface CustomEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - pattern: CustomAPI.Pattern; - - type: 'custom'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface PredefinedEntry { - id: string; - - confidence: PredefinedEntry.Confidence; - - enabled: boolean; - - name: string; - - type: 'predefined'; - - profile_id?: string | null; - } - - export namespace PredefinedEntry { - export interface Confidence { - /** - * Indicates whether this entry has AI remote service validation. - */ - ai_context_available: boolean; - - /** - * Indicates whether this entry has any form of validation that is not an AI remote - * service. - */ - available: boolean; - } - } - - export interface IntegrationEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'integration'; - - updated_at: string; - - profile_id?: string | null; - } - - export interface ExactDataEntry { - id: string; - - /** - * Only applies to custom word lists. Determines if the words should be matched in - * a case-sensitive manner Cannot be set to false if secret is true - */ - case_sensitive: boolean; - - created_at: string; - - enabled: boolean; - - name: string; - - secret: boolean; - - type: 'exact_data'; - - updated_at: string; - } - - export interface DocumentTemplateEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'document_template'; - - updated_at: string; - } - - export interface WordListEntry { - id: string; - - created_at: string; - - enabled: boolean; - - name: string; - - type: 'word_list'; - - updated_at: string; - - word_list: unknown; - - profile_id?: string | null; - } -} - -export interface EntryCreateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - enabled: boolean; - - /** - * Body param: - */ - name: string; - - /** - * Body param: - */ - pattern: CustomAPI.PatternParam; - - /** - * Body param: - */ - profile_id: string; -} - -export type EntryUpdateParams = - | EntryUpdateParams.Variant0 - | EntryUpdateParams.Variant1 - | EntryUpdateParams.Variant2; - -export declare namespace EntryUpdateParams { - export interface Variant0 { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - name: string; - - /** - * Body param: - */ - pattern: CustomAPI.PatternParam; - - /** - * Body param: - */ - type: 'custom'; - - /** - * Body param: - */ - enabled?: boolean; - } - - export interface Variant1 { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - type: 'predefined'; - - /** - * Body param: - */ - enabled?: boolean; - } - - export interface Variant2 { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - type: 'integration'; - - /** - * Body param: - */ - enabled?: boolean; - } -} - -export interface EntryListParams { - account_id: string; -} - -export interface EntryDeleteParams { - account_id: string; -} - -export interface EntryGetParams { - account_id: string; -} - -Entries.EntryListResponsesSinglePage = EntryListResponsesSinglePage; - -export declare namespace Entries { - export { - type EntryCreateResponse as EntryCreateResponse, - type EntryUpdateResponse as EntryUpdateResponse, - type EntryListResponse as EntryListResponse, - type EntryDeleteResponse as EntryDeleteResponse, - type EntryGetResponse as EntryGetResponse, - EntryListResponsesSinglePage as EntryListResponsesSinglePage, - type EntryCreateParams as EntryCreateParams, - type EntryUpdateParams as EntryUpdateParams, - type EntryListParams as EntryListParams, - type EntryDeleteParams as EntryDeleteParams, - type EntryGetParams as EntryGetParams, - }; -} +export * from './entries/index'; diff --git a/src/resources/zero-trust/dlp/entries/custom.ts b/src/resources/zero-trust/dlp/entries/custom.ts new file mode 100644 index 0000000000..f8d07a363b --- /dev/null +++ b/src/resources/zero-trust/dlp/entries/custom.ts @@ -0,0 +1,342 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; +import * as ProfilesCustomAPI from '../profiles/custom'; + +export class Custom extends APIResource { + /** + * Creates a DLP custom entry. + * + * @example + * ```ts + * const custom = + * await client.zeroTrust.dlp.entries.custom.create({ + * account_id: 'account_id', + * enabled: true, + * name: 'name', + * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * }); + * ``` + */ + create(params: CustomCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/dlp/entries`, { body, ...options }) as Core.APIPromise<{ + result: CustomCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates a DLP entry. + * + * @example + * ```ts + * const custom = + * await client.zeroTrust.dlp.entries.custom.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * name: 'name', + * pattern: { regex: 'regex' }, + * type: 'custom', + * }, + * ); + * ``` + */ + update( + entryId: string, + params: CustomUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/dlp/entries/${entryId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: CustomUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Deletes a DLP custom entry. + * + * @example + * ```ts + * const custom = + * await client.zeroTrust.dlp.entries.custom.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + entryId: string, + params: CustomDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/dlp/entries/${entryId}`, options) as Core.APIPromise<{ + result: CustomDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CustomCreateResponse { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + updated_at: string; + + profile_id?: string | null; +} + +export type CustomUpdateResponse = + | CustomUpdateResponse.CustomEntry + | CustomUpdateResponse.PredefinedEntry + | CustomUpdateResponse.IntegrationEntry + | CustomUpdateResponse.ExactDataEntry + | CustomUpdateResponse.DocumentFingerprintEntry + | CustomUpdateResponse.WordListEntry; + +export namespace CustomUpdateResponse { + export interface CustomEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + type: 'custom'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface PredefinedEntry { + id: string; + + confidence: PredefinedEntry.Confidence; + + enabled: boolean; + + name: string; + + type: 'predefined'; + + profile_id?: string | null; + } + + export namespace PredefinedEntry { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } + } + + export interface IntegrationEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'integration'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface ExactDataEntry { + id: string; + + /** + * Only applies to custom word lists. Determines if the words should be matched in + * a case-sensitive manner Cannot be set to false if secret is true + */ + case_sensitive: boolean; + + created_at: string; + + enabled: boolean; + + name: string; + + secret: boolean; + + type: 'exact_data'; + + updated_at: string; + } + + export interface DocumentFingerprintEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'document_fingerprint'; + + updated_at: string; + } + + export interface WordListEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'word_list'; + + updated_at: string; + + word_list: unknown; + + profile_id?: string | null; + } +} + +export type CustomDeleteResponse = unknown; + +export interface CustomCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + pattern: ProfilesCustomAPI.PatternParam; + + /** + * Body param: + */ + profile_id: string; +} + +export type CustomUpdateParams = + | CustomUpdateParams.Variant0 + | CustomUpdateParams.Variant1 + | CustomUpdateParams.Variant2; + +export declare namespace CustomUpdateParams { + export interface Variant0 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + pattern: ProfilesCustomAPI.PatternParam; + + /** + * Body param: + */ + type: 'custom'; + + /** + * Body param: + */ + enabled?: boolean; + } + + export interface Variant1 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + type: 'predefined'; + + /** + * Body param: + */ + enabled?: boolean; + } + + export interface Variant2 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + type: 'integration'; + + /** + * Body param: + */ + enabled?: boolean; + } +} + +export interface CustomDeleteParams { + account_id: string; +} + +export declare namespace Custom { + export { + type CustomCreateResponse as CustomCreateResponse, + type CustomUpdateResponse as CustomUpdateResponse, + type CustomDeleteResponse as CustomDeleteResponse, + type CustomCreateParams as CustomCreateParams, + type CustomUpdateParams as CustomUpdateParams, + type CustomDeleteParams as CustomDeleteParams, + }; +} diff --git a/src/resources/zero-trust/dlp/entries/entries.ts b/src/resources/zero-trust/dlp/entries/entries.ts new file mode 100644 index 0000000000..4f62177603 --- /dev/null +++ b/src/resources/zero-trust/dlp/entries/entries.ts @@ -0,0 +1,727 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; +import * as CustomAPI from './custom'; +import { + Custom, + CustomCreateParams, + CustomCreateResponse, + CustomDeleteParams, + CustomDeleteResponse, + CustomUpdateParams, + CustomUpdateResponse, +} from './custom'; +import * as IntegrationAPI from './integration'; +import { + Integration, + IntegrationCreateParams, + IntegrationCreateResponse, + IntegrationDeleteParams, + IntegrationDeleteResponse, + IntegrationUpdateParams, + IntegrationUpdateResponse, +} from './integration'; +import * as PredefinedAPI from './predefined'; +import { + Predefined, + PredefinedCreateParams, + PredefinedCreateResponse, + PredefinedDeleteParams, + PredefinedDeleteResponse, + PredefinedUpdateParams, + PredefinedUpdateResponse, +} from './predefined'; +import * as ProfilesCustomAPI from '../profiles/custom'; +import { SinglePage } from '../../../../pagination'; + +export class Entries extends APIResource { + custom: CustomAPI.Custom = new CustomAPI.Custom(this._client); + predefined: PredefinedAPI.Predefined = new PredefinedAPI.Predefined(this._client); + integration: IntegrationAPI.Integration = new IntegrationAPI.Integration(this._client); + + /** + * Creates a DLP custom entry. + * + * @example + * ```ts + * const entry = await client.zeroTrust.dlp.entries.create({ + * account_id: 'account_id', + * enabled: true, + * name: 'name', + * pattern: { regex: 'regex' }, + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * }); + * ``` + */ + create(params: EntryCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/dlp/entries`, { body, ...options }) as Core.APIPromise<{ + result: EntryCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates a DLP entry. + * + * @example + * ```ts + * const entry = await client.zeroTrust.dlp.entries.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { + * account_id: 'account_id', + * name: 'name', + * pattern: { regex: 'regex' }, + * type: 'custom', + * }, + * ); + * ``` + */ + update( + entryId: string, + params: EntryUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/dlp/entries/${entryId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: EntryUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Lists all DLP entries in an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const entryListResponse of client.zeroTrust.dlp.entries.list( + * { account_id: 'account_id' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: EntryListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/dlp/entries`, + EntryListResponsesSinglePage, + options, + ); + } + + /** + * Deletes a DLP custom entry. + * + * @example + * ```ts + * const entry = await client.zeroTrust.dlp.entries.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + entryId: string, + params: EntryDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/dlp/entries/${entryId}`, options) as Core.APIPromise<{ + result: EntryDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetches a DLP entry by ID. + * + * @example + * ```ts + * const entry = await client.zeroTrust.dlp.entries.get( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + get( + entryId: string, + params: EntryGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/dlp/entries/${entryId}`, options) as Core.APIPromise<{ + result: EntryGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class EntryListResponsesSinglePage extends SinglePage {} + +export interface EntryCreateResponse { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + updated_at: string; + + profile_id?: string | null; +} + +export type EntryUpdateResponse = + | EntryUpdateResponse.CustomEntry + | EntryUpdateResponse.PredefinedEntry + | EntryUpdateResponse.IntegrationEntry + | EntryUpdateResponse.ExactDataEntry + | EntryUpdateResponse.DocumentFingerprintEntry + | EntryUpdateResponse.WordListEntry; + +export namespace EntryUpdateResponse { + export interface CustomEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + type: 'custom'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface PredefinedEntry { + id: string; + + confidence: PredefinedEntry.Confidence; + + enabled: boolean; + + name: string; + + type: 'predefined'; + + profile_id?: string | null; + } + + export namespace PredefinedEntry { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } + } + + export interface IntegrationEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'integration'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface ExactDataEntry { + id: string; + + /** + * Only applies to custom word lists. Determines if the words should be matched in + * a case-sensitive manner Cannot be set to false if secret is true + */ + case_sensitive: boolean; + + created_at: string; + + enabled: boolean; + + name: string; + + secret: boolean; + + type: 'exact_data'; + + updated_at: string; + } + + export interface DocumentFingerprintEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'document_fingerprint'; + + updated_at: string; + } + + export interface WordListEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'word_list'; + + updated_at: string; + + word_list: unknown; + + profile_id?: string | null; + } +} + +export type EntryListResponse = + | EntryListResponse.CustomEntry + | EntryListResponse.PredefinedEntry + | EntryListResponse.IntegrationEntry + | EntryListResponse.ExactDataEntry + | EntryListResponse.DocumentFingerprintEntry + | EntryListResponse.WordListEntry; + +export namespace EntryListResponse { + export interface CustomEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + type: 'custom'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface PredefinedEntry { + id: string; + + confidence: PredefinedEntry.Confidence; + + enabled: boolean; + + name: string; + + type: 'predefined'; + + profile_id?: string | null; + } + + export namespace PredefinedEntry { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } + } + + export interface IntegrationEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'integration'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface ExactDataEntry { + id: string; + + /** + * Only applies to custom word lists. Determines if the words should be matched in + * a case-sensitive manner Cannot be set to false if secret is true + */ + case_sensitive: boolean; + + created_at: string; + + enabled: boolean; + + name: string; + + secret: boolean; + + type: 'exact_data'; + + updated_at: string; + } + + export interface DocumentFingerprintEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'document_fingerprint'; + + updated_at: string; + } + + export interface WordListEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'word_list'; + + updated_at: string; + + word_list: unknown; + + profile_id?: string | null; + } +} + +export type EntryDeleteResponse = unknown; + +export type EntryGetResponse = + | EntryGetResponse.CustomEntry + | EntryGetResponse.PredefinedEntry + | EntryGetResponse.IntegrationEntry + | EntryGetResponse.ExactDataEntry + | EntryGetResponse.DocumentFingerprintEntry + | EntryGetResponse.WordListEntry; + +export namespace EntryGetResponse { + export interface CustomEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + pattern: ProfilesCustomAPI.Pattern; + + type: 'custom'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface PredefinedEntry { + id: string; + + confidence: PredefinedEntry.Confidence; + + enabled: boolean; + + name: string; + + type: 'predefined'; + + profile_id?: string | null; + } + + export namespace PredefinedEntry { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } + } + + export interface IntegrationEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'integration'; + + updated_at: string; + + profile_id?: string | null; + } + + export interface ExactDataEntry { + id: string; + + /** + * Only applies to custom word lists. Determines if the words should be matched in + * a case-sensitive manner Cannot be set to false if secret is true + */ + case_sensitive: boolean; + + created_at: string; + + enabled: boolean; + + name: string; + + secret: boolean; + + type: 'exact_data'; + + updated_at: string; + } + + export interface DocumentFingerprintEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'document_fingerprint'; + + updated_at: string; + } + + export interface WordListEntry { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + type: 'word_list'; + + updated_at: string; + + word_list: unknown; + + profile_id?: string | null; + } +} + +export interface EntryCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + pattern: ProfilesCustomAPI.PatternParam; + + /** + * Body param: + */ + profile_id: string; +} + +export type EntryUpdateParams = + | EntryUpdateParams.Variant0 + | EntryUpdateParams.Variant1 + | EntryUpdateParams.Variant2; + +export declare namespace EntryUpdateParams { + export interface Variant0 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + name: string; + + /** + * Body param: + */ + pattern: ProfilesCustomAPI.PatternParam; + + /** + * Body param: + */ + type: 'custom'; + + /** + * Body param: + */ + enabled?: boolean; + } + + export interface Variant1 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + type: 'predefined'; + + /** + * Body param: + */ + enabled?: boolean; + } + + export interface Variant2 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + type: 'integration'; + + /** + * Body param: + */ + enabled?: boolean; + } +} + +export interface EntryListParams { + account_id: string; +} + +export interface EntryDeleteParams { + account_id: string; +} + +export interface EntryGetParams { + account_id: string; +} + +Entries.EntryListResponsesSinglePage = EntryListResponsesSinglePage; +Entries.Custom = Custom; +Entries.Predefined = Predefined; +Entries.Integration = Integration; + +export declare namespace Entries { + export { + type EntryCreateResponse as EntryCreateResponse, + type EntryUpdateResponse as EntryUpdateResponse, + type EntryListResponse as EntryListResponse, + type EntryDeleteResponse as EntryDeleteResponse, + type EntryGetResponse as EntryGetResponse, + EntryListResponsesSinglePage as EntryListResponsesSinglePage, + type EntryCreateParams as EntryCreateParams, + type EntryUpdateParams as EntryUpdateParams, + type EntryListParams as EntryListParams, + type EntryDeleteParams as EntryDeleteParams, + type EntryGetParams as EntryGetParams, + }; + + export { + Custom as Custom, + type CustomCreateResponse as CustomCreateResponse, + type CustomUpdateResponse as CustomUpdateResponse, + type CustomDeleteResponse as CustomDeleteResponse, + type CustomCreateParams as CustomCreateParams, + type CustomUpdateParams as CustomUpdateParams, + type CustomDeleteParams as CustomDeleteParams, + }; + + export { + Predefined as Predefined, + type PredefinedCreateResponse as PredefinedCreateResponse, + type PredefinedUpdateResponse as PredefinedUpdateResponse, + type PredefinedDeleteResponse as PredefinedDeleteResponse, + type PredefinedCreateParams as PredefinedCreateParams, + type PredefinedUpdateParams as PredefinedUpdateParams, + type PredefinedDeleteParams as PredefinedDeleteParams, + }; + + export { + Integration as Integration, + type IntegrationCreateResponse as IntegrationCreateResponse, + type IntegrationUpdateResponse as IntegrationUpdateResponse, + type IntegrationDeleteResponse as IntegrationDeleteResponse, + type IntegrationCreateParams as IntegrationCreateParams, + type IntegrationUpdateParams as IntegrationUpdateParams, + type IntegrationDeleteParams as IntegrationDeleteParams, + }; +} diff --git a/src/resources/zero-trust/dlp/entries/index.ts b/src/resources/zero-trust/dlp/entries/index.ts new file mode 100644 index 0000000000..04dc130f11 --- /dev/null +++ b/src/resources/zero-trust/dlp/entries/index.ts @@ -0,0 +1,43 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Custom, + type CustomCreateResponse, + type CustomUpdateResponse, + type CustomDeleteResponse, + type CustomCreateParams, + type CustomUpdateParams, + type CustomDeleteParams, +} from './custom'; +export { + EntryListResponsesSinglePage, + Entries, + type EntryCreateResponse, + type EntryUpdateResponse, + type EntryListResponse, + type EntryDeleteResponse, + type EntryGetResponse, + type EntryCreateParams, + type EntryUpdateParams, + type EntryListParams, + type EntryDeleteParams, + type EntryGetParams, +} from './entries'; +export { + Integration, + type IntegrationCreateResponse, + type IntegrationUpdateResponse, + type IntegrationDeleteResponse, + type IntegrationCreateParams, + type IntegrationUpdateParams, + type IntegrationDeleteParams, +} from './integration'; +export { + Predefined, + type PredefinedCreateResponse, + type PredefinedUpdateResponse, + type PredefinedDeleteResponse, + type PredefinedCreateParams, + type PredefinedUpdateParams, + type PredefinedDeleteParams, +} from './predefined'; diff --git a/src/resources/zero-trust/dlp/entries/integration.ts b/src/resources/zero-trust/dlp/entries/integration.ts new file mode 100644 index 0000000000..bf8fedef54 --- /dev/null +++ b/src/resources/zero-trust/dlp/entries/integration.ts @@ -0,0 +1,165 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; + +export class Integration extends APIResource { + /** + * This will update an existing integration entry + * + * @example + * ```ts + * const integration = + * await client.zeroTrust.dlp.entries.integration.create({ + * account_id: 'account_id', + * enabled: true, + * entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * }); + * ``` + */ + create( + params: IntegrationCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/dlp/entries/integration`, { + body, + ...options, + }) as Core.APIPromise<{ result: IntegrationCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates a DLP entry. + * + * @example + * ```ts + * const integration = + * await client.zeroTrust.dlp.entries.integration.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id', enabled: true }, + * ); + * ``` + */ + update( + entryId: string, + params: IntegrationUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/dlp/entries/integration/${entryId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: IntegrationUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * This is a no-op as integration entires can't be deleted but is needed for our + * generated terraform API + * + * @example + * ```ts + * const integration = + * await client.zeroTrust.dlp.entries.integration.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + entryId: string, + params: IntegrationDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/dlp/entries/integration/${entryId}`, + options, + ) as Core.APIPromise<{ result: IntegrationDeleteResponse | null }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface IntegrationCreateResponse { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + updated_at: string; + + profile_id?: string | null; +} + +export interface IntegrationUpdateResponse { + id: string; + + created_at: string; + + enabled: boolean; + + name: string; + + updated_at: string; + + profile_id?: string | null; +} + +export type IntegrationDeleteResponse = unknown; + +export interface IntegrationCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; + + /** + * Body param: + */ + entry_id: string; + + /** + * Body param: This field is not actually used as the owning profile for a + * predefined entry is already set to a predefined profile + */ + profile_id?: string | null; +} + +export interface IntegrationUpdateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; +} + +export interface IntegrationDeleteParams { + account_id: string; +} + +export declare namespace Integration { + export { + type IntegrationCreateResponse as IntegrationCreateResponse, + type IntegrationUpdateResponse as IntegrationUpdateResponse, + type IntegrationDeleteResponse as IntegrationDeleteResponse, + type IntegrationCreateParams as IntegrationCreateParams, + type IntegrationUpdateParams as IntegrationUpdateParams, + type IntegrationDeleteParams as IntegrationDeleteParams, + }; +} diff --git a/src/resources/zero-trust/dlp/entries/predefined.ts b/src/resources/zero-trust/dlp/entries/predefined.ts new file mode 100644 index 0000000000..e1749f4cf5 --- /dev/null +++ b/src/resources/zero-trust/dlp/entries/predefined.ts @@ -0,0 +1,191 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; + +export class Predefined extends APIResource { + /** + * This will update an existing predefined entry + * + * @example + * ```ts + * const predefined = + * await client.zeroTrust.dlp.entries.predefined.create({ + * account_id: 'account_id', + * enabled: true, + * entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * }); + * ``` + */ + create( + params: PredefinedCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/dlp/entries/predefined`, { + body, + ...options, + }) as Core.APIPromise<{ result: PredefinedCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Updates a DLP entry. + * + * @example + * ```ts + * const predefined = + * await client.zeroTrust.dlp.entries.predefined.update( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id', enabled: true }, + * ); + * ``` + */ + update( + entryId: string, + params: PredefinedUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/dlp/entries/predefined/${entryId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: PredefinedUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * This is a no-op as predefined entires can't be deleted but is needed for our + * generated terraform API + * + * @example + * ```ts + * const predefined = + * await client.zeroTrust.dlp.entries.predefined.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + entryId: string, + params: PredefinedDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/dlp/entries/predefined/${entryId}`, + options, + ) as Core.APIPromise<{ result: PredefinedDeleteResponse | null }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface PredefinedCreateResponse { + id: string; + + confidence: PredefinedCreateResponse.Confidence; + + enabled: boolean; + + name: string; + + profile_id?: string | null; +} + +export namespace PredefinedCreateResponse { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } +} + +export interface PredefinedUpdateResponse { + id: string; + + confidence: PredefinedUpdateResponse.Confidence; + + enabled: boolean; + + name: string; + + profile_id?: string | null; +} + +export namespace PredefinedUpdateResponse { + export interface Confidence { + /** + * Indicates whether this entry has AI remote service validation. + */ + ai_context_available: boolean; + + /** + * Indicates whether this entry has any form of validation that is not an AI remote + * service. + */ + available: boolean; + } +} + +export type PredefinedDeleteResponse = unknown; + +export interface PredefinedCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; + + /** + * Body param: + */ + entry_id: string; + + /** + * Body param: This field is not actually used as the owning profile for a + * predefined entry is already set to a predefined profile + */ + profile_id?: string | null; +} + +export interface PredefinedUpdateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + enabled: boolean; +} + +export interface PredefinedDeleteParams { + account_id: string; +} + +export declare namespace Predefined { + export { + type PredefinedCreateResponse as PredefinedCreateResponse, + type PredefinedUpdateResponse as PredefinedUpdateResponse, + type PredefinedDeleteResponse as PredefinedDeleteResponse, + type PredefinedCreateParams as PredefinedCreateParams, + type PredefinedUpdateParams as PredefinedUpdateParams, + type PredefinedDeleteParams as PredefinedDeleteParams, + }; +} diff --git a/src/resources/zero-trust/dlp/index.ts b/src/resources/zero-trust/dlp/index.ts index 15952685b1..5cea0ef26c 100644 --- a/src/resources/zero-trust/dlp/index.ts +++ b/src/resources/zero-trust/dlp/index.ts @@ -27,7 +27,7 @@ export { type EntryListParams, type EntryDeleteParams, type EntryGetParams, -} from './entries'; +} from './entries/index'; export { Limits, type LimitListResponse, type LimitListParams } from './limits'; export { Patterns, type PatternValidateResponse, type PatternValidateParams } from './patterns'; export { diff --git a/src/resources/zero-trust/dlp/profiles/custom.ts b/src/resources/zero-trust/dlp/profiles/custom.ts index 04d722eb62..b4f412471b 100644 --- a/src/resources/zero-trust/dlp/profiles/custom.ts +++ b/src/resources/zero-trust/dlp/profiles/custom.ts @@ -141,7 +141,7 @@ export interface CustomProfile { | CustomProfile.PredefinedEntry | CustomProfile.IntegrationEntry | CustomProfile.ExactDataEntry - | CustomProfile.DocumentTemplateEntry + | CustomProfile.DocumentFingerprintEntry | CustomProfile.WordListEntry >; @@ -253,7 +253,7 @@ export namespace CustomProfile { updated_at: string; } - export interface DocumentTemplateEntry { + export interface DocumentFingerprintEntry { id: string; created_at: string; @@ -262,7 +262,7 @@ export namespace CustomProfile { name: string; - type: 'document_template'; + type: 'document_fingerprint'; updated_at: string; } @@ -363,6 +363,7 @@ export interface CustomCreateParams { | CustomCreateParams.Predefined | CustomCreateParams.Integration | CustomCreateParams.ExactData + | CustomCreateParams.UnionMember4 >; } @@ -414,6 +415,14 @@ export namespace CustomCreateParams { entry_type: 'exact_data'; } + + export interface UnionMember4 { + enabled: boolean; + + entry_id: string; + + entry_type: 'document_fingerprint'; + } } export interface CustomUpdateParams { @@ -468,7 +477,10 @@ export interface CustomUpdateParams { * Body param: Other entries, e.g. predefined or integration. */ shared_entries?: Array< - CustomUpdateParams.Predefined | CustomUpdateParams.Integration | CustomUpdateParams.ExactData + | CustomUpdateParams.Predefined + | CustomUpdateParams.Integration + | CustomUpdateParams.ExactData + | CustomUpdateParams.UnionMember3 >; } @@ -514,6 +526,14 @@ export namespace CustomUpdateParams { entry_type: 'exact_data'; } + + export interface UnionMember3 { + enabled: boolean; + + entry_id: string; + + entry_type: 'document_fingerprint'; + } } export interface CustomDeleteParams { diff --git a/src/resources/zero-trust/dlp/profiles/index.ts b/src/resources/zero-trust/dlp/profiles/index.ts index ba0f2eb23c..84902c8fe8 100644 --- a/src/resources/zero-trust/dlp/profiles/index.ts +++ b/src/resources/zero-trust/dlp/profiles/index.ts @@ -13,7 +13,10 @@ export { export { Predefined, type PredefinedProfile, + type PredefinedDeleteResponse, + type PredefinedCreateParams, type PredefinedUpdateParams, + type PredefinedDeleteParams, type PredefinedGetParams, } from './predefined'; export { diff --git a/src/resources/zero-trust/dlp/profiles/predefined.ts b/src/resources/zero-trust/dlp/profiles/predefined.ts index a491eb9b2d..1d2ddde8fa 100644 --- a/src/resources/zero-trust/dlp/profiles/predefined.ts +++ b/src/resources/zero-trust/dlp/profiles/predefined.ts @@ -6,6 +6,31 @@ import * as CustomAPI from './custom'; import * as ProfilesAPI from './profiles'; export class Predefined extends APIResource { + /** + * Creates a DLP predefined profile. Only supports enabling/disabling entries. + * + * @example + * ```ts + * const profile = + * await client.zeroTrust.dlp.profiles.predefined.create({ + * account_id: 'account_id', + * profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * }); + * ``` + */ + create( + params: PredefinedCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/dlp/profiles/predefined`, { + body, + ...options, + }) as Core.APIPromise<{ result: ProfilesAPI.Profile }> + )._thenUnwrap((obj) => obj.result); + } + /** * Updates a DLP predefined profile. Only supports enabling/disabling entries. * @@ -32,6 +57,33 @@ export class Predefined extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * This is a no-op as predefined profiles can't be deleted but is needed for our + * generated terraform API + * + * @example + * ```ts + * const predefined = + * await client.zeroTrust.dlp.profiles.predefined.delete( + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: 'account_id' }, + * ); + * ``` + */ + delete( + profileId: string, + params: PredefinedDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/dlp/profiles/predefined/${profileId}`, + options, + ) as Core.APIPromise<{ result: PredefinedDeleteResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Fetches a predefined DLP profile by id. * @@ -72,7 +124,7 @@ export interface PredefinedProfile { | PredefinedProfile.PredefinedEntry | PredefinedProfile.IntegrationEntry | PredefinedProfile.ExactDataEntry - | PredefinedProfile.DocumentTemplateEntry + | PredefinedProfile.DocumentFingerprintEntry | PredefinedProfile.WordListEntry >; @@ -185,7 +237,7 @@ export namespace PredefinedProfile { updated_at: string; } - export interface DocumentTemplateEntry { + export interface DocumentFingerprintEntry { id: string; created_at: string; @@ -194,7 +246,7 @@ export namespace PredefinedProfile { name: string; - type: 'document_template'; + type: 'document_fingerprint'; updated_at: string; } @@ -218,6 +270,59 @@ export namespace PredefinedProfile { } } +export type PredefinedDeleteResponse = unknown; + +export interface PredefinedCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + profile_id: string; + + /** + * Body param: + */ + ai_context_enabled?: boolean; + + /** + * Body param: + */ + allowed_match_count?: number | null; + + /** + * Body param: + */ + confidence_threshold?: string | null; + + /** + * Body param: Scan the context of predefined entries to only return matches + * surrounded by keywords. + */ + context_awareness?: ProfilesAPI.ContextAwarenessParam; + + /** + * @deprecated Body param: + */ + entries?: Array; + + /** + * Body param: + */ + ocr_enabled?: boolean; +} + +export namespace PredefinedCreateParams { + export interface Entry { + id: string; + + enabled: boolean; + } +} + export interface PredefinedUpdateParams { /** * Path param: @@ -264,6 +369,10 @@ export namespace PredefinedUpdateParams { } } +export interface PredefinedDeleteParams { + account_id: string; +} + export interface PredefinedGetParams { account_id: string; } @@ -271,7 +380,10 @@ export interface PredefinedGetParams { export declare namespace Predefined { export { type PredefinedProfile as PredefinedProfile, + type PredefinedDeleteResponse as PredefinedDeleteResponse, + type PredefinedCreateParams as PredefinedCreateParams, type PredefinedUpdateParams as PredefinedUpdateParams, + type PredefinedDeleteParams as PredefinedDeleteParams, type PredefinedGetParams as PredefinedGetParams, }; } diff --git a/src/resources/zero-trust/dlp/profiles/profiles.ts b/src/resources/zero-trust/dlp/profiles/profiles.ts index c6ab216ea2..4f2ddcea1e 100644 --- a/src/resources/zero-trust/dlp/profiles/profiles.ts +++ b/src/resources/zero-trust/dlp/profiles/profiles.ts @@ -17,6 +17,9 @@ import { import * as PredefinedAPI from './predefined'; import { Predefined, + PredefinedCreateParams, + PredefinedDeleteParams, + PredefinedDeleteResponse, PredefinedGetParams, PredefinedProfile as PredefinedAPIPredefinedProfile, PredefinedUpdateParams, @@ -138,7 +141,7 @@ export namespace Profile { | CustomProfile.PredefinedEntry | CustomProfile.IntegrationEntry | CustomProfile.ExactDataEntry - | CustomProfile.DocumentTemplateEntry + | CustomProfile.DocumentFingerprintEntry | CustomProfile.WordListEntry >; @@ -252,7 +255,7 @@ export namespace Profile { updated_at: string; } - export interface DocumentTemplateEntry { + export interface DocumentFingerprintEntry { id: string; created_at: string; @@ -261,7 +264,7 @@ export namespace Profile { name: string; - type: 'document_template'; + type: 'document_fingerprint'; updated_at: string; } @@ -298,7 +301,7 @@ export namespace Profile { | PredefinedProfile.PredefinedEntry | PredefinedProfile.IntegrationEntry | PredefinedProfile.ExactDataEntry - | PredefinedProfile.DocumentTemplateEntry + | PredefinedProfile.DocumentFingerprintEntry | PredefinedProfile.WordListEntry >; @@ -413,7 +416,7 @@ export namespace Profile { updated_at: string; } - export interface DocumentTemplateEntry { + export interface DocumentFingerprintEntry { id: string; created_at: string; @@ -422,7 +425,7 @@ export namespace Profile { name: string; - type: 'document_template'; + type: 'document_fingerprint'; updated_at: string; } @@ -456,7 +459,7 @@ export namespace Profile { | IntegrationProfile.PredefinedEntry | IntegrationProfile.IntegrationEntry | IntegrationProfile.ExactDataEntry - | IntegrationProfile.DocumentTemplateEntry + | IntegrationProfile.DocumentFingerprintEntry | IntegrationProfile.WordListEntry >; @@ -558,7 +561,7 @@ export namespace Profile { updated_at: string; } - export interface DocumentTemplateEntry { + export interface DocumentFingerprintEntry { id: string; created_at: string; @@ -567,7 +570,7 @@ export namespace Profile { name: string; - type: 'document_template'; + type: 'document_fingerprint'; updated_at: string; } @@ -657,7 +660,10 @@ export declare namespace Profiles { export { Predefined as Predefined, type PredefinedAPIPredefinedProfile as PredefinedProfile, + type PredefinedDeleteResponse as PredefinedDeleteResponse, + type PredefinedCreateParams as PredefinedCreateParams, type PredefinedUpdateParams as PredefinedUpdateParams, + type PredefinedDeleteParams as PredefinedDeleteParams, type PredefinedGetParams as PredefinedGetParams, }; } diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index aef238d681..2261c3d520 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -215,6 +215,17 @@ export interface BlockPageSettings { */ name?: string; + /** + * This setting was shared via the Orgs API and cannot be edited by the current + * account + */ + read_only?: boolean; + + /** + * Account tag of account that shared this setting + */ + source_account?: string; + /** * If mode is customized_block_page: suppress detailed info at the bottom of the * block page. @@ -394,6 +405,17 @@ export interface ExtendedEmailMatching { * criteria in Firewall policies. */ enabled?: boolean; + + /** + * This setting was shared via the Orgs API and cannot be edited by the current + * account + */ + read_only?: boolean; + + /** + * Account tag of account that shared this setting + */ + source_account?: string; } /** @@ -441,11 +463,6 @@ export interface GatewayConfigurationSettings { */ antivirus?: AntiVirusSettings | null; - /** - * Setting to enable App Control - */ - 'app-control-settings'?: GatewayConfigurationSettings.AppControlSettings | null; - /** * Block page layout settings. */ @@ -505,16 +522,6 @@ export interface GatewayConfigurationSettings { } export namespace GatewayConfigurationSettings { - /** - * Setting to enable App Control - */ - export interface AppControlSettings { - /** - * Enable App Control - */ - enabled?: boolean; - } - /** * Certificate settings for Gateway TLS interception. If not specified, the * Cloudflare Root CA will be used. @@ -568,11 +575,6 @@ export interface GatewayConfigurationSettingsParam { */ antivirus?: AntiVirusSettingsParam | null; - /** - * Setting to enable App Control - */ - 'app-control-settings'?: GatewayConfigurationSettingsParam.AppControlSettings | null; - /** * Block page layout settings. */ @@ -632,16 +634,6 @@ export interface GatewayConfigurationSettingsParam { } export namespace GatewayConfigurationSettingsParam { - /** - * Setting to enable App Control - */ - export interface AppControlSettings { - /** - * Enable App Control - */ - enabled?: boolean; - } - /** * Certificate settings for Gateway TLS interception. If not specified, the * Cloudflare Root CA will be used. diff --git a/src/resources/zero-trust/gateway/lists/lists.ts b/src/resources/zero-trust/gateway/lists/lists.ts index 1a194de9ac..51dc648bd3 100644 --- a/src/resources/zero-trust/gateway/lists/lists.ts +++ b/src/resources/zero-trust/gateway/lists/lists.ts @@ -168,18 +168,6 @@ export interface GatewayItem { value?: string; } -export interface GatewayItemParam { - /** - * The description of the list item, if present - */ - description?: string; - - /** - * The value of the item in a list. - */ - value?: string; -} - export interface GatewayList { /** * API Resource UUID tag. @@ -271,9 +259,23 @@ export interface ListCreateParams { description?: string; /** - * Body param: The items in the list. + * Body param: items to add to the list. */ - items?: Array; + items?: Array; +} + +export namespace ListCreateParams { + export interface Item { + /** + * The description of the list item, if present + */ + description?: string; + + /** + * The value of the item in a list. + */ + value?: string; + } } export interface ListUpdateParams { @@ -293,9 +295,23 @@ export interface ListUpdateParams { description?: string; /** - * Body param: The items in the list. + * Body param: items to add to the list. */ - items?: Array; + items?: Array; +} + +export namespace ListUpdateParams { + export interface Item { + /** + * The description of the list item, if present + */ + description?: string; + + /** + * The value of the item in a list. + */ + value?: string; + } } export interface ListListParams { diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index af2f499fc7..ad8e339400 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -417,7 +417,7 @@ export interface RuleSetting { * Add custom headers to allowed requests, in the form of key-value pairs. Keys are * header names, pointing to an array with its header value(s). */ - add_headers?: Record | null; + add_headers?: { [key: string]: string } | null; /** * Set by parent MSP accounts to enable their children to bypass this rule. @@ -846,7 +846,7 @@ export interface RuleSettingParam { * Add custom headers to allowed requests, in the form of key-value pairs. Keys are * header names, pointing to an array with its header value(s). */ - add_headers?: Record | null; + add_headers?: { [key: string]: string } | null; /** * Set by parent MSP accounts to enable their children to bypass this rule. diff --git a/src/resources/zero-trust/risk-scoring/behaviours.ts b/src/resources/zero-trust/risk-scoring/behaviours.ts index ce7251c22b..455a73f0ed 100644 --- a/src/resources/zero-trust/risk-scoring/behaviours.ts +++ b/src/resources/zero-trust/risk-scoring/behaviours.ts @@ -53,7 +53,7 @@ export class Behaviours extends APIResource { } export interface BehaviourUpdateResponse { - behaviors: Record; + behaviors: { [key: string]: BehaviourUpdateResponse.Behaviors }; } export namespace BehaviourUpdateResponse { @@ -65,7 +65,7 @@ export namespace BehaviourUpdateResponse { } export interface BehaviourGetResponse { - behaviors: Record; + behaviors: { [key: string]: BehaviourGetResponse.Behaviors }; } export namespace BehaviourGetResponse { @@ -89,7 +89,7 @@ export interface BehaviourUpdateParams { /** * Body param: */ - behaviors: Record; + behaviors: { [key: string]: BehaviourUpdateParams.Behaviors }; } export namespace BehaviourUpdateParams { diff --git a/src/version.ts b/src/version.ts index 5956b8d7dd..dc414ab9ea 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.4.1'; // x-release-please-version +export const VERSION = '4.5.0'; // x-release-please-version diff --git a/tests/api-resources/accounts/tokens/permission-groups.test.ts b/tests/api-resources/accounts/tokens/permission-groups.test.ts index ea607899a9..40bbc53db6 100644 --- a/tests/api-resources/accounts/tokens/permission-groups.test.ts +++ b/tests/api-resources/accounts/tokens/permission-groups.test.ts @@ -28,6 +28,8 @@ describe('resource permissionGroups', () => { test.skip('list: required and optional params', async () => { const response = await client.accounts.tokens.permissionGroups.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Account%20Settings%20Write', + scope: 'com.cloudflare.api.account.zone', }); }); @@ -49,6 +51,8 @@ describe('resource permissionGroups', () => { test.skip('get: required and optional params', async () => { const response = await client.accounts.tokens.permissionGroups.get({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + name: 'Account%20Settings%20Write', + scope: 'com.cloudflare.api.account.zone', }); }); }); diff --git a/tests/api-resources/accounts/tokens/tokens.test.ts b/tests/api-resources/accounts/tokens/tokens.test.ts index 061838067e..0248b48cf9 100644 --- a/tests/api-resources/accounts/tokens/tokens.test.ts +++ b/tests/api-resources/accounts/tokens/tokens.test.ts @@ -22,10 +22,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], }); @@ -50,10 +47,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], condition: { @@ -79,13 +73,9 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], - status: 'active', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -108,13 +98,9 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], - status: 'active', condition: { request_ip: { in: ['123.123.123.0/24', '2606:4700::/32'], @@ -123,6 +109,7 @@ describe('resource tokens', () => { }, expires_on: '2020-01-01T00:00:00Z', not_before: '2018-07-01T05:20:00Z', + status: 'active', }); }); diff --git a/tests/api-resources/brand-protection.test.ts b/tests/api-resources/brand-protection/brand-protection.test.ts similarity index 100% rename from tests/api-resources/brand-protection.test.ts rename to tests/api-resources/brand-protection/brand-protection.test.ts diff --git a/tests/api-resources/browser-rendering/pdf.test.ts b/tests/api-resources/browser-rendering/pdf.test.ts index ad5ab6bdf0..4f6cc2fa32 100644 --- a/tests/api-resources/browser-rendering/pdf.test.ts +++ b/tests/api-resources/browser-rendering/pdf.test.ts @@ -46,6 +46,24 @@ describe('resource pdf', () => { waitUntil: 'load', }, html: 'x', + pdfOptions: { + displayHeaderFooter: true, + footerTemplate: 'footerTemplate', + format: 'letter', + headerTemplate: 'headerTemplate', + height: 'string', + landscape: true, + margin: { bottom: 'string', left: 'string', right: 'string', top: 'string' }, + omitBackground: true, + outline: true, + pageRanges: 'pageRanges', + preferCSSPageSize: true, + printBackground: true, + scale: 0.1, + tagged: true, + timeout: 0, + width: 'string', + }, rejectRequestPattern: ['string'], rejectResourceTypes: ['document'], setExtraHTTPHeaders: { foo: 'string' }, diff --git a/tests/api-resources/cloudforce-one/threat-events/datasets/health.test.ts b/tests/api-resources/cloudforce-one/threat-events/datasets/health.test.ts index c214a9d823..2cb0391ade 100644 --- a/tests/api-resources/cloudforce-one/threat-events/datasets/health.test.ts +++ b/tests/api-resources/cloudforce-one/threat-events/datasets/health.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource health', () => { - test('get: only required params', async () => { + // TODO: HTTP 401 from prism + test.skip('get: only required params', async () => { const responsePromise = client.cloudforceOne.threatEvents.datasets.health.get( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id' }, @@ -24,7 +25,8 @@ describe('resource health', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { + // TODO: HTTP 401 from prism + test.skip('get: required and optional params', async () => { const response = await client.cloudforceOne.threatEvents.datasets.health.get( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { account_id: 'account_id' }, diff --git a/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts b/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts index 9b4ab47939..6e9fdf6100 100644 --- a/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts +++ b/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts @@ -14,8 +14,6 @@ describe('resource threatEvents', () => { test.skip('create: only required params', async () => { const responsePromise = client.cloudforceOne.threatEvents.create({ account_id: 'account_id', - attacker: 'Flying Yeti', - attackerCountry: 'CN', category: 'Domain Resolution', date: '2022-04-01T00:00:00Z', event: 'An attacker registered the domain domain.com', @@ -36,8 +34,6 @@ describe('resource threatEvents', () => { test.skip('create: required and optional params', async () => { const response = await client.cloudforceOne.threatEvents.create({ account_id: 'account_id', - attacker: 'Flying Yeti', - attackerCountry: 'CN', category: 'Domain Resolution', date: '2022-04-01T00:00:00Z', event: 'An attacker registered the domain domain.com', @@ -45,6 +41,8 @@ describe('resource threatEvents', () => { raw: { data: { foo: 'bar' }, source: 'example.com', tlp: 'amber' }, tlp: 'amber', accountId: 123456, + attacker: 'Flying Yeti', + attackerCountry: 'CN', datasetId: 'durableObjectName', indicator: 'domain.com', tags: ['malware'], @@ -104,8 +102,6 @@ describe('resource threatEvents', () => { account_id: 'account_id', data: [ { - attacker: 'Flying Yeti', - attackerCountry: 'CN', category: 'Domain Resolution', date: '2022-04-01T00:00:00Z', event: 'An attacker registered the domain domain.com', @@ -131,8 +127,6 @@ describe('resource threatEvents', () => { account_id: 'account_id', data: [ { - attacker: 'Flying Yeti', - attackerCountry: 'CN', category: 'Domain Resolution', date: '2022-04-01T00:00:00Z', event: 'An attacker registered the domain domain.com', @@ -140,6 +134,8 @@ describe('resource threatEvents', () => { raw: { data: { foo: 'bar' }, source: 'example.com', tlp: 'amber' }, tlp: 'amber', accountId: 123456, + attacker: 'Flying Yeti', + attackerCountry: 'CN', datasetId: 'durableObjectName', indicator: 'domain.com', tags: ['malware'], diff --git a/tests/api-resources/dns/records.test.ts b/tests/api-resources/dns/records.test.ts index 3a5f303fc7..7c4129faa2 100644 --- a/tests/api-resources/dns/records.test.ts +++ b/tests/api-resources/dns/records.test.ts @@ -15,6 +15,7 @@ describe('resource records', () => { const responsePromise = client.dns.records.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', }); const rawResponse = await responsePromise.asResponse(); @@ -31,13 +32,13 @@ describe('resource records', () => { const response = await client.dns.records.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, }); }); @@ -46,6 +47,7 @@ describe('resource records', () => { const responsePromise = client.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', }); const rawResponse = await responsePromise.asResponse(); @@ -62,13 +64,13 @@ describe('resource records', () => { const response = await client.dns.records.update('023e105f4ecef8ad9ca31a8372d0c353', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, }); }); @@ -162,38 +164,38 @@ describe('resource records', () => { patches: [ { name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, id: '023e105f4ecef8ad9ca31a8372d0c353', }, ], posts: [ { name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, }, ], puts: [ { name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, id: '023e105f4ecef8ad9ca31a8372d0c353', }, ], @@ -205,6 +207,7 @@ describe('resource records', () => { const responsePromise = client.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', }); const rawResponse = await responsePromise.asResponse(); @@ -221,13 +224,13 @@ describe('resource records', () => { const response = await client.dns.records.edit('023e105f4ecef8ad9ca31a8372d0c353', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', name: 'example.com', + ttl: 3600, type: 'A', comment: 'Domain verification record', content: '198.51.100.4', proxied: true, settings: { ipv4_only: true, ipv6_only: true }, tags: ['owner:dns-team'], - ttl: 3600, }); }); diff --git a/tests/api-resources/firewall/ua-rules.test.ts b/tests/api-resources/firewall/ua-rules.test.ts index ecaf7976a4..7cba450e27 100644 --- a/tests/api-resources/firewall/ua-rules.test.ts +++ b/tests/api-resources/firewall/ua-rules.test.ts @@ -32,6 +32,8 @@ describe('resource uaRules', () => { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', configuration: { target: 'ua', value: 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)' }, mode: 'challenge', + description: 'Prevent multiple login failures to mitigate brute force attacks', + paused: false, }); }); @@ -57,6 +59,8 @@ describe('resource uaRules', () => { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', configuration: { target: 'ip', value: '198.51.100.4' }, mode: 'challenge', + description: 'Prevent multiple login failures to mitigate brute force attacks', + paused: false, }); }); @@ -75,10 +79,10 @@ describe('resource uaRules', () => { const response = await client.firewall.uaRules.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', description: 'abusive', - description_search: 'abusive', page: 1, + paused: false, per_page: 1, - ua_search: 'Safari', + user_agent: 'Safari', }); }); diff --git a/tests/api-resources/hyperdrive/configs.test.ts b/tests/api-resources/hyperdrive/configs.test.ts index 2aece307d8..846fae447d 100644 --- a/tests/api-resources/hyperdrive/configs.test.ts +++ b/tests/api-resources/hyperdrive/configs.test.ts @@ -52,6 +52,7 @@ describe('resource configs', () => { mtls_certificate_id: '00000000-0000-0000-0000-0000000000', sslmode: 'verify-full', }, + origin_connection_limit: 60, }); }); @@ -97,6 +98,7 @@ describe('resource configs', () => { mtls_certificate_id: '00000000-0000-0000-0000-0000000000', sslmode: 'verify-full', }, + origin_connection_limit: 60, }); }); @@ -162,6 +164,7 @@ describe('resource configs', () => { }, name: 'example-hyperdrive', origin: { database: 'postgres', password: 'password', scheme: 'postgres', user: 'postgres' }, + origin_connection_limit: 60, }); }); diff --git a/tests/api-resources/images/v1/v1.test.ts b/tests/api-resources/images/v1/v1.test.ts index 20ee905bfd..ba9a063400 100644 --- a/tests/api-resources/images/v1/v1.test.ts +++ b/tests/api-resources/images/v1/v1.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -26,7 +26,8 @@ describe('resource v1', () => { test.skip('create: required and optional params', async () => { const response = await client.images.v1.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - file: {}, + id: 'id', + file: await toFile(Buffer.from('# my file contents'), 'README.md'), metadata: {}, requireSignedURLs: true, url: 'https://example.com/path/to/logo.png', diff --git a/tests/api-resources/kv/namespaces/keys.test.ts b/tests/api-resources/kv/namespaces/keys.test.ts index a14b3d5519..1d9985944b 100644 --- a/tests/api-resources/kv/namespaces/keys.test.ts +++ b/tests/api-resources/kv/namespaces/keys.test.ts @@ -80,7 +80,7 @@ describe('resource keys', () => { test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.keys.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ key: 'My-Key', value: 'Some string' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -96,12 +96,12 @@ describe('resource keys', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { + key: 'My-Key', + value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - key: 'My-Key', - metadata: { someMetadataKey: 'bar' }, - value: 'Some string', + metadata: {}, }, ], }); diff --git a/tests/api-resources/kv/namespaces/namespaces.test.ts b/tests/api-resources/kv/namespaces/namespaces.test.ts index c3aa98e19b..83aa204719 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -139,7 +139,7 @@ describe('resource namespaces', () => { test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ key: 'My-Key', value: 'Some string' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -155,12 +155,12 @@ describe('resource namespaces', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { + key: 'My-Key', + value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - key: 'My-Key', - metadata: { someMetadataKey: 'bar' }, - value: 'Some string', + metadata: {}, }, ], }); diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 2d1cc3ddf6..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -14,7 +14,6 @@ describe('resource values', () => { test.skip('update: only required params', async () => { const responsePromise = client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', }); const rawResponse = await responsePromise.asResponse(); @@ -30,10 +29,10 @@ describe('resource values', () => { test.skip('update: required and optional params', async () => { const response = await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); diff --git a/tests/api-resources/logpush/jobs.test.ts b/tests/api-resources/logpush/jobs.test.ts index 8e8e1ef3ed..699ba0606f 100644 --- a/tests/api-resources/logpush/jobs.test.ts +++ b/tests/api-resources/logpush/jobs.test.ts @@ -30,29 +30,29 @@ describe('resource jobs', () => { const response = await client.logpush.jobs.create({ destination_conf: 's3://mybucket/logs?region=us-west-2', account_id: 'account_id', - dataset: 'http_requests', + dataset: 'gateway_dns', enabled: false, filter: '{"where":{"and":[{"key":"ClientRequestPath","operator":"contains","value":"/static"},{"key":"ClientRequestHost","operator":"eq","value":"example.com"}]}}', frequency: 'high', - kind: 'edge', + kind: '', logpull_options: 'fields=RayID,ClientIP,EdgeStartTimestamp×tamps=rfc3339', max_upload_bytes: 5000000, max_upload_interval_seconds: 30, max_upload_records: 1000, name: 'example.com', output_options: { - batch_prefix: 'batch_prefix', - batch_suffix: 'batch_suffix', - 'CVE-2021-44228': true, - field_delimiter: 'field_delimiter', - field_names: ['ClientIP', 'EdgeStartTimestamp', 'RayID'], + batch_prefix: '', + batch_suffix: '', + 'CVE-2021-44228': false, + field_delimiter: ',', + field_names: ['Datetime', 'DstIP', 'SrcIP'], output_type: 'ndjson', - record_delimiter: 'record_delimiter', - record_prefix: 'record_prefix', - record_suffix: 'record_suffix', + record_delimiter: '', + record_prefix: '{', + record_suffix: '}\n', record_template: 'record_template', - sample_rate: 0, + sample_rate: 1, timestamp_format: 'unixnano', }, ownership_challenge: '00000000000000000000', diff --git a/tests/api-resources/magic-transit/connectors/connectors.test.ts b/tests/api-resources/magic-transit/connectors/connectors.test.ts index d4862c1c8d..4c00bff6e0 100644 --- a/tests/api-resources/magic-transit/connectors/connectors.test.ts +++ b/tests/api-resources/magic-transit/connectors/connectors.test.ts @@ -10,6 +10,34 @@ const client = new Cloudflare({ }); describe('resource connectors', () => { + // TODO: consider oneOf instead of maxProperties to indicate that this can be either id or serial_number + test.skip('create: only required params', async () => { + const responsePromise = client.magicTransit.connectors.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + device: {}, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // TODO: consider oneOf instead of maxProperties to indicate that this can be either id or serial_number + test.skip('create: required and optional params', async () => { + const response = await client.magicTransit.connectors.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + device: { id: 'id', serial_number: 'serial_number' }, + activated: true, + interrupt_window_duration_hours: 0, + interrupt_window_hour_of_day: 0, + notes: 'notes', + timezone: 'timezone', + }); + }); + test('update: only required params', async () => { const responsePromise = client.magicTransit.connectors.update('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -53,6 +81,25 @@ describe('resource connectors', () => { }); }); + test('delete: only required params', async () => { + const responsePromise = client.magicTransit.connectors.delete('connector_id', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.magicTransit.connectors.delete('connector_id', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + test('edit: only required params', async () => { const responsePromise = client.magicTransit.connectors.edit('connector_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', diff --git a/tests/api-resources/radar/bots/bots.test.ts b/tests/api-resources/radar/bots/bots.test.ts new file mode 100644 index 0000000000..957ac8598b --- /dev/null +++ b/tests/api-resources/radar/bots/bots.test.ts @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource bots', () => { + test('list', async () => { + const responsePromise = client.radar.bots.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.bots.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.list( + { + botCategory: 'SEARCH_ENGINE_CRAWLER', + botOperator: 'botOperator', + botVerificationStatus: 'VERIFIED', + format: 'JSON', + limit: 5, + offset: 0, + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.bots.get('gptbot'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.bots.get('gptbot', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.get('gptbot', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary', async () => { + const responsePromise = client.radar.bots.summary('BOT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.bots.summary('BOT', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.summary( + 'BOT', + { + asn: ['string'], + bot: ['string'], + botCategory: ['SEARCH_ENGINE_CRAWLER'], + botOperator: ['string'], + botVerificationStatus: ['VERIFIED'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.bots.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.bots.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.timeseries( + { + aggInterval: '1h', + asn: ['string'], + bot: ['string'], + botCategory: ['SEARCH_ENGINE_CRAWLER'], + botOperator: ['string'], + botVerificationStatus: ['VERIFIED'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.bots.timeseriesGroups('BOT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.timeseriesGroups('BOT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.timeseriesGroups( + 'BOT', + { + aggInterval: '1h', + asn: ['string'], + bot: ['string'], + botCategory: ['SEARCH_ENGINE_CRAWLER'], + botOperator: ['string'], + botVerificationStatus: ['VERIFIED'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/bots/web-crawlers.test.ts b/tests/api-resources/radar/bots/web-crawlers.test.ts new file mode 100644 index 0000000000..4d56bba6a4 --- /dev/null +++ b/tests/api-resources/radar/bots/web-crawlers.test.ts @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource webCrawlers', () => { + test('summary', async () => { + const responsePromise = client.radar.bots.webCrawlers.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.webCrawlers.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.webCrawlers.summary( + 'USER_AGENT', + { + botOperator: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.bots.webCrawlers.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.webCrawlers.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.bots.webCrawlers.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + botOperator: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/rules/lists/items.test.ts b/tests/api-resources/rules/lists/items.test.ts index 070fc5b387..4121cd4137 100644 --- a/tests/api-resources/rules/lists/items.test.ts +++ b/tests/api-resources/rules/lists/items.test.ts @@ -122,6 +122,7 @@ describe('resource items', () => { test('delete: required and optional params', async () => { const response = await client.rules.lists.items.delete('2c0fc9fa937b11eaa1b71c4d701ab86e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + items: [{}], }); }); diff --git a/tests/api-resources/user/tokens/permission-groups.test.ts b/tests/api-resources/user/tokens/permission-groups.test.ts index 4dcc445f6b..115a7abd28 100644 --- a/tests/api-resources/user/tokens/permission-groups.test.ts +++ b/tests/api-resources/user/tokens/permission-groups.test.ts @@ -29,4 +29,15 @@ describe('resource permissionGroups', () => { client.user.tokens.permissionGroups.list({ path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); + + // TODO: investigate broken test + test.skip('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.user.tokens.permissionGroups.list( + { name: 'Account%20Settings%20Write', scope: 'com.cloudflare.api.account.zone' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); }); diff --git a/tests/api-resources/user/tokens/tokens.test.ts b/tests/api-resources/user/tokens/tokens.test.ts index 700a927eac..6daec91f23 100644 --- a/tests/api-resources/user/tokens/tokens.test.ts +++ b/tests/api-resources/user/tokens/tokens.test.ts @@ -21,10 +21,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], }); @@ -48,10 +45,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], condition: { @@ -76,13 +70,9 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], - status: 'active', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -104,13 +94,9 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': '*', - 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': '*', - }, + resources: { foo: 'string' }, }, ], - status: 'active', condition: { request_ip: { in: ['123.123.123.0/24', '2606:4700::/32'], @@ -119,6 +105,7 @@ describe('resource tokens', () => { }, expires_on: '2020-01-01T00:00:00Z', not_before: '2018-07-01T05:20:00Z', + status: 'active', }); }); diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts index e3654af1fb..802be1989e 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts @@ -41,6 +41,7 @@ describe('resource scripts', () => { html_handling: 'auto-trailing-slash', not_found_handling: '404-page', run_worker_first: ['string'], + serve_directly: true, }, jwt: 'jwt', }, diff --git a/tests/api-resources/workers/scripts/scripts.test.ts b/tests/api-resources/workers/scripts/scripts.test.ts index 833126a026..9cd76c3500 100644 --- a/tests/api-resources/workers/scripts/scripts.test.ts +++ b/tests/api-resources/workers/scripts/scripts.test.ts @@ -37,6 +37,7 @@ describe('resource scripts', () => { html_handling: 'auto-trailing-slash', not_found_handling: '404-page', run_worker_first: ['string'], + serve_directly: true, }, jwt: 'jwt', }, diff --git a/tests/api-resources/workflows/instances/instances.test.ts b/tests/api-resources/workflows/instances/instances.test.ts index 96ee0c9edc..a33eac54ad 100644 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -25,6 +25,7 @@ describe('resource instances', () => { const response = await client.workflows.instances.create('x', { account_id: 'account_id', instance_id: 'instance_id', + instance_retention: {}, params: {}, }); }); @@ -65,7 +66,7 @@ describe('resource instances', () => { test('bulk: required and optional params', async () => { const response = await client.workflows.instances.bulk('x', { account_id: 'account_id', - body: [{ instance_id: 'instance_id', params: {} }], + body: [{ instance_id: 'instance_id', instance_retention: {}, params: {} }], }); }); diff --git a/tests/api-resources/zero-trust/dlp/entries/custom.test.ts b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts new file mode 100644 index 0000000000..f12ebab0b6 --- /dev/null +++ b/tests/api-resources/zero-trust/dlp/entries/custom.test.ts @@ -0,0 +1,89 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource custom', () => { + test('create: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.custom.create({ + account_id: 'account_id', + enabled: true, + name: 'name', + pattern: { regex: 'regex' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.custom.create({ + account_id: 'account_id', + enabled: true, + name: 'name', + pattern: { regex: 'regex', validation: 'luhn' }, + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + }); + + // TODO: investigate 422 error in prism test + test.skip('update: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.custom.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', name: 'name', pattern: { regex: 'regex' }, type: 'custom' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // TODO: investigate 422 error in prism test + test.skip('update: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.custom.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { + account_id: 'account_id', + name: 'name', + pattern: { regex: 'regex', validation: 'luhn' }, + type: 'custom', + enabled: true, + }, + ); + }); + + test('delete: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.custom.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.custom.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); +}); diff --git a/tests/api-resources/zero-trust/dlp/entries.test.ts b/tests/api-resources/zero-trust/dlp/entries/entries.test.ts similarity index 100% rename from tests/api-resources/zero-trust/dlp/entries.test.ts rename to tests/api-resources/zero-trust/dlp/entries/entries.test.ts diff --git a/tests/api-resources/zero-trust/dlp/entries/integration.test.ts b/tests/api-resources/zero-trust/dlp/entries/integration.test.ts new file mode 100644 index 0000000000..db240add6c --- /dev/null +++ b/tests/api-resources/zero-trust/dlp/entries/integration.test.ts @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource integration', () => { + test('create: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.integration.create({ + account_id: 'account_id', + enabled: true, + entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.integration.create({ + account_id: 'account_id', + enabled: true, + entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.integration.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', enabled: true }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.integration.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', enabled: true }, + ); + }); + + test('delete: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.integration.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.integration.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); +}); diff --git a/tests/api-resources/zero-trust/dlp/entries/predefined.test.ts b/tests/api-resources/zero-trust/dlp/entries/predefined.test.ts new file mode 100644 index 0000000000..7bfb69746e --- /dev/null +++ b/tests/api-resources/zero-trust/dlp/entries/predefined.test.ts @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource predefined', () => { + test('create: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.predefined.create({ + account_id: 'account_id', + enabled: true, + entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.predefined.create({ + account_id: 'account_id', + enabled: true, + entry_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + }); + + test('update: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.predefined.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', enabled: true }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.predefined.update( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id', enabled: true }, + ); + }); + + test('delete: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.entries.predefined.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.zeroTrust.dlp.entries.predefined.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); +}); diff --git a/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts b/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts index a489eb135f..e61f3904fa 100644 --- a/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts +++ b/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts @@ -10,6 +10,33 @@ const client = new Cloudflare({ }); describe('resource predefined', () => { + test('create: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.profiles.predefined.create({ + account_id: 'account_id', + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.zeroTrust.dlp.profiles.predefined.create({ + account_id: 'account_id', + profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + ai_context_enabled: true, + allowed_match_count: 0, + confidence_threshold: 'confidence_threshold', + context_awareness: { enabled: true, skip: { files: true } }, + entries: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', enabled: true }], + ocr_enabled: true, + }); + }); + test('update: only required params', async () => { const responsePromise = client.zeroTrust.dlp.profiles.predefined.update( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', @@ -39,6 +66,27 @@ describe('resource predefined', () => { ); }); + test('delete: only required params', async () => { + const responsePromise = client.zeroTrust.dlp.profiles.predefined.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.zeroTrust.dlp.profiles.predefined.delete( + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: 'account_id' }, + ); + }); + test('get: only required params', async () => { const responsePromise = client.zeroTrust.dlp.profiles.predefined.get( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index b91d54d471..7600e505ed 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -39,7 +39,6 @@ describe('resource configurations', () => { support_url: 'support_url', }, }, - 'app-control-settings': { enabled: false }, block_page: { background_color: 'background_color', enabled: true, @@ -97,7 +96,6 @@ describe('resource configurations', () => { support_url: 'support_url', }, }, - 'app-control-settings': { enabled: false }, block_page: { background_color: 'background_color', enabled: true, diff --git a/tests/index.test.ts b/tests/index.test.ts index 00507b9e00..dc875e144e 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -27,13 +27,13 @@ describe('instantiate client', () => { apiEmail: 'user@example.com', }); - test('they are used in the request', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post' }); + test('they are used in the request', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post' }); expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can ignore `undefined` and leave the default', () => { - const { req } = client.buildRequest({ + test('can ignore `undefined` and leave the default', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': undefined }, @@ -41,8 +41,8 @@ describe('instantiate client', () => { expect((req.headers as Headers)['x-my-default-header']).toEqual('2'); }); - test('can be removed with `null`', () => { - const { req } = client.buildRequest({ + test('can be removed with `null`', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', headers: { 'X-My-Default-Header': null }, @@ -290,20 +290,20 @@ describe('request building', () => { const client = new Cloudflare({ apiKey: '144c9defac04969c7bfad8efaa8ea194', apiEmail: 'user@example.com' }); describe('Content-Length', () => { - test('handles multi-byte characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); + test('handles multi-byte characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: '—' } }); expect((req.headers as Record)['content-length']).toEqual('20'); }); - test('handles standard characters', () => { - const { req } = client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); + test('handles standard characters', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' } }); expect((req.headers as Record)['content-length']).toEqual('22'); }); }); describe('custom headers', () => { - test('handles undefined', () => { - const { req } = client.buildRequest({ + test('handles undefined', async () => { + const { req } = await client.buildRequest({ path: '/foo', method: 'post', body: { value: 'hello' },