diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 763462fada..43fd5a73f8 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -9,9 +9,7 @@ "postCreateCommand": "yarn install", "customizations": { "vscode": { - "extensions": [ - "esbenp.prettier-vscode" - ] + "extensions": ["esbenp.prettier-vscode"] } } } diff --git a/.eslintcache b/.eslintcache new file mode 100644 index 0000000000..cd44813307 --- /dev/null +++ b/.eslintcache @@ -0,0 +1 @@ +[{"/home/tempuser-z687wq/run/codegen-output/cloudflare/cloudflare-node/src/resources/ai/to-markdown.ts":"1"},{"size":1733,"mtime":1759266822909}] \ No newline at end of file diff --git a/.gitignore b/.gitignore index d98d51a880..2412bb77a3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ dist dist-deno /*.tgz .idea/ +.eslintcache diff --git a/.release-please-manifest.json b/.release-please-manifest.json index affd1ab3d1..b5e9157309 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "5.1.0" + ".": "5.2.0" } diff --git a/.stats.yml b/.stats.yml index c4c893951c..5637fc3e0e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1809 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-77d61495fecd0d26b9adff1af0ab3510b06a3cc2c6781b9a40aabcad2f10588a.yml -openapi_spec_hash: 95dee3be411dda77306a41dc7d49eb35 -config_hash: ac04197a992afb1d8c3b416fc46e8c8e +configured_endpoints: 1822 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca8fbfa82d19dca400ec61b8c93392de1acd157860e435419f9a5e9ec8c586e0.yml +openapi_spec_hash: 77d55c70bc3824ac61bd056e2319ee18 +config_hash: 107e0f1f8a98b007260b319226b88b3c diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ecc9139b3..400e7c4098 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,74 @@ # Changelog +## 5.2.0 (2025-09-30) + +Full Changelog: [v5.1.0...v5.2.0](https://github.com/cloudflare/cloudflare-typescript/compare/v5.1.0...v5.2.0) + +### Features + +* **api:** api update ([932e696](https://github.com/cloudflare/cloudflare-typescript/commit/932e69652a97b73ea3073749187a78ee6ddb5cc0)) +* **api:** api update ([4656a4e](https://github.com/cloudflare/cloudflare-typescript/commit/4656a4eb8cc5ed853ce5f248056c48413ebc9a0f)) +* fix(ai): rename duplicate parameter in the to_markdown subresource ([98ccef7](https://github.com/cloudflare/cloudflare-typescript/commit/98ccef7983622f556d6c1356849f84ca1441ebdd)) +* fix(api): RAG-286: Add to_markdown subresource to AI resource ([770500f](https://github.com/cloudflare/cloudflare-typescript/commit/770500fa751cec08bbd4bca0632c3a54e724aefd)) +* Merge branch 'cbennett/LB-4979' into 'main' ([5764b60](https://github.com/cloudflare/cloudflare-typescript/commit/5764b602234b4245009022a2fed3f3e3fd0ea75d)) +* Merge branch 'davis/PINGORA-2658' into 'main' ([92a159e](https://github.com/cloudflare/cloudflare-typescript/commit/92a159e4adfb873f547ab8b6c78da7b0d7fc49f2)) +* Merge branch 'mingwei/BGP-418' into 'main' ([e8480e8](https://github.com/cloudflare/cloudflare-typescript/commit/e8480e8d5f510114fc64459ad6dc40a3a4f32aeb)) +* Revert "Merge branch 'davis/PINGORA-2658' into 'main'" ([03d5bae](https://github.com/cloudflare/cloudflare-typescript/commit/03d5bae6c136efd74b8204f74f588aeb3cc2ac1d)) + + +### Performance Improvements + +* faster formatting ([17f6c4f](https://github.com/cloudflare/cloudflare-typescript/commit/17f6c4f43a503ad2f0b8f7d72dcb0718c62b184e)) + + +### Chores + +* **api:** update composite API spec ([ab0bebd](https://github.com/cloudflare/cloudflare-typescript/commit/ab0bebd30006a7ec15c63b4115ab44c545f0ad27)) +* **api:** update composite API spec ([04d593f](https://github.com/cloudflare/cloudflare-typescript/commit/04d593f11dd0d7246717d36a8da8d1b7eb232377)) +* **api:** update composite API spec ([3cd521d](https://github.com/cloudflare/cloudflare-typescript/commit/3cd521d14666a86ac2c5710ff46142233145dfef)) +* **api:** update composite API spec ([15ff36b](https://github.com/cloudflare/cloudflare-typescript/commit/15ff36bd678935131a2f65eb009b19e8cd408695)) +* **api:** update composite API spec ([38722d4](https://github.com/cloudflare/cloudflare-typescript/commit/38722d4d86dd2cc859d7e2227ba177df7b661af1)) +* **api:** update composite API spec ([f5dbf2f](https://github.com/cloudflare/cloudflare-typescript/commit/f5dbf2f6fdeb58df2f6b7e0fbe4a67cce1a41768)) +* **api:** update composite API spec ([944d006](https://github.com/cloudflare/cloudflare-typescript/commit/944d0067f1027f0516a67dbe76d19a94c90d7ab0)) +* **api:** update composite API spec ([65fb516](https://github.com/cloudflare/cloudflare-typescript/commit/65fb516ba359790a81015844202b142910fc64bd)) +* **api:** update composite API spec ([0227a05](https://github.com/cloudflare/cloudflare-typescript/commit/0227a052c6365411126863f27f6044753562c2b1)) +* **api:** update composite API spec ([2a87192](https://github.com/cloudflare/cloudflare-typescript/commit/2a871929714e7038037bd1b9eddfb7611ac3a27f)) +* **api:** update composite API spec ([9b6e363](https://github.com/cloudflare/cloudflare-typescript/commit/9b6e36343baed1d2b20f048ee03e6b025f1af3f2)) +* **api:** update composite API spec ([3a8a22d](https://github.com/cloudflare/cloudflare-typescript/commit/3a8a22dce7d8d90273e72add4ca427771aa862b8)) +* **api:** update composite API spec ([ceb49a5](https://github.com/cloudflare/cloudflare-typescript/commit/ceb49a54c198672834ef599d92957a41c73450f0)) +* **api:** update composite API spec ([f85cb6b](https://github.com/cloudflare/cloudflare-typescript/commit/f85cb6be0c283dfa6e1e52d0f255541e71485b55)) +* **api:** update composite API spec ([3204575](https://github.com/cloudflare/cloudflare-typescript/commit/32045759e5391d905caafac85506f12aff209be3)) +* **api:** update composite API spec ([852e202](https://github.com/cloudflare/cloudflare-typescript/commit/852e202f145def55c4fbefccd561ed91d140b89e)) +* **api:** update composite API spec ([02745e6](https://github.com/cloudflare/cloudflare-typescript/commit/02745e6039710252caaebecab1c58460b8a3eb55)) +* **api:** update composite API spec ([47d98b6](https://github.com/cloudflare/cloudflare-typescript/commit/47d98b61ca1dd66d2ea622613dbabcbebfa6935e)) +* **api:** update composite API spec ([0c1056e](https://github.com/cloudflare/cloudflare-typescript/commit/0c1056ea63598991152c2e1384822448f80b5614)) +* **api:** update composite API spec ([79e8b83](https://github.com/cloudflare/cloudflare-typescript/commit/79e8b839fb40c574a5d41647d86aba9d62c06c95)) +* **api:** update composite API spec ([d35bbfb](https://github.com/cloudflare/cloudflare-typescript/commit/d35bbfb00b9d1b74a724e9fd5ba764d8e30e4622)) +* **api:** update composite API spec ([87fc40c](https://github.com/cloudflare/cloudflare-typescript/commit/87fc40c356c53ba7a73db3f80050bc2980efcd19)) +* **api:** update composite API spec ([2a6e7ed](https://github.com/cloudflare/cloudflare-typescript/commit/2a6e7ed99641acb0c4708ebf0c201072347a11fe)) +* **api:** update composite API spec ([30a4ab2](https://github.com/cloudflare/cloudflare-typescript/commit/30a4ab26545c98738abff666fcbdc54f945ae7c4)) +* **api:** update composite API spec ([0cab872](https://github.com/cloudflare/cloudflare-typescript/commit/0cab872cbe1428f16df2caddd7f71e3eacf3720e)) +* **api:** update composite API spec ([36c1def](https://github.com/cloudflare/cloudflare-typescript/commit/36c1def65037635cb80a18f37a03d48e090ac317)) +* **api:** update composite API spec ([fabf439](https://github.com/cloudflare/cloudflare-typescript/commit/fabf439a0d8ce775a1ea0814a224d38623f47811)) +* **api:** update composite API spec ([eca4953](https://github.com/cloudflare/cloudflare-typescript/commit/eca49531f0d208f1c12b9df3fac0bfdcc1717d61)) +* **api:** update composite API spec ([de00074](https://github.com/cloudflare/cloudflare-typescript/commit/de0007405ea4cefe380582f48c10ba971c390d25)) +* **api:** update composite API spec ([5fef81c](https://github.com/cloudflare/cloudflare-typescript/commit/5fef81c748ed5e1f36fa3d3c612cd8e4575e2af0)) +* **api:** update composite API spec ([a0bf932](https://github.com/cloudflare/cloudflare-typescript/commit/a0bf932043180bbe447b84187dc049bd7b13ceec)) +* **api:** update composite API spec ([8292aee](https://github.com/cloudflare/cloudflare-typescript/commit/8292aeeda89bebfeb958078b0b8795d746bc7aae)) +* **api:** update composite API spec ([d5b6a6a](https://github.com/cloudflare/cloudflare-typescript/commit/d5b6a6a74d23366c9f2a40a24c462b59843100af)) +* **api:** update composite API spec ([65fff47](https://github.com/cloudflare/cloudflare-typescript/commit/65fff47d4f140920ad7abb22270b5d7a792ab475)) +* **api:** update composite API spec ([c5cc86a](https://github.com/cloudflare/cloudflare-typescript/commit/c5cc86a98b35542e7394ea29123a20bcbfe86bd3)) +* **api:** update composite API spec ([bb6586e](https://github.com/cloudflare/cloudflare-typescript/commit/bb6586eaaccfec366402a2f17aa60e8e3c7ac4be)) +* **api:** update composite API spec ([29623b8](https://github.com/cloudflare/cloudflare-typescript/commit/29623b80f2d5137a211c8400ecec09912269b99b)) +* **api:** update composite API spec ([1fa622c](https://github.com/cloudflare/cloudflare-typescript/commit/1fa622cc4313376ad2c49275db3b4850a12e4038)) +* **api:** update composite API spec ([80d3e7a](https://github.com/cloudflare/cloudflare-typescript/commit/80d3e7ac8e95d4c62665b1892a3eb0d7c5e62b69)) +* do not install brew dependencies in ./scripts/bootstrap by default ([257ac1d](https://github.com/cloudflare/cloudflare-typescript/commit/257ac1dce3d1bdfb915e203f393cde3deb24f8c8)) +* improve example values ([20f0585](https://github.com/cloudflare/cloudflare-typescript/commit/20f05856df1bad6a284198aaae8aee27ee0c31af)) +* **internal:** codegen related update ([0448452](https://github.com/cloudflare/cloudflare-typescript/commit/04484522a5aa79dfdf5334550183fe0a5525ca90)) +* **internal:** fix incremental formatting in some cases ([9abf5ab](https://github.com/cloudflare/cloudflare-typescript/commit/9abf5ab20e49740b74f2537ea854b18023d1b170)) +* **internal:** ignore .eslintcache ([a80827e](https://github.com/cloudflare/cloudflare-typescript/commit/a80827e844ae136ac437ce1b67fd160824f21930)) +* **internal:** remove deprecated `compilerOptions.baseUrl` from tsconfig.json ([ea38064](https://github.com/cloudflare/cloudflare-typescript/commit/ea3806498caf32cf70d51131f098211f6f17a09d)) + ## 5.1.0 (2025-09-12) Full Changelog: [v5.0.0...v5.1.0](https://github.com/cloudflare/cloudflare-typescript/compare/v5.0.0...v5.1.0) diff --git a/api.md b/api.md index 26571fa1ac..7ffb0aa433 100644 --- a/api.md +++ b/api.md @@ -487,6 +487,21 @@ Methods: - client.loadBalancers.monitors.references.get(monitorId, { ...params }) -> ReferenceGetResponsesSinglePage +## MonitorGroups + +Types: + +- MonitorGroup + +Methods: + +- client.loadBalancers.monitorGroups.create({ ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.update(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.list({ ...params }) -> MonitorGroupsSinglePage +- client.loadBalancers.monitorGroups.delete(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.edit(monitorGroupId, { ...params }) -> MonitorGroup +- client.loadBalancers.monitorGroups.get(monitorGroupId, { ...params }) -> MonitorGroup + ## Pools Types: @@ -963,6 +978,8 @@ Types: - RecordExportResponse - RecordImportResponse - RecordScanResponse +- RecordScanReviewResponse +- RecordScanTriggerResponse Methods: @@ -976,13 +993,12 @@ Methods: - client.dns.records.get(dnsRecordId, { ...params }) -> RecordResponse - client.dns.records.import({ ...params }) -> RecordImportResponse - client.dns.records.scan({ ...params }) -> RecordScanResponse +- client.dns.records.scanList({ ...params }) -> RecordResponsesSinglePage +- client.dns.records.scanReview({ ...params }) -> RecordScanReviewResponse +- client.dns.records.scanTrigger({ ...params }) -> RecordScanTriggerResponse ## Settings -Types: - -- DNSSetting - ### Zone Types: @@ -2012,6 +2028,7 @@ Methods: - client.workers.beta.workers.update(workerId, { ...params }) -> Worker - client.workers.beta.workers.list({ ...params }) -> WorkersV4PagePaginationArray - client.workers.beta.workers.delete(workerId, { ...params }) -> WorkerDeleteResponse +- client.workers.beta.workers.edit(workerId, { ...params }) -> Worker - client.workers.beta.workers.get(workerId, { ...params }) -> Worker #### Versions @@ -2067,6 +2084,7 @@ Types: - ScriptUpdateResponse - ScriptDeleteResponse - ScriptGetResponse +- ScriptSearchResponse Methods: @@ -2074,6 +2092,7 @@ Methods: - client.workers.scripts.list({ ...params }) -> ScriptsSinglePage - client.workers.scripts.delete(scriptName, { ...params }) -> ScriptDeleteResponse | null - client.workers.scripts.get(scriptName, { ...params }) -> string +- client.workers.scripts.search({ ...params }) -> ScriptSearchResponse ### Assets @@ -3313,14 +3332,6 @@ Methods: ### Downloads -Types: - -- DownloadGetResponse - -Methods: - -- client.intel.indicatorFeeds.downloads.get(feedId, { ...params }) -> DownloadGetResponse - ## Sinkholes Types: @@ -6162,6 +6173,20 @@ Methods: - client.zeroTrust.networks.subnets.cloudflareSource.update(addressFamily, { ...params }) -> CloudflareSourceUpdateResponse +### HostnameRoutes + +Types: + +- HostnameRoute + +Methods: + +- client.zeroTrust.networks.hostnameRoutes.create({ ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.list({ ...params }) -> HostnameRoutesV4PagePaginationArray +- client.zeroTrust.networks.hostnameRoutes.delete(hostnameRouteId, { ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.edit(hostnameRouteId, { ...params }) -> HostnameRoute +- client.zeroTrust.networks.hostnameRoutes.get(hostnameRouteId, { ...params }) -> HostnameRoute + ## RiskScoring Types: @@ -7168,6 +7193,7 @@ Methods: Types: - ASNListResponse +- ASNAsSetResponse - ASNGetResponse - ASNIPResponse - ASNRelResponse @@ -7175,6 +7201,7 @@ Types: Methods: - client.radar.entities.asns.list({ ...params }) -> ASNListResponse +- client.radar.entities.asns.asSet(asn, { ...params }) -> ASNAsSetResponse - client.radar.entities.asns.get(asn, { ...params }) -> ASNGetResponse - client.radar.entities.asns.ip({ ...params }) -> ASNIPResponse - client.radar.entities.asns.rel(asn, { ...params }) -> ASNRelResponse @@ -8034,16 +8061,6 @@ Methods: ### Crons -Types: - -- CronListResponse -- CronEditResponse - -Methods: - -- client.cloudforceOne.threatEvents.crons.list({ ...params }) -> CronListResponse -- client.cloudforceOne.threatEvents.crons.edit({ ...params }) -> CronEditResponse - ### Datasets Types: @@ -8064,14 +8081,6 @@ Methods: #### Health -Types: - -- HealthGetResponse - -Methods: - -- client.cloudforceOne.threatEvents.datasets.health.get(datasetId, { ...params }) -> HealthGetResponse - ### IndicatorTypes Types: @@ -8624,6 +8633,16 @@ Methods: - client.ai.models.schema.get({ ...params }) -> SchemaGetResponse +## ToMarkdown + +Types: + +- ToMarkdownTransformResponse + +Methods: + +- client.ai.toMarkdown.transform(file, { ...params }) -> ToMarkdownTransformResponsesSinglePage + # SecurityCenter ## Insights diff --git a/package.json b/package.json index e0d8b54994..254904983e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "5.1.0", + "version": "5.2.0", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", diff --git a/release-please-config.json b/release-please-config.json index 624ed99ecc..1ebd0bde2e 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -60,8 +60,5 @@ } ], "release-type": "node", - "extra-files": [ - "src/version.ts", - "README.md" - ] + "extra-files": ["src/version.ts", "README.md"] } diff --git a/scripts/bootstrap b/scripts/bootstrap index 0af58e2511..f68bedacbf 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -4,10 +4,18 @@ set -e cd "$(dirname "$0")/.." -if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ]; then +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ] && [ "$SKIP_BREW" != "1" ] && [ -t 0 ]; then brew bundle check >/dev/null 2>&1 || { - echo "==> Installing Homebrew dependencies…" - brew bundle + echo -n "==> Install Homebrew dependencies? (y/N): " + read -r response + case "$response" in + [yY][eE][sS]|[yY]) + brew bundle + ;; + *) + ;; + esac + echo } fi diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index cd858876e8..4580a22d2d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -42,6 +42,7 @@ TEST_PATHS=( tests/api-resources/load-balancers/monitors/monitors.test.ts tests/api-resources/load-balancers/monitors/previews.test.ts tests/api-resources/load-balancers/monitors/references.test.ts + tests/api-resources/load-balancers/monitor-groups.test.ts tests/api-resources/load-balancers/pools/pools.test.ts tests/api-resources/load-balancers/pools/health.test.ts tests/api-resources/load-balancers/pools/references.test.ts @@ -286,7 +287,6 @@ TEST_PATHS=( 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 @@ -521,6 +521,7 @@ TEST_PATHS=( 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/networks/hostname-routes.test.ts tests/api-resources/zero-trust/risk-scoring/risk-scoring.test.ts tests/api-resources/zero-trust/risk-scoring/behaviours.test.ts tests/api-resources/zero-trust/risk-scoring/summary.test.ts @@ -682,9 +683,7 @@ TEST_PATHS=( 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 @@ -731,6 +730,7 @@ TEST_PATHS=( tests/api-resources/ai/tasks.test.ts tests/api-resources/ai/models/models.test.ts tests/api-resources/ai/models/schema.test.ts + tests/api-resources/ai/to-markdown.test.ts tests/api-resources/security-center/security-center.test.ts tests/api-resources/security-center/insights/insights.test.ts tests/api-resources/security-center/insights/class.test.ts diff --git a/scripts/fast-format b/scripts/fast-format new file mode 100755 index 0000000000..8a8e9d5906 --- /dev/null +++ b/scripts/fast-format @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "Script started with $# arguments" +echo "Arguments: $*" +echo "Script location: $(dirname "$0")" + +cd "$(dirname "$0")/.." +echo "Changed to directory: $(pwd)" + +if [ $# -eq 0 ]; then + echo "Usage: $0 [additional-formatter-args...]" + echo "The file should contain one file path per line" + exit 1 +fi + +FILE_LIST="$1" + +echo "Looking for file: $FILE_LIST" + +if [ ! -f "$FILE_LIST" ]; then + echo "Error: File '$FILE_LIST' not found" + exit 1 +fi + +echo "==> Running eslint --fix" +ESLINT_FILES="$(grep '\.ts$' "$FILE_LIST" || true)" +if ! [ -z "$ESLINT_FILES" ]; then + echo "$ESLINT_FILES" | ESLINT_USE_FLAT_CONFIG="false" xargs ./node_modules/.bin/eslint --cache --fix +fi + +echo "==> Running prettier --write" +# format things eslint didn't +PRETTIER_FILES="$(grep '\.\(js\|json\)$' "$FILE_LIST" || true)" +if ! [ -z "$PRETTIER_FILES" ]; then + echo "$PRETTIER_FILES" | xargs ./node_modules/.bin/prettier \ + --write --cache --cache-strategy metadata --no-error-on-unmatched-pattern \ + '!**/dist' '!**/*.ts' '!**/*.mts' '!**/*.cts' '!**/*.js' '!**/*.mjs' '!**/*.cjs' +fi diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index 84a9fa9940..a965d93b86 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -177,14 +177,18 @@ export interface Prefix { account_id?: string; /** - * Prefix advertisement status to the Internet. This field is only not 'null' if on - * demand is enabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ advertised?: boolean | null; /** - * Last time the advertisement status was changed. This field is only not 'null' if - * on demand is enabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ advertised_modified_at?: string | null; @@ -218,14 +222,18 @@ export interface Prefix { modified_at?: string; /** - * Whether advertisement of the prefix to the Internet may be dynamically enabled - * or disabled. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ on_demand_enabled?: boolean; /** - * Whether advertisement status of the prefix is locked, meaning it cannot be - * changed. + * @deprecated Prefer the + * [BGP Prefixes API](https://developers.cloudflare.com/api/resources/addressing/subresources/prefixes/subresources/bgp_prefixes/) + * instead, which allows for advertising multiple BGP routes within a single IP + * Prefix. */ on_demand_locked?: boolean; } diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index 92fbb2f5cb..0c4c49b406 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -233,7 +233,7 @@ export interface AIGatewayCreateResponse { authentication?: boolean; - dlp?: AIGatewayCreateResponse.DLP; + dlp?: AIGatewayCreateResponse.UnionMember0 | AIGatewayCreateResponse.UnionMember1; log_management?: number | null; @@ -243,17 +243,61 @@ export interface AIGatewayCreateResponse { logpush_public_key?: string | null; + otel?: Array | null; + store_id?: string | null; + + stripe?: AIGatewayCreateResponse.Stripe | null; } export namespace AIGatewayCreateResponse { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayUpdateResponse { @@ -286,7 +330,7 @@ export interface AIGatewayUpdateResponse { authentication?: boolean; - dlp?: AIGatewayUpdateResponse.DLP; + dlp?: AIGatewayUpdateResponse.UnionMember0 | AIGatewayUpdateResponse.UnionMember1; log_management?: number | null; @@ -296,17 +340,61 @@ export interface AIGatewayUpdateResponse { logpush_public_key?: string | null; + otel?: Array | null; + store_id?: string | null; + + stripe?: AIGatewayUpdateResponse.Stripe | null; } export namespace AIGatewayUpdateResponse { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayListResponse { @@ -339,7 +427,7 @@ export interface AIGatewayListResponse { authentication?: boolean; - dlp?: AIGatewayListResponse.DLP; + dlp?: AIGatewayListResponse.UnionMember0 | AIGatewayListResponse.UnionMember1; log_management?: number | null; @@ -349,17 +437,61 @@ export interface AIGatewayListResponse { logpush_public_key?: string | null; + otel?: Array | null; + store_id?: string | null; + + stripe?: AIGatewayListResponse.Stripe | null; } export namespace AIGatewayListResponse { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayDeleteResponse { @@ -392,7 +524,7 @@ export interface AIGatewayDeleteResponse { authentication?: boolean; - dlp?: AIGatewayDeleteResponse.DLP; + dlp?: AIGatewayDeleteResponse.UnionMember0 | AIGatewayDeleteResponse.UnionMember1; log_management?: number | null; @@ -402,17 +534,61 @@ export interface AIGatewayDeleteResponse { logpush_public_key?: string | null; + otel?: Array | null; + store_id?: string | null; + + stripe?: AIGatewayDeleteResponse.Stripe | null; } export namespace AIGatewayDeleteResponse { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayGetResponse { @@ -445,7 +621,7 @@ export interface AIGatewayGetResponse { authentication?: boolean; - dlp?: AIGatewayGetResponse.DLP; + dlp?: AIGatewayGetResponse.UnionMember0 | AIGatewayGetResponse.UnionMember1; log_management?: number | null; @@ -455,17 +631,61 @@ export interface AIGatewayGetResponse { logpush_public_key?: string | null; + otel?: Array | null; + store_id?: string | null; + + stripe?: AIGatewayGetResponse.Stripe | null; } export namespace AIGatewayGetResponse { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayCreateParams { @@ -579,7 +799,7 @@ export interface AIGatewayUpdateParams { /** * Body param: */ - dlp?: AIGatewayUpdateParams.DLP; + dlp?: AIGatewayUpdateParams.UnionMember0 | AIGatewayUpdateParams.UnionMember1; /** * Body param: @@ -601,20 +821,70 @@ export interface AIGatewayUpdateParams { */ logpush_public_key?: string | null; + /** + * Body param: + */ + otel?: Array | null; + /** * Body param: */ store_id?: string | null; + + /** + * Body param: + */ + stripe?: AIGatewayUpdateParams.Stripe | null; } export namespace AIGatewayUpdateParams { - export interface DLP { + export interface UnionMember0 { action: 'BLOCK' | 'FLAG'; enabled: boolean; profiles: Array; } + + export interface UnionMember1 { + enabled: boolean; + + policies: Array; + } + + export namespace UnionMember1 { + export interface Policy { + id: string; + + action: 'FLAG' | 'BLOCK'; + + check: Array<'REQUEST' | 'RESPONSE'>; + + enabled: boolean; + + profiles: Array; + } + } + + export interface Otel { + authorization: string; + + headers: { [key: string]: string }; + + url: string; + } + + export interface Stripe { + authorization: string; + + usage_events: Array; + } + + export namespace Stripe { + export interface UsageEvent { + payload: string; + } + } } export interface AIGatewayListParams extends V4PagePaginationArrayParams { diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index f2df3ca255..e3cdca10e1 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -427,7 +427,8 @@ export namespace LogListParams { | 'prompts.version_id' | 'authentication' | 'wholesale' - | 'compatibilityMode'; + | 'compatibilityMode' + | 'dlp_action'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; @@ -499,7 +500,8 @@ export namespace LogDeleteParams { | 'prompts.version_id' | 'authentication' | 'wholesale' - | 'compatibilityMode'; + | 'compatibilityMode' + | 'dlp_action'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index a728fa6bf6..a6774c28a0 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -6,6 +6,13 @@ import * as AuthorsAPI from './authors'; import { AuthorListParams, AuthorListResponse, AuthorListResponsesSinglePage, Authors } from './authors'; import * as TasksAPI from './tasks'; import { TaskListParams, TaskListResponse, TaskListResponsesSinglePage, Tasks } from './tasks'; +import * as ToMarkdownAPI from './to-markdown'; +import { + ToMarkdown, + ToMarkdownTransformParams, + ToMarkdownTransformResponse, + ToMarkdownTransformResponsesSinglePage, +} from './to-markdown'; import * as FinetunesAPI from './finetunes/finetunes'; import { FinetuneCreateParams, @@ -27,6 +34,7 @@ export class AI extends APIResource { authors: AuthorsAPI.Authors = new AuthorsAPI.Authors(this._client); tasks: TasksAPI.Tasks = new TasksAPI.Tasks(this._client); models: ModelsAPI.Models = new ModelsAPI.Models(this._client); + toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); /** * This endpoint provides users with the capability to run specific AI models @@ -1054,6 +1062,8 @@ AI.Tasks = Tasks; AI.TaskListResponsesSinglePage = TaskListResponsesSinglePage; AI.Models = Models; AI.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray; +AI.ToMarkdown = ToMarkdown; +AI.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage; export declare namespace AI { export { type AIRunResponse as AIRunResponse, type AIRunParams as AIRunParams }; @@ -1086,4 +1096,11 @@ export declare namespace AI { ModelListResponsesV4PagePaginationArray as ModelListResponsesV4PagePaginationArray, type ModelListParams as ModelListParams, }; + + export { + ToMarkdown as ToMarkdown, + type ToMarkdownTransformResponse as ToMarkdownTransformResponse, + ToMarkdownTransformResponsesSinglePage as ToMarkdownTransformResponsesSinglePage, + type ToMarkdownTransformParams as ToMarkdownTransformParams, + }; } diff --git a/src/resources/ai/index.ts b/src/resources/ai/index.ts index d75349a3a3..213e475dd2 100644 --- a/src/resources/ai/index.ts +++ b/src/resources/ai/index.ts @@ -21,3 +21,9 @@ export { type ModelListParams, } from './models/index'; export { TaskListResponsesSinglePage, Tasks, type TaskListResponse, type TaskListParams } from './tasks'; +export { + ToMarkdownTransformResponsesSinglePage, + ToMarkdown, + type ToMarkdownTransformResponse, + type ToMarkdownTransformParams, +} from './to-markdown'; diff --git a/src/resources/ai/to-markdown.ts b/src/resources/ai/to-markdown.ts new file mode 100644 index 0000000000..8c075a3a75 --- /dev/null +++ b/src/resources/ai/to-markdown.ts @@ -0,0 +1,61 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; +import { type BlobLike } from '../../uploads'; + +export class ToMarkdown extends APIResource { + /** + * Convert Files into Markdown + */ + transform( + file: string | ArrayBufferView | ArrayBuffer | BlobLike, + params: ToMarkdownTransformParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tomarkdown`, + ToMarkdownTransformResponsesSinglePage, + { + body: file, + method: 'post', + ...options, + headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, + __binaryRequest: true, + }, + ); + } +} + +export class ToMarkdownTransformResponsesSinglePage extends SinglePage {} + +export interface ToMarkdownTransformResponse { + data: string; + + format: string; + + mimeType: string; + + name: string; + + tokens: string; +} + +export interface ToMarkdownTransformParams { + /** + * Path param: + */ + account_id: string; +} + +ToMarkdown.ToMarkdownTransformResponsesSinglePage = ToMarkdownTransformResponsesSinglePage; + +export declare namespace ToMarkdown { + export { + type ToMarkdownTransformResponse as ToMarkdownTransformResponse, + ToMarkdownTransformResponsesSinglePage as ToMarkdownTransformResponsesSinglePage, + type ToMarkdownTransformParams as ToMarkdownTransformParams, + }; +} diff --git a/src/resources/alerting/destinations/pagerduty.ts b/src/resources/alerting/destinations/pagerduty.ts index 4f8ff15c80..9c37f6ae42 100644 --- a/src/resources/alerting/destinations/pagerduty.ts +++ b/src/resources/alerting/destinations/pagerduty.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import { SinglePage } from '../../../pagination'; export class PagerdutyResource extends APIResource { @@ -123,39 +122,27 @@ export interface PagerdutyCreateResponse { } export interface PagerdutyDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** * Whether the API call was successful */ success: true; - - result_info?: PagerdutyDeleteResponse.ResultInfo; } export namespace PagerdutyDeleteResponse { - export interface ResultInfo { - /** - * Total number of results for the requested service - */ - count?: number; - - /** - * Current page within paginated list of results - */ - page?: number; - - /** - * Number of results per page of results - */ - per_page?: number; - - /** - * Total results available without any search parameters - */ - total_count?: number; + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; } } diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index 5a8432f22c..279c67d0bf 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import { SinglePage } from '../../../pagination'; export class Webhooks extends APIResource { @@ -188,39 +187,27 @@ export interface WebhookUpdateResponse { } export interface WebhookDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** * Whether the API call was successful */ success: true; - - result_info?: WebhookDeleteResponse.ResultInfo; } export namespace WebhookDeleteResponse { - export interface ResultInfo { - /** - * Total number of results for the requested service - */ - count?: number; - - /** - * Current page within paginated list of results - */ - page?: number; - - /** - * Number of results per page of results - */ - per_page?: number; - - /** - * Total results available without any search parameters - */ - total_count?: number; + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; } } diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index 7502b15051..c2caed4005 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; import { SinglePage } from '../../pagination'; export class Policies extends APIResource { @@ -766,9 +765,9 @@ export interface PolicyUpdateResponse { } export interface PolicyDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** * Whether the API call was successful @@ -779,6 +778,18 @@ export interface PolicyDeleteResponse { } export namespace PolicyDeleteResponse { + export interface Error { + message: string; + + code?: number; + } + + export interface Message { + message: string; + + code?: number; + } + export interface ResultInfo { /** * Total number of results for the requested service diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index de1a717f29..8db71dac25 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -72,6 +72,7 @@ export class BotManagement extends APIResource { * const botManagement = await client.botManagement.update({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * ai_bots_protection: 'disabled', + * cf_robots_variant: 'off', * crawler_protection: 'disabled', * enable_js: true, * fight_mode: true, @@ -120,6 +121,11 @@ export interface BotFightModeConfiguration { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -202,6 +208,11 @@ export interface BotFightModeConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -245,6 +256,11 @@ export interface SubscriptionConfiguration { */ bm_cookie_enabled?: boolean; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -341,6 +357,11 @@ export interface SubscriptionConfigurationParam { */ bm_cookie_enabled?: boolean; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -372,6 +393,11 @@ export interface SuperBotFightModeDefinitelyConfiguration { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -450,6 +476,11 @@ export interface SuperBotFightModeDefinitelyConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -497,6 +528,11 @@ export interface SuperBotFightModeLikelyConfiguration { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -574,6 +610,11 @@ export interface SuperBotFightModeLikelyConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -650,6 +691,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Body param: Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -686,6 +732,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Body param: Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -741,6 +792,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled' | 'only_on_ad_pages'; + /** + * Body param: Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ @@ -815,6 +871,11 @@ export declare namespace BotManagementUpdateParams { */ bm_cookie_enabled?: boolean; + /** + * Body param: Specifies the Robots Access Control License variant to use. + */ + cf_robots_variant?: 'off' | 'policy_only'; + /** * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. */ diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index 5afa5cc125..34fcca114b 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -293,7 +293,7 @@ export namespace JsonCreateParams { * Schema for the response format. More information here: * https://developers.cloudflare.com/workers-ai/json-mode/ */ - schema?: { [key: string]: unknown }; + json_schema?: { [key: string]: string | number | boolean | unknown | Array } | null; } /** diff --git a/src/resources/browser-rendering/links.ts b/src/resources/browser-rendering/links.ts index 22ad8e0156..b23485b3ae 100644 --- a/src/resources/browser-rendering/links.ts +++ b/src/resources/browser-rendering/links.ts @@ -102,6 +102,11 @@ export interface LinkCreateParams { */ emulateMediaType?: string; + /** + * Body param: + */ + excludeExternalLinks?: boolean; + /** * Body param: Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/calls/turn.ts b/src/resources/calls/turn.ts index 26b2a1df08..b396738c34 100644 --- a/src/resources/calls/turn.ts +++ b/src/resources/calls/turn.ts @@ -17,7 +17,11 @@ export class TURN extends APIResource { */ create(params: TURNCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/calls/turn_keys`, { body, ...options }); + return ( + this._client.post(`/accounts/${account_id}/calls/turn_keys`, { body, ...options }) as Core.APIPromise<{ + result: TURNCreateResponse; + }> + )._thenUnwrap((obj) => obj.result); } /** diff --git a/src/resources/cloudforce-one/threat-events/crons.ts b/src/resources/cloudforce-one/threat-events/crons.ts index a936094f30..d0d6d1526a 100644 --- a/src/resources/cloudforce-one/threat-events/crons.ts +++ b/src/resources/cloudforce-one/threat-events/crons.ts @@ -1,71 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Crons extends APIResource { - /** - * Reads the last cron update time - * - * @example - * ```ts - * const crons = - * await client.cloudforceOne.threatEvents.crons.list({ - * account_id: 'account_id', - * }); - * ``` - */ - list(params: CronListParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/events/cron`, options); - } - - /** - * Reads the last cron update time - * - * @example - * ```ts - * const response = - * await client.cloudforceOne.threatEvents.crons.edit({ - * account_id: 'account_id', - * }); - * ``` - */ - edit(params: CronEditParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.patch(`/accounts/${account_id}/cloudforce-one/events/cron`, options); - } -} - -export interface CronListResponse { - update: string; -} - -export interface CronEditResponse { - id: number; - - update: string; -} - -export interface CronListParams { - /** - * Account ID. - */ - account_id: string; -} - -export interface CronEditParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace Crons { - export { - type CronListResponse as CronListResponse, - type CronEditResponse as CronEditResponse, - type CronListParams as CronListParams, - type CronEditParams as CronEditParams, - }; -} +export class Crons extends APIResource {} diff --git a/src/resources/cloudforce-one/threat-events/datasets/datasets.ts b/src/resources/cloudforce-one/threat-events/datasets/datasets.ts index 2a67c89304..b622d676cc 100644 --- a/src/resources/cloudforce-one/threat-events/datasets/datasets.ts +++ b/src/resources/cloudforce-one/threat-events/datasets/datasets.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as HealthAPI from './health'; -import { Health, HealthGetParams, HealthGetResponse } from './health'; +import { Health } from './health'; export class Datasets extends APIResource { health: HealthAPI.Health = new HealthAPI.Health(this._client); @@ -240,9 +240,5 @@ export declare namespace Datasets { type DatasetRawParams as DatasetRawParams, }; - export { - Health as Health, - type HealthGetResponse as HealthGetResponse, - type HealthGetParams as HealthGetParams, - }; + export { Health as Health }; } diff --git a/src/resources/cloudforce-one/threat-events/datasets/health.ts b/src/resources/cloudforce-one/threat-events/datasets/health.ts index ba992c67f5..df190ccb6a 100644 --- a/src/resources/cloudforce-one/threat-events/datasets/health.ts +++ b/src/resources/cloudforce-one/threat-events/datasets/health.ts @@ -1,179 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import * as Core from '../../../../core'; -export class Health extends APIResource { - /** - * Benchmark Durable Object warmup - * - * @example - * ```ts - * const health = - * await client.cloudforceOne.threatEvents.datasets.health.get( - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { account_id: 'account_id' }, - * ); - * ``` - */ - get( - datasetId: string, - params: HealthGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return this._client.get( - `/accounts/${account_id}/cloudforce-one/events/dataset/${datasetId}/health`, - options, - ); - } -} - -export interface HealthGetResponse { - properties: HealthGetResponse.Properties; - - type: string; -} - -export namespace HealthGetResponse { - export interface Properties { - durationMs: Properties.DurationMs; - - ok: Properties.Ok; - - shards: Properties.Shards; - - totalShards: Properties.TotalShards; - - totalSizeBytes: Properties.TotalSizeBytes; - - totalSizeMB: Properties.TotalSizeMB; - } - - export namespace Properties { - export interface DurationMs { - type: string; - } - - export interface Ok { - type: string; - } - - export interface Shards { - items: Shards.Items; - - type: string; - } - - export namespace Shards { - export interface Items { - properties: Items.Properties; - - type: string; - } - - export namespace Items { - export interface Properties { - datasetId: Properties.DatasetID; - - date: Properties.Date; - - healthCheckMs: Properties.HealthCheckMs; - - pageCount: Properties.PageCount; - - pageSize: Properties.PageSize; - - sizeBytes: Properties.SizeBytes; - - sizeMB: Properties.SizeMB; - - startupMs: Properties.StartupMs; - - tableStats: Properties.TableStats; - - timedOut: Properties.TimedOut; - - totalMs: Properties.TotalMs; - } - - export namespace Properties { - export interface DatasetID { - type: string; - } - - export interface Date { - type: string; - } - - export interface HealthCheckMs { - type: string; - } - - export interface PageCount { - type: string; - } - - export interface PageSize { - type: string; - } - - export interface SizeBytes { - type: string; - } - - export interface SizeMB { - type: string; - } - - export interface StartupMs { - type: string; - } - - export interface TableStats { - additionalProperties: TableStats.AdditionalProperties; - - type: string; - } - - export namespace TableStats { - export interface AdditionalProperties { - type: string; - } - } - - export interface TimedOut { - type: string; - } - - export interface TotalMs { - type: string; - } - } - } - } - - export interface TotalShards { - type: string; - } - - export interface TotalSizeBytes { - type: string; - } - - export interface TotalSizeMB { - type: string; - } - } -} - -export interface HealthGetParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace Health { - export { type HealthGetResponse as HealthGetResponse, type HealthGetParams as HealthGetParams }; -} +export class Health extends APIResource {} diff --git a/src/resources/cloudforce-one/threat-events/datasets/index.ts b/src/resources/cloudforce-one/threat-events/datasets/index.ts index d340ba91d3..ec7b118e68 100644 --- a/src/resources/cloudforce-one/threat-events/datasets/index.ts +++ b/src/resources/cloudforce-one/threat-events/datasets/index.ts @@ -13,4 +13,4 @@ export { type DatasetGetParams, type DatasetRawParams, } from './datasets'; -export { Health, type HealthGetResponse, type HealthGetParams } from './health'; +export { Health } from './health'; diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 6a36effbdf..02c8bab160 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -15,13 +15,7 @@ export { type CategoryGetParams, } from './categories'; export { Countries, type CountryListResponse, type CountryListParams } from './countries'; -export { - Crons, - type CronListResponse, - type CronEditResponse, - type CronListParams, - type CronEditParams, -} from './crons'; +export { Crons } from './crons'; export { Datasets, type DatasetCreateResponse, diff --git a/src/resources/cloudforce-one/threat-events/tags.ts b/src/resources/cloudforce-one/threat-events/tags.ts index f014fd5f61..06b38f7c8f 100644 --- a/src/resources/cloudforce-one/threat-events/tags.ts +++ b/src/resources/cloudforce-one/threat-events/tags.ts @@ -5,14 +5,14 @@ import * as Core from '../../../core'; export class Tags extends APIResource { /** - * Creates a new tag + * Creates a new tag to be used accross threat events. * * @example * ```ts * const tag = * await client.cloudforceOne.threatEvents.tags.create({ * account_id: 'account_id', - * name: 'name', + * value: 'APT28', * }); * ``` */ @@ -26,9 +26,39 @@ export class Tags extends APIResource { } export interface TagCreateResponse { - name: string; - uuid: string; + + value: string; + + activeDuration?: string; + + actorCategory?: string; + + aliasGroupNames?: Array; + + aliasGroupNamesInternal?: Array; + + analyticPriority?: number; + + attributionConfidence?: string; + + attributionOrganization?: string; + + categoryName?: string; + + externalReferenceLinks?: Array; + + internalDescription?: string; + + motive?: string; + + opsecLevel?: string; + + originCountryISO?: string; + + priority?: number; + + sophisticationLevel?: string; } export interface TagCreateParams { @@ -40,7 +70,82 @@ export interface TagCreateParams { /** * Body param: */ - name: string; + value: string; + + /** + * Body param: + */ + activeDuration?: string; + + /** + * Body param: + */ + actorCategory?: string; + + /** + * Body param: + */ + aliasGroupNames?: Array; + + /** + * Body param: + */ + aliasGroupNamesInternal?: Array; + + /** + * Body param: + */ + analyticPriority?: number; + + /** + * Body param: + */ + attributionConfidence?: string; + + /** + * Body param: + */ + attributionOrganization?: string; + + /** + * Body param: + */ + categoryUuid?: string; + + /** + * Body param: + */ + externalReferenceLinks?: Array; + + /** + * Body param: + */ + internalDescription?: string; + + /** + * Body param: + */ + motive?: string; + + /** + * Body param: + */ + opsecLevel?: string; + + /** + * Body param: + */ + originCountryISO?: string; + + /** + * Body param: + */ + priority?: number; + + /** + * Body param: + */ + sophisticationLevel?: string; } export declare namespace Tags { diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 52e3bbda25..119f0b95d8 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -21,7 +21,7 @@ import { import * as CountriesAPI from './countries'; import { Countries, CountryListParams, CountryListResponse } from './countries'; import * as CronsAPI from './crons'; -import { CronEditParams, CronEditResponse, CronListParams, CronListResponse, Crons } from './crons'; +import { Crons } from './crons'; import * as EventTagsAPI from './event-tags'; import { EventTagCreateParams, @@ -87,6 +87,7 @@ export class ThreatEvents extends APIResource { * category: 'Domain Resolution', * date: '2022-04-01T00:00:00Z', * event: 'An attacker registered the domain domain.com', + * indicatorType: 'domain', * raw: { data: { foo: 'bar' } }, * tlp: 'amber', * }); @@ -164,6 +165,7 @@ export class ThreatEvents extends APIResource { * date: '2022-04-01T00:00:00Z', * event: * 'An attacker registered the domain domain.com', + * indicatorType: 'domain', * raw: { data: { foo: 'bar' } }, * tlp: 'amber', * }, @@ -238,8 +240,12 @@ export interface ThreatEventCreateResponse { event: string; + indicator: string; + indicatorType: string; + indicatorTypeId: number; + killChain: number; mitreAttack: Array; @@ -248,6 +254,8 @@ export interface ThreatEventCreateResponse { numReferences: number; + rawId: string; + referenced: Array; referencedIds: Array; @@ -267,6 +275,8 @@ export interface ThreatEventCreateResponse { uuid: string; insight?: string; + + releasabilityId?: string; } export type ThreatEventListResponse = Array; @@ -283,8 +293,12 @@ export namespace ThreatEventListResponse { event: string; + indicator: string; + indicatorType: string; + indicatorTypeId: number; + killChain: number; mitreAttack: Array; @@ -293,6 +307,8 @@ export namespace ThreatEventListResponse { numReferences: number; + rawId: string; + referenced: Array; referencedIds: Array; @@ -312,6 +328,8 @@ export namespace ThreatEventListResponse { uuid: string; insight?: string; + + releasabilityId?: string; } } @@ -335,8 +353,12 @@ export interface ThreatEventEditResponse { event: string; + indicator: string; + indicatorType: string; + indicatorTypeId: number; + killChain: number; mitreAttack: Array; @@ -345,6 +367,8 @@ export interface ThreatEventEditResponse { numReferences: number; + rawId: string; + referenced: Array; referencedIds: Array; @@ -364,6 +388,8 @@ export interface ThreatEventEditResponse { uuid: string; insight?: string; + + releasabilityId?: string; } export interface ThreatEventGetResponse { @@ -377,8 +403,12 @@ export interface ThreatEventGetResponse { event: string; + indicator: string; + indicatorType: string; + indicatorTypeId: number; + killChain: number; mitreAttack: Array; @@ -387,6 +417,8 @@ export interface ThreatEventGetResponse { numReferences: number; + rawId: string; + referenced: Array; referencedIds: Array; @@ -406,6 +438,8 @@ export interface ThreatEventGetResponse { uuid: string; insight?: string; + + releasabilityId?: string; } export interface ThreatEventCreateParams { @@ -429,6 +463,11 @@ export interface ThreatEventCreateParams { */ event: string; + /** + * Body param: + */ + indicatorType: string; + /** * Body param: */ @@ -467,7 +506,7 @@ export interface ThreatEventCreateParams { /** * Body param: */ - indicatorType?: string; + insight?: string; /** * Body param: @@ -591,6 +630,8 @@ export namespace ThreatEventBulkCreateParams { event: string; + indicatorType: string; + raw: Data.Raw; tlp: string; @@ -605,7 +646,7 @@ export namespace ThreatEventBulkCreateParams { indicator?: string; - indicatorType?: string; + insight?: string; tags?: Array; @@ -764,13 +805,7 @@ export declare namespace ThreatEvents { type CountryListParams as CountryListParams, }; - export { - Crons as Crons, - type CronListResponse as CronListResponse, - type CronEditResponse as CronEditResponse, - type CronListParams as CronListParams, - type CronEditParams as CronEditParams, - }; + export { Crons as Crons }; export { Datasets as Datasets, diff --git a/src/resources/dns-firewall/dns-firewall.ts b/src/resources/dns-firewall/dns-firewall.ts index 744c9101f2..b71c825e34 100644 --- a/src/resources/dns-firewall/dns-firewall.ts +++ b/src/resources/dns-firewall/dns-firewall.ts @@ -214,16 +214,30 @@ export interface DNSFirewallCreateResponse { ecs_fallback: boolean; /** - * Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Higher TTLs will be - * decreased to the maximum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets an upper bound on + * this duration. For caching purposes, higher TTLs will be decreased to the + * maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl: number; /** - * Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Lower TTLs will be - * increased to the minimum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets a lower bound on + * this duration. For caching purposes, lower TTLs will be increased to the minimum + * value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl: number; @@ -238,8 +252,12 @@ export interface DNSFirewallCreateResponse { name: string; /** - * Negative DNS cache TTL This setting controls how long DNS Firewall should cache - * negative responses (e.g., NXDOMAIN) from the upstream servers. + * This setting controls how long DNS Firewall should cache negative responses + * (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl: number | null; @@ -282,16 +300,30 @@ export interface DNSFirewallListResponse { ecs_fallback: boolean; /** - * Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Higher TTLs will be - * decreased to the maximum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets an upper bound on + * this duration. For caching purposes, higher TTLs will be decreased to the + * maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl: number; /** - * Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Lower TTLs will be - * increased to the minimum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets a lower bound on + * this duration. For caching purposes, lower TTLs will be increased to the minimum + * value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl: number; @@ -306,8 +338,12 @@ export interface DNSFirewallListResponse { name: string; /** - * Negative DNS cache TTL This setting controls how long DNS Firewall should cache - * negative responses (e.g., NXDOMAIN) from the upstream servers. + * This setting controls how long DNS Firewall should cache negative responses + * (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl: number | null; @@ -357,16 +393,30 @@ export interface DNSFirewallEditResponse { ecs_fallback: boolean; /** - * Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Higher TTLs will be - * decreased to the maximum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets an upper bound on + * this duration. For caching purposes, higher TTLs will be decreased to the + * maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl: number; /** - * Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Lower TTLs will be - * increased to the minimum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets a lower bound on + * this duration. For caching purposes, lower TTLs will be increased to the minimum + * value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl: number; @@ -381,8 +431,12 @@ export interface DNSFirewallEditResponse { name: string; /** - * Negative DNS cache TTL This setting controls how long DNS Firewall should cache - * negative responses (e.g., NXDOMAIN) from the upstream servers. + * This setting controls how long DNS Firewall should cache negative responses + * (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl: number | null; @@ -425,16 +479,30 @@ export interface DNSFirewallGetResponse { ecs_fallback: boolean; /** - * Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Higher TTLs will be - * decreased to the maximum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets an upper bound on + * this duration. For caching purposes, higher TTLs will be decreased to the + * maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl: number; /** - * Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs for purposes - * of caching between DNS Firewall and the upstream servers. Lower TTLs will be - * increased to the minimum defined here for caching purposes. + * By default, Cloudflare attempts to cache responses for as long as indicated by + * the TTL received from upstream nameservers. This setting sets a lower bound on + * this duration. For caching purposes, lower TTLs will be increased to the minimum + * value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl: number; @@ -449,8 +517,12 @@ export interface DNSFirewallGetResponse { name: string; /** - * Negative DNS cache TTL This setting controls how long DNS Firewall should cache - * negative responses (e.g., NXDOMAIN) from the upstream servers. + * This setting controls how long DNS Firewall should cache negative responses + * (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl: number | null; @@ -507,22 +579,40 @@ export interface DNSFirewallCreateParams { ecs_fallback?: boolean; /** - * Body param: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs - * for purposes of caching between DNS Firewall and the upstream servers. Higher - * TTLs will be decreased to the maximum defined here for caching purposes. + * Body param: By default, Cloudflare attempts to cache responses for as long as + * indicated by the TTL received from upstream nameservers. This setting sets an + * upper bound on this duration. For caching purposes, higher TTLs will be + * decreased to the maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl?: number; /** - * Body param: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs - * for purposes of caching between DNS Firewall and the upstream servers. Lower - * TTLs will be increased to the minimum defined here for caching purposes. + * Body param: By default, Cloudflare attempts to cache responses for as long as + * indicated by the TTL received from upstream nameservers. This setting sets a + * lower bound on this duration. For caching purposes, lower TTLs will be increased + * to the minimum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl?: number; /** - * Body param: Negative DNS cache TTL This setting controls how long DNS Firewall - * should cache negative responses (e.g., NXDOMAIN) from the upstream servers. + * Body param: This setting controls how long DNS Firewall should cache negative + * responses (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl?: number | null; @@ -576,16 +666,30 @@ export interface DNSFirewallEditParams { ecs_fallback?: boolean; /** - * Body param: Maximum DNS cache TTL This setting sets an upper bound on DNS TTLs - * for purposes of caching between DNS Firewall and the upstream servers. Higher - * TTLs will be decreased to the maximum defined here for caching purposes. + * Body param: By default, Cloudflare attempts to cache responses for as long as + * indicated by the TTL received from upstream nameservers. This setting sets an + * upper bound on this duration. For caching purposes, higher TTLs will be + * decreased to the maximum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ maximum_cache_ttl?: number; /** - * Body param: Minimum DNS cache TTL This setting sets a lower bound on DNS TTLs - * for purposes of caching between DNS Firewall and the upstream servers. Lower - * TTLs will be increased to the minimum defined here for caching purposes. + * Body param: By default, Cloudflare attempts to cache responses for as long as + * indicated by the TTL received from upstream nameservers. This setting sets a + * lower bound on this duration. For caching purposes, lower TTLs will be increased + * to the minimum value defined by this setting. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. + * + * Note that, even with this setting, there is no guarantee that a response will be + * cached for at least the specified duration. Cached responses may be removed + * earlier for capacity or other operational reasons. */ minimum_cache_ttl?: number; @@ -595,8 +699,12 @@ export interface DNSFirewallEditParams { name?: string; /** - * Body param: Negative DNS cache TTL This setting controls how long DNS Firewall - * should cache negative responses (e.g., NXDOMAIN) from the upstream servers. + * Body param: This setting controls how long DNS Firewall should cache negative + * responses (e.g., NXDOMAIN) from the upstream servers. + * + * This setting does not affect the TTL value in the DNS response Cloudflare + * returns to clients. Cloudflare will always forward the TTL value received from + * upstream nameservers. */ negative_cache_ttl?: number | null; diff --git a/src/resources/dns/dns.ts b/src/resources/dns/dns.ts index a3cbe1362e..9effbf50fa 100644 --- a/src/resources/dns/dns.ts +++ b/src/resources/dns/dns.ts @@ -41,9 +41,15 @@ import { RecordImportResponse, RecordListParams, RecordResponse, + RecordResponsesSinglePage, RecordResponsesV4PagePaginationArray, + RecordScanListParams, RecordScanParams, RecordScanResponse, + RecordScanReviewParams, + RecordScanReviewResponse, + RecordScanTriggerParams, + RecordScanTriggerResponse, RecordTags, RecordUpdateParams, Records, @@ -59,7 +65,7 @@ import { import * as AnalyticsAPI from './analytics/analytics'; import { Analytics } from './analytics/analytics'; import * as SettingsAPI from './settings/settings'; -import { DNSSetting, Settings } from './settings/settings'; +import { Settings } from './settings/settings'; import * as ZoneTransfersAPI from './zone-transfers/zone-transfers'; import { ZoneTransfers } from './zone-transfers/zone-transfers'; @@ -74,6 +80,7 @@ export class DNS extends APIResource { DNS.DNSSECResource = DNSSECResource; DNS.Records = Records; DNS.RecordResponsesV4PagePaginationArray = RecordResponsesV4PagePaginationArray; +DNS.RecordResponsesSinglePage = RecordResponsesSinglePage; DNS.Settings = Settings; DNS.Analytics = Analytics; DNS.ZoneTransfers = ZoneTransfers; @@ -121,7 +128,10 @@ export declare namespace DNS { type RecordExportResponse as RecordExportResponse, type RecordImportResponse as RecordImportResponse, type RecordScanResponse as RecordScanResponse, + type RecordScanReviewResponse as RecordScanReviewResponse, + type RecordScanTriggerResponse as RecordScanTriggerResponse, RecordResponsesV4PagePaginationArray as RecordResponsesV4PagePaginationArray, + RecordResponsesSinglePage as RecordResponsesSinglePage, type RecordCreateParams as RecordCreateParams, type RecordUpdateParams as RecordUpdateParams, type RecordListParams as RecordListParams, @@ -132,9 +142,12 @@ export declare namespace DNS { type RecordGetParams as RecordGetParams, type RecordImportParams as RecordImportParams, type RecordScanParams as RecordScanParams, + type RecordScanListParams as RecordScanListParams, + type RecordScanReviewParams as RecordScanReviewParams, + type RecordScanTriggerParams as RecordScanTriggerParams, }; - export { Settings as Settings, type DNSSetting as DNSSetting }; + export { Settings as Settings }; export { Analytics as Analytics }; diff --git a/src/resources/dns/index.ts b/src/resources/dns/index.ts index 2f757b2315..d284f88926 100644 --- a/src/resources/dns/index.ts +++ b/src/resources/dns/index.ts @@ -12,6 +12,7 @@ export { } from './dnssec'; export { RecordResponsesV4PagePaginationArray, + RecordResponsesSinglePage, Records, type ARecord, type AAAARecord, @@ -44,6 +45,8 @@ export { type RecordExportResponse, type RecordImportResponse, type RecordScanResponse, + type RecordScanReviewResponse, + type RecordScanTriggerResponse, type RecordCreateParams, type RecordUpdateParams, type RecordListParams, @@ -54,6 +57,9 @@ export { type RecordGetParams, type RecordImportParams, type RecordScanParams, + type RecordScanListParams, + type RecordScanReviewParams, + type RecordScanTriggerParams, } from './records'; -export { Settings, type DNSSetting } from './settings/index'; +export { Settings } from './settings/index'; export { ZoneTransfers } from './zone-transfers/index'; diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index e430b9af32..0a09cf3cb4 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as RecordsAPI from './records'; import * as Shared from '../shared'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; export class Records extends APIResource { /** @@ -273,13 +273,7 @@ export class Records extends APIResource { * Scan for common DNS records on your domain and automatically add them to your * zone. Useful if you haven't updated your nameservers yet. * - * @example - * ```ts - * const response = await client.dns.records.scan({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: {}, - * }); - * ``` + * @deprecated This endpoint is deprecated in favor of a new asynchronous version. Please use the [/scan/trigger](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/trigger) and [/scan/review](https://developers.cloudflare.com/api/resources/dns/subresources/records/methods/scan/review) endpoints instead. */ scan(params: RecordScanParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, body } = params; @@ -289,10 +283,86 @@ export class Records extends APIResource { }> )._thenUnwrap((obj) => obj.result); } + + /** + * Retrieves the list of DNS records discovered up to this point by the + * asynchronous scan. These records are temporary until explicitly accepted or + * rejected via `POST /scan/review`. Additional records may be discovered by the + * scan later. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const recordResponse of client.dns.records.scanList( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + scanList( + params: RecordScanListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { zone_id } = params; + return this._client.getAPIList( + `/zones/${zone_id}/dns_records/scan/review`, + RecordResponsesSinglePage, + options, + ); + } + + /** + * Accept or reject DNS records found by the DNS records scan. Accepted records + * will be permanently added to the zone, while rejected records will be + * permanently deleted. + * + * @example + * ```ts + * const response = await client.dns.records.scanReview({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + scanReview( + params: RecordScanReviewParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/dns_records/scan/review`, { + body, + ...options, + }) as Core.APIPromise<{ result: RecordScanReviewResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Initiates an asynchronous scan for common DNS records on your domain. Note that + * this **does not** automatically add records to your zone. The scan runs in the + * background, and results can be reviewed later using the `/scan/review` + * endpoints. Useful if you haven't updated your nameservers yet. + * + * @example + * ```ts + * const response = await client.dns.records.scanTrigger({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + scanTrigger( + params: RecordScanTriggerParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return this._client.post(`/zones/${zone_id}/dns_records/scan/trigger`, options); + } } export class RecordResponsesV4PagePaginationArray extends V4PagePaginationArray {} +export class RecordResponsesSinglePage extends SinglePage {} + export interface ARecord { /** * Complete DNS record name, including the zone name, in Punycode. @@ -5852,6 +5922,57 @@ export interface RecordScanResponse { total_records_parsed?: number; } +export interface RecordScanReviewResponse { + accepts?: Array; + + rejects?: Array; +} + +export interface RecordScanTriggerResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace RecordScanTriggerResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} + export type RecordCreateParams = | RecordCreateParams.ARecord | RecordCreateParams.AAAARecord @@ -12166,7 +12287,139 @@ export interface RecordScanParams { body: unknown; } +export interface RecordScanListParams { + /** + * Identifier. + */ + zone_id: string; +} + +export interface RecordScanReviewParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: + */ + accepts?: Array< + | ARecordParam + | AAAARecordParam + | CNAMERecordParam + | MXRecordParam + | NSRecordParam + | RecordScanReviewParams.DNSRecordsOpenpgpkeyRecord + | PTRRecordParam + | TXTRecordParam + | CAARecordParam + | CERTRecordParam + | DNSKEYRecordParam + | DSRecordParam + | HTTPSRecordParam + | LOCRecordParam + | NAPTRRecordParam + | SMIMEARecordParam + | SRVRecordParam + | SSHFPRecordParam + | SVCBRecordParam + | TLSARecordParam + | URIRecordParam + >; + + /** + * Body param: + */ + rejects?: Array; +} + +export namespace RecordScanReviewParams { + export interface DNSRecordsOpenpgpkeyRecord { + /** + * Complete DNS record name, including the zone name, in Punycode. + */ + 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. + */ + type: 'OPENPGPKEY'; + + /** + * Comments or notes about the DNS record. This field has no effect on DNS + * responses. + */ + comment?: string; + + /** + * A single Base64-encoded OpenPGP Transferable Public Key (RFC 4880 Section 11.1) + */ + content?: string; + + /** + * Whether the record is receiving the performance and security benefits of + * Cloudflare. + */ + proxied?: boolean; + + /** + * Settings for the DNS record. + */ + settings?: DNSRecordsOpenpgpkeyRecord.Settings; + + /** + * Custom tags for the DNS record. This field has no effect on DNS responses. + */ + tags?: Array; + } + + export namespace DNSRecordsOpenpgpkeyRecord { + /** + * Settings for the DNS record. + */ + export interface Settings { + /** + * When enabled, only A records will be generated, and AAAA records will not be + * created. This setting is intended for exceptional cases. Note that this option + * only applies to proxied records and it has no effect on whether Cloudflare + * communicates with the origin using IPv4 or IPv6. + */ + ipv4_only?: boolean; + + /** + * When enabled, only AAAA records will be generated, and A records will not be + * created. This setting is intended for exceptional cases. Note that this option + * only applies to proxied records and it has no effect on whether Cloudflare + * communicates with the origin using IPv4 or IPv6. + */ + ipv6_only?: boolean; + } + } + + export interface Reject { + /** + * Identifier. + */ + id: string; + } +} + +export interface RecordScanTriggerParams { + /** + * Identifier. + */ + zone_id: string; +} + Records.RecordResponsesV4PagePaginationArray = RecordResponsesV4PagePaginationArray; +Records.RecordResponsesSinglePage = RecordResponsesSinglePage; export declare namespace Records { export { @@ -12201,7 +12454,10 @@ export declare namespace Records { type RecordExportResponse as RecordExportResponse, type RecordImportResponse as RecordImportResponse, type RecordScanResponse as RecordScanResponse, + type RecordScanReviewResponse as RecordScanReviewResponse, + type RecordScanTriggerResponse as RecordScanTriggerResponse, RecordResponsesV4PagePaginationArray as RecordResponsesV4PagePaginationArray, + RecordResponsesSinglePage as RecordResponsesSinglePage, type RecordCreateParams as RecordCreateParams, type RecordUpdateParams as RecordUpdateParams, type RecordListParams as RecordListParams, @@ -12212,5 +12468,8 @@ export declare namespace Records { type RecordGetParams as RecordGetParams, type RecordImportParams as RecordImportParams, type RecordScanParams as RecordScanParams, + type RecordScanListParams as RecordScanListParams, + type RecordScanReviewParams as RecordScanReviewParams, + type RecordScanTriggerParams as RecordScanTriggerParams, }; } diff --git a/src/resources/dns/settings/account/account.ts b/src/resources/dns/settings/account/account.ts index 41c7c2d909..9c46a00f70 100644 --- a/src/resources/dns/settings/account/account.ts +++ b/src/resources/dns/settings/account/account.ts @@ -61,7 +61,7 @@ export class Account extends APIResource { } export interface AccountEditResponse { - zone_defaults?: AccountEditResponse.ZoneDefaults; + zone_defaults: AccountEditResponse.ZoneDefaults; } export namespace AccountEditResponse { @@ -70,50 +70,50 @@ export namespace AccountEditResponse { * Whether to flatten all CNAME records in the zone. Note that, due to DNS * limitations, a CNAME record at the zone apex will always be flattened. */ - flatten_all_cnames?: boolean; + flatten_all_cnames: boolean; /** * Whether to enable Foundation DNS Advanced Nameservers on the zone. */ - foundation_dns?: boolean; + foundation_dns: boolean; /** * Settings for this internal zone. */ - internal_dns?: ZoneDefaults.InternalDNS; + internal_dns: ZoneDefaults.InternalDNS; /** * Whether to enable multi-provider DNS, which causes Cloudflare to activate the * zone even when non-Cloudflare NS records exist, and to respect NS records at the * zone apex during outbound zone transfers. */ - multi_provider?: boolean; + multi_provider: boolean; /** * Settings determining the nameservers through which the zone should be available. */ - nameservers?: ZoneDefaults.Nameservers; + nameservers: ZoneDefaults.Nameservers; /** * The time to live (TTL) of the zone's nameserver (NS) records. */ - ns_ttl?: number; + ns_ttl: number; /** * Allows a Secondary DNS zone to use (proxied) override records and CNAME * flattening at the zone apex. */ - secondary_overrides?: boolean; + secondary_overrides: boolean; /** * Components of the zone's SOA record. */ - soa?: ZoneDefaults.SOA; + soa: ZoneDefaults.SOA; /** * Whether the zone mode is a regular or CDN/DNS only zone. */ - zone_mode?: 'standard' | 'cdn_only' | 'dns_only'; + zone_mode: 'standard' | 'cdn_only' | 'dns_only'; } export namespace ZoneDefaults { @@ -145,46 +145,47 @@ export namespace AccountEditResponse { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } } export interface AccountGetResponse { - zone_defaults?: AccountGetResponse.ZoneDefaults; + zone_defaults: AccountGetResponse.ZoneDefaults; } export namespace AccountGetResponse { @@ -193,50 +194,50 @@ export namespace AccountGetResponse { * Whether to flatten all CNAME records in the zone. Note that, due to DNS * limitations, a CNAME record at the zone apex will always be flattened. */ - flatten_all_cnames?: boolean; + flatten_all_cnames: boolean; /** * Whether to enable Foundation DNS Advanced Nameservers on the zone. */ - foundation_dns?: boolean; + foundation_dns: boolean; /** * Settings for this internal zone. */ - internal_dns?: ZoneDefaults.InternalDNS; + internal_dns: ZoneDefaults.InternalDNS; /** * Whether to enable multi-provider DNS, which causes Cloudflare to activate the * zone even when non-Cloudflare NS records exist, and to respect NS records at the * zone apex during outbound zone transfers. */ - multi_provider?: boolean; + multi_provider: boolean; /** * Settings determining the nameservers through which the zone should be available. */ - nameservers?: ZoneDefaults.Nameservers; + nameservers: ZoneDefaults.Nameservers; /** * The time to live (TTL) of the zone's nameserver (NS) records. */ - ns_ttl?: number; + ns_ttl: number; /** * Allows a Secondary DNS zone to use (proxied) override records and CNAME * flattening at the zone apex. */ - secondary_overrides?: boolean; + secondary_overrides: boolean; /** * Components of the zone's SOA record. */ - soa?: ZoneDefaults.SOA; + soa: ZoneDefaults.SOA; /** * Whether the zone mode is a regular or CDN/DNS only zone. */ - zone_mode?: 'standard' | 'cdn_only' | 'dns_only'; + zone_mode: 'standard' | 'cdn_only' | 'dns_only'; } export namespace ZoneDefaults { @@ -268,40 +269,41 @@ export namespace AccountGetResponse { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } } @@ -388,7 +390,7 @@ export namespace AccountEditParams { /** * Nameserver type */ - type: 'cloudflare.standard' | 'cloudflare.standard.random' | 'custom.account' | 'custom.tenant'; + type?: 'cloudflare.standard' | 'cloudflare.standard.random' | 'custom.account' | 'custom.tenant'; } /** @@ -399,40 +401,41 @@ export namespace AccountEditParams { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } } diff --git a/src/resources/dns/settings/index.ts b/src/resources/dns/settings/index.ts index db85c0804d..dd4f8f0713 100644 --- a/src/resources/dns/settings/index.ts +++ b/src/resources/dns/settings/index.ts @@ -7,7 +7,7 @@ export { type AccountEditParams, type AccountGetParams, } from './account/index'; -export { Settings, type DNSSetting } from './settings'; +export { Settings } from './settings'; export { Zone, type ZoneEditResponse, diff --git a/src/resources/dns/settings/settings.ts b/src/resources/dns/settings/settings.ts index f01f70088c..307c5b8287 100644 --- a/src/resources/dns/settings/settings.ts +++ b/src/resources/dns/settings/settings.ts @@ -17,114 +17,10 @@ export class Settings extends APIResource { account: AccountAPI.Account = new AccountAPI.Account(this._client); } -export interface DNSSetting { - /** - * Whether to flatten all CNAME records in the zone. Note that, due to DNS - * limitations, a CNAME record at the zone apex will always be flattened. - */ - flatten_all_cnames?: boolean; - - /** - * Whether to enable Foundation DNS Advanced Nameservers on the zone. - */ - foundation_dns?: boolean; - - /** - * Settings for this internal zone. - */ - internal_dns?: DNSSetting.InternalDNS; - - /** - * Whether to enable multi-provider DNS, which causes Cloudflare to activate the - * zone even when non-Cloudflare NS records exist, and to respect NS records at the - * zone apex during outbound zone transfers. - */ - multi_provider?: boolean; - - /** - * The time to live (TTL) of the zone's nameserver (NS) records. - */ - ns_ttl?: number; - - /** - * Allows a Secondary DNS zone to use (proxied) override records and CNAME - * flattening at the zone apex. - */ - secondary_overrides?: boolean; - - /** - * Components of the zone's SOA record. - */ - soa?: DNSSetting.SOA; - - /** - * Whether the zone mode is a regular or CDN/DNS only zone. - */ - zone_mode?: 'standard' | 'cdn_only' | 'dns_only'; -} - -export namespace DNSSetting { - /** - * Settings for this internal zone. - */ - export interface InternalDNS { - /** - * The ID of the zone to fallback to. - */ - reference_zone_id?: string; - } - - /** - * Components of the zone's SOA record. - */ - export interface SOA { - /** - * Time in seconds of being unable to query the primary server after which - * secondary servers should stop serving the zone. - */ - expire: number; - - /** - * The time to live (TTL) for negative caching of records within the zone. - */ - min_ttl: number; - - /** - * The primary nameserver, which may be used for outbound zone transfers. - */ - mname: string; - - /** - * Time in seconds after which secondary servers should re-check the SOA record to - * see if the zone has been updated. - */ - refresh: number; - - /** - * Time in seconds after which secondary servers should retry queries after the - * primary server was unresponsive. - */ - retry: number; - - /** - * The email address of the zone administrator, with the first label representing - * the local part of the email address. - */ - rname: string; - - /** - * The time to live (TTL) of the SOA record itself. - */ - ttl: number; - } -} - Settings.Zone = Zone; Settings.Account = Account; export declare namespace Settings { - export { type DNSSetting as DNSSetting }; - export { Zone as Zone, type ZoneEditResponse as ZoneEditResponse, diff --git a/src/resources/dns/settings/zone.ts b/src/resources/dns/settings/zone.ts index 1e9b2f665e..8e8013f0ba 100644 --- a/src/resources/dns/settings/zone.ts +++ b/src/resources/dns/settings/zone.ts @@ -48,50 +48,50 @@ export interface ZoneEditResponse { * Whether to flatten all CNAME records in the zone. Note that, due to DNS * limitations, a CNAME record at the zone apex will always be flattened. */ - flatten_all_cnames?: boolean; + flatten_all_cnames: boolean; /** * Whether to enable Foundation DNS Advanced Nameservers on the zone. */ - foundation_dns?: boolean; + foundation_dns: boolean; /** * Settings for this internal zone. */ - internal_dns?: ZoneEditResponse.InternalDNS; + internal_dns: ZoneEditResponse.InternalDNS; /** * Whether to enable multi-provider DNS, which causes Cloudflare to activate the * zone even when non-Cloudflare NS records exist, and to respect NS records at the * zone apex during outbound zone transfers. */ - multi_provider?: boolean; + multi_provider: boolean; /** * Settings determining the nameservers through which the zone should be available. */ - nameservers?: ZoneEditResponse.Nameservers; + nameservers: ZoneEditResponse.Nameservers; /** * The time to live (TTL) of the zone's nameserver (NS) records. */ - ns_ttl?: number; + ns_ttl: number; /** * Allows a Secondary DNS zone to use (proxied) override records and CNAME * flattening at the zone apex. */ - secondary_overrides?: boolean; + secondary_overrides: boolean; /** * Components of the zone's SOA record. */ - soa?: ZoneEditResponse.SOA; + soa: ZoneEditResponse.SOA; /** * Whether the zone mode is a regular or CDN/DNS only zone. */ - zone_mode?: 'standard' | 'cdn_only' | 'dns_only'; + zone_mode: 'standard' | 'cdn_only' | 'dns_only'; } export namespace ZoneEditResponse { @@ -128,40 +128,41 @@ export namespace ZoneEditResponse { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } @@ -170,50 +171,50 @@ export interface ZoneGetResponse { * Whether to flatten all CNAME records in the zone. Note that, due to DNS * limitations, a CNAME record at the zone apex will always be flattened. */ - flatten_all_cnames?: boolean; + flatten_all_cnames: boolean; /** * Whether to enable Foundation DNS Advanced Nameservers on the zone. */ - foundation_dns?: boolean; + foundation_dns: boolean; /** * Settings for this internal zone. */ - internal_dns?: ZoneGetResponse.InternalDNS; + internal_dns: ZoneGetResponse.InternalDNS; /** * Whether to enable multi-provider DNS, which causes Cloudflare to activate the * zone even when non-Cloudflare NS records exist, and to respect NS records at the * zone apex during outbound zone transfers. */ - multi_provider?: boolean; + multi_provider: boolean; /** * Settings determining the nameservers through which the zone should be available. */ - nameservers?: ZoneGetResponse.Nameservers; + nameservers: ZoneGetResponse.Nameservers; /** * The time to live (TTL) of the zone's nameserver (NS) records. */ - ns_ttl?: number; + ns_ttl: number; /** * Allows a Secondary DNS zone to use (proxied) override records and CNAME * flattening at the zone apex. */ - secondary_overrides?: boolean; + secondary_overrides: boolean; /** * Components of the zone's SOA record. */ - soa?: ZoneGetResponse.SOA; + soa: ZoneGetResponse.SOA; /** * Whether the zone mode is a regular or CDN/DNS only zone. */ - zone_mode?: 'standard' | 'cdn_only' | 'dns_only'; + zone_mode: 'standard' | 'cdn_only' | 'dns_only'; } export namespace ZoneGetResponse { @@ -250,40 +251,41 @@ export namespace ZoneGetResponse { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } @@ -360,14 +362,14 @@ export namespace ZoneEditParams { */ export interface Nameservers { /** - * Nameserver type + * Configured nameserver set to be used for this zone */ - type: 'cloudflare.standard' | 'custom.account' | 'custom.tenant' | 'custom.zone'; + ns_set?: number; /** - * Configured nameserver set to be used for this zone + * Nameserver type */ - ns_set?: number; + type?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant' | 'custom.zone'; } /** @@ -378,40 +380,41 @@ export namespace ZoneEditParams { * Time in seconds of being unable to query the primary server after which * secondary servers should stop serving the zone. */ - expire: number; + expire?: number; /** * The time to live (TTL) for negative caching of records within the zone. */ - min_ttl: number; + min_ttl?: number; /** - * The primary nameserver, which may be used for outbound zone transfers. + * The primary nameserver, which may be used for outbound zone transfers. If null, + * a Cloudflare-assigned value will be used. */ - mname: string; + mname?: string | null; /** * Time in seconds after which secondary servers should re-check the SOA record to * see if the zone has been updated. */ - refresh: number; + refresh?: number; /** * Time in seconds after which secondary servers should retry queries after the * primary server was unresponsive. */ - retry: number; + retry?: number; /** * The email address of the zone administrator, with the first label representing * the local part of the email address. */ - rname: string; + rname?: string; /** * The time to live (TTL) of the SOA record itself. */ - ttl: number; + ttl?: number; } } diff --git a/src/resources/email-routing/dns.ts b/src/resources/email-routing/dns.ts index 00465efb06..13ba0729f5 100644 --- a/src/resources/email-routing/dns.ts +++ b/src/resources/email-routing/dns.ts @@ -14,7 +14,6 @@ export class DNS extends APIResource { * ```ts * const settings = await client.emailRouting.dns.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'example.net', * }); * ``` */ @@ -59,7 +58,6 @@ export class DNS extends APIResource { * ```ts * const settings = await client.emailRouting.dns.edit({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * name: 'example.net', * }); * ``` */ @@ -314,7 +312,7 @@ export interface DNSCreateParams { /** * Body param: Domain of your zone. */ - name: string; + name?: string; } export interface DNSDeleteParams { @@ -333,7 +331,7 @@ export interface DNSEditParams { /** * Body param: Domain of your zone. */ - name: string; + name?: string; } export interface DNSGetParams { diff --git a/src/resources/email-security/settings/domains.ts b/src/resources/email-security/settings/domains.ts index 63e57cd641..3f39ad82d4 100644 --- a/src/resources/email-security/settings/domains.ts +++ b/src/resources/email-security/settings/domains.ts @@ -173,6 +173,8 @@ export interface DomainListResponse { authorization?: DomainListResponse.Authorization | null; + dmarc_status?: 'none' | 'good' | 'invalid' | null; + emails_processed?: DomainListResponse.EmailsProcessed | null; folder?: 'AllItems' | 'Inbox' | null; @@ -186,6 +188,8 @@ export interface DomainListResponse { require_tls_inbound?: boolean | null; require_tls_outbound?: boolean | null; + + spf_status?: 'none' | 'good' | 'neutral' | 'open' | 'invalid' | null; } export namespace DomainListResponse { @@ -257,6 +261,8 @@ export interface DomainEditResponse { authorization?: DomainEditResponse.Authorization | null; + dmarc_status?: 'none' | 'good' | 'invalid' | null; + emails_processed?: DomainEditResponse.EmailsProcessed | null; folder?: 'AllItems' | 'Inbox' | null; @@ -270,6 +276,8 @@ export interface DomainEditResponse { require_tls_inbound?: boolean | null; require_tls_outbound?: boolean | null; + + spf_status?: 'none' | 'good' | 'neutral' | 'open' | 'invalid' | null; } export namespace DomainEditResponse { @@ -327,6 +335,8 @@ export interface DomainGetResponse { authorization?: DomainGetResponse.Authorization | null; + dmarc_status?: 'none' | 'good' | 'invalid' | null; + emails_processed?: DomainGetResponse.EmailsProcessed | null; folder?: 'AllItems' | 'Inbox' | null; @@ -340,6 +350,8 @@ export interface DomainGetResponse { require_tls_inbound?: boolean | null; require_tls_outbound?: boolean | null; + + spf_status?: 'none' | 'good' | 'neutral' | 'open' | 'invalid' | null; } export namespace DomainGetResponse { diff --git a/src/resources/images/v1/stats.ts b/src/resources/images/v1/stats.ts index 5b76877ddd..b9a10e4576 100644 --- a/src/resources/images/v1/stats.ts +++ b/src/resources/images/v1/stats.ts @@ -5,7 +5,9 @@ import * as Core from '../../../core'; export class Stats extends APIResource { /** - * Fetch usage statistics details for Cloudflare Images. + * Fetch image statistics details for Cloudflare Images. The returned statistics + * detail storage usage, including the current image count vs this account's + * allowance. * * @example * ```ts diff --git a/src/resources/intel/indicator-feeds/downloads.ts b/src/resources/intel/indicator-feeds/downloads.ts index 8bb4aad61e..50312d8580 100644 --- a/src/resources/intel/indicator-feeds/downloads.ts +++ b/src/resources/intel/indicator-feeds/downloads.ts @@ -1,59 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Downloads extends APIResource { - /** - * Download indicator feed data - * - * @example - * ```ts - * const download = - * await client.intel.indicatorFeeds.downloads.get(12, { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - feedId: number, - params: DownloadGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/intel/indicator_feeds/${feedId}/download`, - options, - ) as Core.APIPromise<{ result: DownloadGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface DownloadGetResponse { - /** - * Feed id - */ - file_id?: number; - - /** - * Name of the file unified in our system - */ - filename?: string; - - /** - * Current status of upload, should be unified - */ - status?: string; -} - -export interface DownloadGetParams { - /** - * Identifier - */ - account_id: string; -} - -export declare namespace Downloads { - export { type DownloadGetResponse as DownloadGetResponse, type DownloadGetParams as DownloadGetParams }; -} +export class Downloads extends APIResource {} diff --git a/src/resources/intel/indicator-feeds/index.ts b/src/resources/intel/indicator-feeds/index.ts index c9f2ee64de..d443b5d668 100644 --- a/src/resources/intel/indicator-feeds/index.ts +++ b/src/resources/intel/indicator-feeds/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Downloads, type DownloadGetResponse, type DownloadGetParams } from './downloads'; +export { Downloads } from './downloads'; export { IndicatorFeedListResponsesSinglePage, IndicatorFeeds, diff --git a/src/resources/intel/indicator-feeds/indicator-feeds.ts b/src/resources/intel/indicator-feeds/indicator-feeds.ts index 7948c01280..8b9a97f8cf 100644 --- a/src/resources/intel/indicator-feeds/indicator-feeds.ts +++ b/src/resources/intel/indicator-feeds/indicator-feeds.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as DownloadsAPI from './downloads'; -import { DownloadGetParams, DownloadGetResponse, Downloads } from './downloads'; +import { Downloads } from './downloads'; import * as PermissionsAPI from './permissions'; import { PermissionCreateParams, @@ -439,9 +439,5 @@ export declare namespace IndicatorFeeds { type PermissionDeleteParams as PermissionDeleteParams, }; - export { - Downloads as Downloads, - type DownloadGetResponse as DownloadGetResponse, - type DownloadGetParams as DownloadGetParams, - }; + export { Downloads as Downloads }; } diff --git a/src/resources/load-balancers/index.ts b/src/resources/load-balancers/index.ts index ebd8cab7b2..8758b53ed9 100644 --- a/src/resources/load-balancers/index.ts +++ b/src/resources/load-balancers/index.ts @@ -1,6 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { LoadBalancers } from './load-balancers'; +export { + MonitorGroupsSinglePage, + MonitorGroups, + type MonitorGroup, + type MonitorGroupCreateParams, + type MonitorGroupUpdateParams, + type MonitorGroupListParams, + type MonitorGroupDeleteParams, + type MonitorGroupEditParams, + type MonitorGroupGetParams, +} from './monitor-groups'; export { MonitorsSinglePage, Monitors, diff --git a/src/resources/load-balancers/load-balancers.ts b/src/resources/load-balancers/load-balancers.ts index 1cd26f3e14..eb4687adca 100644 --- a/src/resources/load-balancers/load-balancers.ts +++ b/src/resources/load-balancers/load-balancers.ts @@ -3,6 +3,18 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as LoadBalancersAPI from './load-balancers'; +import * as MonitorGroupsAPI from './monitor-groups'; +import { + MonitorGroup, + MonitorGroupCreateParams, + MonitorGroupDeleteParams, + MonitorGroupEditParams, + MonitorGroupGetParams, + MonitorGroupListParams, + MonitorGroupUpdateParams, + MonitorGroups, + MonitorGroupsSinglePage, +} from './monitor-groups'; import * as PreviewsAPI from './previews'; import { PreviewGetParams, PreviewGetResponse, Previews } from './previews'; import * as RegionsAPI from './regions'; @@ -45,6 +57,7 @@ import { SinglePage } from '../../pagination'; export class LoadBalancers extends APIResource { monitors: MonitorsAPI.Monitors = new MonitorsAPI.Monitors(this._client); + monitorGroups: MonitorGroupsAPI.MonitorGroups = new MonitorGroupsAPI.MonitorGroups(this._client); pools: PoolsAPI.Pools = new PoolsAPI.Pools(this._client); previews: PreviewsAPI.Previews = new PreviewsAPI.Previews(this._client); regions: RegionsAPI.Regions = new RegionsAPI.Regions(this._client); @@ -2132,6 +2145,8 @@ export interface LoadBalancerGetParams { LoadBalancers.LoadBalancersSinglePage = LoadBalancersSinglePage; LoadBalancers.Monitors = Monitors; LoadBalancers.MonitorsSinglePage = MonitorsSinglePage; +LoadBalancers.MonitorGroups = MonitorGroups; +LoadBalancers.MonitorGroupsSinglePage = MonitorGroupsSinglePage; LoadBalancers.Pools = Pools; LoadBalancers.PoolsSinglePage = PoolsSinglePage; LoadBalancers.Previews = Previews; @@ -2181,6 +2196,18 @@ export declare namespace LoadBalancers { type MonitorGetParams as MonitorGetParams, }; + export { + MonitorGroups as MonitorGroups, + type MonitorGroup as MonitorGroup, + MonitorGroupsSinglePage as MonitorGroupsSinglePage, + type MonitorGroupCreateParams as MonitorGroupCreateParams, + type MonitorGroupUpdateParams as MonitorGroupUpdateParams, + type MonitorGroupListParams as MonitorGroupListParams, + type MonitorGroupDeleteParams as MonitorGroupDeleteParams, + type MonitorGroupEditParams as MonitorGroupEditParams, + type MonitorGroupGetParams as MonitorGroupGetParams, + }; + export { Pools as Pools, type Pool as Pool, diff --git a/src/resources/load-balancers/monitor-groups.ts b/src/resources/load-balancers/monitor-groups.ts new file mode 100644 index 0000000000..c818642b0f --- /dev/null +++ b/src/resources/load-balancers/monitor-groups.ts @@ -0,0 +1,436 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { SinglePage } from '../../pagination'; + +export class MonitorGroups extends APIResource { + /** + * Create a new monitor group. + * + * @example + * ```ts + * const monitorGroup = + * await client.loadBalancers.monitorGroups.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * id: 'id', + * description: 'Primary datacenter monitors', + * members: [ + * { + * enabled: true, + * monitor_id: 'monitor_id', + * monitoring_only: false, + * must_be_healthy: true, + * }, + * ], + * }); + * ``` + */ + create(params: MonitorGroupCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/load_balancers/monitor_groups`, { + body, + ...options, + }) as Core.APIPromise<{ result: MonitorGroup }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Modify a configured monitor group. + * + * @example + * ```ts + * const monitorGroup = + * await client.loadBalancers.monitorGroups.update( + * '17b5962d775c646f3f9725cbc7a53df4', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * id: 'id', + * description: 'Primary datacenter monitors', + * members: [ + * { + * enabled: true, + * monitor_id: 'monitor_id', + * monitoring_only: false, + * must_be_healthy: true, + * }, + * ], + * }, + * ); + * ``` + */ + update( + monitorGroupId: string, + params: MonitorGroupUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: MonitorGroup }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List configured monitor groups. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const monitorGroup of client.loadBalancers.monitorGroups.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + params: MonitorGroupListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/load_balancers/monitor_groups`, + MonitorGroupsSinglePage, + options, + ); + } + + /** + * Delete a configured monitor group. + * + * @example + * ```ts + * const monitorGroup = + * await client.loadBalancers.monitorGroups.delete( + * '17b5962d775c646f3f9725cbc7a53df4', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + monitorGroupId: string, + params: MonitorGroupDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete( + `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, + options, + ) as Core.APIPromise<{ result: MonitorGroup }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Apply changes to an existing monitor group, overwriting the supplied properties. + * + * @example + * ```ts + * const monitorGroup = + * await client.loadBalancers.monitorGroups.edit( + * '17b5962d775c646f3f9725cbc7a53df4', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * id: 'id', + * description: 'Primary datacenter monitors', + * members: [ + * { + * enabled: true, + * monitor_id: 'monitor_id', + * monitoring_only: false, + * must_be_healthy: true, + * }, + * ], + * }, + * ); + * ``` + */ + edit( + monitorGroupId: string, + params: MonitorGroupEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, { + body, + ...options, + }) as Core.APIPromise<{ result: MonitorGroup }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Fetch a single configured monitor group. + * + * @example + * ```ts + * const monitorGroup = + * await client.loadBalancers.monitorGroups.get( + * '17b5962d775c646f3f9725cbc7a53df4', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + monitorGroupId: string, + params: MonitorGroupGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/load_balancers/monitor_groups/${monitorGroupId}`, + options, + ) as Core.APIPromise<{ result: MonitorGroup }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class MonitorGroupsSinglePage extends SinglePage {} + +export interface MonitorGroup { + /** + * The ID of the Monitor Group to use for checking the health of origins within + * this pool. + */ + id: string; + + /** + * A short description of the monitor group + */ + description: string; + + /** + * List of monitors in this group + */ + members: Array; + + /** + * The timestamp of when the monitor group was created + */ + created_at?: string; + + /** + * The timestamp of when the monitor group was last updated + */ + updated_at?: string; +} + +export namespace MonitorGroup { + export interface Member { + /** + * Whether this monitor is enabled in the group + */ + enabled: boolean; + + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor_id: string; + + /** + * Whether this monitor is used for monitoring only (does not affect pool health) + */ + monitoring_only: boolean; + + /** + * Whether this monitor must be healthy for the pool to be considered healthy + */ + must_be_healthy: boolean; + + /** + * The timestamp of when the monitor was added to the group + */ + created_at?: string; + + /** + * The timestamp of when the monitor group member was last updated + */ + updated_at?: string; + } +} + +export interface MonitorGroupCreateParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + id: string; + + /** + * Body param: A short description of the monitor group + */ + description: string; + + /** + * Body param: List of monitors in this group + */ + members: Array; +} + +export namespace MonitorGroupCreateParams { + export interface Member { + /** + * Whether this monitor is enabled in the group + */ + enabled: boolean; + + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor_id: string; + + /** + * Whether this monitor is used for monitoring only (does not affect pool health) + */ + monitoring_only: boolean; + + /** + * Whether this monitor must be healthy for the pool to be considered healthy + */ + must_be_healthy: boolean; + } +} + +export interface MonitorGroupUpdateParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + id: string; + + /** + * Body param: A short description of the monitor group + */ + description: string; + + /** + * Body param: List of monitors in this group + */ + members: Array; +} + +export namespace MonitorGroupUpdateParams { + export interface Member { + /** + * Whether this monitor is enabled in the group + */ + enabled: boolean; + + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor_id: string; + + /** + * Whether this monitor is used for monitoring only (does not affect pool health) + */ + monitoring_only: boolean; + + /** + * Whether this monitor must be healthy for the pool to be considered healthy + */ + must_be_healthy: boolean; + } +} + +export interface MonitorGroupListParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface MonitorGroupDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface MonitorGroupEditParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + id: string; + + /** + * Body param: A short description of the monitor group + */ + description: string; + + /** + * Body param: List of monitors in this group + */ + members: Array; +} + +export namespace MonitorGroupEditParams { + export interface Member { + /** + * Whether this monitor is enabled in the group + */ + enabled: boolean; + + /** + * The ID of the Monitor to use for checking the health of origins within this + * pool. + */ + monitor_id: string; + + /** + * Whether this monitor is used for monitoring only (does not affect pool health) + */ + monitoring_only: boolean; + + /** + * Whether this monitor must be healthy for the pool to be considered healthy + */ + must_be_healthy: boolean; + } +} + +export interface MonitorGroupGetParams { + /** + * Identifier. + */ + account_id: string; +} + +MonitorGroups.MonitorGroupsSinglePage = MonitorGroupsSinglePage; + +export declare namespace MonitorGroups { + export { + type MonitorGroup as MonitorGroup, + MonitorGroupsSinglePage as MonitorGroupsSinglePage, + type MonitorGroupCreateParams as MonitorGroupCreateParams, + type MonitorGroupUpdateParams as MonitorGroupUpdateParams, + type MonitorGroupListParams as MonitorGroupListParams, + type MonitorGroupDeleteParams as MonitorGroupDeleteParams, + type MonitorGroupEditParams as MonitorGroupEditParams, + type MonitorGroupGetParams as MonitorGroupGetParams, + }; +} diff --git a/src/resources/load-balancers/pools/pools.ts b/src/resources/load-balancers/pools/pools.ts index 781cab4774..e99980c31c 100644 --- a/src/resources/load-balancers/pools/pools.ts +++ b/src/resources/load-balancers/pools/pools.ts @@ -250,6 +250,12 @@ export interface Pool { */ monitor?: string; + /** + * The ID of the Monitor Group to use for checking the health of origins within + * this pool. + */ + monitor_group?: string; + /** * A short name (tag) for the pool. Only alphanumeric characters, hyphens, and * underscores are allowed. @@ -354,6 +360,12 @@ export interface PoolCreateParams { */ monitor?: string; + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + monitor_group?: string; + /** * Body param: This field is now deprecated. It has been moved to Cloudflare's * Centralized Notification service @@ -443,6 +455,12 @@ export interface PoolUpdateParams { */ monitor?: string; + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + monitor_group?: string; + /** * Body param: This field is now deprecated. It has been moved to Cloudflare's * Centralized Notification service @@ -553,6 +571,12 @@ export interface PoolEditParams { */ monitor?: string; + /** + * Body param: The ID of the Monitor Group to use for checking the health of + * origins within this pool. + */ + monitor_group?: string; + /** * Body param: A short name (tag) for the pool. Only alphanumeric characters, * hyphens, and underscores are allowed. diff --git a/src/resources/logs/rayid.ts b/src/resources/logs/rayid.ts index d93b9baf8c..6e40d6cfa9 100644 --- a/src/resources/logs/rayid.ts +++ b/src/resources/logs/rayid.ts @@ -30,7 +30,7 @@ export type RayIDGetResponse = string | unknown; export interface RayIDGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/logs/received/fields.ts b/src/resources/logs/received/fields.ts index d84198e6ee..5e289166d6 100644 --- a/src/resources/logs/received/fields.ts +++ b/src/resources/logs/received/fields.ts @@ -27,7 +27,7 @@ export interface FieldGetResponse { export interface FieldGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/logs/received/received.ts b/src/resources/logs/received/received.ts index fffcbe7c04..6f0ab3dbaa 100644 --- a/src/resources/logs/received/received.ts +++ b/src/resources/logs/received/received.ts @@ -36,7 +36,7 @@ export type ReceivedGetResponse = string | unknown; export interface ReceivedGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/magic-transit/cf-interconnects.ts b/src/resources/magic-transit/cf-interconnects.ts index 3d365e8f1e..ae644c3ba2 100644 --- a/src/resources/magic-transit/cf-interconnects.ts +++ b/src/resources/magic-transit/cf-interconnects.ts @@ -146,6 +146,12 @@ export namespace CfInterconnectUpdateResponse { */ id?: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + /** * The name of the interconnect. The name cannot share a name with other tunnels. */ @@ -225,6 +231,12 @@ export namespace CfInterconnectListResponse { */ id?: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + /** * The name of the interconnect. The name cannot share a name with other tunnels. */ @@ -306,6 +318,12 @@ export namespace CfInterconnectBulkUpdateResponse { */ id?: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + /** * The name of the interconnect. The name cannot share a name with other tunnels. */ @@ -385,6 +403,12 @@ export namespace CfInterconnectGetResponse { */ id?: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + /** * The name of the interconnect. The name cannot share a name with other tunnels. */ @@ -459,6 +483,12 @@ export interface CfInterconnectUpdateParams { */ account_id: string; + /** + * Body param: True if automatic stateful return routing should be enabled for a + * tunnel, false otherwise. + */ + automatic_return_routing?: boolean; + /** * Body param: An optional description of the interconnect. */ diff --git a/src/resources/magic-transit/gre-tunnels.ts b/src/resources/magic-transit/gre-tunnels.ts index ed60dd107b..8ce3288b29 100644 --- a/src/resources/magic-transit/gre-tunnels.ts +++ b/src/resources/magic-transit/gre-tunnels.ts @@ -229,6 +229,12 @@ export interface GRETunnelCreateResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: GRETunnelCreateResponse.BGP; bgp_status?: GRETunnelCreateResponse.BGPStatus; @@ -421,6 +427,12 @@ export namespace GRETunnelUpdateResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: ModifiedGRETunnel.BGP; bgp_status?: ModifiedGRETunnel.BGPStatus; @@ -612,6 +624,12 @@ export namespace GRETunnelListResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: GRETunnel.BGP; bgp_status?: GRETunnel.BGPStatus; @@ -805,6 +823,12 @@ export namespace GRETunnelDeleteResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: DeletedGRETunnel.BGP; bgp_status?: DeletedGRETunnel.BGPStatus; @@ -998,6 +1022,12 @@ export namespace GRETunnelBulkUpdateResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: ModifiedGRETunnel.BGP; bgp_status?: ModifiedGRETunnel.BGPStatus; @@ -1189,6 +1219,12 @@ export namespace GRETunnelGetResponse { */ name: string; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: GRETunnel.BGP; bgp_status?: GRETunnel.BGPStatus; @@ -1376,6 +1412,12 @@ export interface GRETunnelCreateParams { */ name: string; + /** + * Body param: True if automatic stateful return routing should be enabled for a + * tunnel, false otherwise. + */ + automatic_return_routing?: boolean; + /** * Body param: */ @@ -1537,6 +1579,12 @@ export interface GRETunnelUpdateParams { */ name: string; + /** + * Body param: True if automatic stateful return routing should be enabled for a + * tunnel, false otherwise. + */ + automatic_return_routing?: boolean; + /** * Body param: An optional description of the GRE tunnel. */ diff --git a/src/resources/magic-transit/ipsec-tunnels.ts b/src/resources/magic-transit/ipsec-tunnels.ts index bf9587d55b..1318526e85 100644 --- a/src/resources/magic-transit/ipsec-tunnels.ts +++ b/src/resources/magic-transit/ipsec-tunnels.ts @@ -279,6 +279,12 @@ export interface IPSECTunnelCreateResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: IPSECTunnelCreateResponse.BGP; bgp_status?: IPSECTunnelCreateResponse.BGPStatus; @@ -288,6 +294,8 @@ export interface IPSECTunnelCreateResponse { */ created_on?: string; + custom_remote_identities?: IPSECTunnelCreateResponse.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -380,6 +388,20 @@ export namespace IPSECTunnelCreateResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -477,6 +499,12 @@ export namespace IPSECTunnelUpdateResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: ModifiedIPSECTunnel.BGP; bgp_status?: ModifiedIPSECTunnel.BGPStatus; @@ -486,6 +514,8 @@ export namespace IPSECTunnelUpdateResponse { */ created_on?: string; + custom_remote_identities?: ModifiedIPSECTunnel.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -578,6 +608,20 @@ export namespace IPSECTunnelUpdateResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -674,6 +718,12 @@ export namespace IPSECTunnelListResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: IPSECTunnel.BGP; bgp_status?: IPSECTunnel.BGPStatus; @@ -683,6 +733,8 @@ export namespace IPSECTunnelListResponse { */ created_on?: string; + custom_remote_identities?: IPSECTunnel.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -775,6 +827,20 @@ export namespace IPSECTunnelListResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -873,6 +939,12 @@ export namespace IPSECTunnelDeleteResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: DeletedIPSECTunnel.BGP; bgp_status?: DeletedIPSECTunnel.BGPStatus; @@ -882,6 +954,8 @@ export namespace IPSECTunnelDeleteResponse { */ created_on?: string; + custom_remote_identities?: DeletedIPSECTunnel.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -974,6 +1048,20 @@ export namespace IPSECTunnelDeleteResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -1072,6 +1160,12 @@ export namespace IPSECTunnelBulkUpdateResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: ModifiedIPSECTunnel.BGP; bgp_status?: ModifiedIPSECTunnel.BGPStatus; @@ -1081,6 +1175,8 @@ export namespace IPSECTunnelBulkUpdateResponse { */ created_on?: string; + custom_remote_identities?: ModifiedIPSECTunnel.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -1173,6 +1269,20 @@ export namespace IPSECTunnelBulkUpdateResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -1269,6 +1379,12 @@ export namespace IPSECTunnelGetResponse { */ allow_null_cipher?: boolean; + /** + * True if automatic stateful return routing should be enabled for a tunnel, false + * otherwise. + */ + automatic_return_routing?: boolean; + bgp?: IPSECTunnel.BGP; bgp_status?: IPSECTunnel.BGPStatus; @@ -1278,6 +1394,8 @@ export namespace IPSECTunnelGetResponse { */ created_on?: string; + custom_remote_identities?: IPSECTunnel.CustomRemoteIdentities; + /** * The IP address assigned to the customer side of the IPsec tunnel. Not required, * but must be set for proactive traceroutes to work. @@ -1370,6 +1488,20 @@ export namespace IPSECTunnelGetResponse { customer_speaker_port?: number; } + export interface CustomRemoteIdentities { + /** + * A custom IKE ID of type FQDN that may be used to identity the IPsec tunnel. The + * generated IKE IDs can still be used even if this custom value is specified. + * + * Must be of the form `..custom.ipsec.cloudflare.com`. + * + * This custom ID does not need to be unique. Two IPsec tunnels may have the same + * custom fqdn_id. However, if another IPsec tunnel has the same value then the two + * tunnels cannot have the same cloudflare_endpoint. + */ + fqdn_id?: string; + } + export interface HealthCheck { /** * The direction of the flow of the healthcheck. Either unidirectional, where the @@ -1473,6 +1605,12 @@ export interface IPSECTunnelCreateParams { */ name: string; + /** + * Body param: True if automatic stateful return routing should be enabled for a + * tunnel, false otherwise. + */ + automatic_return_routing?: boolean; + /** * Body param: */ @@ -1634,6 +1772,12 @@ export interface IPSECTunnelUpdateParams { */ name: string; + /** + * Body param: True if automatic stateful return routing should be enabled for a + * tunnel, false otherwise. + */ + automatic_return_routing?: boolean; + /** * Body param: */ diff --git a/src/resources/magic-transit/pcaps/download.ts b/src/resources/magic-transit/pcaps/download.ts index 9413fdcad8..46a0a7ee84 100644 --- a/src/resources/magic-transit/pcaps/download.ts +++ b/src/resources/magic-transit/pcaps/download.ts @@ -32,7 +32,7 @@ export class Download extends APIResource { export interface DownloadGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/magic-transit/pcaps/ownership.ts b/src/resources/magic-transit/pcaps/ownership.ts index b9daa44fee..93602154ba 100644 --- a/src/resources/magic-transit/pcaps/ownership.ts +++ b/src/resources/magic-transit/pcaps/ownership.ts @@ -131,7 +131,7 @@ export interface Ownership { export interface OwnershipCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -144,21 +144,21 @@ export interface OwnershipCreateParams { export interface OwnershipDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface OwnershipGetParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface OwnershipValidateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/magic-transit/pcaps/pcaps.ts b/src/resources/magic-transit/pcaps/pcaps.ts index b1ec94cd7d..fca2bf5d2c 100644 --- a/src/resources/magic-transit/pcaps/pcaps.ts +++ b/src/resources/magic-transit/pcaps/pcaps.ts @@ -90,7 +90,7 @@ export class PCAPs extends APIResource { } /** - * Stop full PCAP + * Stop full PCAP. * * @example * ```ts @@ -485,7 +485,7 @@ export type PCAPCreateParams = export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestSimple { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -526,7 +526,7 @@ export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestFull { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -580,21 +580,21 @@ export declare namespace PCAPCreateParams { export interface PCAPListParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface PCAPGetParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface PCAPStopParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/page-rules.ts b/src/resources/page-rules.ts index 9d52c828c4..992decfd3f 100644 --- a/src/resources/page-rules.ts +++ b/src/resources/page-rules.ts @@ -12,8 +12,16 @@ export class PageRules extends APIResource { * ```ts * const pageRule = await client.pageRules.create({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * actions: [{}], - * targets: [{}], + * actions: [{ id: 'browser_check' }], + * targets: [ + * { + * constraint: { + * operator: 'matches', + * value: '*example.com/images/*', + * }, + * target: 'url', + * }, + * ], * }); * ``` */ @@ -36,8 +44,16 @@ export class PageRules extends APIResource { * '023e105f4ecef8ad9ca31a8372d0c353', * { * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * actions: [{}], - * targets: [{}], + * actions: [{ id: 'browser_check' }], + * targets: [ + * { + * constraint: { + * operator: 'matches', + * value: '*example.com/images/*', + * }, + * target: 'url', + * }, + * ], * }, * ); * ``` diff --git a/src/resources/page-shield/connections.ts b/src/resources/page-shield/connections.ts index 64752e17b8..e833a8ed79 100644 --- a/src/resources/page-shield/connections.ts +++ b/src/resources/page-shield/connections.ts @@ -112,7 +112,7 @@ export interface ConnectionListParams { exclude_urls?: string; /** - * Query param: Export the list of connections as a file. + * Query param: Export the list of connections as a file, limited to 50000 entries. */ export?: 'csv'; diff --git a/src/resources/page-shield/cookies.ts b/src/resources/page-shield/cookies.ts index c28fea58c8..5be49a4322 100644 --- a/src/resources/page-shield/cookies.ts +++ b/src/resources/page-shield/cookies.ts @@ -140,7 +140,7 @@ export interface CookieListParams { domain?: string; /** - * Query param: Export the list of cookies as a file. + * Query param: Export the list of cookies as a file, limited to 50000 entries. */ export?: 'csv'; diff --git a/src/resources/page-shield/scripts.ts b/src/resources/page-shield/scripts.ts index 457f26bfb2..d8d557f1ba 100644 --- a/src/resources/page-shield/scripts.ts +++ b/src/resources/page-shield/scripts.ts @@ -276,7 +276,7 @@ export interface ScriptListParams { exclude_urls?: string; /** - * Query param: Export the list of scripts as a file. + * Query param: Export the list of scripts as a file, limited to 50000 entries. */ export?: 'csv'; diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index e09e6de091..a22b6f10e9 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model. * - * @example - * ```ts - * const response = - * await client.radar.ai.inference.summary.model(); - * ``` + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -33,11 +29,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task. * - * @example - * ```ts - * const response = - * await client.radar.ai.inference.summary.task(); - * ``` + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/ai/inference/timeseries-groups/summary.ts b/src/resources/radar/ai/inference/timeseries-groups/summary.ts index f06dea0b4d..bf808d1b21 100644 --- a/src/resources/radar/ai/inference/timeseries-groups/summary.ts +++ b/src/resources/radar/ai/inference/timeseries-groups/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by model over time. * - * @example - * ```ts - * const response = - * await client.radar.ai.inference.timeseriesGroups.summary.model(); - * ``` + * @deprecated */ model(query?: SummaryModelParams, options?: Core.RequestOptions): Core.APIPromise; model(options?: Core.RequestOptions): Core.APIPromise; @@ -34,11 +30,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of unique accounts by task over time. * - * @example - * ```ts - * const response = - * await client.radar.ai.inference.timeseriesGroups.summary.task(); - * ``` + * @deprecated */ task(query?: SummaryTaskParams, options?: Core.RequestOptions): Core.APIPromise; task(options?: Core.RequestOptions): Core.APIPromise; diff --git a/src/resources/radar/entities/asns.ts b/src/resources/radar/entities/asns.ts index 97c681b4d6..66ecf4a6e9 100644 --- a/src/resources/radar/entities/asns.ts +++ b/src/resources/radar/entities/asns.ts @@ -29,6 +29,35 @@ export class ASNs extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieves Internet Routing Registry AS-SETs that an AS is a member of. + * + * @example + * ```ts + * const response = await client.radar.entities.asns.asSet(3); + * ``` + */ + asSet( + asn: number, + query?: ASNAsSetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + asSet(asn: number, options?: Core.RequestOptions): Core.APIPromise; + asSet( + asn: number, + query: ASNAsSetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.asSet(asn, {}, query); + } + return ( + this._client.get(`/radar/entities/asns/${asn}/as_set`, { query, ...options }) as Core.APIPromise<{ + result: ASNAsSetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the requested autonomous system information. (A confidence level below * `5` indicates a low level of confidence in the traffic data - normally this @@ -124,6 +153,54 @@ export namespace ASNListResponse { } } +export interface ASNAsSetResponse { + as_sets: Array; + + /** + * Paths from the AS-SET that include the given AS to its upstreams recursively + */ + paths: Array>; +} + +export namespace ASNAsSetResponse { + export interface AsSet { + /** + * The number of AS members in the AS-SET + */ + as_members_count: number; + + /** + * The number of AS-SET members in the AS-SET + */ + as_set_members_count: number; + + /** + * The number of recursive upstream AS-SETs + */ + as_set_upstreams_count: number; + + /** + * The number of unique ASNs in the AS-SETs recursive downstream + */ + asn_cone_size: number; + + /** + * The IRR sources of the AS-SET + */ + irr_sources: Array; + + /** + * The name of the AS-SET + */ + name: string; + + /** + * The inferred AS number of the AS-SET + */ + asn?: number; + } +} + export interface ASNGetResponse { asn: ASNGetResponse.ASN; } @@ -327,6 +404,13 @@ export interface ASNListParams { orderBy?: 'ASN' | 'POPULATION'; } +export interface ASNAsSetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + export interface ASNGetParams { /** * Format in which results will be returned. @@ -361,10 +445,12 @@ export interface ASNRelParams { export declare namespace ASNs { export { type ASNListResponse as ASNListResponse, + type ASNAsSetResponse as ASNAsSetResponse, type ASNGetResponse as ASNGetResponse, type ASNIPResponse as ASNIPResponse, type ASNRelResponse as ASNRelResponse, type ASNListParams as ASNListParams, + type ASNAsSetParams as ASNAsSetParams, type ASNGetParams as ASNGetParams, type ASNIPParams as ASNIPParams, type ASNRelParams as ASNRelParams, diff --git a/src/resources/radar/entities/entities.ts b/src/resources/radar/entities/entities.ts index 75f6aae099..d9fee166c0 100644 --- a/src/resources/radar/entities/entities.ts +++ b/src/resources/radar/entities/entities.ts @@ -4,6 +4,8 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ASNsAPI from './asns'; import { + ASNAsSetParams, + ASNAsSetResponse, ASNGetParams, ASNGetResponse, ASNIPParams, @@ -91,10 +93,12 @@ export declare namespace Entities { export { ASNs as ASNs, type ASNListResponse as ASNListResponse, + type ASNAsSetResponse as ASNAsSetResponse, type ASNGetResponse as ASNGetResponse, type ASNIPResponse as ASNIPResponse, type ASNRelResponse as ASNRelResponse, type ASNListParams as ASNListParams, + type ASNAsSetParams as ASNAsSetParams, type ASNGetParams as ASNGetParams, type ASNIPParams as ASNIPParams, type ASNRelParams as ASNRelParams, diff --git a/src/resources/radar/entities/index.ts b/src/resources/radar/entities/index.ts index 2039fc458d..cd46728345 100644 --- a/src/resources/radar/entities/index.ts +++ b/src/resources/radar/entities/index.ts @@ -3,10 +3,12 @@ export { ASNs, type ASNListResponse, + type ASNAsSetResponse, type ASNGetResponse, type ASNIPResponse, type ASNRelResponse, type ASNListParams, + type ASNAsSetParams, type ASNGetParams, type ASNIPParams, type ASNRelParams, diff --git a/src/resources/radar/http/ases/ases.ts b/src/resources/radar/http/ases/ases.ts index 58c7cf7603..10694a020f 100644 --- a/src/resources/radar/http/ases/ases.ts +++ b/src/resources/radar/http/ases/ases.ts @@ -217,6 +217,14 @@ export interface AseGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/bot-class.ts b/src/resources/radar/http/ases/bot-class.ts index a2e6558b30..6445b6cd7a 100644 --- a/src/resources/radar/http/ases/bot-class.ts +++ b/src/resources/radar/http/ases/bot-class.ts @@ -198,6 +198,14 @@ export interface BotClassGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/browser-family.ts b/src/resources/radar/http/ases/browser-family.ts index a70aa120d6..00de7696a5 100644 --- a/src/resources/radar/http/ases/browser-family.ts +++ b/src/resources/radar/http/ases/browser-family.ts @@ -198,6 +198,14 @@ export interface BrowserFamilyGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/device-type.ts b/src/resources/radar/http/ases/device-type.ts index 9c3dbe6100..d2a867b1ce 100644 --- a/src/resources/radar/http/ases/device-type.ts +++ b/src/resources/radar/http/ases/device-type.ts @@ -198,6 +198,14 @@ export interface DeviceTypeGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/http-method.ts b/src/resources/radar/http/ases/http-method.ts index bfb9cb0190..fe83fa1fb4 100644 --- a/src/resources/radar/http/ases/http-method.ts +++ b/src/resources/radar/http/ases/http-method.ts @@ -203,6 +203,14 @@ export interface HTTPMethodGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/http-protocol.ts b/src/resources/radar/http/ases/http-protocol.ts index 13e404be64..590616cd92 100644 --- a/src/resources/radar/http/ases/http-protocol.ts +++ b/src/resources/radar/http/ases/http-protocol.ts @@ -203,6 +203,14 @@ export interface HTTPProtocolGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP version. */ diff --git a/src/resources/radar/http/ases/ip-version.ts b/src/resources/radar/http/ases/ip-version.ts index f844441b34..5b33784026 100644 --- a/src/resources/radar/http/ases/ip-version.ts +++ b/src/resources/radar/http/ases/ip-version.ts @@ -200,6 +200,14 @@ export interface IPVersionGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/os.ts b/src/resources/radar/http/ases/os.ts index 4df77721c1..f3f307fe57 100644 --- a/src/resources/radar/http/ases/os.ts +++ b/src/resources/radar/http/ases/os.ts @@ -201,6 +201,14 @@ export interface OSGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/ases/tls-version.ts b/src/resources/radar/http/ases/tls-version.ts index 9adec6449d..59103601a4 100644 --- a/src/resources/radar/http/ases/tls-version.ts +++ b/src/resources/radar/http/ases/tls-version.ts @@ -203,6 +203,14 @@ export interface TLSVersionGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/http.ts b/src/resources/radar/http/http.ts index 14f5be3600..7d3a80fcb6 100644 --- a/src/resources/radar/http/http.ts +++ b/src/resources/radar/http/http.ts @@ -271,6 +271,14 @@ export interface HTTPTimeseriesParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/bot-class.ts b/src/resources/radar/http/locations/bot-class.ts index 04ca13fed1..e4cb08aec9 100644 --- a/src/resources/radar/http/locations/bot-class.ts +++ b/src/resources/radar/http/locations/bot-class.ts @@ -198,6 +198,14 @@ export interface BotClassGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/browser-family.ts b/src/resources/radar/http/locations/browser-family.ts index 762e5ecc35..138d5e0bbe 100644 --- a/src/resources/radar/http/locations/browser-family.ts +++ b/src/resources/radar/http/locations/browser-family.ts @@ -199,6 +199,14 @@ export interface BrowserFamilyGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/device-type.ts b/src/resources/radar/http/locations/device-type.ts index c2c9e7438f..d166a8568d 100644 --- a/src/resources/radar/http/locations/device-type.ts +++ b/src/resources/radar/http/locations/device-type.ts @@ -199,6 +199,14 @@ export interface DeviceTypeGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/http-method.ts b/src/resources/radar/http/locations/http-method.ts index 46bba7a540..f06213f62b 100644 --- a/src/resources/radar/http/locations/http-method.ts +++ b/src/resources/radar/http/locations/http-method.ts @@ -204,6 +204,14 @@ export interface HTTPMethodGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/http-protocol.ts b/src/resources/radar/http/locations/http-protocol.ts index ccc624c8c6..7fae9f01b6 100644 --- a/src/resources/radar/http/locations/http-protocol.ts +++ b/src/resources/radar/http/locations/http-protocol.ts @@ -204,6 +204,14 @@ export interface HTTPProtocolGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP version. */ diff --git a/src/resources/radar/http/locations/ip-version.ts b/src/resources/radar/http/locations/ip-version.ts index 30e68b8efc..d0441c609c 100644 --- a/src/resources/radar/http/locations/ip-version.ts +++ b/src/resources/radar/http/locations/ip-version.ts @@ -199,6 +199,14 @@ export interface IPVersionGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/locations.ts b/src/resources/radar/http/locations/locations.ts index 875d649603..fc472fe6d4 100644 --- a/src/resources/radar/http/locations/locations.ts +++ b/src/resources/radar/http/locations/locations.ts @@ -217,6 +217,14 @@ export interface LocationGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/os.ts b/src/resources/radar/http/locations/os.ts index 6d658aaeb1..12daac41e0 100644 --- a/src/resources/radar/http/locations/os.ts +++ b/src/resources/radar/http/locations/os.ts @@ -203,6 +203,14 @@ export interface OSGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/locations/tls-version.ts b/src/resources/radar/http/locations/tls-version.ts index 9c3b1691a8..56373c6dd3 100644 --- a/src/resources/radar/http/locations/tls-version.ts +++ b/src/resources/radar/http/locations/tls-version.ts @@ -205,6 +205,14 @@ export interface TLSVersionGetParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 95ce04817e..9f7f84b12e 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -11,10 +11,7 @@ export class Summary extends APIResource { * https://developers.cloudflare.com/radar/concepts/bot-classes/ for more * information. * - * @example - * ```ts - * const response = await client.radar.http.summary.botClass(); - * ``` + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -39,11 +36,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests generated by mobile, desktop, and * other types of devices. * - * @example - * ```ts - * const response = - * await client.radar.http.summary.deviceType(); - * ``` + * @deprecated */ deviceType( query?: SummaryDeviceTypeParams, @@ -67,11 +60,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS). * - * @example - * ```ts - * const response = - * await client.radar.http.summary.httpProtocol(); - * ``` + * @deprecated */ httpProtocol( query?: SummaryHTTPProtocolParams, @@ -95,11 +84,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version. * - * @example - * ```ts - * const response = - * await client.radar.http.summary.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: SummaryHTTPVersionParams, @@ -123,11 +108,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version. * - * @example - * ```ts - * const response = - * await client.radar.http.summary.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: SummaryIPVersionParams, @@ -152,10 +133,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP requests by operating system (Windows, macOS, * Android, iOS, and others). * - * @example - * ```ts - * const response = await client.radar.http.summary.os(); - * ``` + * @deprecated */ os(query?: SummaryOSParams, options?: Core.RequestOptions): Core.APIPromise; os(options?: Core.RequestOptions): Core.APIPromise; @@ -176,11 +154,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support. * - * @example - * ```ts - * const response = - * await client.radar.http.summary.postQuantum(); - * ``` + * @deprecated */ postQuantum( query?: SummaryPostQuantumParams, @@ -204,11 +178,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version. * - * @example - * ```ts - * const response = - * await client.radar.http.summary.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: SummaryTLSVersionParams, @@ -1175,6 +1145,14 @@ export interface SummaryBotClassParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1262,6 +1240,14 @@ export interface SummaryDeviceTypeParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1354,6 +1340,14 @@ export interface SummaryHTTPProtocolParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP version. */ @@ -1441,6 +1435,14 @@ export interface SummaryHTTPVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1528,6 +1530,14 @@ export interface SummaryIPVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1615,6 +1625,14 @@ export interface SummaryOSParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1702,6 +1720,14 @@ export interface SummaryPostQuantumParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1794,6 +1820,14 @@ export interface SummaryTLSVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/timeseries-groups.ts b/src/resources/radar/http/timeseries-groups.ts index beacdaeb1a..a22fdb7774 100644 --- a/src/resources/radar/http/timeseries-groups.ts +++ b/src/resources/radar/http/timeseries-groups.ts @@ -10,11 +10,7 @@ export class TimeseriesGroups extends APIResource { * over time. Visit https://developers.cloudflare.com/radar/concepts/bot-classes/ * for more information. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.botClass(); - * ``` + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -38,11 +34,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.browser(); - * ``` + * @deprecated */ browser( query?: TimeseriesGroupBrowserParams, @@ -66,11 +58,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by user agent family over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.browserFamily(); - * ``` + * @deprecated */ browserFamily( query?: TimeseriesGroupBrowserFamilyParams, @@ -95,11 +83,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by device type over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.deviceType(); - * ``` + * @deprecated */ deviceType( query?: TimeseriesGroupDeviceTypeParams, @@ -125,11 +109,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP requests by HTTP protocol (HTTP vs. HTTPS) * over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.httpProtocol(); - * ``` + * @deprecated */ httpProtocol( query?: TimeseriesGroupHTTPProtocolParams, @@ -154,11 +134,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by HTTP version over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.httpVersion(); - * ``` + * @deprecated */ httpVersion( query?: TimeseriesGroupHTTPVersionParams, @@ -183,11 +159,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by IP version over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.ipVersion(); - * ``` + * @deprecated */ ipVersion( query?: TimeseriesGroupIPVersionParams, @@ -211,11 +183,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by operating system over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.os(); - * ``` + * @deprecated */ os( query?: TimeseriesGroupOSParams, @@ -239,11 +207,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by post-quantum support over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.postQuantum(); - * ``` + * @deprecated */ postQuantum( query?: TimeseriesGroupPostQuantumParams, @@ -268,11 +232,7 @@ export class TimeseriesGroups extends APIResource { /** * Retrieves the distribution of HTTP requests by TLS version over time. * - * @example - * ```ts - * const response = - * await client.radar.http.timeseriesGroups.tlsVersion(); - * ``` + * @deprecated */ tlsVersion( query?: TimeseriesGroupTLSVersionParams, @@ -1474,6 +1434,14 @@ export interface TimeseriesGroupBotClassParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1573,6 +1541,14 @@ export interface TimeseriesGroupBrowserParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1674,6 +1650,14 @@ export interface TimeseriesGroupBrowserFamilyParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1775,6 +1759,14 @@ export interface TimeseriesGroupDeviceTypeParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -1874,6 +1866,14 @@ export interface TimeseriesGroupHTTPProtocolParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP version. */ @@ -1968,6 +1968,14 @@ export interface TimeseriesGroupHTTPVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -2062,6 +2070,14 @@ export interface TimeseriesGroupIPVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -2156,6 +2172,14 @@ export interface TimeseriesGroupOSParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -2250,6 +2274,14 @@ export interface TimeseriesGroupPostQuantumParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -2349,6 +2381,14 @@ export interface TimeseriesGroupTLSVersionParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/http/top.ts b/src/resources/radar/http/top.ts index dd047c3df3..01ee05806f 100644 --- a/src/resources/radar/http/top.ts +++ b/src/resources/radar/http/top.ts @@ -318,6 +318,14 @@ export interface TopBrowserParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ @@ -410,6 +418,14 @@ export interface TopBrowserFamilyParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by HTTP protocol (HTTP vs. HTTPS). */ diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index c1c6b5efee..917ce13982 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -8,11 +8,7 @@ export class Summary extends APIResource { /** * Retrieves the distribution of HTTP authentication requests by bot class. * - * @example - * ```ts - * const response = - * await client.radar.leakedCredentials.summary.botClass(); - * ``` + * @deprecated */ botClass( query?: SummaryBotClassParams, @@ -38,11 +34,7 @@ export class Summary extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status. * - * @example - * ```ts - * const response = - * await client.radar.leakedCredentials.summary.compromised(); - * ``` + * @deprecated */ compromised( query?: SummaryCompromisedParams, diff --git a/src/resources/radar/leaked-credentials/timeseries-groups.ts b/src/resources/radar/leaked-credentials/timeseries-groups.ts index 0a739a8819..83aa48d077 100644 --- a/src/resources/radar/leaked-credentials/timeseries-groups.ts +++ b/src/resources/radar/leaked-credentials/timeseries-groups.ts @@ -9,11 +9,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by bot class over * time. * - * @example - * ```ts - * const response = - * await client.radar.leakedCredentials.timeseriesGroups.botClass(); - * ``` + * @deprecated */ botClass( query?: TimeseriesGroupBotClassParams, @@ -39,11 +35,7 @@ export class TimeseriesGroups extends APIResource { * Retrieves the distribution of HTTP authentication requests by compromised * credential status over time. * - * @example - * ```ts - * const response = - * await client.radar.leakedCredentials.timeseriesGroups.compromised(); - * ``` + * @deprecated */ compromised( query?: TimeseriesGroupCompromisedParams, diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index b46440c98d..c484510bb6 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -13,10 +13,7 @@ export class Netflows extends APIResource { * Retrieves the distribution of network traffic (NetFlows) by HTTP vs other * protocols. * - * @example - * ```ts - * const response = await client.radar.netflows.summary(); - * ``` + * @deprecated */ summary( query?: NetflowSummaryParams, @@ -322,6 +319,14 @@ export interface NetflowSummaryParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by location. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude locations from results. For example, `-US,PT` @@ -380,6 +385,14 @@ export interface NetflowTimeseriesParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Filters results by location. Specify a comma-separated list of alpha-2 codes. * Prefix with `-` to exclude locations from results. For example, `-US,PT` diff --git a/src/resources/radar/netflows/top.ts b/src/resources/radar/netflows/top.ts index 31521f718d..e8c73158d4 100644 --- a/src/resources/radar/netflows/top.ts +++ b/src/resources/radar/netflows/top.ts @@ -309,6 +309,14 @@ export interface TopAsesParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Limits the number of objects returned in the response. */ @@ -365,6 +373,14 @@ export interface TopLocationsParams { */ format?: 'JSON' | 'CSV'; + /** + * Filters results by Geolocation. Specify a comma-separated list of GeoNames IDs. + * Prefix with `-` to exclude geoIds from results. For example, `-2267056,360689` + * excludes results from the 2267056 (Lisbon), but includes results from 5128638 + * (New York). + */ + geoId?: Array; + /** * Limits the number of objects returned in the response. */ diff --git a/src/resources/radar/search.ts b/src/resources/radar/search.ts index 8eb6959901..ebf8a722f5 100644 --- a/src/resources/radar/search.ts +++ b/src/resources/radar/search.ts @@ -48,6 +48,7 @@ export interface SearchGlobalParams { * Search types excluded from results. */ exclude?: Array< + | 'ADM1S' | 'ASNS' | 'BOTS' | 'CERTIFICATE_AUTHORITIES' @@ -68,6 +69,7 @@ export interface SearchGlobalParams { * Search types included in results. */ include?: Array< + | 'ADM1S' | 'ASNS' | 'BOTS' | 'CERTIFICATE_AUTHORITIES' diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 375d8ee6e9..3f5b99c978 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -109,7 +109,7 @@ export interface TraceCreateResponse { export interface TraceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/resource-sharing/recipients.ts b/src/resources/resource-sharing/recipients.ts index 56f6ac2aa6..f94b84a7f9 100644 --- a/src/resources/resource-sharing/recipients.ts +++ b/src/resources/resource-sharing/recipients.ts @@ -106,12 +106,12 @@ export class Recipients extends APIResource { params: RecipientGetParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; + const { account_id, ...query } = params; return ( - this._client.get( - `/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, - options, - ) as Core.APIPromise<{ result: RecipientGetResponse }> + this._client.get(`/accounts/${account_id}/shares/${shareId}/recipients/${recipientId}`, { + query, + ...options, + }) as Core.APIPromise<{ result: RecipientGetResponse }> )._thenUnwrap((obj) => obj.result); } } @@ -148,6 +148,27 @@ export interface RecipientCreateResponse { * Share Recipient status message. */ status_message: string; + + resources?: Array; +} + +export namespace RecipientCreateResponse { + export interface Resource { + /** + * Share Recipient error message. + */ + error: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Version. + */ + resource_version: number; + } } export interface RecipientListResponse { @@ -180,6 +201,27 @@ export interface RecipientListResponse { * Share Recipient status message. */ status_message: string; + + resources?: Array; +} + +export namespace RecipientListResponse { + export interface Resource { + /** + * Share Recipient error message. + */ + error: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Version. + */ + resource_version: number; + } } export interface RecipientDeleteResponse { @@ -212,6 +254,27 @@ export interface RecipientDeleteResponse { * Share Recipient status message. */ status_message: string; + + resources?: Array; +} + +export namespace RecipientDeleteResponse { + export interface Resource { + /** + * Share Recipient error message. + */ + error: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Version. + */ + resource_version: number; + } } export interface RecipientGetResponse { @@ -244,6 +307,27 @@ export interface RecipientGetResponse { * Share Recipient status message. */ status_message: string; + + resources?: Array; +} + +export namespace RecipientGetResponse { + export interface Resource { + /** + * Share Recipient error message. + */ + error: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Version. + */ + resource_version: number; + } } export interface RecipientCreateParams { @@ -268,6 +352,11 @@ export interface RecipientListParams extends V4PagePaginationArrayParams { * Path param: Account identifier. */ account_id: string; + + /** + * Query param: Include resources in the response. + */ + include_resources?: boolean; } export interface RecipientDeleteParams { @@ -279,9 +368,14 @@ export interface RecipientDeleteParams { export interface RecipientGetParams { /** - * Account identifier. + * Path param: Account identifier. */ account_id: string; + + /** + * Query param: Include resources in the response. + */ + include_resources?: boolean; } Recipients.RecipientListResponsesV4PagePaginationArray = RecipientListResponsesV4PagePaginationArray; diff --git a/src/resources/resource-sharing/resource-sharing.ts b/src/resources/resource-sharing/resource-sharing.ts index ec6f1cd232..a020353393 100644 --- a/src/resources/resource-sharing/resource-sharing.ts +++ b/src/resources/resource-sharing/resource-sharing.ts @@ -165,11 +165,12 @@ export class ResourceSharing extends APIResource { params: ResourceSharingGetParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; + const { account_id, ...query } = params; return ( - this._client.get(`/accounts/${account_id}/shares/${shareId}`, options) as Core.APIPromise<{ - result: ResourceSharingGetResponse; - }> + this._client.get(`/accounts/${account_id}/shares/${shareId}`, { + query, + ...options, + }) as Core.APIPromise<{ result: ResourceSharingGetResponse }> )._thenUnwrap((obj) => obj.result); } } @@ -216,7 +217,92 @@ export interface ResourceSharingCreateResponse { target_type: 'account' | 'organization'; + /** + * The number of recipients in the 'associated' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associated_recipient_count?: number; + + /** + * The number of recipients in the 'associating' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associating_recipient_count?: number; + + /** + * The number of recipients in the 'disassociated' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociated_recipient_count?: number; + + /** + * The number of recipients in the 'disassociating' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociating_recipient_count?: number; + kind?: 'sent' | 'received'; + + /** + * A list of resources that are part of the share. This field is only included when + * requested via the 'include_resources' parameter. + */ + resources?: Array; +} + +export namespace ResourceSharingCreateResponse { + export interface Resource { + /** + * Share Resource identifier. + */ + id: string; + + /** + * When the share was created. + */ + created: string; + + /** + * Resource Metadata. + */ + meta: unknown; + + /** + * When the share was modified. + */ + modified: string; + + /** + * Account identifier. + */ + resource_account_id: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Type. + */ + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; + + /** + * Resource Version. + */ + resource_version: number; + + /** + * Resource Status. + */ + status: 'active' | 'deleting' | 'deleted'; + } } export interface ResourceSharingUpdateResponse { @@ -259,7 +345,92 @@ export interface ResourceSharingUpdateResponse { target_type: 'account' | 'organization'; + /** + * The number of recipients in the 'associated' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associated_recipient_count?: number; + + /** + * The number of recipients in the 'associating' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associating_recipient_count?: number; + + /** + * The number of recipients in the 'disassociated' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociated_recipient_count?: number; + + /** + * The number of recipients in the 'disassociating' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociating_recipient_count?: number; + kind?: 'sent' | 'received'; + + /** + * A list of resources that are part of the share. This field is only included when + * requested via the 'include_resources' parameter. + */ + resources?: Array; +} + +export namespace ResourceSharingUpdateResponse { + export interface Resource { + /** + * Share Resource identifier. + */ + id: string; + + /** + * When the share was created. + */ + created: string; + + /** + * Resource Metadata. + */ + meta: unknown; + + /** + * When the share was modified. + */ + modified: string; + + /** + * Account identifier. + */ + resource_account_id: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Type. + */ + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; + + /** + * Resource Version. + */ + resource_version: number; + + /** + * Resource Status. + */ + status: 'active' | 'deleting' | 'deleted'; + } } export interface ResourceSharingListResponse { @@ -302,7 +473,92 @@ export interface ResourceSharingListResponse { target_type: 'account' | 'organization'; + /** + * The number of recipients in the 'associated' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associated_recipient_count?: number; + + /** + * The number of recipients in the 'associating' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associating_recipient_count?: number; + + /** + * The number of recipients in the 'disassociated' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociated_recipient_count?: number; + + /** + * The number of recipients in the 'disassociating' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociating_recipient_count?: number; + kind?: 'sent' | 'received'; + + /** + * A list of resources that are part of the share. This field is only included when + * requested via the 'include_resources' parameter. + */ + resources?: Array; +} + +export namespace ResourceSharingListResponse { + export interface Resource { + /** + * Share Resource identifier. + */ + id: string; + + /** + * When the share was created. + */ + created: string; + + /** + * Resource Metadata. + */ + meta: unknown; + + /** + * When the share was modified. + */ + modified: string; + + /** + * Account identifier. + */ + resource_account_id: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Type. + */ + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; + + /** + * Resource Version. + */ + resource_version: number; + + /** + * Resource Status. + */ + status: 'active' | 'deleting' | 'deleted'; + } } export interface ResourceSharingDeleteResponse { @@ -345,7 +601,92 @@ export interface ResourceSharingDeleteResponse { target_type: 'account' | 'organization'; + /** + * The number of recipients in the 'associated' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associated_recipient_count?: number; + + /** + * The number of recipients in the 'associating' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associating_recipient_count?: number; + + /** + * The number of recipients in the 'disassociated' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociated_recipient_count?: number; + + /** + * The number of recipients in the 'disassociating' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociating_recipient_count?: number; + kind?: 'sent' | 'received'; + + /** + * A list of resources that are part of the share. This field is only included when + * requested via the 'include_resources' parameter. + */ + resources?: Array; +} + +export namespace ResourceSharingDeleteResponse { + export interface Resource { + /** + * Share Resource identifier. + */ + id: string; + + /** + * When the share was created. + */ + created: string; + + /** + * Resource Metadata. + */ + meta: unknown; + + /** + * When the share was modified. + */ + modified: string; + + /** + * Account identifier. + */ + resource_account_id: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Type. + */ + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; + + /** + * Resource Version. + */ + resource_version: number; + + /** + * Resource Status. + */ + status: 'active' | 'deleting' | 'deleted'; + } } export interface ResourceSharingGetResponse { @@ -388,7 +729,92 @@ export interface ResourceSharingGetResponse { target_type: 'account' | 'organization'; + /** + * The number of recipients in the 'associated' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associated_recipient_count?: number; + + /** + * The number of recipients in the 'associating' state. This field is only included + * when requested via the 'include_recipient_counts' parameter. + */ + associating_recipient_count?: number; + + /** + * The number of recipients in the 'disassociated' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociated_recipient_count?: number; + + /** + * The number of recipients in the 'disassociating' state. This field is only + * included when requested via the 'include_recipient_counts' parameter. + */ + disassociating_recipient_count?: number; + kind?: 'sent' | 'received'; + + /** + * A list of resources that are part of the share. This field is only included when + * requested via the 'include_resources' parameter. + */ + resources?: Array; +} + +export namespace ResourceSharingGetResponse { + export interface Resource { + /** + * Share Resource identifier. + */ + id: string; + + /** + * When the share was created. + */ + created: string; + + /** + * Resource Metadata. + */ + meta: unknown; + + /** + * When the share was modified. + */ + modified: string; + + /** + * Account identifier. + */ + resource_account_id: string; + + /** + * Share Resource identifier. + */ + resource_id: string; + + /** + * Resource Type. + */ + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; + + /** + * Resource Version. + */ + resource_version: number; + + /** + * Resource Status. + */ + status: 'active' | 'deleting' | 'deleted'; + } } export interface ResourceSharingCreateParams { @@ -448,7 +874,13 @@ export namespace ResourceSharingCreateParams { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; } } @@ -475,6 +907,16 @@ export interface ResourceSharingListParams extends V4PagePaginationArrayParams { */ direction?: 'asc' | 'desc'; + /** + * Query param: Include recipient counts in the response. + */ + include_recipient_counts?: boolean; + + /** + * Query param: Include resources in the response. + */ + include_resources?: boolean; + /** * Query param: Filter shares by kind. */ @@ -485,6 +927,18 @@ export interface ResourceSharingListParams extends V4PagePaginationArrayParams { */ order?: 'name' | 'created'; + /** + * Query param: Filter share resources by resource_types. + */ + resource_types?: Array< + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching' + >; + /** * Query param: Filter shares by status. */ @@ -505,9 +959,19 @@ export interface ResourceSharingDeleteParams { export interface ResourceSharingGetParams { /** - * Account identifier. + * Path param: Account identifier. */ account_id: string; + + /** + * Query param: Include recipient counts in the response. + */ + include_recipient_counts?: boolean; + + /** + * Query param: Include resources in the response. + */ + include_resources?: boolean; } ResourceSharing.ResourceSharingListResponsesV4PagePaginationArray = diff --git a/src/resources/resource-sharing/resources.ts b/src/resources/resource-sharing/resources.ts index 91100457a4..6e24761c2a 100644 --- a/src/resources/resource-sharing/resources.ts +++ b/src/resources/resource-sharing/resources.ts @@ -190,7 +190,13 @@ export interface ResourceCreateResponse { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Resource Version. @@ -237,7 +243,13 @@ export interface ResourceUpdateResponse { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Resource Version. @@ -284,7 +296,13 @@ export interface ResourceListResponse { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Resource Version. @@ -331,7 +349,13 @@ export interface ResourceDeleteResponse { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Resource Version. @@ -378,7 +402,13 @@ export interface ResourceGetResponse { /** * Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Resource Version. @@ -415,7 +445,13 @@ export interface ResourceCreateParams { /** * Body param: Resource Type. */ - resource_type: 'custom-ruleset' | 'widget'; + resource_type: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; } export interface ResourceUpdateParams { @@ -439,7 +475,13 @@ export interface ResourceListParams extends V4PagePaginationArrayParams { /** * Query param: Filter share resources by resource_type. */ - resource_type?: 'custom-ruleset' | 'widget'; + resource_type?: + | 'custom-ruleset' + | 'widget' + | 'gateway-policy' + | 'gateway-destination-ip' + | 'gateway-block-page-settings' + | 'gateway-extended-email-matching'; /** * Query param: Filter share resources by status. diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index cafdaefaff..f834fbc70b 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -12,6 +12,9 @@ export class Items extends APIResource { * This operation is asynchronous. To get current the operation status, invoke the * `Get bulk operation status` endpoint with the returned `operation_id`. * + * There is a limit of 1 pending bulk operation per account. If an outstanding bulk + * operation is in progress, the request will be rejected. + * * @example * ```ts * const item = await client.rules.lists.items.create( @@ -44,6 +47,9 @@ export class Items extends APIResource { * This operation is asynchronous. To get current the operation status, invoke the * `Get bulk operation status` endpoint with the returned `operation_id`. * + * There is a limit of 1 pending bulk operation per account. If an outstanding bulk + * operation is in progress, the request will be rejected. + * * @example * ```ts * const item = await client.rules.lists.items.update( @@ -102,6 +108,9 @@ export class Items extends APIResource { * This operation is asynchronous. To get current the operation status, invoke the * `Get bulk operation status` endpoint with the returned `operation_id`. * + * There is a limit of 1 pending bulk operation per account. If an outstanding bulk + * operation is in progress, the request will be rejected. + * * @example * ```ts * const item = await client.rules.lists.items.delete( diff --git a/src/resources/snippets/snippets.ts b/src/resources/snippets/snippets.ts index bfc3c4dc14..bc4563bcca 100644 --- a/src/resources/snippets/snippets.ts +++ b/src/resources/snippets/snippets.ts @@ -160,15 +160,12 @@ export interface SnippetUpdateParams { */ zone_id: string; - /** - * Body param: The list of files belonging to the snippet. - */ - files: Array; - /** * Body param: Metadata about the snippet. */ metadata: SnippetUpdateParams.Metadata; + + [k: string]: Array | string | SnippetUpdateParams.Metadata | undefined; } export namespace SnippetUpdateParams { diff --git a/src/resources/stream/downloads.ts b/src/resources/stream/downloads.ts index 48fe492adf..a9d2589f13 100644 --- a/src/resources/stream/downloads.ts +++ b/src/resources/stream/downloads.ts @@ -5,7 +5,8 @@ import * as Core from '../../core'; export class Downloads extends APIResource { /** - * Creates a download for a video when a video is ready to view. + * Creates a download for a video when a video is ready to view. Use + * `/downloads/{download_type}` instead for type-specific downloads. * * @example * ```ts @@ -33,7 +34,8 @@ export class Downloads extends APIResource { } /** - * Delete the downloads for a video. + * Delete the downloads for a video. Use `/downloads/{download_type}` instead for + * type-specific downloads. * * @example * ```ts diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts index 3d777a700c..8b15a53e2d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/bindings.ts @@ -47,9 +47,12 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindAssets | BindingGetResponse.WorkersBindingKindBrowser | BindingGetResponse.WorkersBindingKindD1 + | BindingGetResponse.WorkersBindingKindDataBlob | BindingGetResponse.WorkersBindingKindDispatchNamespace | BindingGetResponse.WorkersBindingKindDurableObjectNamespace | BindingGetResponse.WorkersBindingKindHyperdrive + | BindingGetResponse.WorkersBindingKindInherit + | BindingGetResponse.WorkersBindingKindImages | BindingGetResponse.WorkersBindingKindJson | BindingGetResponse.WorkersBindingKindKVNamespace | BindingGetResponse.WorkersBindingKindMTLSCertificate @@ -58,13 +61,16 @@ export type BindingGetResponse = | BindingGetResponse.WorkersBindingKindQueue | BindingGetResponse.WorkersBindingKindR2Bucket | BindingGetResponse.WorkersBindingKindSecretText + | BindingGetResponse.WorkersBindingKindSendEmail | BindingGetResponse.WorkersBindingKindService | BindingGetResponse.WorkersBindingKindTailConsumer + | BindingGetResponse.WorkersBindingKindTextBlob | BindingGetResponse.WorkersBindingKindVectorize | BindingGetResponse.WorkersBindingKindVersionMetadata | BindingGetResponse.WorkersBindingKindSecretsStoreSecret | BindingGetResponse.WorkersBindingKindSecretKey - | BindingGetResponse.WorkersBindingKindWorkflow; + | BindingGetResponse.WorkersBindingKindWorkflow + | BindingGetResponse.WorkersBindingKindWasmModule; export namespace BindingGetResponse { export interface WorkersBindingKindAI { @@ -137,6 +143,24 @@ export namespace BindingGetResponse { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -244,6 +268,44 @@ export namespace BindingGetResponse { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -361,6 +423,13 @@ export namespace BindingGetResponse { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -375,12 +444,34 @@ export namespace BindingGetResponse { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. */ - environment: string; + destination_address?: string; + } + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -395,6 +486,11 @@ export namespace BindingGetResponse { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -414,6 +510,24 @@ export namespace BindingGetResponse { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -525,6 +639,24 @@ export namespace BindingGetResponse { */ script_name?: string; } + + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } } export interface BindingGetParams { 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 3251e38417..9170366dbd 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -356,9 +356,12 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindAssets | Metadata.WorkersBindingKindBrowser | Metadata.WorkersBindingKindD1 + | Metadata.WorkersBindingKindDataBlob | Metadata.WorkersBindingKindDispatchNamespace | Metadata.WorkersBindingKindDurableObjectNamespace | Metadata.WorkersBindingKindHyperdrive + | Metadata.WorkersBindingKindInherit + | Metadata.WorkersBindingKindImages | Metadata.WorkersBindingKindJson | Metadata.WorkersBindingKindKVNamespace | Metadata.WorkersBindingKindMTLSCertificate @@ -367,19 +370,21 @@ export namespace ScriptUpdateParams { | Metadata.WorkersBindingKindQueue | Metadata.WorkersBindingKindR2Bucket | Metadata.WorkersBindingKindSecretText + | Metadata.WorkersBindingKindSendEmail | Metadata.WorkersBindingKindService | Metadata.WorkersBindingKindTailConsumer + | Metadata.WorkersBindingKindTextBlob | Metadata.WorkersBindingKindVectorize | Metadata.WorkersBindingKindVersionMetadata | Metadata.WorkersBindingKindSecretsStoreSecret | Metadata.WorkersBindingKindSecretKey | Metadata.WorkersBindingKindWorkflow + | Metadata.WorkersBindingKindWasmModule >; /** - * Name of the part in the multipart request that contains the script (e.g. the - * file adding a listener to the `fetch` event). Indicates a - * `service worker syntax` Worker. + * Name of the uploaded file that contains the script (e.g. the file adding a + * listener to the `fetch` event). Indicates a `service worker syntax` Worker. */ body_part?: string; @@ -418,8 +423,8 @@ export namespace ScriptUpdateParams { logpush?: boolean; /** - * Name of the part in the multipart request that contains the main module (e.g. - * the file exporting a `fetch` handler). Indicates a `module syntax` Worker. + * Name of the uploaded file that contains the main module (e.g. the file exporting + * a `fetch` handler). Indicates a `module syntax` Worker. */ main_module?: string; @@ -586,6 +591,24 @@ export namespace ScriptUpdateParams { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -693,6 +716,44 @@ export namespace ScriptUpdateParams { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -810,6 +871,13 @@ export namespace ScriptUpdateParams { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -829,12 +897,34 @@ export namespace ScriptUpdateParams { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. */ - environment: string; + destination_address?: string; + } + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -849,6 +939,11 @@ export namespace ScriptUpdateParams { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -868,6 +963,24 @@ export namespace ScriptUpdateParams { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -992,6 +1105,24 @@ export namespace ScriptUpdateParams { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -1058,10 +1189,20 @@ export namespace ScriptUpdateParams { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.ts index 62ac031103..2dc200282a 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/secrets.ts @@ -88,11 +88,11 @@ export class Secrets extends APIResource { params: SecretDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; + const { account_id, url_encoded } = params; return ( this._client.delete( `/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets/${secretName}`, - options, + { query: { url_encoded }, ...options }, ) as Core.APIPromise<{ result: SecretDeleteResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -119,11 +119,11 @@ export class Secrets extends APIResource { params: SecretGetParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id } = params; + const { account_id, ...query } = params; return ( this._client.get( `/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}/secrets/${secretName}`, - options, + { query, ...options }, ) as Core.APIPromise<{ result: SecretGetResponse }> )._thenUnwrap((obj) => obj.result); } @@ -379,16 +379,26 @@ export interface SecretListParams { export interface SecretDeleteParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; + + /** + * Query param: Flag that indicates whether the secret name is URL encoded. + */ + url_encoded?: boolean; } export interface SecretGetParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; + + /** + * Query param: Flag that indicates whether the secret name is URL encoded. + */ + url_encoded?: boolean; } Secrets.SecretListResponsesSinglePage = SecretListResponsesSinglePage; diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index 3f2241277e..fea3a53ffc 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -75,9 +75,12 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindAssets | SettingEditResponse.WorkersBindingKindBrowser | SettingEditResponse.WorkersBindingKindD1 + | SettingEditResponse.WorkersBindingKindDataBlob | SettingEditResponse.WorkersBindingKindDispatchNamespace | SettingEditResponse.WorkersBindingKindDurableObjectNamespace | SettingEditResponse.WorkersBindingKindHyperdrive + | SettingEditResponse.WorkersBindingKindInherit + | SettingEditResponse.WorkersBindingKindImages | SettingEditResponse.WorkersBindingKindJson | SettingEditResponse.WorkersBindingKindKVNamespace | SettingEditResponse.WorkersBindingKindMTLSCertificate @@ -86,13 +89,16 @@ export interface SettingEditResponse { | SettingEditResponse.WorkersBindingKindQueue | SettingEditResponse.WorkersBindingKindR2Bucket | SettingEditResponse.WorkersBindingKindSecretText + | SettingEditResponse.WorkersBindingKindSendEmail | SettingEditResponse.WorkersBindingKindService | SettingEditResponse.WorkersBindingKindTailConsumer + | SettingEditResponse.WorkersBindingKindTextBlob | SettingEditResponse.WorkersBindingKindVectorize | SettingEditResponse.WorkersBindingKindVersionMetadata | SettingEditResponse.WorkersBindingKindSecretsStoreSecret | SettingEditResponse.WorkersBindingKindSecretKey | SettingEditResponse.WorkersBindingKindWorkflow + | SettingEditResponse.WorkersBindingKindWasmModule >; /** @@ -130,7 +136,7 @@ export interface SettingEditResponse { placement?: SettingEditResponse.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -216,6 +222,24 @@ export namespace SettingEditResponse { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -323,6 +347,44 @@ export namespace SettingEditResponse { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -440,6 +502,13 @@ export namespace SettingEditResponse { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -454,12 +523,34 @@ export namespace SettingEditResponse { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. */ - environment: string; + allowed_sender_addresses?: Array; + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -474,6 +565,11 @@ export namespace SettingEditResponse { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -493,6 +589,24 @@ export namespace SettingEditResponse { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -605,6 +719,24 @@ export namespace SettingEditResponse { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -653,10 +785,20 @@ export namespace SettingEditResponse { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } @@ -685,9 +827,12 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindAssets | SettingGetResponse.WorkersBindingKindBrowser | SettingGetResponse.WorkersBindingKindD1 + | SettingGetResponse.WorkersBindingKindDataBlob | SettingGetResponse.WorkersBindingKindDispatchNamespace | SettingGetResponse.WorkersBindingKindDurableObjectNamespace | SettingGetResponse.WorkersBindingKindHyperdrive + | SettingGetResponse.WorkersBindingKindInherit + | SettingGetResponse.WorkersBindingKindImages | SettingGetResponse.WorkersBindingKindJson | SettingGetResponse.WorkersBindingKindKVNamespace | SettingGetResponse.WorkersBindingKindMTLSCertificate @@ -696,13 +841,16 @@ export interface SettingGetResponse { | SettingGetResponse.WorkersBindingKindQueue | SettingGetResponse.WorkersBindingKindR2Bucket | SettingGetResponse.WorkersBindingKindSecretText + | SettingGetResponse.WorkersBindingKindSendEmail | SettingGetResponse.WorkersBindingKindService | SettingGetResponse.WorkersBindingKindTailConsumer + | SettingGetResponse.WorkersBindingKindTextBlob | SettingGetResponse.WorkersBindingKindVectorize | SettingGetResponse.WorkersBindingKindVersionMetadata | SettingGetResponse.WorkersBindingKindSecretsStoreSecret | SettingGetResponse.WorkersBindingKindSecretKey | SettingGetResponse.WorkersBindingKindWorkflow + | SettingGetResponse.WorkersBindingKindWasmModule >; /** @@ -740,7 +888,7 @@ export interface SettingGetResponse { placement?: SettingGetResponse.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -826,6 +974,24 @@ export namespace SettingGetResponse { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -933,6 +1099,44 @@ export namespace SettingGetResponse { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -1050,6 +1254,13 @@ export namespace SettingGetResponse { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -1064,12 +1275,34 @@ export namespace SettingGetResponse { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. */ - environment: string; + destination_address?: string; + } + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -1084,6 +1317,11 @@ export namespace SettingGetResponse { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -1103,6 +1341,24 @@ export namespace SettingGetResponse { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -1215,6 +1471,24 @@ export namespace SettingGetResponse { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -1263,10 +1537,20 @@ export namespace SettingGetResponse { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } @@ -1308,9 +1592,12 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindAssets | Settings.WorkersBindingKindBrowser | Settings.WorkersBindingKindD1 + | Settings.WorkersBindingKindDataBlob | Settings.WorkersBindingKindDispatchNamespace | Settings.WorkersBindingKindDurableObjectNamespace | Settings.WorkersBindingKindHyperdrive + | Settings.WorkersBindingKindInherit + | Settings.WorkersBindingKindImages | Settings.WorkersBindingKindJson | Settings.WorkersBindingKindKVNamespace | Settings.WorkersBindingKindMTLSCertificate @@ -1319,13 +1606,16 @@ export namespace SettingEditParams { | Settings.WorkersBindingKindQueue | Settings.WorkersBindingKindR2Bucket | Settings.WorkersBindingKindSecretText + | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService | Settings.WorkersBindingKindTailConsumer + | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata | Settings.WorkersBindingKindSecretsStoreSecret | Settings.WorkersBindingKindSecretKey | Settings.WorkersBindingKindWorkflow + | Settings.WorkersBindingKindWasmModule >; /** @@ -1368,7 +1658,7 @@ export namespace SettingEditParams { placement?: Settings.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -1454,6 +1744,24 @@ export namespace SettingEditParams { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -1561,6 +1869,44 @@ export namespace SettingEditParams { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -1678,6 +2024,13 @@ export namespace SettingEditParams { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -1697,12 +2050,34 @@ export namespace SettingEditParams { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. */ - environment: string; + allowed_destination_addresses?: Array; + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -1717,6 +2092,11 @@ export namespace SettingEditParams { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -1736,6 +2116,24 @@ export namespace SettingEditParams { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -1860,6 +2258,24 @@ export namespace SettingEditParams { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -1926,10 +2342,20 @@ export namespace SettingEditParams { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts index 35116351b0..73ea9f79b9 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/tags.ts @@ -16,7 +16,7 @@ export class Tags extends APIResource { * 'this-is_my_script-01', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: ['my-tag'], + * body: ['my-team', 'my-public-api'], * }, * )) { * // ... @@ -101,14 +101,8 @@ export class TagUpdateResponsesSinglePage extends SinglePage export class TagListResponsesSinglePage extends SinglePage {} -/** - * Tag to help you manage your Worker. - */ export type TagUpdateResponse = string; -/** - * Tag to help you manage your Worker. - */ export type TagListResponse = string; export type TagDeleteResponse = unknown; @@ -120,7 +114,7 @@ export interface TagUpdateParams { account_id: string; /** - * Body param: Tags to help you manage your Workers. + * Body param: Tags associated with the Worker. */ body: Array; } diff --git a/src/resources/workers/beta/beta.ts b/src/resources/workers/beta/beta.ts index 2e0f708337..8f43f5d9dc 100644 --- a/src/resources/workers/beta/beta.ts +++ b/src/resources/workers/beta/beta.ts @@ -7,6 +7,7 @@ import { WorkerCreateParams, WorkerDeleteParams, WorkerDeleteResponse, + WorkerEditParams, WorkerGetParams, WorkerListParams, WorkerUpdateParams, @@ -31,6 +32,7 @@ export declare namespace Beta { type WorkerUpdateParams as WorkerUpdateParams, type WorkerListParams as WorkerListParams, type WorkerDeleteParams as WorkerDeleteParams, + type WorkerEditParams as WorkerEditParams, type WorkerGetParams as WorkerGetParams, }; } diff --git a/src/resources/workers/beta/index.ts b/src/resources/workers/beta/index.ts index 1a2dc90d9d..2a3b6909f1 100644 --- a/src/resources/workers/beta/index.ts +++ b/src/resources/workers/beta/index.ts @@ -10,5 +10,6 @@ export { type WorkerUpdateParams, type WorkerListParams, type WorkerDeleteParams, + type WorkerEditParams, type WorkerGetParams, } from './workers/index'; diff --git a/src/resources/workers/beta/workers/index.ts b/src/resources/workers/beta/workers/index.ts index af231f5b6d..0b985e5f56 100644 --- a/src/resources/workers/beta/workers/index.ts +++ b/src/resources/workers/beta/workers/index.ts @@ -19,5 +19,6 @@ export { type WorkerUpdateParams, type WorkerListParams, type WorkerDeleteParams, + type WorkerEditParams, type WorkerGetParams, } from './workers'; diff --git a/src/resources/workers/beta/workers/versions.ts b/src/resources/workers/beta/workers/versions.ts index 7f5e1c38cd..300510fc56 100644 --- a/src/resources/workers/beta/workers/versions.ts +++ b/src/resources/workers/beta/workers/versions.ts @@ -13,7 +13,7 @@ export class Versions extends APIResource { * ```ts * const version = * await client.workers.beta.workers.versions.create( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'worker_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -23,9 +23,10 @@ export class Versions extends APIResource { params: VersionCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id, ...body } = params; + const { account_id, deploy, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/workers/${workerId}/versions`, { + query: { deploy }, body, ...options, }) as Core.APIPromise<{ result: Version }> @@ -39,7 +40,7 @@ export class Versions extends APIResource { * ```ts * // Automatically fetches more pages as needed. * for await (const version of client.workers.beta.workers.versions.list( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'worker_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... @@ -66,15 +67,15 @@ export class Versions extends APIResource { * ```ts * const version = * await client.workers.beta.workers.versions.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * 'worker_id', + * 'version_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ delete( workerId: string, - versionId: (string & {}) | 'latest', + versionId: string, params: VersionDeleteParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -92,15 +93,15 @@ export class Versions extends APIResource { * ```ts * const version = * await client.workers.beta.workers.versions.get( - * '023e105f4ecef8ad9ca31a8372d0c353', - * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * 'worker_id', + * 'version_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get( workerId: string, - versionId: (string & {}) | 'latest', + versionId: string, params: VersionGetParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -139,6 +140,12 @@ export interface Version { /** * Configuration for assets within a Worker. + * + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files should be included as modules named `_headers` and `_redirects` with + * content type `text/plain`. */ assets?: Version.Assets; @@ -153,9 +160,12 @@ export interface Version { | Version.WorkersBindingKindAssets | Version.WorkersBindingKindBrowser | Version.WorkersBindingKindD1 + | Version.WorkersBindingKindDataBlob | Version.WorkersBindingKindDispatchNamespace | Version.WorkersBindingKindDurableObjectNamespace | Version.WorkersBindingKindHyperdrive + | Version.WorkersBindingKindInherit + | Version.WorkersBindingKindImages | Version.WorkersBindingKindJson | Version.WorkersBindingKindKVNamespace | Version.WorkersBindingKindMTLSCertificate @@ -164,13 +174,16 @@ export interface Version { | Version.WorkersBindingKindQueue | Version.WorkersBindingKindR2Bucket | Version.WorkersBindingKindSecretText + | Version.WorkersBindingKindSendEmail | Version.WorkersBindingKindService | Version.WorkersBindingKindTailConsumer + | Version.WorkersBindingKindTextBlob | Version.WorkersBindingKindVectorize | Version.WorkersBindingKindVersionMetadata | Version.WorkersBindingKindSecretsStoreSecret | Version.WorkersBindingKindSecretKey | Version.WorkersBindingKindWorkflow + | Version.WorkersBindingKindWasmModule >; /** @@ -205,6 +218,15 @@ export interface Version { /** * Code, sourcemaps, and other content used at runtime. + * + * This includes + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files used to configure + * [Static Assets](https://developers.cloudflare.com/workers/static-assets/). + * `_headers` and `_redirects` files should be included as modules named `_headers` + * and `_redirects` with content type `text/plain`. */ modules?: Array; @@ -247,6 +269,12 @@ export namespace Version { /** * Configuration for assets within a Worker. + * + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files should be included as modules named `_headers` and `_redirects` with + * content type `text/plain`. */ export interface Assets { /** @@ -356,6 +384,24 @@ export namespace Version { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -463,6 +509,44 @@ export namespace Version { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -580,6 +664,13 @@ export namespace Version { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -594,12 +685,34 @@ export namespace Version { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. */ - environment: string; + name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -614,6 +727,11 @@ export namespace Version { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -633,6 +751,24 @@ export namespace Version { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -745,6 +881,24 @@ export namespace Version { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Resource limits enforced at runtime. */ @@ -836,6 +990,12 @@ export interface VersionCreateParams { */ account_id: string; + /** + * Query param: If true, a deployment will be created that sends 100% of traffic to + * the new version. + */ + deploy?: boolean; + /** * Body param: Metadata about the version. */ @@ -843,6 +1003,12 @@ export interface VersionCreateParams { /** * Body param: Configuration for assets within a Worker. + * + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files should be included as modules named `_headers` and `_redirects` with + * content type `text/plain`. */ assets?: VersionCreateParams.Assets; @@ -857,9 +1023,12 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindAssets | VersionCreateParams.WorkersBindingKindBrowser | VersionCreateParams.WorkersBindingKindD1 + | VersionCreateParams.WorkersBindingKindDataBlob | VersionCreateParams.WorkersBindingKindDispatchNamespace | VersionCreateParams.WorkersBindingKindDurableObjectNamespace | VersionCreateParams.WorkersBindingKindHyperdrive + | VersionCreateParams.WorkersBindingKindInherit + | VersionCreateParams.WorkersBindingKindImages | VersionCreateParams.WorkersBindingKindJson | VersionCreateParams.WorkersBindingKindKVNamespace | VersionCreateParams.WorkersBindingKindMTLSCertificate @@ -868,13 +1037,16 @@ export interface VersionCreateParams { | VersionCreateParams.WorkersBindingKindQueue | VersionCreateParams.WorkersBindingKindR2Bucket | VersionCreateParams.WorkersBindingKindSecretText + | VersionCreateParams.WorkersBindingKindSendEmail | VersionCreateParams.WorkersBindingKindService | VersionCreateParams.WorkersBindingKindTailConsumer + | VersionCreateParams.WorkersBindingKindTextBlob | VersionCreateParams.WorkersBindingKindVectorize | VersionCreateParams.WorkersBindingKindVersionMetadata | VersionCreateParams.WorkersBindingKindSecretsStoreSecret | VersionCreateParams.WorkersBindingKindSecretKey | VersionCreateParams.WorkersBindingKindWorkflow + | VersionCreateParams.WorkersBindingKindWasmModule >; /** @@ -910,6 +1082,15 @@ export interface VersionCreateParams { /** * Body param: Code, sourcemaps, and other content used at runtime. + * + * This includes + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files used to configure + * [Static Assets](https://developers.cloudflare.com/workers/static-assets/). + * `_headers` and `_redirects` files should be included as modules named `_headers` + * and `_redirects` with content type `text/plain`. */ modules?: Array; @@ -942,6 +1123,12 @@ export namespace VersionCreateParams { /** * Configuration for assets within a Worker. + * + * [`_headers`](https://developers.cloudflare.com/workers/static-assets/headers/#custom-headers) + * and + * [`_redirects`](https://developers.cloudflare.com/workers/static-assets/redirects/) + * files should be included as modules named `_headers` and `_redirects` with + * content type `text/plain`. */ export interface Assets { /** @@ -1051,6 +1238,24 @@ export namespace VersionCreateParams { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -1158,6 +1363,44 @@ export namespace VersionCreateParams { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -1275,6 +1518,13 @@ export namespace VersionCreateParams { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -1294,12 +1544,34 @@ export namespace VersionCreateParams { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. */ - environment: string; + allowed_sender_addresses?: Array; + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -1314,6 +1586,11 @@ export namespace VersionCreateParams { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -1333,6 +1610,24 @@ export namespace VersionCreateParams { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -1457,6 +1752,24 @@ export namespace VersionCreateParams { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Resource limits enforced at runtime. */ @@ -1534,7 +1847,9 @@ export interface VersionGetParams { account_id: string; /** - * Query param: + * Query param: Whether to include the `modules` property of the version in the + * response, which contains code and sourcemap content and may add several + * megabytes to the response size. */ include?: 'modules'; } diff --git a/src/resources/workers/beta/workers/workers.ts b/src/resources/workers/beta/workers/workers.ts index f5ac845261..ba7791704e 100644 --- a/src/resources/workers/beta/workers/workers.ts +++ b/src/resources/workers/beta/workers/workers.ts @@ -39,12 +39,15 @@ export class Workers extends APIResource { } /** - * Update an existing Worker. + * Perform a complete replacement of a Worker, where omitted properties are set to + * their default values. This is the exact same as the Create Worker endpoint, but + * operates on an existing Worker. To perform a partial update instead, use the + * Edit Worker endpoint. * * @example * ```ts * const worker = await client.workers.beta.workers.update( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'worker_id', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * name: 'my-worker', @@ -96,7 +99,7 @@ export class Workers extends APIResource { * @example * ```ts * const worker = await client.workers.beta.workers.delete( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'worker_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -110,13 +113,44 @@ export class Workers extends APIResource { return this._client.delete(`/accounts/${account_id}/workers/workers/${workerId}`, options); } + /** + * Perform a partial update on a Worker, where omitted properties are left + * unchanged from their current values. + * + * @example + * ```ts + * const worker = await client.workers.beta.workers.edit( + * 'worker_id', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * logpush: true, + * name: 'my-worker', + * observability: {}, + * subdomain: {}, + * tags: ['my-team', 'my-public-api'], + * tail_consumers: [{ name: 'my-tail-consumer' }], + * }, + * ); + * ``` + */ + edit(workerId: string, params: WorkerEditParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/workers/workers/${workerId}`, { + body, + ...options, + headers: { 'Content-Type': 'application/merge-patch+json', ...options?.headers }, + }) as Core.APIPromise<{ result: Worker }> + )._thenUnwrap((obj) => obj.result); + } + /** * Get details about a specific Worker. * * @example * ```ts * const worker = await client.workers.beta.workers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'worker_id', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` @@ -135,7 +169,7 @@ export class WorkersV4PagePaginationArray extends V4PagePaginationArray export interface Worker { /** - * Identifier. + * Immutable ID of the Worker. */ id: string; @@ -145,39 +179,39 @@ export interface Worker { created_on: string; /** - * Name of the Worker. + * Whether logpush is enabled for the Worker. */ - name: string; + logpush: boolean; /** - * When the Worker was most recently updated. - */ - updated_on: string; - - /** - * Whether logpush is enabled for the Worker. + * Name of the Worker. */ - logpush?: boolean; + name: string; /** * Observability settings for the Worker. */ - observability?: Worker.Observability; + observability: Worker.Observability; /** * Subdomain settings for the Worker. */ - subdomain?: Worker.Subdomain; + subdomain: Worker.Subdomain; /** * Tags associated with the Worker. */ - tags?: Array; + tags: Array; /** * Other Workers that should consume logs from the Worker. */ - tail_consumers?: Array; + tail_consumers: Array; + + /** + * When the Worker was most recently updated. + */ + updated_on: string; } export namespace Worker { @@ -523,6 +557,113 @@ export interface WorkerDeleteParams { account_id: string; } +export interface WorkerEditParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Whether logpush is enabled for the Worker. + */ + logpush: boolean; + + /** + * Body param: Name of the Worker. + */ + name: string; + + /** + * Body param: Observability settings for the Worker. + */ + observability: WorkerEditParams.Observability; + + /** + * Body param: Subdomain settings for the Worker. + */ + subdomain: WorkerEditParams.Subdomain; + + /** + * Body param: Tags associated with the Worker. + */ + tags: Array; + + /** + * Body param: Other Workers that should consume logs from the Worker. + */ + tail_consumers: Array; +} + +export namespace WorkerEditParams { + /** + * Observability settings for the Worker. + */ + export interface Observability { + /** + * Whether observability is enabled for the Worker. + */ + enabled?: boolean; + + /** + * The sampling rate for observability. From 0 to 1 (1 = 100%, 0.1 = 10%). + */ + head_sampling_rate?: number; + + /** + * Log settings for the Worker. + */ + logs?: Observability.Logs; + } + + export namespace Observability { + /** + * Log settings for the Worker. + */ + export interface Logs { + /** + * Whether logs are enabled for the Worker. + */ + enabled?: boolean; + + /** + * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). + */ + head_sampling_rate?: number; + + /** + * Whether + * [invocation logs](https://developers.cloudflare.com/workers/observability/logs/workers-logs/#invocation-logs) + * are enabled for the Worker. + */ + invocation_logs?: boolean; + } + } + + /** + * Subdomain settings for the Worker. + */ + export interface Subdomain { + /** + * Whether the \*.workers.dev subdomain is enabled for the Worker. + */ + enabled?: boolean; + + /** + * Whether + * [preview URLs](https://developers.cloudflare.com/workers/configuration/previews/) + * are enabled for the Worker. + */ + previews_enabled?: boolean; + } + + export interface TailConsumer { + /** + * Name of the consumer Worker. + */ + name: string; + } +} + export interface WorkerGetParams { /** * Identifier. @@ -543,6 +684,7 @@ export declare namespace Workers { type WorkerUpdateParams as WorkerUpdateParams, type WorkerListParams as WorkerListParams, type WorkerDeleteParams as WorkerDeleteParams, + type WorkerEditParams as WorkerEditParams, type WorkerGetParams as WorkerGetParams, }; diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index deeca000b3..08d046d2c3 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -41,10 +41,12 @@ export { type ScriptUpdateResponse, type ScriptDeleteResponse, type ScriptGetResponse, + type ScriptSearchResponse, type ScriptUpdateParams, type ScriptListParams, type ScriptDeleteParams, type ScriptGetParams, + type ScriptSearchParams, } from './scripts/index'; export { Subdomains, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 73bd09f1ac..4bbd0bb198 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -34,10 +34,12 @@ export { type ScriptUpdateResponse, type ScriptDeleteResponse, type ScriptGetResponse, + type ScriptSearchResponse, type ScriptUpdateParams, type ScriptListParams, type ScriptDeleteParams, type ScriptGetParams, + type ScriptSearchParams, } from './scripts'; export { SecretListResponsesSinglePage, diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 21511a3bb3..05bc7152a0 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -71,9 +71,12 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindAssets | ScriptAndVersionSettingEditResponse.WorkersBindingKindBrowser | ScriptAndVersionSettingEditResponse.WorkersBindingKindD1 + | ScriptAndVersionSettingEditResponse.WorkersBindingKindDataBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindDispatchNamespace | ScriptAndVersionSettingEditResponse.WorkersBindingKindDurableObjectNamespace | ScriptAndVersionSettingEditResponse.WorkersBindingKindHyperdrive + | ScriptAndVersionSettingEditResponse.WorkersBindingKindInherit + | ScriptAndVersionSettingEditResponse.WorkersBindingKindImages | ScriptAndVersionSettingEditResponse.WorkersBindingKindJson | ScriptAndVersionSettingEditResponse.WorkersBindingKindKVNamespace | ScriptAndVersionSettingEditResponse.WorkersBindingKindMTLSCertificate @@ -82,13 +85,16 @@ export interface ScriptAndVersionSettingEditResponse { | ScriptAndVersionSettingEditResponse.WorkersBindingKindQueue | ScriptAndVersionSettingEditResponse.WorkersBindingKindR2Bucket | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretText + | ScriptAndVersionSettingEditResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingEditResponse.WorkersBindingKindService | ScriptAndVersionSettingEditResponse.WorkersBindingKindTailConsumer + | ScriptAndVersionSettingEditResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingEditResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingEditResponse.WorkersBindingKindVersionMetadata | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretsStoreSecret | ScriptAndVersionSettingEditResponse.WorkersBindingKindSecretKey | ScriptAndVersionSettingEditResponse.WorkersBindingKindWorkflow + | ScriptAndVersionSettingEditResponse.WorkersBindingKindWasmModule >; /** @@ -126,7 +132,7 @@ export interface ScriptAndVersionSettingEditResponse { placement?: ScriptAndVersionSettingEditResponse.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -212,6 +218,24 @@ export namespace ScriptAndVersionSettingEditResponse { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -319,6 +343,44 @@ export namespace ScriptAndVersionSettingEditResponse { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -436,6 +498,13 @@ export namespace ScriptAndVersionSettingEditResponse { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -450,12 +519,34 @@ export namespace ScriptAndVersionSettingEditResponse { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. */ - environment: string; + allowed_sender_addresses?: Array; + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -470,6 +561,11 @@ export namespace ScriptAndVersionSettingEditResponse { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -489,6 +585,24 @@ export namespace ScriptAndVersionSettingEditResponse { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -601,6 +715,24 @@ export namespace ScriptAndVersionSettingEditResponse { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -649,10 +781,20 @@ export namespace ScriptAndVersionSettingEditResponse { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } @@ -681,9 +823,12 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindAssets | ScriptAndVersionSettingGetResponse.WorkersBindingKindBrowser | ScriptAndVersionSettingGetResponse.WorkersBindingKindD1 + | ScriptAndVersionSettingGetResponse.WorkersBindingKindDataBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindDispatchNamespace | ScriptAndVersionSettingGetResponse.WorkersBindingKindDurableObjectNamespace | ScriptAndVersionSettingGetResponse.WorkersBindingKindHyperdrive + | ScriptAndVersionSettingGetResponse.WorkersBindingKindInherit + | ScriptAndVersionSettingGetResponse.WorkersBindingKindImages | ScriptAndVersionSettingGetResponse.WorkersBindingKindJson | ScriptAndVersionSettingGetResponse.WorkersBindingKindKVNamespace | ScriptAndVersionSettingGetResponse.WorkersBindingKindMTLSCertificate @@ -692,13 +837,16 @@ export interface ScriptAndVersionSettingGetResponse { | ScriptAndVersionSettingGetResponse.WorkersBindingKindQueue | ScriptAndVersionSettingGetResponse.WorkersBindingKindR2Bucket | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretText + | ScriptAndVersionSettingGetResponse.WorkersBindingKindSendEmail | ScriptAndVersionSettingGetResponse.WorkersBindingKindService | ScriptAndVersionSettingGetResponse.WorkersBindingKindTailConsumer + | ScriptAndVersionSettingGetResponse.WorkersBindingKindTextBlob | ScriptAndVersionSettingGetResponse.WorkersBindingKindVectorize | ScriptAndVersionSettingGetResponse.WorkersBindingKindVersionMetadata | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretsStoreSecret | ScriptAndVersionSettingGetResponse.WorkersBindingKindSecretKey | ScriptAndVersionSettingGetResponse.WorkersBindingKindWorkflow + | ScriptAndVersionSettingGetResponse.WorkersBindingKindWasmModule >; /** @@ -736,7 +884,7 @@ export interface ScriptAndVersionSettingGetResponse { placement?: ScriptAndVersionSettingGetResponse.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -822,6 +970,24 @@ export namespace ScriptAndVersionSettingGetResponse { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -929,6 +1095,44 @@ export namespace ScriptAndVersionSettingGetResponse { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -1046,6 +1250,13 @@ export namespace ScriptAndVersionSettingGetResponse { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -1060,12 +1271,34 @@ export namespace ScriptAndVersionSettingGetResponse { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. + */ + allowed_destination_addresses?: Array; + + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. */ - environment: string; + destination_address?: string; + } + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -1080,6 +1313,11 @@ export namespace ScriptAndVersionSettingGetResponse { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -1099,6 +1337,24 @@ export namespace ScriptAndVersionSettingGetResponse { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -1211,6 +1467,24 @@ export namespace ScriptAndVersionSettingGetResponse { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -1259,10 +1533,20 @@ export namespace ScriptAndVersionSettingGetResponse { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } @@ -1304,9 +1588,12 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindAssets | Settings.WorkersBindingKindBrowser | Settings.WorkersBindingKindD1 + | Settings.WorkersBindingKindDataBlob | Settings.WorkersBindingKindDispatchNamespace | Settings.WorkersBindingKindDurableObjectNamespace | Settings.WorkersBindingKindHyperdrive + | Settings.WorkersBindingKindInherit + | Settings.WorkersBindingKindImages | Settings.WorkersBindingKindJson | Settings.WorkersBindingKindKVNamespace | Settings.WorkersBindingKindMTLSCertificate @@ -1315,13 +1602,16 @@ export namespace ScriptAndVersionSettingEditParams { | Settings.WorkersBindingKindQueue | Settings.WorkersBindingKindR2Bucket | Settings.WorkersBindingKindSecretText + | Settings.WorkersBindingKindSendEmail | Settings.WorkersBindingKindService | Settings.WorkersBindingKindTailConsumer + | Settings.WorkersBindingKindTextBlob | Settings.WorkersBindingKindVectorize | Settings.WorkersBindingKindVersionMetadata | Settings.WorkersBindingKindSecretsStoreSecret | Settings.WorkersBindingKindSecretKey | Settings.WorkersBindingKindWorkflow + | Settings.WorkersBindingKindWasmModule >; /** @@ -1364,7 +1654,7 @@ export namespace ScriptAndVersionSettingEditParams { placement?: Settings.Placement; /** - * Tags to help you manage your Workers. + * Tags associated with the Worker. */ tags?: Array; @@ -1450,6 +1740,24 @@ export namespace ScriptAndVersionSettingEditParams { type: 'd1'; } + export interface WorkersBindingKindDataBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the data content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'data_blob'; + } + export interface WorkersBindingKindDispatchNamespace { /** * A JavaScript variable name for the binding. @@ -1557,6 +1865,44 @@ export namespace ScriptAndVersionSettingEditParams { type: 'hyperdrive'; } + export interface WorkersBindingKindInherit { + /** + * The name of the inherited binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'inherit'; + + /** + * The old name of the inherited binding. If set, the binding will be renamed from + * `old_name` to `name` in the new version. If not set, the binding will keep the + * same name between versions. + */ + old_name?: string; + + /** + * Identifier for the version to inherit the binding from, which can be the version + * ID or the literal "latest" to inherit from the latest version. Defaults to + * inheriting the binding from the latest version. + */ + version_id?: string; + } + + export interface WorkersBindingKindImages { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'images'; + } + export interface WorkersBindingKindJson { /** * JSON data to use. @@ -1674,6 +2020,13 @@ export namespace ScriptAndVersionSettingEditParams { * The kind of resource that the binding provides. */ type: 'r2_bucket'; + + /** + * The + * [jurisdiction](https://developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions) + * of the R2 bucket. + */ + jurisdiction?: 'eu' | 'fedramp'; } export interface WorkersBindingKindSecretText { @@ -1693,12 +2046,34 @@ export namespace ScriptAndVersionSettingEditParams { type: 'secret_text'; } - export interface WorkersBindingKindService { + export interface WorkersBindingKindSendEmail { /** - * Optional environment if the Worker utilizes one. + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'send_email'; + + /** + * List of allowed destination addresses. */ - environment: string; + allowed_destination_addresses?: Array; + /** + * List of allowed sender addresses. + */ + allowed_sender_addresses?: Array; + + /** + * Destination address for the email. + */ + destination_address?: string; + } + + export interface WorkersBindingKindService { /** * A JavaScript variable name for the binding. */ @@ -1713,6 +2088,11 @@ export namespace ScriptAndVersionSettingEditParams { * The kind of resource that the binding provides. */ type: 'service'; + + /** + * Optional environment if the Worker utilizes one. + */ + environment?: string; } export interface WorkersBindingKindTailConsumer { @@ -1732,6 +2112,24 @@ export namespace ScriptAndVersionSettingEditParams { type: 'tail_consumer'; } + export interface WorkersBindingKindTextBlob { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the text content. Only accepted for + * `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'text_blob'; + } + export interface WorkersBindingKindVectorize { /** * Name of the Vectorize index to bind to. @@ -1856,6 +2254,24 @@ export namespace ScriptAndVersionSettingEditParams { script_name?: string; } + export interface WorkersBindingKindWasmModule { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The name of the file containing the WebAssembly module content. Only accepted + * for `service worker syntax` Workers. + */ + part: string; + + /** + * @deprecated The kind of resource that the binding provides. + */ + type: 'wasm_module'; + } + /** * Limits to apply for this Worker. */ @@ -1922,10 +2338,20 @@ export namespace ScriptAndVersionSettingEditParams { */ invocation_logs: boolean; + /** + * A list of destinations where logs will be exported to. + */ + destinations?: Array; + /** * The sampling rate for logs. From 0 to 1 (1 = 100%, 0.1 = 10%). Default is 1. */ head_sampling_rate?: number | null; + + /** + * Whether log persistence is enabled for the Worker. + */ + persist?: boolean; } } diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 60eb45d876..d96bb354dc 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -196,6 +196,26 @@ export class Scripts extends APIResource { headers: { Accept: 'application/javascript', ...options?.headers }, }); } + + /** + * Search for Workers in an account. + * + * @example + * ```ts + * const response = await client.workers.scripts.search({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + search(params: ScriptSearchParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return ( + this._client.get(`/accounts/${account_id}/workers/scripts-search`, { + query, + ...options, + }) as Core.APIPromise<{ result: ScriptSearchResponse }> + )._thenUnwrap((obj) => obj.result); + } } export class ScriptsSinglePage extends SinglePage