diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0b8bb94ba..74356bbc5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,12 @@ name: CI on: push: - branches: - - main - pull_request: - branches: - - main - - next + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,10 +14,9 @@ concurrency: jobs: lint: + timeout-minutes: 10 name: lint - runs-on: ubuntu-latest - timeout-minutes: 5 - + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 @@ -33,10 +32,12 @@ jobs: run: ./scripts/lint build: + timeout-minutes: 5 name: build - runs-on: ubuntu-latest - - + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + permissions: + contents: read + id-token: write steps: - uses: actions/checkout@v4 @@ -50,18 +51,32 @@ jobs: - name: Check build run: ./scripts/build + + - name: Get GitHub OIDC Token + if: github.repository == 'stainless-sdks/cloudflare-node' + id: github-oidc + uses: actions/github-script@v6 + with: + script: core.setOutput('github_token', await core.getIDToken()); + + - name: Upload tarball + if: github.repository == 'stainless-sdks/cloudflare-node' + env: + URL: https://pkg.stainless.com/s + AUTH: ${{ steps.github-oidc.outputs.github_token }} + SHA: ${{ github.sha }} + run: ./scripts/utils/upload-artifact.sh test: - name: test - runs-on: ubuntu-latest timeout-minutes: 10 - + name: test + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} steps: - uses: actions/checkout@v4 - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Bootstrap run: ./scripts/bootstrap @@ -69,9 +84,10 @@ jobs: - name: Run tests run: ./scripts/test examples: + timeout-minutes: 10 name: examples - runs-on: ubuntu-latest - timeout-minutes: 5 + runs-on: ${{ github.repository == 'stainless-sdks/cloudflare-node' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.repository == 'cloudflare/cloudflare-typescript' steps: - uses: actions/checkout@v4 @@ -79,7 +95,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | yarn install diff --git a/.github/workflows/publish-npm.yml b/.github/workflows/publish-npm.yml index 1f5fe1ffba..b449ce64bf 100644 --- a/.github/workflows/publish-npm.yml +++ b/.github/workflows/publish-npm.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v3 with: - node-version: '18' + node-version: '20' - name: Install dependencies run: | diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 34a3350a9a..83f9eb8041 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.2.0" + ".": "4.3.0" } diff --git a/.stats.yml b/.stats.yml index 025f3a2867..470cb923dc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,4 @@ -configured_endpoints: 1655 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ed9f898b31619623e50d660d04beca50e44987bfd3eb3a6ff98d3bca2a9c569.yml +configured_endpoints: 1734 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fbc6a8fce0f0e610b2737d9dc9755ab47d02a55d23152e9bdee060780a422df5.yml +openapi_spec_hash: 26c9bd123e3ac76b7c135c949c244286 +config_hash: 7e270b3449efce600e3469937a344c2d diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d9a93117b..0f1fc191e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,79 @@ # Changelog +## 4.3.0 (2025-05-21) + +Full Changelog: [v4.2.0...v4.3.0](https://github.com/cloudflare/cloudflare-typescript/compare/v4.2.0...v4.3.0) + +### Features + +* **access_settings:** add CRUD support ([f10edca](https://github.com/cloudflare/cloudflare-typescript/commit/f10edca8807f638ad09603e07424486f97bfff76)) +* **api:** api update ([4b92c4f](https://github.com/cloudflare/cloudflare-typescript/commit/4b92c4f1f5b9a565111d86b49d9f727edba414c9)) +* **api:** api update ([8f538f0](https://github.com/cloudflare/cloudflare-typescript/commit/8f538f07d0c7a77d6ea9e6449dda85aa4ef417ff)) +* **api:** api update ([3383cee](https://github.com/cloudflare/cloudflare-typescript/commit/3383cee6f073858b4128febc395ec211f6c7ab60)) +* **api:** api update ([63c569a](https://github.com/cloudflare/cloudflare-typescript/commit/63c569a77682b9f95a93e363b3bdde90ab469593)) +* **api:** api update ([267933d](https://github.com/cloudflare/cloudflare-typescript/commit/267933df6ec0f23df0763d93dd22aca8be61ce21)) +* **api:** api update ([f2248f5](https://github.com/cloudflare/cloudflare-typescript/commit/f2248f5a5a91b8b2a6f36f2ce9cf7eb438ed5e67)) +* **api:** api update ([38c6642](https://github.com/cloudflare/cloudflare-typescript/commit/38c664259586e53c298fa369db87cc5180c890b7)) +* **api:** api update ([b6ed1cc](https://github.com/cloudflare/cloudflare-typescript/commit/b6ed1ccbcf1f5d3f1ec2cc57a1d505694a7c2661)) +* **api:** api update ([2cd116d](https://github.com/cloudflare/cloudflare-typescript/commit/2cd116d7fa8da3f5ddf8720b7f0eeb07a13e2354)) +* **api:** api update ([04b28c9](https://github.com/cloudflare/cloudflare-typescript/commit/04b28c976cd076e8521cf7c609ee9e79a7348954)) +* **api:** api update ([32246fe](https://github.com/cloudflare/cloudflare-typescript/commit/32246febe32abc6c345994c435a67e193bf46df6)) +* **api:** api update ([610ee95](https://github.com/cloudflare/cloudflare-typescript/commit/610ee95773913b2f36b8fa341b44c1b8581c81c9)) +* **api:** api update ([b98e9dd](https://github.com/cloudflare/cloudflare-typescript/commit/b98e9dd351d99bdd87a00649ec2a4075533b7c8d)) +* **api:** api update ([d8a282f](https://github.com/cloudflare/cloudflare-typescript/commit/d8a282f13b77ebecb1eef31db5b6f1b7ff3c9a6c)) +* **api:** api update ([a63f486](https://github.com/cloudflare/cloudflare-typescript/commit/a63f4866496c733242cf5b874b42d1955c916bf8)) +* **api:** api update ([8833eee](https://github.com/cloudflare/cloudflare-typescript/commit/8833eee3e4d7db8d1d76842286aa11b98679237c)) +* **api:** api update ([d0c063d](https://github.com/cloudflare/cloudflare-typescript/commit/d0c063d253c91d63b2fc3708887bd616afd09ccc)) +* **api:** api update ([04b1f4b](https://github.com/cloudflare/cloudflare-typescript/commit/04b1f4b5c0a834c56c9daa6d6d4a52bb5a5de9a3)) +* **api:** api update ([fc0816e](https://github.com/cloudflare/cloudflare-typescript/commit/fc0816e20b20abb83880daaaf233f0abb1268c68)) +* **api:** api update ([1645e91](https://github.com/cloudflare/cloudflare-typescript/commit/1645e914b614fd95cacf57889531821ad03056a6)) +* **api:** api update ([ee6d90f](https://github.com/cloudflare/cloudflare-typescript/commit/ee6d90f733416f602caf2754ff994123645ee02f)) +* **api:** api update ([3d6233f](https://github.com/cloudflare/cloudflare-typescript/commit/3d6233fe117ff9490327811bcc47900f7ad4db57)) +* **api:** api update ([2a65e03](https://github.com/cloudflare/cloudflare-typescript/commit/2a65e0337bd157441ffb9027ba4bbbd4a0a9ac21)) +* **api:** api update ([a06323d](https://github.com/cloudflare/cloudflare-typescript/commit/a06323d0ed3841116e4a87a45655934a7bba6285)) +* **api:** api update ([dd94764](https://github.com/cloudflare/cloudflare-typescript/commit/dd94764796cbe5fc3edf7e007db4fd245a027e51)) +* **api:** api update ([aa75d23](https://github.com/cloudflare/cloudflare-typescript/commit/aa75d23186267e697c5193d7896810923fc1966f)) +* **api:** api update ([fb8f01b](https://github.com/cloudflare/cloudflare-typescript/commit/fb8f01b605818ffd311edda7651e2b99dba47b9e)) +* **api:** api update ([515205e](https://github.com/cloudflare/cloudflare-typescript/commit/515205e76913d2654266dd417d7f25f57db59cc3)) +* **api:** api update ([d30643b](https://github.com/cloudflare/cloudflare-typescript/commit/d30643b50971a4484029cd9ecd5504690c35b627)) +* **api:** api update ([392ac4d](https://github.com/cloudflare/cloudflare-typescript/commit/392ac4d59e9eb37cb9632e267f7a1983143335e0)) +* **api:** api update ([ccf8894](https://github.com/cloudflare/cloudflare-typescript/commit/ccf88946dd933479c915a728554951f14ee4c55c)) +* **api:** api update ([cceaf7f](https://github.com/cloudflare/cloudflare-typescript/commit/cceaf7f47576b44378c03409c7201b7d1d7ec7b5)) +* **api:** api update ([d9ca485](https://github.com/cloudflare/cloudflare-typescript/commit/d9ca48553dc51acb72648722c20443cc73b4e16d)) +* **api:** api update ([f136fa7](https://github.com/cloudflare/cloudflare-typescript/commit/f136fa7656c3cfcaa28a8bc79ac425b7f8b0d8a3)) +* **api:** api update ([06205bd](https://github.com/cloudflare/cloudflare-typescript/commit/06205bd17f0068fef6a53eaa194df2ac84a050c9)) +* **api:** api update ([57e6a56](https://github.com/cloudflare/cloudflare-typescript/commit/57e6a565e539efdf9dd5697fe7a42a501b6dff84)) +* **api:** api update ([7627ea8](https://github.com/cloudflare/cloudflare-typescript/commit/7627ea80fc287c01ba0c26805c6b0c678968b1c3)) +* **api:** api update ([e273904](https://github.com/cloudflare/cloudflare-typescript/commit/e27390436ad4edbe691fc1603f6780cdc71824de)) +* **api:** manual updates ([9dba1b4](https://github.com/cloudflare/cloudflare-typescript/commit/9dba1b4aa5ab00324d49f1d1965f99c642680e50)) +* **api:** manual updates ([3f56e74](https://github.com/cloudflare/cloudflare-typescript/commit/3f56e749f659854ec909787349538a8950b7ba66)) +* **api:** manual updates ([7f5a183](https://github.com/cloudflare/cloudflare-typescript/commit/7f5a183efa1f0366074e46636283afbecedc6c78)) +* **api:** manual updates ([2d164bc](https://github.com/cloudflare/cloudflare-typescript/commit/2d164bc3ea7df10fc01977832b43edf8240da385)) +* **api:** update path placeholders ([8419794](https://github.com/cloudflare/cloudflare-typescript/commit/84197940ce3f8ae368acaf4f07ce6f0b9b9a8278)) +* **device_settings:** swap list to get endpoint ([9f4a764](https://github.com/cloudflare/cloudflare-typescript/commit/9f4a764456ef13a099c938ed024d28fe3230f065)) +* **schema_validation:** add mapped endpoints ([e95421c](https://github.com/cloudflare/cloudflare-typescript/commit/e95421c87b8ec9a0282158b7f19005b26b3854f8)) +* **threat_events:** add list support ([6de3b53](https://github.com/cloudflare/cloudflare-typescript/commit/6de3b5314a47920e96ab6c36cc3f92806a597cbe)) + + +### Bug Fixes + +* **api:** fix path placeholders ([61b35dd](https://github.com/cloudflare/cloudflare-typescript/commit/61b35dd431e4f1a1041e5d0beb7948892ae2852b)) +* **client:** fix bug where subresource has the same name as its parent resource ([1d17818](https://github.com/cloudflare/cloudflare-typescript/commit/1d17818124a1fa5910f54958b97f7f7471fd7f77)) +* **client:** reexported types for subresource with the same name as its parent ([a91a792](https://github.com/cloudflare/cloudflare-typescript/commit/a91a792f08173f663ddef68e478f52d3a98d7086)) +* **urlscanner:** don't unwwrap scan response ([643bd93](https://github.com/cloudflare/cloudflare-typescript/commit/643bd937612852151024ccab140dadd0fbf8a6ab)) + + +### Chores + +* **ci:** bump node version for release workflows ([57c53b4](https://github.com/cloudflare/cloudflare-typescript/commit/57c53b4259d505bb465193ce4d85cb327c73f612)) +* **docs:** add missing deprecation warnings ([6ddef2c](https://github.com/cloudflare/cloudflare-typescript/commit/6ddef2c508844711f8a24aad34fa7c12d3fc0b18)) + + +### Documentation + +* add examples to tsdocs ([1b7dfd5](https://github.com/cloudflare/cloudflare-typescript/commit/1b7dfd570155ee237ca2f19592805c53a8d7edc8)) +* **readme:** fix typo ([550552e](https://github.com/cloudflare/cloudflare-typescript/commit/550552e7789259debc81b42c834f0a50877c5a66)) + ## 4.2.0 (2025-03-18) Full Changelog: [v4.1.0...v4.2.0](https://github.com/cloudflare/cloudflare-typescript/compare/v4.1.0...v4.2.0) diff --git a/README.md b/README.md index a81507ee54..02f9f6b842 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ async function main() { main(); ``` -Error codes are as followed: +Error codes are as follows: | Status Code | Error Type | | ----------- | -------------------------- | diff --git a/api.md b/api.md index f45e2c74fc..1bd95c9cc9 100644 --- a/api.md +++ b/api.md @@ -136,7 +136,7 @@ Types: Methods: - client.originCACertificates.create({ ...params }) -> OriginCACertificate -- client.originCACertificates.list({ ...params }) -> OriginCACertificatesSinglePage +- client.originCACertificates.list({ ...params }) -> OriginCACertificatesV4PagePaginationArray - client.originCACertificates.delete(certificateId) -> OriginCACertificateDeleteResponse - client.originCACertificates.get(certificateId) -> OriginCACertificate @@ -868,13 +868,11 @@ Types: - CustomNameserver - CustomNameserverDeleteResponse -- CustomNameserverAvailabiltyResponse Methods: - client.customNameservers.create({ ...params }) -> CustomNameserver - client.customNameservers.delete(customNSId, { ...params }) -> CustomNameserverDeleteResponsesSinglePage -- client.customNameservers.availabilty({ ...params }) -> CustomNameserverAvailabiltyResponsesSinglePage - client.customNameservers.get({ ...params }) -> CustomNameserversSinglePage # DNSFirewall @@ -1849,7 +1847,6 @@ Methods: Types: - Action -- Methods - RateLimit - RateLimitDeleteResponse @@ -2049,13 +2046,14 @@ Types: - Script - ScriptSetting - ScriptUpdateResponse +- ScriptDeleteResponse - ScriptGetResponse Methods: - client.workers.scripts.update(scriptName, { ...params }) -> ScriptUpdateResponse - client.workers.scripts.list({ ...params }) -> ScriptsSinglePage -- client.workers.scripts.delete(scriptName, { ...params }) -> void +- client.workers.scripts.delete(scriptName, { ...params }) -> ScriptDeleteResponse | null - client.workers.scripts.get(scriptName, { ...params }) -> string ### Assets @@ -2075,18 +2073,19 @@ Methods: Types: - SubdomainCreateResponse +- SubdomainDeleteResponse - SubdomainGetResponse Methods: - client.workers.scripts.subdomain.create(scriptName, { ...params }) -> SubdomainCreateResponse +- client.workers.scripts.subdomain.delete(scriptName, { ...params }) -> SubdomainDeleteResponse - client.workers.scripts.subdomain.get(scriptName, { ...params }) -> SubdomainGetResponse ### Schedules Types: -- Schedule - ScheduleUpdateResponse - ScheduleGetResponse @@ -2167,6 +2166,18 @@ Methods: - client.workers.scripts.secrets.delete(scriptName, secretName, { ...params }) -> SecretDeleteResponse | null - client.workers.scripts.secrets.get(scriptName, secretName, { ...params }) -> SecretGetResponse +### ScriptAndVersionSettings + +Types: + +- ScriptAndVersionSettingEditResponse +- ScriptAndVersionSettingGetResponse + +Methods: + +- client.workers.scripts.scriptAndVersionSettings.edit(scriptName, { ...params }) -> ScriptAndVersionSettingEditResponse +- client.workers.scripts.scriptAndVersionSettings.get(scriptName, { ...params }) -> ScriptAndVersionSettingGetResponse + ## AccountSettings Types: @@ -2204,6 +2215,22 @@ Methods: - client.workers.subdomains.update({ ...params }) -> SubdomainUpdateResponse - client.workers.subdomains.get({ ...params }) -> SubdomainGetResponse +## Observability + +### Telemetry + +Types: + +- TelemetryKeysResponse +- TelemetryQueryResponse +- TelemetryValuesResponse + +Methods: + +- client.workers.observability.telemetry.keys({ ...params }) -> TelemetryKeysResponsesSinglePage +- client.workers.observability.telemetry.query({ ...params }) -> TelemetryQueryResponse +- client.workers.observability.telemetry.values({ ...params }) -> TelemetryValuesResponsesSinglePage + # KV ## Namespaces @@ -2211,42 +2238,31 @@ Methods: Types: - Namespace -- NamespaceUpdateResponse - NamespaceDeleteResponse -- NamespaceBulkDeleteResponse -- NamespaceBulkUpdateResponse Methods: - client.kv.namespaces.create({ ...params }) -> Namespace -- client.kv.namespaces.update(namespaceId, { ...params }) -> NamespaceUpdateResponse | null +- client.kv.namespaces.update(namespaceId, { ...params }) -> Namespace - client.kv.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray - client.kv.namespaces.delete(namespaceId, { ...params }) -> NamespaceDeleteResponse | null -- client.kv.namespaces.bulkDelete(namespaceId, [ ...body ]) -> NamespaceBulkDeleteResponse | null -- client.kv.namespaces.bulkUpdate(namespaceId, [ ...body ]) -> NamespaceBulkUpdateResponse | null - client.kv.namespaces.get(namespaceId, { ...params }) -> Namespace -### Analytics - -Types: - -- Components -- Schema - -Methods: - -- client.kv.namespaces.analytics.list({ ...params }) -> Schema -- client.kv.namespaces.analytics.stored({ ...params }) -> Components - ### Keys Types: - Key +- KeyBulkDeleteResponse +- KeyBulkGetResponse +- KeyBulkUpdateResponse Methods: - client.kv.namespaces.keys.list(namespaceId, { ...params }) -> KeysCursorLimitPagination +- client.kv.namespaces.keys.bulkDelete(namespaceId, [ ...body ]) -> KeyBulkDeleteResponse | null +- client.kv.namespaces.keys.bulkGet(namespaceId, { ...params }) -> KeyBulkGetResponse | null +- client.kv.namespaces.keys.bulkUpdate(namespaceId, [ ...body ]) -> KeyBulkUpdateResponse | null ### Metadata @@ -2306,6 +2322,7 @@ Methods: - client.queues.update(queueId, { ...params }) -> Queue - client.queues.list({ ...params }) -> QueuesSinglePage - client.queues.delete(queueId, { ...params }) -> QueueDeleteResponse +- client.queues.edit(queueId, { ...params }) -> Queue - client.queues.get(queueId, { ...params }) -> Queue ## Consumers @@ -2327,12 +2344,27 @@ Methods: Types: - MessageAckResponse +- MessageBulkPushResponse - MessagePullResponse +- MessagePushResponse Methods: - client.queues.messages.ack(queueId, { ...params }) -> MessageAckResponse +- client.queues.messages.bulkPush(queueId, { ...params }) -> MessageBulkPushResponse - client.queues.messages.pull(queueId, { ...params }) -> MessagePullResponsesSinglePage +- client.queues.messages.push(queueId, { ...params }) -> MessagePushResponse + +## Purge + +Types: + +- PurgeStatusResponse + +Methods: + +- client.queues.purge.start(queueId, { ...params }) -> Queue +- client.queues.purge.status(queueId, { ...params }) -> PurgeStatusResponse # APIGateway @@ -3243,6 +3275,7 @@ Types: - AppUpdateResponse - AppListResponse - AppDeleteResponse +- AppEditResponse Methods: @@ -3250,6 +3283,7 @@ Methods: - client.magicTransit.apps.update(accountAppId, { ...params }) -> AppUpdateResponse | null - client.magicTransit.apps.list({ ...params }) -> AppListResponsesSinglePage - client.magicTransit.apps.delete(accountAppId, { ...params }) -> AppDeleteResponse | null +- client.magicTransit.apps.edit(accountAppId, { ...params }) -> AppEditResponse | null ## CfInterconnects @@ -3423,25 +3457,45 @@ Methods: Types: -- EventListResponse -- EventGetResponse +- EventListResponse +- EventGetResponse + +Methods: + +- client.magicTransit.connectors.events.list(connectorId, { ...params }) -> EventListResponse +- client.magicTransit.connectors.events.get(connectorId, eventT, eventN, { ...params }) -> EventGetResponse + +#### Latest + +Types: + +- LatestListResponse Methods: -- client.magicTransit.connectors.events.list(connectorId, { ...params }) -> EventListResponse -- client.magicTransit.connectors.events.get(connectorId, eventT, eventN, { ...params }) -> EventGetResponse +- client.magicTransit.connectors.events.latest.list(connectorId, { ...params }) -> LatestListResponse ### Snapshots Types: -- SnapshotListResponse -- SnapshotGetResponse +- SnapshotListResponse +- SnapshotGetResponse + +Methods: + +- client.magicTransit.connectors.snapshots.list(connectorId, { ...params }) -> SnapshotListResponse +- client.magicTransit.connectors.snapshots.get(connectorId, snapshotT, { ...params }) -> SnapshotGetResponse + +#### Latest + +Types: + +- LatestListResponse Methods: -- client.magicTransit.connectors.snapshots.list(connectorId, { ...params }) -> SnapshotListResponse -- client.magicTransit.connectors.snapshots.get(connectorId, snapshotT, { ...params }) -> SnapshotGetResponse +- client.magicTransit.connectors.snapshots.latest.list(connectorId, { ...params }) -> LatestListResponse ## PCAPs @@ -3458,6 +3512,7 @@ Methods: - client.magicTransit.pcaps.create({ ...params }) -> PCAPCreateResponse - client.magicTransit.pcaps.list({ ...params }) -> PCAPListResponsesSinglePage - client.magicTransit.pcaps.get(pcapId, { ...params }) -> PCAPGetResponse +- client.magicTransit.pcaps.stop(pcapId, { ...params }) -> void ### Ownership @@ -3841,26 +3896,29 @@ Types: - Hostname - ListsList - Redirect +- ListCreateResponse +- ListUpdateResponse +- ListListResponse - ListDeleteResponse +- ListGetResponse Methods: -- client.rules.lists.create({ ...params }) -> ListsList -- client.rules.lists.update(listId, { ...params }) -> ListsList -- client.rules.lists.list({ ...params }) -> ListsListsSinglePage +- client.rules.lists.create({ ...params }) -> ListCreateResponse +- client.rules.lists.update(listId, { ...params }) -> ListUpdateResponse +- client.rules.lists.list({ ...params }) -> ListListResponse - client.rules.lists.delete(listId, { ...params }) -> ListDeleteResponse -- client.rules.lists.get(listId, { ...params }) -> ListsList +- client.rules.lists.get(listId, { ...params }) -> ListGetResponse ### BulkOperations Types: -- OperationStatus - BulkOperationGetResponse Methods: -- client.rules.lists.bulkOperations.get(accountIdentifier, operationId) -> BulkOperationGetResponse +- client.rules.lists.bulkOperations.get(operationId, { ...params }) -> BulkOperationGetResponse ### Items @@ -3878,9 +3936,9 @@ Methods: - client.rules.lists.items.create(listId, [ ...body ]) -> ItemCreateResponse - client.rules.lists.items.update(listId, [ ...body ]) -> ItemUpdateResponse -- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponsesCursorPagination +- client.rules.lists.items.list(listId, { ...params }) -> ItemListResponse - client.rules.lists.items.delete(listId, { ...params }) -> ItemDeleteResponse -- client.rules.lists.items.get(accountIdentifier, listId, itemId) -> ItemGetResponse +- client.rules.lists.items.get(listId, itemId, { ...params }) -> ItemGetResponse # Stream @@ -4190,8 +4248,10 @@ Types: Methods: - client.d1.database.create({ ...params }) -> D1 +- client.d1.database.update(databaseId, { ...params }) -> D1 - client.d1.database.list({ ...params }) -> DatabaseListResponsesV4PagePaginationArray - client.d1.database.delete(databaseId, { ...params }) -> DatabaseDeleteResponse | null +- client.d1.database.edit(databaseId, { ...params }) -> D1 - client.d1.database.export(databaseId, { ...params }) -> DatabaseExportResponse - client.d1.database.get(databaseId, { ...params }) -> D1 - client.d1.database.import(databaseId, { ...params }) -> DatabaseImportResponse @@ -4213,6 +4273,7 @@ Methods: - client.r2.buckets.create({ ...params }) -> Bucket - client.r2.buckets.list({ ...params }) -> BucketListResponse - client.r2.buckets.delete(bucketName, { ...params }) -> BucketDeleteResponse +- client.r2.buckets.edit(bucketName, { ...params }) -> Bucket - client.r2.buckets.get(bucketName, { ...params }) -> Bucket ### Lifecycle @@ -4278,14 +4339,16 @@ Methods: Types: - EventNotificationUpdateResponse +- EventNotificationListResponse - EventNotificationDeleteResponse - EventNotificationGetResponse Methods: - client.r2.buckets.eventNotifications.update(bucketName, queueId, { ...params }) -> EventNotificationUpdateResponse +- client.r2.buckets.eventNotifications.list(bucketName, { ...params }) -> EventNotificationListResponse - client.r2.buckets.eventNotifications.delete(bucketName, queueId, { ...params }) -> EventNotificationDeleteResponse -- client.r2.buckets.eventNotifications.get(bucketName, { ...params }) -> EventNotificationGetResponse +- client.r2.buckets.eventNotifications.get(bucketName, queueId, { ...params }) -> EventNotificationGetResponse ### Locks @@ -4334,6 +4397,54 @@ Methods: - client.r2.temporaryCredentials.create({ ...params }) -> TemporaryCredentialCreateResponse +## SuperSlurper + +### Jobs + +Types: + +- JobCreateResponse +- JobListResponse +- JobAbortResponse +- JobAbortAllResponse +- JobGetResponse +- JobPauseResponse +- JobProgressResponse +- JobResumeResponse + +Methods: + +- client.r2.superSlurper.jobs.create({ ...params }) -> JobCreateResponse +- client.r2.superSlurper.jobs.list({ ...params }) -> JobListResponsesSinglePage +- client.r2.superSlurper.jobs.abort(jobId, { ...params }) -> JobAbortResponse +- client.r2.superSlurper.jobs.abortAll({ ...params }) -> JobAbortAllResponse +- client.r2.superSlurper.jobs.get(jobId, { ...params }) -> JobGetResponse +- client.r2.superSlurper.jobs.pause(jobId, { ...params }) -> JobPauseResponse +- client.r2.superSlurper.jobs.progress(jobId, { ...params }) -> JobProgressResponse +- client.r2.superSlurper.jobs.resume(jobId, { ...params }) -> JobResumeResponse + +#### Logs + +Types: + +- LogListResponse + +Methods: + +- client.r2.superSlurper.jobs.logs.list(jobId, { ...params }) -> LogListResponsesSinglePage + +### ConnectivityPrecheck + +Types: + +- ConnectivityPrecheckSourceResponse +- ConnectivityPrecheckTargetResponse + +Methods: + +- client.r2.superSlurper.connectivityPrecheck.source({ ...params }) -> ConnectivityPrecheckSourceResponse +- client.r2.superSlurper.connectivityPrecheck.target({ ...params }) -> ConnectivityPrecheckTargetResponse + # WorkersForPlatforms ## Dispatch @@ -4360,11 +4471,12 @@ Types: - Script - ScriptUpdateResponse +- ScriptDeleteResponse Methods: - client.workersForPlatforms.dispatch.namespaces.scripts.update(dispatchNamespace, scriptName, { ...params }) -> ScriptUpdateResponse -- client.workersForPlatforms.dispatch.namespaces.scripts.delete(dispatchNamespace, scriptName, { ...params }) -> void +- client.workersForPlatforms.dispatch.namespaces.scripts.delete(dispatchNamespace, scriptName, { ...params }) -> ScriptDeleteResponse | null - client.workersForPlatforms.dispatch.namespaces.scripts.get(dispatchNamespace, scriptName, { ...params }) -> Script ##### AssetUpload @@ -4450,22 +4562,62 @@ Methods: - client.zeroTrust.devices.list({ ...params }) -> DevicesSinglePage - client.zeroTrust.devices.get(deviceId, { ...params }) -> DeviceGetResponse | null -### DEXTests +### Devices Types: -- DEXTest -- SchemaData -- SchemaHTTP -- DEXTestDeleteResponse +- DeviceListResponse +- DeviceDeleteResponse +- DeviceGetResponse +- DeviceRevokeResponse + +Methods: + +- client.zeroTrust.devices.devices.list({ ...params }) -> DeviceListResponsesCursorPagination +- client.zeroTrust.devices.devices.delete(deviceId, { ...params }) -> DeviceDeleteResponse | null +- client.zeroTrust.devices.devices.get(deviceId, { ...params }) -> DeviceGetResponse +- client.zeroTrust.devices.devices.revoke(deviceId, { ...params }) -> DeviceRevokeResponse | null + +### Resilience + +#### GlobalWARPOverride + +Types: + +- GlobalWARPOverrideCreateResponse +- GlobalWARPOverrideGetResponse + +Methods: + +- client.zeroTrust.devices.resilience.globalWARPOverride.create({ ...params }) -> GlobalWARPOverrideCreateResponse | null +- client.zeroTrust.devices.resilience.globalWARPOverride.get({ ...params }) -> GlobalWARPOverrideGetResponse | null + +### Registrations + +Types: + +- RegistrationListResponse +- RegistrationDeleteResponse +- RegistrationBulkDeleteResponse +- RegistrationGetResponse +- RegistrationRevokeResponse +- RegistrationUnrevokeResponse Methods: -- client.zeroTrust.devices.dexTests.create({ ...params }) -> SchemaHTTP | null -- client.zeroTrust.devices.dexTests.update(dexTestId, { ...params }) -> SchemaHTTP | null -- client.zeroTrust.devices.dexTests.list({ ...params }) -> SchemaHTTPSSinglePage -- client.zeroTrust.devices.dexTests.delete(dexTestId, { ...params }) -> DEXTestDeleteResponse -- client.zeroTrust.devices.dexTests.get(dexTestId, { ...params }) -> SchemaHTTP | null +- client.zeroTrust.devices.registrations.list({ ...params }) -> RegistrationListResponsesCursorPagination +- client.zeroTrust.devices.registrations.delete(registrationId, { ...params }) -> RegistrationDeleteResponse | null +- client.zeroTrust.devices.registrations.bulkDelete({ ...params }) -> RegistrationBulkDeleteResponse | null +- client.zeroTrust.devices.registrations.get(registrationId, { ...params }) -> RegistrationGetResponse +- client.zeroTrust.devices.registrations.revoke({ ...params }) -> RegistrationRevokeResponse | null +- client.zeroTrust.devices.registrations.unrevoke({ ...params }) -> RegistrationUnrevokeResponse | null + +### DEXTests + +Types: + +- SchemaData +- SchemaHTTP ### Networks @@ -4537,15 +4689,10 @@ Methods: ##### Certificates -Types: - -- CertificateEditResponse -- CertificateGetResponse - Methods: -- client.zeroTrust.devices.policies.default.certificates.edit({ ...params }) -> CertificateEditResponse | null -- client.zeroTrust.devices.policies.default.certificates.get({ ...params }) -> CertificateGetResponse | null +- client.zeroTrust.devices.policies.default.certificates.edit({ ...params }) -> DevicePolicyCertificates | null +- client.zeroTrust.devices.policies.default.certificates.get({ ...params }) -> DevicePolicyCertificates | null #### Custom @@ -4644,8 +4791,8 @@ Types: Methods: - client.zeroTrust.devices.settings.update({ ...params }) -> DeviceSettings | null -- client.zeroTrust.devices.settings.list({ ...params }) -> DeviceSettings | null - client.zeroTrust.devices.settings.edit({ ...params }) -> DeviceSettings | null +- client.zeroTrust.devices.settings.get({ ...params }) -> DeviceSettings | null ### Unrevoke @@ -4662,10 +4809,12 @@ Methods: Types: - OverrideCodeListResponse +- OverrideCodeGetResponse Methods: -- client.zeroTrust.devices.overrideCodes.list(deviceId, { ...params }) -> OverrideCodeListResponse | null +- client.zeroTrust.devices.overrideCodes.list(deviceId, { ...params }) -> OverrideCodeListResponsesSinglePage +- client.zeroTrust.devices.overrideCodes.get(registrationId, { ...params }) -> OverrideCodeGetResponse ## IdentityProviders @@ -4773,7 +4922,7 @@ Methods: - client.zeroTrust.access.infrastructure.targets.list({ ...params }) -> TargetListResponsesV4PagePaginationArray - client.zeroTrust.access.infrastructure.targets.delete(targetId, { ...params }) -> void - client.zeroTrust.access.infrastructure.targets.bulkDelete({ ...params }) -> void -- client.zeroTrust.access.infrastructure.targets.bulkUpdate([ ...body ]) -> TargetBulkUpdateResponse +- client.zeroTrust.access.infrastructure.targets.bulkUpdate([ ...body ]) -> TargetBulkUpdateResponsesSinglePage - client.zeroTrust.access.infrastructure.targets.get(targetId, { ...params }) -> TargetGetResponse ### Applications @@ -4898,7 +5047,19 @@ Types: Methods: -- client.zeroTrust.access.applications.policyTests.users.list(policyTestId, { ...params }) -> UserListResponsesSinglePage +- client.zeroTrust.access.applications.policyTests.users.list(policyTestId, { ...params }) -> UserListResponsesV4PagePaginationArray + +#### Settings + +Types: + +- SettingUpdateResponse +- SettingEditResponse + +Methods: + +- client.zeroTrust.access.applications.settings.update(appId, { ...params }) -> SettingUpdateResponse +- client.zeroTrust.access.applications.settings.edit(appId, { ...params }) -> SettingEditResponse ### Certificates @@ -5627,7 +5788,7 @@ Methods: Methods: -- client.zeroTrust.gateway.configurations.customCertificate.get({ ...params }) -> CustomCertificateSettings +- client.zeroTrust.gateway.configurations.customCertificate.get({ ...params }) -> CustomCertificateSettings | null ### Lists @@ -6039,6 +6200,16 @@ Methods: ## AI +### ToMarkdown + +Types: + +- ToMarkdownCreateResponse + +Methods: + +- client.radar.ai.toMarkdown.create({ ...params }) -> ToMarkdownCreateResponsesSinglePage + ### Inference #### Summary @@ -6174,6 +6345,7 @@ Types: - RouteAsesResponse - RouteMoasResponse - RoutePfx2asResponse +- RouteRealtimeResponse - RouteStatsResponse Methods: @@ -6181,6 +6353,7 @@ Methods: - client.radar.bgp.routes.ases({ ...params }) -> RouteAsesResponse - client.radar.bgp.routes.moas({ ...params }) -> RouteMoasResponse - client.radar.bgp.routes.pfx2as({ ...params }) -> RoutePfx2asResponse +- client.radar.bgp.routes.realtime({ ...params }) -> RouteRealtimeResponse - client.radar.bgp.routes.stats({ ...params }) -> RouteStatsResponse ### IPs @@ -6562,17 +6735,21 @@ Types: - SummaryBitrateResponse - SummaryDurationResponse +- SummaryIndustryResponse - SummaryIPVersionResponse - SummaryProtocolResponse - SummaryVectorResponse +- SummaryVerticalResponse Methods: - client.radar.attacks.layer3.summary.bitrate({ ...params }) -> SummaryBitrateResponse - client.radar.attacks.layer3.summary.duration({ ...params }) -> SummaryDurationResponse +- client.radar.attacks.layer3.summary.industry({ ...params }) -> SummaryIndustryResponse - client.radar.attacks.layer3.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse - client.radar.attacks.layer3.summary.protocol({ ...params }) -> SummaryProtocolResponse - client.radar.attacks.layer3.summary.vector({ ...params }) -> SummaryVectorResponse +- client.radar.attacks.layer3.summary.vertical({ ...params }) -> SummaryVerticalResponse #### TimeseriesGroups @@ -6638,17 +6815,21 @@ Types: - SummaryHTTPMethodResponse - SummaryHTTPVersionResponse +- SummaryIndustryResponse - SummaryIPVersionResponse - SummaryManagedRulesResponse - SummaryMitigationProductResponse +- SummaryVerticalResponse Methods: - client.radar.attacks.layer7.summary.httpMethod({ ...params }) -> SummaryHTTPMethodResponse - client.radar.attacks.layer7.summary.httpVersion({ ...params }) -> SummaryHTTPVersionResponse +- client.radar.attacks.layer7.summary.industry({ ...params }) -> SummaryIndustryResponse - client.radar.attacks.layer7.summary.ipVersion({ ...params }) -> SummaryIPVersionResponse - client.radar.attacks.layer7.summary.managedRules({ ...params }) -> SummaryManagedRulesResponse - client.radar.attacks.layer7.summary.mitigationProduct({ ...params }) -> SummaryMitigationProductResponse +- client.radar.attacks.layer7.summary.vertical({ ...params }) -> SummaryVerticalResponse #### TimeseriesGroups @@ -7460,14 +7641,14 @@ Types: Methods: -- client.cloudforceOne.requests.create(accountIdentifier, { ...params }) -> Item -- client.cloudforceOne.requests.update(accountIdentifier, requestIdentifier, { ...params }) -> Item -- client.cloudforceOne.requests.list(accountIdentifier, { ...params }) -> ListItemsSinglePage -- client.cloudforceOne.requests.delete(accountIdentifier, requestIdentifier) -> RequestDeleteResponse -- client.cloudforceOne.requests.constants(accountIdentifier) -> RequestConstants -- client.cloudforceOne.requests.get(accountIdentifier, requestIdentifier) -> Item -- client.cloudforceOne.requests.quota(accountIdentifier) -> Quota -- client.cloudforceOne.requests.types(accountIdentifier) -> RequestTypesResponsesSinglePage +- client.cloudforceOne.requests.create({ ...params }) -> Item +- client.cloudforceOne.requests.update(requestId, { ...params }) -> Item +- client.cloudforceOne.requests.list({ ...params }) -> ListItemsSinglePage +- client.cloudforceOne.requests.delete(requestId, { ...params }) -> RequestDeleteResponse +- client.cloudforceOne.requests.constants({ ...params }) -> RequestConstants +- client.cloudforceOne.requests.get(requestId, { ...params }) -> Item +- client.cloudforceOne.requests.quota({ ...params }) -> Quota +- client.cloudforceOne.requests.types({ ...params }) -> RequestTypesResponsesSinglePage ### Message @@ -7478,10 +7659,10 @@ Types: Methods: -- client.cloudforceOne.requests.message.create(accountIdentifier, requestIdentifier, { ...params }) -> Message -- client.cloudforceOne.requests.message.update(accountIdentifier, requestIdentifier, messageIdentifer, { ...params }) -> Message -- client.cloudforceOne.requests.message.delete(accountIdentifier, requestIdentifier, messageIdentifer) -> MessageDeleteResponse -- client.cloudforceOne.requests.message.get(accountIdentifier, requestIdentifier, { ...params }) -> MessagesSinglePage +- client.cloudforceOne.requests.message.create(requestId, { ...params }) -> Message +- client.cloudforceOne.requests.message.update(requestId, messageId, { ...params }) -> Message +- client.cloudforceOne.requests.message.delete(requestId, messageId, { ...params }) -> MessageDeleteResponse +- client.cloudforceOne.requests.message.get(requestId, { ...params }) -> MessagesSinglePage ### Priority @@ -7494,11 +7675,11 @@ Types: Methods: -- client.cloudforceOne.requests.priority.create(accountIdentifier, { ...params }) -> Priority -- client.cloudforceOne.requests.priority.update(accountIdentifier, priorityIdentifer, { ...params }) -> Item -- client.cloudforceOne.requests.priority.delete(accountIdentifier, priorityIdentifer) -> PriorityDeleteResponse -- client.cloudforceOne.requests.priority.get(accountIdentifier, priorityIdentifer) -> Item -- client.cloudforceOne.requests.priority.quota(accountIdentifier) -> Quota +- client.cloudforceOne.requests.priority.create({ ...params }) -> Priority +- client.cloudforceOne.requests.priority.update(priorityId, { ...params }) -> Item +- client.cloudforceOne.requests.priority.delete(priorityId, { ...params }) -> PriorityDeleteResponse +- client.cloudforceOne.requests.priority.get(priorityId, { ...params }) -> Item +- client.cloudforceOne.requests.priority.quota({ ...params }) -> Quota ### Assets @@ -7511,16 +7692,17 @@ Types: Methods: -- client.cloudforceOne.requests.assets.create(accountIdentifier, requestIdentifier, { ...params }) -> AssetCreateResponsesSinglePage -- client.cloudforceOne.requests.assets.update(accountIdentifier, requestIdentifier, assetIdentifer, { ...params }) -> AssetUpdateResponse -- client.cloudforceOne.requests.assets.delete(accountIdentifier, requestIdentifier, assetIdentifer) -> AssetDeleteResponse -- client.cloudforceOne.requests.assets.get(accountIdentifier, requestIdentifier, assetIdentifer) -> AssetGetResponsesSinglePage +- client.cloudforceOne.requests.assets.create(requestId, { ...params }) -> AssetCreateResponsesSinglePage +- client.cloudforceOne.requests.assets.update(requestId, assetId, { ...params }) -> AssetUpdateResponse +- client.cloudforceOne.requests.assets.delete(requestId, assetId, { ...params }) -> AssetDeleteResponse +- client.cloudforceOne.requests.assets.get(requestId, assetId, { ...params }) -> AssetGetResponsesSinglePage ## ThreatEvents Types: - ThreatEventCreateResponse +- ThreatEventListResponse - ThreatEventDeleteResponse - ThreatEventBulkCreateResponse - ThreatEventEditResponse @@ -7529,6 +7711,7 @@ Types: Methods: - client.cloudforceOne.threatEvents.create({ ...params }) -> ThreatEventCreateResponse +- client.cloudforceOne.threatEvents.list({ ...params }) -> ThreatEventListResponse - client.cloudforceOne.threatEvents.delete(eventId, { ...params }) -> ThreatEventDeleteResponse - client.cloudforceOne.threatEvents.bulkCreate({ ...params }) -> ThreatEventBulkCreateResponse - client.cloudforceOne.threatEvents.edit(eventId, { ...params }) -> ThreatEventEditResponse @@ -7868,12 +8051,14 @@ Types: - WorkflowUpdateResponse - WorkflowListResponse +- WorkflowDeleteResponse - WorkflowGetResponse Methods: - client.workflows.update(workflowName, { ...params }) -> WorkflowUpdateResponse - client.workflows.list({ ...params }) -> WorkflowListResponsesV4PagePaginationArray +- client.workflows.delete(workflowName, { ...params }) -> WorkflowDeleteResponse - client.workflows.get(workflowName, { ...params }) -> WorkflowGetResponse ## Instances @@ -7902,6 +8087,16 @@ Methods: - client.workflows.instances.status.edit(workflowName, instanceId, { ...params }) -> StatusEditResponse +### Events + +Types: + +- EventCreateResponse + +Methods: + +- client.workflows.instances.events.create(workflowName, instanceId, eventType, { ...params }) -> EventCreateResponse + ## Versions Types: @@ -8214,6 +8409,36 @@ Methods: - client.browserRendering.snapshot.create({ ...params }) -> SnapshotCreateResponse +## Json + +Types: + +- JsonCreateResponse + +Methods: + +- client.browserRendering.json.create({ ...params }) -> JsonCreateResponse + +## Links + +Types: + +- LinkCreateResponse + +Methods: + +- client.browserRendering.links.create({ ...params }) -> LinkCreateResponse + +## Markdown + +Types: + +- MarkdownCreateResponse + +Methods: + +- client.browserRendering.markdown.create({ ...params }) -> MarkdownCreateResponse + # CustomPages Types: @@ -8227,3 +8452,120 @@ Methods: - client.customPages.update(identifier, { ...params }) -> CustomPageUpdateResponse | null - client.customPages.list({ ...params }) -> CustomPageListResponsesSinglePage - client.customPages.get(identifier, { ...params }) -> CustomPageGetResponse | null + +# SecretsStore + +## Stores + +Types: + +- StoreCreateResponse +- StoreListResponse +- StoreDeleteResponse + +Methods: + +- client.secretsStore.stores.create([ ...body ]) -> StoreCreateResponsesSinglePage +- client.secretsStore.stores.list({ ...params }) -> StoreListResponsesV4PagePaginationArray +- client.secretsStore.stores.delete(storeId, { ...params }) -> StoreDeleteResponse + +### Secrets + +Types: + +- SecretCreateResponse +- SecretListResponse +- SecretDeleteResponse +- SecretBulkDeleteResponse +- SecretDuplicateResponse +- SecretEditResponse +- SecretGetResponse + +Methods: + +- client.secretsStore.stores.secrets.create(storeId, [ ...body ]) -> SecretCreateResponsesSinglePage +- client.secretsStore.stores.secrets.list(storeId, { ...params }) -> SecretListResponsesV4PagePaginationArray +- client.secretsStore.stores.secrets.delete(storeId, secretId, { ...params }) -> SecretDeleteResponse +- client.secretsStore.stores.secrets.bulkDelete(storeId, { ...params }) -> SecretBulkDeleteResponsesSinglePage +- client.secretsStore.stores.secrets.duplicate(storeId, secretId, { ...params }) -> SecretDuplicateResponse +- client.secretsStore.stores.secrets.edit(storeId, secretId, { ...params }) -> SecretEditResponse +- client.secretsStore.stores.secrets.get(storeId, secretId, { ...params }) -> SecretGetResponse + +## Quota + +Types: + +- QuotaGetResponse + +Methods: + +- client.secretsStore.quota.get({ ...params }) -> QuotaGetResponse + +# Pipelines + +Types: + +- PipelineCreateResponse +- PipelineUpdateResponse +- PipelineListResponse +- PipelineGetResponse + +Methods: + +- client.pipelines.create({ ...params }) -> PipelineCreateResponse +- client.pipelines.update(pipelineName, { ...params }) -> PipelineUpdateResponse +- client.pipelines.list({ ...params }) -> PipelineListResponse +- client.pipelines.delete(pipelineName, { ...params }) -> void +- client.pipelines.get(pipelineName, { ...params }) -> PipelineGetResponse + +# SchemaValidation + +## Schemas + +Types: + +- SchemaCreateResponse +- SchemaListResponse +- SchemaDeleteResponse +- SchemaEditResponse +- SchemaGetResponse + +Methods: + +- client.schemaValidation.schemas.create({ ...params }) -> SchemaCreateResponse +- client.schemaValidation.schemas.list({ ...params }) -> SchemaListResponsesV4PagePaginationArray +- client.schemaValidation.schemas.delete(schemaId, { ...params }) -> SchemaDeleteResponse +- client.schemaValidation.schemas.edit(schemaId, { ...params }) -> SchemaEditResponse +- client.schemaValidation.schemas.get(schemaId, { ...params }) -> SchemaGetResponse + +## Settings + +Types: + +- SettingUpdateResponse +- SettingEditResponse +- SettingGetResponse + +Methods: + +- client.schemaValidation.settings.update({ ...params }) -> SettingUpdateResponse +- client.schemaValidation.settings.edit({ ...params }) -> SettingEditResponse +- client.schemaValidation.settings.get({ ...params }) -> SettingGetResponse + +### Operations + +Types: + +- OperationUpdateResponse +- OperationListResponse +- OperationDeleteResponse +- OperationBulkEditResponse +- OperationGetResponse + +Methods: + +- client.schemaValidation.settings.operations.update(operationId, { ...params }) -> OperationUpdateResponse +- client.schemaValidation.settings.operations.list({ ...params }) -> OperationListResponsesV4PagePaginationArray +- client.schemaValidation.settings.operations.delete(operationId, { ...params }) -> OperationDeleteResponse +- client.schemaValidation.settings.operations.bulkEdit({ ...params }) -> OperationBulkEditResponse +- client.schemaValidation.settings.operations.get(operationId, { ...params }) -> OperationGetResponse diff --git a/examples/workers/script-upload.ts b/examples/workers/script-upload.ts new file mode 100644 index 0000000000..7fc8ee6831 --- /dev/null +++ b/examples/workers/script-upload.ts @@ -0,0 +1,87 @@ +#!/usr/bin/env -S npm run tsn -T + +/* + * Generate an API token: https://developers.cloudflare.com/fundamentals/api/get-started/create-token/ + * (Not Global API Key!) + * + * Find your account id: https://developers.cloudflare.com/fundamentals/setup/find-account-and-zone-ids/ + * + * Set these environment variables: + * - CLOUDFLARE_API_TOKEN + * - CLOUDFLARE_ACCOUNT_ID + * + * ### Workers for Platforms ### + * + * For uploading a User Worker to a dispatch namespace: + * https://developers.cloudflare.com/cloudflare-for-platforms/workers-for-platforms/ + * + * Define a "dispatchNamespaceName" variable and change the entire "const script = " line to the following: + * "const script = await client.workersForPlatforms.dispatch.namespaces.scripts.update(dispatchNamespaceName, scriptName, {" + */ + +import Cloudflare from 'cloudflare'; +import { toFile } from 'cloudflare/index'; + +const apiToken = process.env['CLOUDFLARE_API_TOKEN'] ?? ''; +if (!apiToken) { + throw new Error('Please set envar CLOUDFLARE_ACCOUNT_ID'); +} + +const accountID = process.env['CLOUDFLARE_ACCOUNT_ID'] ?? ''; +if (!accountID) { + throw new Error('Please set envar CLOUDFLARE_API_TOKEN'); +} + +const client = new Cloudflare({ + apiToken: apiToken, +}); + +async function main() { + const scriptName = 'my-hello-world-script'; + const scriptFileName = `${scriptName}.mjs`; + + // Workers Scripts prefer Module Syntax + // https://blog.cloudflare.com/workers-javascript-modules/ + const scriptContent = ` + export default { + async fetch(request, env, ctx) { + return new Response(env.MESSAGE, { status: 200 }); + } + }; + `; + + try { + // https://developers.cloudflare.com/api/resources/workers/subresources/scripts/methods/update/ + const script = await client.workers.scripts.update(scriptName, { + account_id: accountID, + // https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/ + metadata: { + main_module: scriptFileName, + bindings: [ + { + type: 'plain_text', + name: 'MESSAGE', + text: 'Hello World!', + }, + ], + }, + files: { + // Add main_module file + [scriptFileName]: await toFile(Buffer.from(scriptContent), scriptFileName, { + type: 'application/javascript+module', + }), + // Can add other files, such as more modules or source maps + // [sourceMapFileName]: await toFile(Buffer.from(sourceMapContent), sourceMapFileName, { + // type: 'application/source-map', + // }), + }, + }); + console.log('Script Upload success!'); + console.log(JSON.stringify(script, null, 2)); + } catch (error) { + console.error('Script Upload failure!'); + console.error(error); + } +} + +main(); diff --git a/package.json b/package.json index 5832e6b581..2225f1d944 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "4.2.0", + "version": "4.3.0", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", @@ -107,17 +107,17 @@ "default": "./dist/index.mjs" }, "./*.mjs": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "default": "./dist/*.mjs" }, "./*.js": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "default": ["./dist/*.js", "./dist/*/index.js"] + "types": "./dist/*.d.ts", + "default": "./dist/*.js" }, "./*": { - "types": ["./dist/*.d.ts", "./dist/*/index.d.ts"], - "require": ["./dist/*.js", "./dist/*/index.js"], - "default": ["./dist/*.mjs", "./dist/*/index.mjs"] + "types": "./dist/*.d.ts", + "require": "./dist/*.js", + "default": "./dist/*.mjs" } } } diff --git a/scripts/utils/upload-artifact.sh b/scripts/utils/upload-artifact.sh new file mode 100755 index 0000000000..96427f53d3 --- /dev/null +++ b/scripts/utils/upload-artifact.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +set -exuo pipefail + +RESPONSE=$(curl -X POST "$URL" \ + -H "Authorization: Bearer $AUTH" \ + -H "Content-Type: application/json") + +SIGNED_URL=$(echo "$RESPONSE" | jq -r '.url') + +if [[ "$SIGNED_URL" == "null" ]]; then + echo -e "\033[31mFailed to get signed URL.\033[0m" + exit 1 +fi + +UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \ + -H "Content-Type: application/gzip" \ + --data-binary @- "$SIGNED_URL" 2>&1) + +if echo "$UPLOAD_RESPONSE" | grep -q "HTTP/[0-9.]* 200"; then + echo -e "\033[32mUploaded build to Stainless storage.\033[0m" + echo -e "\033[32mInstallation: npm install 'https://pkg.stainless.com/s/cloudflare-node/$SHA'\033[0m" +else + echo -e "\033[31mFailed to upload artifact.\033[0m" + exit 1 +fi diff --git a/src/_shims/index-deno.ts b/src/_shims/index-deno.ts index bb3c002433..30d6bd1631 100644 --- a/src/_shims/index-deno.ts +++ b/src/_shims/index-deno.ts @@ -108,3 +108,5 @@ export declare class FsReadStream extends Readable { const _ReadableStream = ReadableStream; type _ReadableStream = ReadableStream; export { _ReadableStream as ReadableStream }; + +export const init = () => {}; diff --git a/src/_shims/index.d.ts b/src/_shims/index.d.ts index a2107f4120..86f9ce6687 100644 --- a/src/_shims/index.d.ts +++ b/src/_shims/index.d.ts @@ -79,3 +79,5 @@ export function fileFromPath(path: string, options?: FileFromPathOptions): Promi export function fileFromPath(path: string, filename?: string, options?: FileFromPathOptions): Promise; export function isFsReadStream(value: any): value is FsReadStream; + +export const init: () => void; diff --git a/src/_shims/index.js b/src/_shims/index.js index 1704568bcd..aa84d90a98 100644 --- a/src/_shims/index.js +++ b/src/_shims/index.js @@ -3,7 +3,9 @@ */ const shims = require('./registry'); const auto = require('cloudflare/_shims/auto/runtime'); -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +exports.init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; for (const property of Object.keys(shims)) { Object.defineProperty(exports, property, { get() { @@ -11,3 +13,5 @@ for (const property of Object.keys(shims)) { }, }); } + +exports.init(); diff --git a/src/_shims/index.mjs b/src/_shims/index.mjs index 1fdfc626bf..792ace2a55 100644 --- a/src/_shims/index.mjs +++ b/src/_shims/index.mjs @@ -3,5 +3,9 @@ */ import * as shims from './registry.mjs'; import * as auto from 'cloudflare/_shims/auto/runtime'; -if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +export const init = () => { + if (!shims.kind) shims.setShims(auto.getRuntime(), { auto: true }); +}; export * from './registry.mjs'; + +init(); diff --git a/src/core.ts b/src/core.ts index c36859eb9b..31543a68af 100644 --- a/src/core.ts +++ b/src/core.ts @@ -16,7 +16,12 @@ import { type RequestInit, type Response, type HeadersInit, + init, } from './_shims/index'; + +// try running side effects outside of _shims/index to workaround https://github.com/vercel/next.js/issues/76881 +init(); + export { type Response }; import { BlobLike, isBlobLike, isMultipartBody } from './uploads'; export { @@ -28,6 +33,20 @@ export { export type Fetch = (url: RequestInfo, init?: RequestInit) => Promise; +/** + * An alias to the builtin `Array` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Array = Array; + +/** + * An alias to the builtin `Record` type so we can + * easily alias it in import statements if there are name clashes. + */ +type _Record = Record; + +export type { _Array as Array, _Record as Record }; + type PromiseOrValue = T | Promise; type APIResponseProps = { @@ -151,6 +170,7 @@ export class APIPromise extends Promise { export abstract class APIClient { baseURL: string; + apiVersion: string; maxRetries: number; timeout: number; httpAgent: Agent | undefined; @@ -160,18 +180,21 @@ export abstract class APIClient { constructor({ baseURL, + apiVersion, maxRetries = 2, timeout = 60000, // 1 minute httpAgent, fetch: overriddenFetch, }: { baseURL: string; + apiVersion: string; maxRetries?: number | undefined; timeout: number | undefined; httpAgent: Agent | undefined; fetch: Fetch | undefined; }) { this.baseURL = baseURL; + this.apiVersion = apiVersion; this.maxRetries = validatePositiveInteger('maxRetries', maxRetries); this.timeout = validatePositiveInteger('timeout', timeout); this.httpAgent = httpAgent; @@ -196,6 +219,7 @@ export abstract class APIClient { Accept: 'application/json', 'Content-Type': 'application/json', 'User-Agent': this.getUserAgent(), + 'api-version': this.getAPIVerson(), ...getPlatformHeaders(), ...this.authHeaders(opts), }; @@ -277,10 +301,10 @@ export abstract class APIClient { } buildRequest( - options: FinalRequestOptions, + inputOptions: FinalRequestOptions, { retryCount = 0 }: { retryCount?: number } = {}, ): { req: RequestInit; url: string; timeout: number } { - options = { ...options }; + const options = { ...inputOptions }; const { method, path, query, headers: headers = {} } = options; const body = @@ -308,8 +332,8 @@ export abstract class APIClient { } if (this.idempotencyHeader && method !== 'get') { - if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey(); - headers[this.idempotencyHeader] = options.idempotencyKey; + if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey(); + headers[this.idempotencyHeader] = inputOptions.idempotencyKey; } const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount }); @@ -395,7 +419,7 @@ export abstract class APIClient { !headers ? {} : Symbol.iterator in headers ? Object.fromEntries(Array.from(headers as Iterable).map((header) => [...header])) - : { ...headers } + : { ...(headers as any as Record) } ); } @@ -627,6 +651,10 @@ export abstract class APIClient { private getUserAgent(): string { return `${this.constructor.name}/JS ${VERSION}`; } + + private getAPIVerson(): string { + return this.apiVersion; + } } export type PageInfo = { url: URL } | { params: Record | null }; diff --git a/src/index.ts b/src/index.ts index 90e280165c..015e92a036 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,7 @@ import { Memberships } from './resources/memberships'; import { OriginCACertificates } from './resources/origin-ca-certificates'; import { OriginPostQuantumEncryption } from './resources/origin-post-quantum-encryption'; import { PageRules } from './resources/page-rules'; +import { Pipelines } from './resources/pipelines'; import { RateLimits } from './resources/rate-limits'; import { SecurityTXT } from './resources/security-txt'; import { URLNormalization } from './resources/url-normalization'; @@ -92,6 +93,8 @@ import { ResourceSharing } from './resources/resource-sharing/resource-sharing'; import { Rules } from './resources/rules/rules'; import { Rulesets } from './resources/rulesets/rulesets'; import { RUM } from './resources/rum/rum'; +import { SchemaValidation } from './resources/schema-validation/schema-validation'; +import { SecretsStore } from './resources/secrets-store/secrets-store'; import { SecurityCenter } from './resources/security-center/security-center'; import { Snippets } from './resources/snippets/snippets'; import { Spectrum } from './resources/spectrum/spectrum'; @@ -139,6 +142,11 @@ export interface ClientOptions { */ baseURL?: string | null | undefined; + /** + * Define the API version to target for the requests, e.g., "2025-01-01" + */ + apiVersion?: string | null; + /** * The maximum amount of time (in milliseconds) that the client should wait for a response * from the server before timing out a single request. @@ -208,6 +216,7 @@ export class Cloudflare extends Core.APIClient { * @param {string | null | undefined} [opts.apiEmail=process.env['CLOUDFLARE_EMAIL'] ?? null] * @param {string | null | undefined} [opts.userServiceKey=process.env['CLOUDFLARE_API_USER_SERVICE_KEY'] ?? null] * @param {string} [opts.baseURL=process.env['CLOUDFLARE_BASE_URL'] ?? https://api.cloudflare.com/client/v4] - Override the default base URL for the API. + * @param {string | null} [opts.apiVersion] - Define the version to target for the API. * @param {number} [opts.timeout=1 minute] - The maximum amount of time (in milliseconds) the client will wait for a response before timing out. * @param {number} [opts.httpAgent] - An HTTP agent used to manage HTTP(s) connections. * @param {Core.Fetch} [opts.fetch] - Specify a custom `fetch` function implementation. @@ -217,6 +226,7 @@ export class Cloudflare extends Core.APIClient { */ constructor({ baseURL = Core.readEnv('CLOUDFLARE_BASE_URL'), + apiVersion = null, apiToken = Core.readEnv('CLOUDFLARE_API_TOKEN') ?? null, apiKey = Core.readEnv('CLOUDFLARE_API_KEY') ?? null, apiEmail = Core.readEnv('CLOUDFLARE_EMAIL') ?? null, @@ -230,10 +240,12 @@ export class Cloudflare extends Core.APIClient { userServiceKey, ...opts, baseURL: baseURL || `https://api.cloudflare.com/client/v4`, + apiVersion: apiVersion || new Date().toISOString().slice(0, 10), }; super({ baseURL: options.baseURL!, + apiVersion: options.apiVersion!, timeout: options.timeout ?? 60000 /* 1 minute */, httpAgent: options.httpAgent, maxRetries: options.maxRetries, @@ -340,6 +352,9 @@ export class Cloudflare extends Core.APIClient { securityCenter: API.SecurityCenter = new API.SecurityCenter(this); browserRendering: API.BrowserRendering = new API.BrowserRendering(this); customPages: API.CustomPages = new API.CustomPages(this); + secretsStore: API.SecretsStore = new API.SecretsStore(this); + pipelines: API.Pipelines = new API.Pipelines(this); + schemaValidation: API.SchemaValidation = new API.SchemaValidation(this); protected override defaultQuery(): Core.DefaultQuery | undefined { return this._options.defaultQuery; @@ -558,6 +573,9 @@ Cloudflare.AI = AI; Cloudflare.SecurityCenter = SecurityCenter; Cloudflare.BrowserRendering = BrowserRendering; Cloudflare.CustomPages = CustomPages; +Cloudflare.SecretsStore = SecretsStore; +Cloudflare.Pipelines = Pipelines; +Cloudflare.SchemaValidation = SchemaValidation; export declare namespace Cloudflare { export type RequestOptions = Core.RequestOptions; @@ -772,6 +790,12 @@ export declare namespace Cloudflare { export { CustomPages as CustomPages }; + export { SecretsStore as SecretsStore }; + + export { Pipelines as Pipelines }; + + export { SchemaValidation as SchemaValidation }; + export type ASN = API.ASN; export type AuditLog = API.AuditLog; export type CertificateCA = API.CertificateCA; diff --git a/src/resources.ts b/src/resources.ts new file mode 100644 index 0000000000..b283d5781d --- /dev/null +++ b/src/resources.ts @@ -0,0 +1 @@ +export * from './resources/index'; diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 2ead570f74..9f4c7eb9bf 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -6,6 +6,21 @@ import * as Core from '../core'; export class AbuseReports extends APIResource { /** * Submit the Abuse Report of a particular type + * + * @example + * ```ts + * const abuseReport = await client.abuseReports.create( + * 'abuse_general', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * act: 'abuse_general', + * email: 'email', + * email2: 'email2', + * name: 'x', + * urls: 'urls', + * }, + * ); + * ``` */ create( reportType: @@ -53,84 +68,71 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - address1: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). + * Body param: The abuse report type */ - agent_name: string; + act: + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_general' + | 'abuse_phishing' + | 'abuse_children' + | 'abuse_threat' + | 'abuse_registrar_whois' + | 'abuse_ncsei'; /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - agree: 0 | 1; + email: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: Should match the value provided in `email` */ - city: string; + email2: string; /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - country: string; + name: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). */ - host_notification: 'send' | 'send-anon' | 'none'; + urls: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - original_work: string; + address1?: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: The name of the copyright holder. Text not exceeding 60 characters. + * This field may be released by Cloudflare to third parties such as the Lumen + * Database (https://lumendatabase.org/). */ - owner_notification: 'send' | 'send-anon' | 'none'; + agent_name?: string; /** - * Body param: Required for DMCA reports, should be same as Name. An affirmation - * that all information in the report is true and accurate while agreeing to the - * policies of Cloudflare's abuse reports + * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA + * reports */ - signature: string; + agree?: 0 | 1; /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - state: string; - - /** - * Body param: The abuse report type - */ - act?: - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + city?: string; /** * Body param: Any additional comments about the infringement not exceeding 2000 @@ -145,6 +147,13 @@ export declare namespace AbuseReportCreateParams { */ company?: string; + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + country?: string; + /** * Body param: A list of IP addresses separated by ‘ ’ (new line character). The * list of destination IPs should not exceed 30 IP addresses. Each one of the IP @@ -153,16 +162,10 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** * Body param: A detailed description of the infringement, including any necessary @@ -171,13 +174,6 @@ export declare namespace AbuseReportCreateParams { */ justification?: string; - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name?: string; - /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. @@ -190,6 +186,19 @@ export declare namespace AbuseReportCreateParams { */ ncsei_subject_representation?: boolean; + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + original_work?: string; + + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -198,6 +207,23 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Required for DMCA reports, should be same as Name. An affirmation + * that all information in the report is true and accurate while agreeing to the + * policies of Cloudflare's abuse reports + */ + signature?: string; + /** * Body param: A list of IP addresses separated by ‘ ’ (new line character). The * list of source IPs should not exceed 30 IP addresses. Each one of the IP @@ -205,6 +231,13 @@ export declare namespace AbuseReportCreateParams { */ source_ips?: string; + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + state?: string; + /** * Body param: Text not exceeding 20 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -231,14 +264,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsTrademarkReport { @@ -248,51 +273,44 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters - */ - justification: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: The abuse report type */ - owner_notification: 'send' | 'send-anon' | 'none'; + act: + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_general' + | 'abuse_phishing' + | 'abuse_children' + | 'abuse_threat' + | 'abuse_registrar_whois' + | 'abuse_ncsei'; /** - * Body param: Text not exceeding 1000 characters + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - trademark_number: string; + email: string; /** - * Body param: Text not exceeding 1000 characters + * Body param: Should match the value provided in `email` */ - trademark_office: string; + email2: string; /** - * Body param: Text not exceeding 1000 characters + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - trademark_symbol: string; + name: string; /** - * Body param: The abuse report type + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). */ - act?: - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + urls: string; /** * Body param: Text not exceeding 100 characters. This field may be released by @@ -349,23 +367,17 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters */ - name?: string; + justification?: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) @@ -386,6 +398,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -394,6 +412,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -428,43 +456,31 @@ export declare namespace AbuseReportCreateParams { title?: string; /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; - } - - export interface AbuseReportsGeneralReport { - /** - * Path param: The account ID of the submitter. + * Body param: Text not exceeding 1000 characters */ - account_id: string; + trademark_number?: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: Text not exceeding 1000 characters */ - host_notification: 'send' | 'send-anon' | 'none'; + trademark_office?: string; /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters + * Body param: Text not exceeding 1000 characters */ - justification: string; + trademark_symbol?: string; + } + export interface AbuseReportsGeneralReport { /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Path param: The account ID of the submitter. */ - owner_notification: 'send' | 'send-anon' | 'none'; + account_id: string; /** * Body param: The abuse report type */ - act?: + act: | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' @@ -474,6 +490,33 @@ export declare namespace AbuseReportCreateParams { | 'abuse_registrar_whois' | 'abuse_ncsei'; + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + /** * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -529,23 +572,17 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters */ - name?: string; + justification?: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) @@ -566,6 +603,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -574,6 +617,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -621,14 +674,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsPhishingReport { @@ -637,29 +682,10 @@ export declare namespace AbuseReportCreateParams { */ account_id: string; - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters - */ - justification: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - /** * Body param: The abuse report type */ - act?: + act: | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' @@ -669,6 +695,33 @@ export declare namespace AbuseReportCreateParams { | 'abuse_registrar_whois' | 'abuse_ncsei'; + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + /** * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -724,23 +777,17 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters */ - name?: string; + justification?: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) @@ -761,6 +808,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -769,6 +822,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -816,14 +879,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsChildrenAbuseReport { @@ -833,42 +888,44 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: The abuse report type */ - host_notification: 'send' | 'send-anon' | 'none'; + act: + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_general' + | 'abuse_phishing' + | 'abuse_children' + | 'abuse_threat' + | 'abuse_registrar_whois' + | 'abuse_ncsei'; /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - justification: string; + email: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: Should match the value provided in `email` */ - ncmec_notification: 'send' | 'send-anon' | 'none'; + email2: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - owner_notification: 'send' | 'send-anon' | 'none'; + name: string; /** - * Body param: The abuse report type - */ - act?: - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; /** * Body param: Text not exceeding 100 characters. This field may be released by @@ -925,23 +982,23 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** - * Body param: Should match the value provided in `email` + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters */ - email2?: string; + justification?: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - name?: string; + ncmec_notification?: 'send' | 'send-anon' | 'none'; /** * Body param: If the submitter is the target of NCSEI in the URLs of the abuse @@ -956,6 +1013,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -964,6 +1027,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -1011,14 +1084,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsThreatReport { @@ -1027,29 +1092,10 @@ export declare namespace AbuseReportCreateParams { */ account_id: string; - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters - */ - justification: string; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - /** * Body param: The abuse report type */ - act?: + act: | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' @@ -1059,6 +1105,33 @@ export declare namespace AbuseReportCreateParams { | 'abuse_registrar_whois' | 'abuse_ncsei'; + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + /** * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -1114,23 +1187,17 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters */ - name?: string; + justification?: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) @@ -1151,6 +1218,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -1159,6 +1232,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -1206,14 +1289,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsRegistrarWhoisReport { @@ -1222,16 +1297,10 @@ export declare namespace AbuseReportCreateParams { */ account_id: string; - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - /** * Body param: The abuse report type */ - act?: + act: | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' @@ -1241,6 +1310,33 @@ export declare namespace AbuseReportCreateParams { | 'abuse_registrar_whois' | 'abuse_ncsei'; + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + /** * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -1295,18 +1391,6 @@ export declare namespace AbuseReportCreateParams { */ destination_ips?: string; - /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` - */ - email2?: string; - /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. @@ -1320,13 +1404,6 @@ export declare namespace AbuseReportCreateParams { */ justification?: string; - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name?: string; - /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. @@ -1346,6 +1423,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -1354,6 +1437,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -1401,14 +1494,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } export interface AbuseReportsNcseiReport { @@ -1417,28 +1502,10 @@ export declare namespace AbuseReportCreateParams { */ account_id: string; - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - host_notification: 'send' | 'send-anon' | 'none'; - - /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. - */ - ncsei_subject_representation: boolean; - - /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. - */ - owner_notification: 'send' | 'send-anon' | 'none'; - /** * Body param: The abuse report type */ - act?: + act: | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' @@ -1448,6 +1515,33 @@ export declare namespace AbuseReportCreateParams { | 'abuse_registrar_whois' | 'abuse_ncsei'; + /** + * Body param: A valid email of the abuse reporter. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + email: string; + + /** + * Body param: Should match the value provided in `email` + */ + email2: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list + * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. + * Each URL should be unique. This field may be released by Cloudflare to third + * parties such as the Lumen Database (https://lumendatabase.org/). + */ + urls: string; + /** * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -1503,16 +1597,10 @@ export declare namespace AbuseReportCreateParams { destination_ips?: string; /** - * Body param: A valid email of the abuse reporter. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - email?: string; - - /** - * Body param: Should match the value provided in `email` + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - email2?: string; + host_notification?: 'send' | 'send-anon' | 'none'; /** * Body param: A detailed description of the infringement, including any necessary @@ -1521,19 +1609,18 @@ export declare namespace AbuseReportCreateParams { */ justification?: string; - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - name?: string; - /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. */ ncmec_notification?: 'send' | 'send-anon' | 'none'; + /** + * Body param: If the submitter is the target of NCSEI in the URLs of the abuse + * report. + */ + ncsei_subject_representation?: boolean; + /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -1541,6 +1628,12 @@ export declare namespace AbuseReportCreateParams { */ original_work?: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + owner_notification?: 'send' | 'send-anon' | 'none'; + /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. * The total size of the field should not exceed 2000 characters. Each individual @@ -1549,6 +1642,16 @@ export declare namespace AbuseReportCreateParams { */ ports_protocols?: string; + /** + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + /** * Body param: Required for DMCA reports, should be same as Name. An affirmation * that all information in the report is true and accurate while agreeing to the @@ -1596,13 +1699,12 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 1000 characters */ trademark_symbol?: string; - - /** - * Body param: A list of valid URLs separated by ‘ ’ (new line character). The list - * of the URLs should not exceed 250 URLs. All URLs should have the same hostname. - * Each URL should be unique. This field may be released by Cloudflare to third - * parties such as the Lumen Database (https://lumendatabase.org/). - */ - urls?: string; } } + +export declare namespace AbuseReports { + export { + type AbuseReportCreateResponse as AbuseReportCreateResponse, + type AbuseReportCreateParams as AbuseReportCreateParams, + }; +} diff --git a/src/resources/accounts/accounts.ts b/src/resources/accounts/accounts.ts index 2789317b3d..6c647407f3 100644 --- a/src/resources/accounts/accounts.ts +++ b/src/resources/accounts/accounts.ts @@ -53,6 +53,14 @@ export class Accounts extends APIResource { /** * Create an account (only available for tenant admins at this time) + * + * @example + * ```ts + * const account = await client.accounts.create({ + * name: 'name', + * type: 'standard', + * }); + * ``` */ create(body: AccountCreateParams, options?: Core.RequestOptions): Core.APIPromise { return ( @@ -62,6 +70,14 @@ export class Accounts extends APIResource { /** * Update an existing account. + * + * @example + * ```ts + * const account = await client.accounts.update({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * name: 'Demo Account', + * }); + * ``` */ update(params: AccountUpdateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -74,6 +90,14 @@ export class Accounts extends APIResource { /** * List all accounts you have ownership or verified access to. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const account of client.accounts.list()) { + * // ... + * } + * ``` */ list( query?: AccountListParams, @@ -94,6 +118,13 @@ export class Accounts extends APIResource { * Delete a specific account (only available for tenant admins at this time). This * is a permanent operation that will delete any zones or other resources under the * account + * + * @example + * ```ts + * const account = await client.accounts.delete({ + * account_id: 'account_id', + * }); + * ``` */ delete( params: AccountDeleteParams, @@ -109,6 +140,13 @@ export class Accounts extends APIResource { /** * Get information about a specific account that you are a member of. + * + * @example + * ```ts + * const account = await client.accounts.get({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * }); + * ``` */ get(params: AccountGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; @@ -152,37 +190,11 @@ export namespace Account { */ abuse_contact_email?: string; - /** - * @deprecated Specifies the default nameservers to be used for new zones added to - * this account. - * - * - `cloudflare.standard` for Cloudflare-branded nameservers - * - `custom.account` for account custom nameservers - * - `custom.tenant` for tenant custom nameservers - * - * See - * [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) - * for more information. - * - * Deprecated in favor of - * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings). - */ - default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant'; - /** * Indicates whether membership in this account requires that Two-Factor * Authentication is enabled */ enforce_twofactor?: boolean; - - /** - * @deprecated Indicates whether new zones should use the account-level custom - * nameservers by default. - * - * Deprecated in favor of - * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings). - */ - use_account_custom_ns_by_default?: boolean; } } @@ -254,37 +266,11 @@ export namespace AccountUpdateParams { */ abuse_contact_email?: string; - /** - * @deprecated Specifies the default nameservers to be used for new zones added to - * this account. - * - * - `cloudflare.standard` for Cloudflare-branded nameservers - * - `custom.account` for account custom nameservers - * - `custom.tenant` for tenant custom nameservers - * - * See - * [Custom Nameservers](https://developers.cloudflare.com/dns/additional-options/custom-nameservers/) - * for more information. - * - * Deprecated in favor of - * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings). - */ - default_nameservers?: 'cloudflare.standard' | 'custom.account' | 'custom.tenant'; - /** * Indicates whether membership in this account requires that Two-Factor * Authentication is enabled */ enforce_twofactor?: boolean; - - /** - * @deprecated Indicates whether new zones should use the account-level custom - * nameservers by default. - * - * Deprecated in favor of - * [DNS Settings](https://developers.cloudflare.com/api/operations/dns-settings-for-an-account-update-dns-settings). - */ - use_account_custom_ns_by_default?: boolean; } } @@ -314,6 +300,7 @@ export interface AccountGetParams { account_id: string; } +Accounts.AccountsV4PagePaginationArray = AccountsV4PagePaginationArray; Accounts.Members = Members; Accounts.Roles = Roles; Accounts.Subscriptions = Subscriptions; @@ -321,6 +308,17 @@ Accounts.Tokens = Tokens; Accounts.Logs = Logs; export declare namespace Accounts { + export { + type Account as Account, + type AccountDeleteResponse as AccountDeleteResponse, + AccountsV4PagePaginationArray as AccountsV4PagePaginationArray, + type AccountCreateParams as AccountCreateParams, + type AccountUpdateParams as AccountUpdateParams, + type AccountListParams as AccountListParams, + type AccountDeleteParams as AccountDeleteParams, + type AccountGetParams as AccountGetParams, + }; + export { Members as Members, type Status as Status, diff --git a/src/resources/accounts/logs/audit.ts b/src/resources/accounts/logs/audit.ts index b396a10369..78f9845be8 100644 --- a/src/resources/accounts/logs/audit.ts +++ b/src/resources/accounts/logs/audit.ts @@ -11,6 +11,20 @@ export class Audit extends APIResource { * missing entries in the available audit logs. Be aware of the following * limitations.
  • Audit logs are available only for the past 30 days. *
  • Error handling is not yet implemented.
+ * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const auditListResponse of client.accounts.logs.audit.list( + * { + * account_id: 'a67e14daa5f8dceeb91fe5449ba496ef', + * before: '2024-10-31', + * since: '2024-10-30', + * }, + * )) { + * // ... + * } + * ``` */ list( params: AuditListParams, @@ -140,7 +154,7 @@ export namespace AuditListResponse { /** * The type of actor. */ - type?: 'user' | 'account' | 'cloudflare-admin'; + type?: 'account' | 'cloudflare_admin' | 'system' | 'user'; } /** diff --git a/src/resources/accounts/members.ts b/src/resources/accounts/members.ts index 4acd8a3785..a69c6d42de 100644 --- a/src/resources/accounts/members.ts +++ b/src/resources/accounts/members.ts @@ -9,6 +9,15 @@ import { type V4PagePaginationArrayParams } from '../../pagination'; export class Members extends APIResource { /** * Add a user to the list of members for this account. + * + * @example + * ```ts + * const member = await client.accounts.members.create({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * email: 'user@example.com', + * roles: ['3536bcfad5faccb999b47003c79917fb'], + * }); + * ``` */ create(params: MemberCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -21,6 +30,14 @@ export class Members extends APIResource { /** * Modify an account member. + * + * @example + * ```ts + * const member = await client.accounts.members.update( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ update( memberId: string, @@ -38,6 +55,16 @@ export class Members extends APIResource { /** * List all members of an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const member of client.accounts.members.list({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * })) { + * // ... + * } + * ``` */ list( params: MemberListParams, @@ -52,6 +79,14 @@ export class Members extends APIResource { /** * Remove a member from an account. + * + * @example + * ```ts + * const member = await client.accounts.members.delete( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ delete( memberId: string, @@ -68,6 +103,14 @@ export class Members extends APIResource { /** * Get information about a specific member of an account. + * + * @example + * ```ts + * const member = await client.accounts.members.get( + * '4536bcfad5faccb111b47003c79917fa', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ get( memberId: string, diff --git a/src/resources/accounts/roles.ts b/src/resources/accounts/roles.ts index 0b3b98ff4d..509e0381e6 100644 --- a/src/resources/accounts/roles.ts +++ b/src/resources/accounts/roles.ts @@ -9,6 +9,16 @@ import { type V4PagePaginationArrayParams } from '../../pagination'; export class Roles extends APIResource { /** * Get all available roles for an account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const role of client.accounts.roles.list({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * })) { + * // ... + * } + * ``` */ list( params: RoleListParams, @@ -23,6 +33,14 @@ export class Roles extends APIResource { /** * Get information about a specific role for an account. + * + * @example + * ```ts + * const role = await client.accounts.roles.get( + * '3536bcfad5faccb999b47003c79917fb', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ get(roleId: string, params: RoleGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; diff --git a/src/resources/accounts/subscriptions.ts b/src/resources/accounts/subscriptions.ts index 92c3e7c354..6f5dfd3257 100644 --- a/src/resources/accounts/subscriptions.ts +++ b/src/resources/accounts/subscriptions.ts @@ -8,6 +8,14 @@ import { SubscriptionsSinglePage } from '../shared'; export class Subscriptions extends APIResource { /** * Creates an account subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ create( params: SubscriptionCreateParams, @@ -23,6 +31,15 @@ export class Subscriptions extends APIResource { /** * Updates an account subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.update( + * '506e3185e9c882d175a2d0cb0093d9f2', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ update( subscriptionIdentifier: string, @@ -40,6 +57,15 @@ export class Subscriptions extends APIResource { /** * Deletes an account's subscription. + * + * @example + * ```ts + * const subscription = + * await client.accounts.subscriptions.delete( + * '506e3185e9c882d175a2d0cb0093d9f2', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( subscriptionIdentifier: string, @@ -57,6 +83,16 @@ export class Subscriptions extends APIResource { /** * Lists all of an account's subscriptions. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const subscription of client.accounts.subscriptions.get( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ get( params: SubscriptionGetParams, diff --git a/src/resources/accounts/tokens/permission-groups.ts b/src/resources/accounts/tokens/permission-groups.ts index f6212383a1..37c6d2d52c 100644 --- a/src/resources/accounts/tokens/permission-groups.ts +++ b/src/resources/accounts/tokens/permission-groups.ts @@ -7,6 +7,16 @@ import { SinglePage } from '../../../pagination'; export class PermissionGroups extends APIResource { /** * Find all available permission groups for Account Owned API Tokens + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const permissionGroupListResponse of client.accounts.tokens.permissionGroups.list( + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * )) { + * // ... + * } + * ``` */ list( params: PermissionGroupListParams, @@ -22,6 +32,16 @@ export class PermissionGroups extends APIResource { /** * Find all available permission groups for Account Owned API Tokens + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const permissionGroupGetResponse of client.accounts.tokens.permissionGroups.get( + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * )) { + * // ... + * } + * ``` */ get( params: PermissionGroupGetParams, diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index 8013f37fa5..ff9f4a126e 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -26,6 +26,29 @@ export class Tokens extends APIResource { /** * Create a new Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.create({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * name: 'readonly token', + * policies: [ + * { + * effect: 'allow', + * permission_groups: [ + * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, + * { id: '82e64a83756745bbbb1c9c2701bf816b' }, + * ], + * resources: { + * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': + * '*', + * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': + * '*', + * }, + * }, + * ], + * }); + * ``` */ create(params: TokenCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -38,6 +61,33 @@ export class Tokens extends APIResource { /** * Update an existing token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.update( + * 'ed17574386854bf78a67040be0a770b0', + * { + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * name: 'readonly token', + * policies: [ + * { + * effect: 'allow', + * permission_groups: [ + * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, + * { id: '82e64a83756745bbbb1c9c2701bf816b' }, + * ], + * resources: { + * 'com.cloudflare.api.account.zone.22b1de5f1c0e4b3ea97bb1e963b06a43': + * '*', + * 'com.cloudflare.api.account.zone.eb78d65290b24279ba6f44721b3ea3c4': + * '*', + * }, + * }, + * ], + * status: 'active', + * }, + * ); + * ``` */ update( tokenId: string, @@ -54,6 +104,16 @@ export class Tokens extends APIResource { /** * List all Account Owned API tokens created for this account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const token of client.accounts.tokens.list({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * })) { + * // ... + * } + * ``` */ list( params: TokenListParams, @@ -68,6 +128,14 @@ export class Tokens extends APIResource { /** * Destroy an Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.delete( + * 'ed17574386854bf78a67040be0a770b0', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ delete( tokenId: string, @@ -84,6 +152,14 @@ export class Tokens extends APIResource { /** * Get information about a specific Account Owned API token. + * + * @example + * ```ts + * const token = await client.accounts.tokens.get( + * 'ed17574386854bf78a67040be0a770b0', + * { account_id: 'eb78d65290b24279ba6f44721b3ea3c4' }, + * ); + * ``` */ get(tokenId: string, params: TokenGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; @@ -96,6 +172,13 @@ export class Tokens extends APIResource { /** * Test whether a token works. + * + * @example + * ```ts + * const response = await client.accounts.tokens.verify({ + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * }); + * ``` */ verify(params: TokenVerifyParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; diff --git a/src/resources/accounts/tokens/value.ts b/src/resources/accounts/tokens/value.ts index fc9b58dfd9..235c07f52b 100644 --- a/src/resources/accounts/tokens/value.ts +++ b/src/resources/accounts/tokens/value.ts @@ -7,6 +7,18 @@ import * as Shared from '../../shared'; export class Value extends APIResource { /** * Roll the Account Owned API token secret. + * + * @example + * ```ts + * const tokenValue = + * await client.accounts.tokens.value.update( + * 'ed17574386854bf78a67040be0a770b0', + * { + * account_id: 'eb78d65290b24279ba6f44721b3ea3c4', + * body: {}, + * }, + * ); + * ``` */ update( tokenId: string, diff --git a/src/resources/acm/total-tls.ts b/src/resources/acm/total-tls.ts index 07d170f690..7d5a2b2523 100644 --- a/src/resources/acm/total-tls.ts +++ b/src/resources/acm/total-tls.ts @@ -6,6 +6,14 @@ import * as Core from '../../core'; export class TotalTLS extends APIResource { /** * Set Total TLS Settings or disable the feature for a Zone. + * + * @example + * ```ts + * const totalTLS = await client.acm.totalTLS.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * enabled: true, + * }); + * ``` */ create( params: TotalTLSCreateParams, @@ -21,6 +29,13 @@ export class TotalTLS extends APIResource { /** * Get Total TLS Settings for a Zone. + * + * @example + * ```ts + * const totalTLS = await client.acm.totalTLS.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: TotalTLSGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; @@ -80,7 +95,7 @@ export interface TotalTLSGetResponse { export interface TotalTLSCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -99,7 +114,7 @@ export interface TotalTLSCreateParams { export interface TotalTLSGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/addressing/address-maps/accounts.ts b/src/resources/addressing/address-maps/accounts.ts index 589190d231..24ad9c25e4 100644 --- a/src/resources/addressing/address-maps/accounts.ts +++ b/src/resources/addressing/address-maps/accounts.ts @@ -2,11 +2,22 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; export class Accounts extends APIResource { /** * Add an account as a member of a particular address map. + * + * @example + * ```ts + * const account = + * await client.addressing.addressMaps.accounts.update( + * '055817b111884e0227e1be16a0be6ee0', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, @@ -22,6 +33,15 @@ export class Accounts extends APIResource { /** * Remove an account as a member of a particular address map. + * + * @example + * ```ts + * const account = + * await client.addressing.addressMaps.accounts.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, @@ -37,12 +57,12 @@ export class Accounts extends APIResource { } export interface AccountUpdateResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -50,36 +70,68 @@ export interface AccountUpdateResponse { } export namespace AccountUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } } export interface AccountDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -87,24 +139,56 @@ export interface AccountDeleteResponse { } export namespace AccountDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } diff --git a/src/resources/addressing/address-maps/address-maps.ts b/src/resources/addressing/address-maps/address-maps.ts index c179e49a71..cbee434db5 100644 --- a/src/resources/addressing/address-maps/address-maps.ts +++ b/src/resources/addressing/address-maps/address-maps.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as AddressMapsAPI from './address-maps'; -import * as Shared from '../../shared'; import * as AccountsAPI from './accounts'; import { AccountDeleteParams, @@ -25,6 +24,14 @@ export class AddressMaps extends APIResource { /** * Create a new address map under the account. + * + * @example + * ```ts + * const addressMap = + * await client.addressing.addressMaps.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * }); + * ``` */ create( params: AddressMapCreateParams, @@ -41,6 +48,16 @@ export class AddressMaps extends APIResource { /** * List all address maps owned by the account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const addressMap of client.addressing.addressMaps.list( + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( params: AddressMapListParams, @@ -57,6 +74,15 @@ export class AddressMaps extends APIResource { /** * Delete a particular address map owned by the account. An Address Map must be * disabled before it can be deleted. + * + * @example + * ```ts + * const addressMap = + * await client.addressing.addressMaps.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, @@ -69,6 +95,14 @@ export class AddressMaps extends APIResource { /** * Modify properties of an address map owned by the account. + * + * @example + * ```ts + * const addressMap = await client.addressing.addressMaps.edit( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ edit( addressMapId: string, @@ -86,6 +120,14 @@ export class AddressMaps extends APIResource { /** * Show a particular address map owned by the account. + * + * @example + * ```ts + * const addressMap = await client.addressing.addressMaps.get( + * '055817b111884e0227e1be16a0be6ee0', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get( addressMapId: string, @@ -244,12 +286,12 @@ export namespace AddressMapCreateResponse { } export interface AddressMapDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -257,24 +299,56 @@ export interface AddressMapDeleteResponse { } export namespace AddressMapDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } diff --git a/src/resources/addressing/address-maps/ips.ts b/src/resources/addressing/address-maps/ips.ts index b68855f9bb..9200c70acd 100644 --- a/src/resources/addressing/address-maps/ips.ts +++ b/src/resources/addressing/address-maps/ips.ts @@ -2,11 +2,22 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; export class IPs extends APIResource { /** * Add an IP from a prefix owned by the account to a particular address map. + * + * @example + * ```ts + * const ip = await client.addressing.addressMaps.ips.update( + * '055817b111884e0227e1be16a0be6ee0', + * '192.0.2.1', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, @@ -23,6 +34,15 @@ export class IPs extends APIResource { /** * Remove an IP from a particular address map. + * + * @example + * ```ts + * const ip = await client.addressing.addressMaps.ips.delete( + * '055817b111884e0227e1be16a0be6ee0', + * '192.0.2.1', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( addressMapId: string, @@ -39,12 +59,12 @@ export class IPs extends APIResource { } export interface IPUpdateResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -52,36 +72,68 @@ export interface IPUpdateResponse { } export namespace IPUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } } export interface IPDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -89,24 +141,56 @@ export interface IPDeleteResponse { } export namespace IPDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } diff --git a/src/resources/addressing/address-maps/zones.ts b/src/resources/addressing/address-maps/zones.ts index 263fc1ee81..88c7b17abf 100644 --- a/src/resources/addressing/address-maps/zones.ts +++ b/src/resources/addressing/address-maps/zones.ts @@ -2,11 +2,23 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; export class Zones extends APIResource { /** * Add a zone as a member of a particular address map. + * + * @example + * ```ts + * const zone = + * await client.addressing.addressMaps.zones.update( + * '055817b111884e0227e1be16a0be6ee0', + * { + * zone_id: '8ac8489932db6327334c9b6d58544cfe', + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * body: {}, + * }, + * ); + * ``` */ update( addressMapId: string, @@ -22,6 +34,18 @@ export class Zones extends APIResource { /** * Remove a zone as a member of a particular address map. + * + * @example + * ```ts + * const zone = + * await client.addressing.addressMaps.zones.delete( + * '055817b111884e0227e1be16a0be6ee0', + * { + * zone_id: '8ac8489932db6327334c9b6d58544cfe', + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * }, + * ); + * ``` */ delete( addressMapId: string, @@ -37,12 +61,12 @@ export class Zones extends APIResource { } export interface ZoneUpdateResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -50,36 +74,68 @@ export interface ZoneUpdateResponse { } export namespace ZoneUpdateResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } } export interface ZoneDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -87,24 +143,56 @@ export interface ZoneDeleteResponse { } export namespace ZoneDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } diff --git a/src/resources/addressing/loa-documents.ts b/src/resources/addressing/loa-documents.ts index ba1b9a39f8..dafacf0abb 100644 --- a/src/resources/addressing/loa-documents.ts +++ b/src/resources/addressing/loa-documents.ts @@ -7,6 +7,15 @@ import { type Response } from '../../_shims/index'; export class LOADocuments extends APIResource { /** * Submit LOA document (pdf format) under the account. + * + * @example + * ```ts + * const loaDocument = + * await client.addressing.loaDocuments.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * loa_document: '@document.pdf', + * }); + * ``` */ create( params: LOADocumentCreateParams, @@ -23,6 +32,18 @@ export class LOADocuments extends APIResource { /** * Download specified LOA document under the account. + * + * @example + * ```ts + * const loaDocument = + * await client.addressing.loaDocuments.get( + * 'd933b1530bc56c9953cf8ce166da8004', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * + * const content = await loaDocument.blob(); + * console.log(content); + * ``` */ get( loaDocumentId: string | null, diff --git a/src/resources/addressing/prefixes/advertisement-status.ts b/src/resources/addressing/prefixes/advertisement-status.ts index 73a0c2a1e5..65d52cbd5f 100644 --- a/src/resources/addressing/prefixes/advertisement-status.ts +++ b/src/resources/addressing/prefixes/advertisement-status.ts @@ -9,6 +9,18 @@ export class AdvertisementStatus extends APIResource { * * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for * advertising and withdrawing subnets of an IP prefix. + * + * @example + * ```ts + * const response = + * await client.addressing.prefixes.advertisementStatus.edit( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * advertised: true, + * }, + * ); + * ``` */ edit( prefixId: string, @@ -29,6 +41,15 @@ export class AdvertisementStatus extends APIResource { * * **Deprecated:** Prefer the BGP Prefixes endpoints, which additionally allow for * advertising and withdrawing subnets of an IP prefix. + * + * @example + * ```ts + * const advertisementStatus = + * await client.addressing.prefixes.advertisementStatus.get( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get( prefixId: string, diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts index a49a099a4b..519a372d99 100644 --- a/src/resources/addressing/prefixes/bgp-prefixes.ts +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -9,6 +9,15 @@ export class BGPPrefixes extends APIResource { * Create a BGP prefix, controlling the BGP advertisement status of a specific * subnet. When created, BGP prefixes are initially withdrawn, and can be * advertised with the Update BGP Prefix API. + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.create( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ create( prefixId: string, @@ -29,6 +38,17 @@ export class BGPPrefixes extends APIResource { * control which specific subnets are advertised to the Internet. It is possible to * advertise subnets more specific than an IP Prefix by creating more specific BGP * Prefixes. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const bgpPrefix of client.addressing.prefixes.bgpPrefixes.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( prefixId: string, @@ -46,6 +66,16 @@ export class BGPPrefixes extends APIResource { /** * Update the properties of a BGP Prefix, such as the on demand advertisement * status (advertised or withdrawn). + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.edit( + * '2af39739cc4e3b5910c918468bb89828', + * '7009ba364c7a5760798ceb430e603b74', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ edit( prefixId: string, @@ -64,6 +94,16 @@ export class BGPPrefixes extends APIResource { /** * Retrieve a single BGP Prefix according to its identifier + * + * @example + * ```ts + * const bgpPrefix = + * await client.addressing.prefixes.bgpPrefixes.get( + * '2af39739cc4e3b5910c918468bb89828', + * '7009ba364c7a5760798ceb430e603b74', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get( prefixId: string, @@ -94,6 +134,11 @@ export interface BGPPrefix { */ asn?: number | null; + /** + * Number of times to prepend the Cloudflare ASN to the BGP AS-Path attribute + */ + asn_prepend_count?: number; + bgp_signal_opts?: BGPPrefix.BGPSignalOpts; /** @@ -106,6 +151,13 @@ export interface BGPPrefix { modified_at?: string; on_demand?: BGPPrefix.OnDemand; + + /** + * Controls whether the BGP prefix is automatically withdrawn when prefix is + * withdrawn from Magic routing table (for Magic Transit customers using Direct + * CNI) + */ + withdraw_if_no_route?: boolean; } export namespace BGPPrefix { @@ -175,10 +227,23 @@ export interface BGPPrefixEditParams { */ account_id: string; + /** + * Body param: Number of times to prepend the Cloudflare ASN to the BGP AS-Path + * attribute + */ + asn_prepend_count?: number; + /** * Body param: */ on_demand?: BGPPrefixEditParams.OnDemand; + + /** + * Body param: Controls whether the BGP prefix is automatically withdrawn when + * prefix is withdrawn from Magic routing table (for Magic Transit customers using + * Direct CNI) + */ + withdraw_if_no_route?: boolean; } export namespace BGPPrefixEditParams { diff --git a/src/resources/addressing/prefixes/delegations.ts b/src/resources/addressing/prefixes/delegations.ts index 7566c99df8..ae0bc86716 100644 --- a/src/resources/addressing/prefixes/delegations.ts +++ b/src/resources/addressing/prefixes/delegations.ts @@ -7,6 +7,20 @@ import { SinglePage } from '../../../pagination'; export class Delegations extends APIResource { /** * Create a new account delegation for a given IP prefix. + * + * @example + * ```ts + * const delegations = + * await client.addressing.prefixes.delegations.create( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * cidr: '192.0.2.0/24', + * delegated_account_id: + * 'b1946ac92492d2347c6235b4d2611184', + * }, + * ); + * ``` */ create( prefixId: string, @@ -24,6 +38,17 @@ export class Delegations extends APIResource { /** * List all delegations for a given account IP prefix. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const delegations of client.addressing.prefixes.delegations.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( prefixId: string, @@ -40,6 +65,16 @@ export class Delegations extends APIResource { /** * Delete an account delegation for a given IP prefix. + * + * @example + * ```ts + * const delegation = + * await client.addressing.prefixes.delegations.delete( + * '2af39739cc4e3b5910c918468bb89828', + * 'd933b1530bc56c9953cf8ce166da8004', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( prefixId: string, diff --git a/src/resources/addressing/prefixes/prefixes.ts b/src/resources/addressing/prefixes/prefixes.ts index e3389f7360..84a9fa9940 100644 --- a/src/resources/addressing/prefixes/prefixes.ts +++ b/src/resources/addressing/prefixes/prefixes.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import * as AdvertisementStatusAPI from './advertisement-status'; import { AdvertisementStatus, @@ -52,6 +51,16 @@ export class Prefixes extends APIResource { /** * Add a new prefix under the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.create({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * asn: 209242, + * cidr: '192.0.2.0/24', + * loa_document_id: 'd933b1530bc56c9953cf8ce166da8004', + * }); + * ``` */ create(params: PrefixCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -65,6 +74,16 @@ export class Prefixes extends APIResource { /** * List all prefixes owned by the account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const prefix of client.addressing.prefixes.list({ + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * })) { + * // ... + * } + * ``` */ list( params: PrefixListParams, @@ -80,6 +99,14 @@ export class Prefixes extends APIResource { /** * Delete an unapproved prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.delete( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( prefixId: string, @@ -92,6 +119,17 @@ export class Prefixes extends APIResource { /** * Modify the description for a prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.edit( + * '2af39739cc4e3b5910c918468bb89828', + * { + * account_id: '258def64c72dae45f3e4c8516e2111f2', + * description: 'Internal test prefix', + * }, + * ); + * ``` */ edit(prefixId: string, params: PrefixEditParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -105,6 +143,14 @@ export class Prefixes extends APIResource { /** * List a particular prefix owned by the account. + * + * @example + * ```ts + * const prefix = await client.addressing.prefixes.get( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get(prefixId: string, params: PrefixGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; @@ -185,12 +231,12 @@ export interface Prefix { } export interface PrefixDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -198,24 +244,56 @@ export interface PrefixDeleteResponse { } export namespace PrefixDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } + export interface ResultInfo { /** - * Total number of results for the requested service + * Total number of results for the requested service. */ count?: number; /** - * Current page within paginated list of results + * Current page within paginated list of results. */ page?: number; /** - * Number of results per page of results + * Number of results per page of results. */ per_page?: number; /** - * Total results available without any search parameters + * Total results available without any search parameters. */ total_count?: number; } diff --git a/src/resources/addressing/prefixes/service-bindings.ts b/src/resources/addressing/prefixes/service-bindings.ts index 763fe5c7ff..5ef9365d41 100644 --- a/src/resources/addressing/prefixes/service-bindings.ts +++ b/src/resources/addressing/prefixes/service-bindings.ts @@ -2,15 +2,24 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import { SinglePage } from '../../../pagination'; export class ServiceBindings extends APIResource { /** * Creates a new Service Binding, routing traffic to IPs within the given CIDR to a * service running on Cloudflare's network. **Note:** This API may only be used on - * prefixes currently configured with a Magic Transit service binding, and only - * allows creating service bindings for the Cloudflare CDN or Cloudflare Spectrum. + * prefixes currently configured with a Magic Transit/Cloudflare CDN/Cloudflare + * Spectrum service binding, and only allows creating upgrade service bindings for + * the Cloudflare CDN or Cloudflare Spectrum. + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.create( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ create( prefixId: string, @@ -33,6 +42,17 @@ export class ServiceBindings extends APIResource { * `192.0.2.0/24` to Cloudflare Magic Transit and `192.0.2.1/32` to the Cloudflare * CDN would route traffic for `192.0.2.1` to the CDN, and traffic for all other * IPs in the prefix to Cloudflare Magic Transit. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const serviceBinding of client.addressing.prefixes.serviceBindings.list( + * '2af39739cc4e3b5910c918468bb89828', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( prefixId: string, @@ -49,6 +69,16 @@ export class ServiceBindings extends APIResource { /** * Delete a Service Binding + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.delete( + * '2af39739cc4e3b5910c918468bb89828', + * '0429b49b6a5155297b78e75a44b09e14', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ delete( prefixId: string, @@ -65,6 +95,16 @@ export class ServiceBindings extends APIResource { /** * Fetch a single Service Binding + * + * @example + * ```ts + * const serviceBinding = + * await client.addressing.prefixes.serviceBindings.get( + * '2af39739cc4e3b5910c918468bb89828', + * '0429b49b6a5155297b78e75a44b09e14', + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * ); + * ``` */ get( prefixId: string, @@ -126,16 +166,50 @@ export namespace ServiceBinding { } export interface ServiceBindingDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } +export namespace ServiceBindingDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} + export interface ServiceBindingCreateParams { /** * Path param: Identifier of a Cloudflare account. diff --git a/src/resources/addressing/regional-hostnames/regional-hostnames.ts b/src/resources/addressing/regional-hostnames/regional-hostnames.ts index 3c3b0c2162..53c5c9a505 100644 --- a/src/resources/addressing/regional-hostnames/regional-hostnames.ts +++ b/src/resources/addressing/regional-hostnames/regional-hostnames.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import * as RegionsAPI from './regions'; import { RegionListParams, RegionListResponse, RegionListResponsesSinglePage, Regions } from './regions'; import { SinglePage } from '../../../pagination'; @@ -15,6 +14,16 @@ export class RegionalHostnames extends APIResource { * are physically located within the chosen region to decrypt and service HTTPS * traffic. Learn more about * [Regional Services](https://developers.cloudflare.com/data-localization/regional-services/get-started/). + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * hostname: 'foo.example.com', + * region_key: 'ca', + * }); + * ``` */ create( params: RegionalHostnameCreateParams, @@ -31,6 +40,16 @@ export class RegionalHostnames extends APIResource { /** * List all Regional Hostnames within a zone. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const regionalHostnameListResponse of client.addressing.regionalHostnames.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: RegionalHostnameListParams, @@ -46,6 +65,15 @@ export class RegionalHostnames extends APIResource { /** * Delete the region configuration for a specific Regional Hostname. + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.delete( + * 'foo.example.com', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( hostname: string, @@ -59,6 +87,18 @@ export class RegionalHostnames extends APIResource { /** * Update the configuration for a specific Regional Hostname. Only the region_key * of a hostname is mutable. + * + * @example + * ```ts + * const response = + * await client.addressing.regionalHostnames.edit( + * 'foo.example.com', + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * region_key: 'ca', + * }, + * ); + * ``` */ edit( hostname: string, @@ -76,6 +116,15 @@ export class RegionalHostnames extends APIResource { /** * Fetch the configuration for a specific Regional Hostname, within a zone. + * + * @example + * ```ts + * const regionalHostname = + * await client.addressing.regionalHostnames.get( + * 'foo.example.com', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( hostname: string, @@ -110,6 +159,11 @@ export interface RegionalHostnameCreateResponse { * Identifying key for the region */ region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; } export interface RegionalHostnameListResponse { @@ -128,19 +182,58 @@ export interface RegionalHostnameListResponse { * Identifying key for the region */ region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; } export interface RegionalHostnameDeleteResponse { - errors: Array; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } +export namespace RegionalHostnameDeleteResponse { + export interface Error { + code: number; + + message: string; + + documentation_url?: string; + + source?: Error.Source; + } + + export namespace Error { + export interface Source { + pointer?: string; + } + } + + export interface Message { + code: number; + + message: string; + + documentation_url?: string; + + source?: Message.Source; + } + + export namespace Message { + export interface Source { + pointer?: string; + } + } +} + export interface RegionalHostnameEditResponse { /** * When the regional hostname was created @@ -157,6 +250,11 @@ export interface RegionalHostnameEditResponse { * Identifying key for the region */ region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; } export interface RegionalHostnameGetResponse { @@ -175,11 +273,16 @@ export interface RegionalHostnameGetResponse { * Identifying key for the region */ region_key: string; + + /** + * Configure which routing method to use for the regional hostname + */ + routing?: string; } export interface RegionalHostnameCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -193,25 +296,30 @@ export interface RegionalHostnameCreateParams { * Body param: Identifying key for the region */ region_key: string; + + /** + * Body param: Configure which routing method to use for the regional hostname + */ + routing?: string; } export interface RegionalHostnameListParams { /** - * Identifier + * Identifier. */ zone_id: string; } export interface RegionalHostnameDeleteParams { /** - * Identifier + * Identifier. */ zone_id: string; } export interface RegionalHostnameEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -223,7 +331,7 @@ export interface RegionalHostnameEditParams { export interface RegionalHostnameGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/addressing/regional-hostnames/regions.ts b/src/resources/addressing/regional-hostnames/regions.ts index db005d7338..0f11942e41 100644 --- a/src/resources/addressing/regional-hostnames/regions.ts +++ b/src/resources/addressing/regional-hostnames/regions.ts @@ -7,6 +7,16 @@ import { SinglePage } from '../../../pagination'; export class Regions extends APIResource { /** * List all Regional Services regions available for use by this account. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const regionListResponse of client.addressing.regionalHostnames.regions.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: RegionListParams, @@ -37,7 +47,7 @@ export interface RegionListResponse { export interface RegionListParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/addressing/services.ts b/src/resources/addressing/services.ts index 17341ca348..ab947c31d3 100644 --- a/src/resources/addressing/services.ts +++ b/src/resources/addressing/services.ts @@ -10,6 +10,16 @@ export class Services extends APIResource { * service running on the Cloudflare network to enable a Cloudflare product on the * IP addresses. This endpoint can be used as a reference of available services on * the Cloudflare network, and their service IDs. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const serviceListResponse of client.addressing.services.list( + * { account_id: '258def64c72dae45f3e4c8516e2111f2' }, + * )) { + * // ... + * } + * ``` */ list( params: ServiceListParams, diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index 86aad037e5..ca019da35e 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -67,6 +67,20 @@ export class AIGateway extends APIResource { /** * Create a new Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.create({ + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * id: 'my-gateway', + * cache_invalidate_on_update: true, + * cache_ttl: 0, + * collect_logs: true, + * rate_limiting_interval: 0, + * rate_limiting_limit: 0, + * rate_limiting_technique: 'fixed', + * }); + * ``` */ create( params: AIGatewayCreateParams, @@ -83,6 +97,22 @@ export class AIGateway extends APIResource { /** * Update a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.update( + * 'my-gateway', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * cache_invalidate_on_update: true, + * cache_ttl: 0, + * collect_logs: true, + * rate_limiting_interval: 0, + * rate_limiting_limit: 0, + * rate_limiting_technique: 'fixed', + * }, + * ); + * ``` */ update( id: string, @@ -100,6 +130,16 @@ export class AIGateway extends APIResource { /** * List Gateways + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const aiGatewayListResponse of client.aiGateway.list( + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` */ list( params: AIGatewayListParams, @@ -115,6 +155,14 @@ export class AIGateway extends APIResource { /** * Delete a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.delete( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` */ delete( id: string, @@ -131,6 +179,13 @@ export class AIGateway extends APIResource { /** * Fetch a Gateway + * + * @example + * ```ts + * const aiGateway = await client.aiGateway.get('my-gateway', { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * }); + * ``` */ get( id: string, @@ -492,6 +547,7 @@ export interface AIGatewayGetParams { account_id: string; } +AIGateway.AIGatewayListResponsesV4PagePaginationArray = AIGatewayListResponsesV4PagePaginationArray; AIGateway.EvaluationTypes = EvaluationTypes; AIGateway.EvaluationTypeListResponsesV4PagePaginationArray = EvaluationTypeListResponsesV4PagePaginationArray; AIGateway.Logs = Logs; @@ -503,6 +559,20 @@ AIGateway.EvaluationListResponsesV4PagePaginationArray = EvaluationListResponses AIGateway.URLs = URLs; export declare namespace AIGateway { + export { + type AIGatewayCreateResponse as AIGatewayCreateResponse, + type AIGatewayUpdateResponse as AIGatewayUpdateResponse, + type AIGatewayListResponse as AIGatewayListResponse, + type AIGatewayDeleteResponse as AIGatewayDeleteResponse, + type AIGatewayGetResponse as AIGatewayGetResponse, + AIGatewayListResponsesV4PagePaginationArray as AIGatewayListResponsesV4PagePaginationArray, + type AIGatewayCreateParams as AIGatewayCreateParams, + type AIGatewayUpdateParams as AIGatewayUpdateParams, + type AIGatewayListParams as AIGatewayListParams, + type AIGatewayDeleteParams as AIGatewayDeleteParams, + type AIGatewayGetParams as AIGatewayGetParams, + }; + export { EvaluationTypes as EvaluationTypes, type EvaluationTypeListResponse as EvaluationTypeListResponse, diff --git a/src/resources/ai-gateway/datasets.ts b/src/resources/ai-gateway/datasets.ts index 6582ad5afa..fdf7c5f990 100644 --- a/src/resources/ai-gateway/datasets.ts +++ b/src/resources/ai-gateway/datasets.ts @@ -7,6 +7,25 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p export class Datasets extends APIResource { /** * Create a new Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.create( + * 'my-gateway', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * enable: true, + * filters: [ + * { + * key: 'created_at', + * operator: 'eq', + * value: ['string'], + * }, + * ], + * name: 'name', + * }, + * ); + * ``` */ create( gatewayId: string, @@ -24,6 +43,26 @@ export class Datasets extends APIResource { /** * Update a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.update( + * 'my-gateway', + * 'id', + * { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * enable: true, + * filters: [ + * { + * key: 'created_at', + * operator: 'eq', + * value: ['string'], + * }, + * ], + * name: 'name', + * }, + * ); + * ``` */ update( gatewayId: string, @@ -42,6 +81,17 @@ export class Datasets extends APIResource { /** * List Datasets + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const datasetListResponse of client.aiGateway.datasets.list( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` */ list( gatewayId: string, @@ -58,6 +108,15 @@ export class Datasets extends APIResource { /** * Delete a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.delete( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` */ delete( gatewayId: string, @@ -76,6 +135,15 @@ export class Datasets extends APIResource { /** * Fetch a Dataset + * + * @example + * ```ts + * const dataset = await client.aiGateway.datasets.get( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` */ get( gatewayId: string, diff --git a/src/resources/ai-gateway/evaluation-types.ts b/src/resources/ai-gateway/evaluation-types.ts index b6d4c75b3f..8a50a99868 100644 --- a/src/resources/ai-gateway/evaluation-types.ts +++ b/src/resources/ai-gateway/evaluation-types.ts @@ -7,6 +7,16 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p export class EvaluationTypes extends APIResource { /** * List Evaluators + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const evaluationTypeListResponse of client.aiGateway.evaluationTypes.list( + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * )) { + * // ... + * } + * ``` */ list( params: EvaluationTypeListParams, diff --git a/src/resources/ai-gateway/evaluations.ts b/src/resources/ai-gateway/evaluations.ts index b572e53b69..07acb57c43 100644 --- a/src/resources/ai-gateway/evaluations.ts +++ b/src/resources/ai-gateway/evaluations.ts @@ -7,6 +7,17 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p export class Evaluations extends APIResource { /** * Create a new Evaluation + * + * @example + * ```ts + * const evaluation = + * await client.aiGateway.evaluations.create('my-gateway', { + * account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0', + * dataset_ids: ['string'], + * evaluation_type_ids: ['string'], + * name: 'name', + * }); + * ``` */ create( gatewayId: string, @@ -24,6 +35,17 @@ export class Evaluations extends APIResource { /** * List Evaluations + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const evaluationListResponse of client.aiGateway.evaluations.list( + * 'my-gateway', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * )) { + * // ... + * } + * ``` */ list( gatewayId: string, @@ -40,6 +62,16 @@ export class Evaluations extends APIResource { /** * Delete a Evaluation + * + * @example + * ```ts + * const evaluation = + * await client.aiGateway.evaluations.delete( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` */ delete( gatewayId: string, @@ -58,6 +90,15 @@ export class Evaluations extends APIResource { /** * Fetch a Evaluation + * + * @example + * ```ts + * const evaluation = await client.aiGateway.evaluations.get( + * 'my-gateway', + * 'id', + * { account_id: '3ebbcb006d4d46d7bb6a8c7f14676cb0' }, + * ); + * ``` */ get( gatewayId: string, diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index a5631d091a..6b9563bcee 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -7,6 +7,17 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../p export class Logs extends APIResource { /** * List Gateway Logs + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const logListResponse of client.aiGateway.logs.list( + * 'my-gateway', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * )) { + * // ... + * } + * ``` */ list( gatewayId: string, @@ -23,6 +34,14 @@ export class Logs extends APIResource { /** * Delete Gateway Logs + * + * @example + * ```ts + * const log = await client.aiGateway.logs.delete( + * 'my-gateway', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ delete( gatewayId: string, @@ -38,6 +57,15 @@ export class Logs extends APIResource { /** * Patch Gateway Log + * + * @example + * ```ts + * const response = await client.aiGateway.logs.edit( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ edit( gatewayId: string, @@ -56,6 +84,15 @@ export class Logs extends APIResource { /** * Get Gateway Log Detail + * + * @example + * ```ts + * const log = await client.aiGateway.logs.get( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ get( gatewayId: string, @@ -74,6 +111,15 @@ export class Logs extends APIResource { /** * Get Gateway Log Request + * + * @example + * ```ts + * const response = await client.aiGateway.logs.request( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ request( gatewayId: string, @@ -90,6 +136,15 @@ export class Logs extends APIResource { /** * Get Gateway Log Response + * + * @example + * ```ts + * const response = await client.aiGateway.logs.response( + * 'my-gateway', + * 'id', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ response( gatewayId: string, @@ -216,22 +271,22 @@ export interface LogListParams extends V4PagePaginationArrayParams { account_id: string; /** - * Query param: + * @deprecated Query param: */ cached?: boolean; /** - * Query param: + * @deprecated Query param: */ direction?: 'asc' | 'desc'; /** - * Query param: + * @deprecated Query param: */ end_date?: string; /** - * Query param: + * @deprecated Query param: */ feedback?: 0 | 1; @@ -241,27 +296,27 @@ export interface LogListParams extends V4PagePaginationArrayParams { filters?: Array; /** - * Query param: + * @deprecated Query param: */ max_cost?: number; /** - * Query param: + * @deprecated Query param: */ max_duration?: number; /** - * Query param: + * @deprecated Query param: */ max_tokens_in?: number; /** - * Query param: + * @deprecated Query param: */ max_tokens_out?: number; /** - * Query param: + * @deprecated Query param: */ max_total_tokens?: number; @@ -271,37 +326,37 @@ export interface LogListParams extends V4PagePaginationArrayParams { meta_info?: boolean; /** - * Query param: + * @deprecated Query param: */ min_cost?: number; /** - * Query param: + * @deprecated Query param: */ min_duration?: number; /** - * Query param: + * @deprecated Query param: */ min_tokens_in?: number; /** - * Query param: + * @deprecated Query param: */ min_tokens_out?: number; /** - * Query param: + * @deprecated Query param: */ min_total_tokens?: number; /** - * Query param: + * @deprecated Query param: */ model?: string; /** - * Query param: + * @deprecated Query param: */ model_type?: string; @@ -316,17 +371,17 @@ export interface LogListParams extends V4PagePaginationArrayParams { order_by_direction?: 'asc' | 'desc'; /** - * Query param: + * @deprecated Query param: */ provider?: string; /** - * Query param: + * @deprecated Query param: */ request_content_type?: string; /** - * Query param: + * @deprecated Query param: */ response_content_type?: string; @@ -336,12 +391,12 @@ export interface LogListParams extends V4PagePaginationArrayParams { search?: string; /** - * Query param: + * @deprecated Query param: */ start_date?: string; /** - * Query param: + * @deprecated Query param: */ success?: boolean; } diff --git a/src/resources/ai-gateway/urls.ts b/src/resources/ai-gateway/urls.ts index 0d75440e5c..1d4313fa24 100644 --- a/src/resources/ai-gateway/urls.ts +++ b/src/resources/ai-gateway/urls.ts @@ -6,6 +6,15 @@ import * as Core from '../../core'; export class URLs extends APIResource { /** * Get Gateway URL + * + * @example + * ```ts + * const url = await client.aiGateway.urls.get( + * 'my-gateway', + * 'workers-ai', + * { account_id: '0d37909e38d3e99c29fa2cd343ac421a' }, + * ); + * ``` */ get( gatewayId: string, diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index 22abfb0a7d..e78906193f 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -64,7 +64,8 @@ export type AIRunResponse = | AIRunResponse.UnionMember7 | AIRunResponse.Translation | AIRunResponse.Summarization - | AIRunResponse.ImageToText; + | AIRunResponse.ImageToText + | AIRunResponse.ImageTextToText; export namespace AIRunResponse { export interface TextClassification { @@ -186,7 +187,7 @@ export namespace AIRunResponse { /** * The generated text response from the model */ - response?: string; + response: string; /** * An array of tool calls requests made during the response generation @@ -250,6 +251,10 @@ export namespace AIRunResponse { export interface ImageToText { description?: string; } + + export interface ImageTextToText { + description?: string; + } } export type AIRunParams = @@ -264,7 +269,9 @@ export type AIRunParams = | AIRunParams.Messages | AIRunParams.Translation | AIRunParams.Summarization - | AIRunParams.ImageToText; + | AIRunParams.ImageToText + | AIRunParams.Variant12 + | AIRunParams.Variant13; export declare namespace AIRunParams { export interface TextClassification { @@ -355,7 +362,7 @@ export declare namespace AIRunParams { account_id: string; /** - * Body param: A text description of the image you want to generate + * Body param: A text description of the audio you want to generate */ prompt: string; @@ -549,6 +556,12 @@ export declare namespace AIRunParams { */ presence_penalty?: number; + /** + * Body param: If true, a chat template is not applied and you must adhere to the + * specific model's expected formatting. + */ + raw?: boolean; + /** * Body param: Penalty for repeated tokens; higher values discourage repetition. */ @@ -565,7 +578,8 @@ export declare namespace AIRunParams { seed?: number; /** - * Body param: If true, the response will be streamed back incrementally. + * Body param: If true, the response will be streamed back incrementally using SSE, + * Server Sent Events. */ stream?: boolean; @@ -588,7 +602,7 @@ export declare namespace AIRunParams { top_k?: number; /** - * Body param: Controls the creativity of the AI's responses by adjusting how many + * Body param: Adjusts the creativity of the AI's responses by controlling how many * possible words it considers. Lower values make outputs more predictable; higher * values allow for more varied and creative responses. */ @@ -854,6 +868,158 @@ export declare namespace AIRunParams { */ top_p?: number; } + + export interface Variant12 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image: string; + + /** + * Body param: The input text prompt for the model to generate a response. + */ + prompt: string; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: Whether to ignore the EOS token and continue generating tokens after + * the EOS token is generated. + */ + ignore_eos?: boolean; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Controls the creativity of the AI's responses by adjusting how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export interface Variant13 { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image: string; + + /** + * Body param: An array of message objects representing the conversation history. + */ + messages: Array; + + /** + * Body param: Decreases the likelihood of the model repeating the same lines + * verbatim. + */ + frequency_penalty?: number; + + /** + * Body param: Whether to ignore the EOS token and continue generating tokens after + * the EOS token is generated. + */ + ignore_eos?: boolean; + + /** + * Body param: The maximum number of tokens to generate in the response. + */ + max_tokens?: number; + + /** + * Body param: Increases the likelihood of the model introducing new topics. + */ + presence_penalty?: number; + + /** + * Body param: Penalty for repeated tokens; higher values discourage repetition. + */ + repetition_penalty?: number; + + /** + * Body param: Random seed for reproducibility of the generation. + */ + seed?: number; + + /** + * Body param: Controls the randomness of the output; higher values produce more + * random results. + */ + temperature?: number; + + /** + * Body param: Limits the AI to choose from the top 'k' most probable words. Lower + * values make responses more focused; higher values introduce more variety and + * potential surprises. + */ + top_k?: number; + + /** + * Body param: Controls the creativity of the AI's responses by adjusting how many + * possible words it considers. Lower values make outputs more predictable; higher + * values allow for more varied and creative responses. + */ + top_p?: number; + } + + export namespace Variant13 { + export interface Message { + /** + * The content of the message as a string. + */ + content: string; + + /** + * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool'). + */ + role: string; + } + } } AI.Finetunes = Finetunes; @@ -865,6 +1031,8 @@ AI.Models = Models; AI.ModelListResponsesV4PagePaginationArray = ModelListResponsesV4PagePaginationArray; export declare namespace AI { + export { type AIRunResponse as AIRunResponse, type AIRunParams as AIRunParams }; + export { Finetunes as Finetunes, type FinetuneCreateResponse as FinetuneCreateResponse, diff --git a/src/resources/alerting/available-alerts.ts b/src/resources/alerting/available-alerts.ts index acd3a3261e..3a7fd80ac7 100644 --- a/src/resources/alerting/available-alerts.ts +++ b/src/resources/alerting/available-alerts.ts @@ -6,6 +6,14 @@ import * as Core from '../../core'; export class AvailableAlerts extends APIResource { /** * Gets a list of all alert types for which an account is eligible. + * + * @example + * ```ts + * const availableAlerts = + * await client.alerting.availableAlerts.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ list( params: AvailableAlertListParams, diff --git a/src/resources/alerting/destinations/eligible.ts b/src/resources/alerting/destinations/eligible.ts index 93e480679c..20103897e8 100644 --- a/src/resources/alerting/destinations/eligible.ts +++ b/src/resources/alerting/destinations/eligible.ts @@ -6,6 +6,14 @@ import * as Core from '../../../core'; export class Eligible extends APIResource { /** * Get a list of all delivery mechanism types for which an account is eligible. + * + * @example + * ```ts + * const eligible = + * await client.alerting.destinations.eligible.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: EligibleGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; diff --git a/src/resources/alerting/destinations/pagerduty.ts b/src/resources/alerting/destinations/pagerduty.ts index d229984140..4f8ff15c80 100644 --- a/src/resources/alerting/destinations/pagerduty.ts +++ b/src/resources/alerting/destinations/pagerduty.ts @@ -8,6 +8,14 @@ import { SinglePage } from '../../../pagination'; export class PagerdutyResource extends APIResource { /** * Creates a new token for integrating with PagerDuty. + * + * @example + * ```ts + * const pagerduty = + * await client.alerting.destinations.pagerduty.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ create( params: PagerdutyCreateParams, @@ -24,6 +32,14 @@ export class PagerdutyResource extends APIResource { /** * Deletes all the PagerDuty Services connected to the account. + * + * @example + * ```ts + * const pagerduty = + * await client.alerting.destinations.pagerduty.delete({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ delete( params: PagerdutyDeleteParams, @@ -35,6 +51,16 @@ export class PagerdutyResource extends APIResource { /** * Get a list of all configured PagerDuty services. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const pagerduty of client.alerting.destinations.pagerduty.get( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ get( params: PagerdutyGetParams, @@ -50,6 +76,15 @@ export class PagerdutyResource extends APIResource { /** * Links PagerDuty with the account using the integration token. + * + * @example + * ```ts + * const response = + * await client.alerting.destinations.pagerduty.link( + * '8c71e667571b4f61b94d9e4b12158038', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ link( tokenId: string, diff --git a/src/resources/alerting/destinations/webhooks.ts b/src/resources/alerting/destinations/webhooks.ts index eebca4e092..e81dc1e4f2 100644 --- a/src/resources/alerting/destinations/webhooks.ts +++ b/src/resources/alerting/destinations/webhooks.ts @@ -8,6 +8,16 @@ import { SinglePage } from '../../../pagination'; export class Webhooks extends APIResource { /** * Creates a new webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'Slack Webhook', + * url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + * }); + * ``` */ create(params: WebhookCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -21,6 +31,19 @@ export class Webhooks extends APIResource { /** * Update a webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.update( + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * name: 'Slack Webhook', + * url: 'https://hooks.slack.com/services/Ds3fdBFbV/456464Gdd', + * }, + * ); + * ``` */ update( webhookId: string, @@ -38,6 +61,16 @@ export class Webhooks extends APIResource { /** * Gets a list of all configured webhook destinations. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const webhooks of client.alerting.destinations.webhooks.list( + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: WebhookListParams, @@ -53,6 +86,15 @@ export class Webhooks extends APIResource { /** * Delete a configured webhook destination. + * + * @example + * ```ts + * const webhook = + * await client.alerting.destinations.webhooks.delete( + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( webhookId: string, @@ -68,6 +110,15 @@ export class Webhooks extends APIResource { /** * Get details for a single webhooks destination. + * + * @example + * ```ts + * const webhooks = + * await client.alerting.destinations.webhooks.get( + * 'b115d5ec-15c6-41ee-8b76-92c449b5227b', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get(webhookId: string, params: WebhookGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; diff --git a/src/resources/alerting/history.ts b/src/resources/alerting/history.ts index b6ae964dcc..4a124a9833 100644 --- a/src/resources/alerting/history.ts +++ b/src/resources/alerting/history.ts @@ -9,6 +9,16 @@ export class HistoryResource extends APIResource { * Gets a list of history records for notifications sent to an account. The records * are displayed for last `x` number of days based on the zone plan (free = 30, pro * = 30, biz = 30, ent = 90). + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const history of client.alerting.history.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` */ list( params: HistoryListParams, diff --git a/src/resources/alerting/policies.ts b/src/resources/alerting/policies.ts index f177815c6c..7502b15051 100644 --- a/src/resources/alerting/policies.ts +++ b/src/resources/alerting/policies.ts @@ -8,6 +8,17 @@ import { SinglePage } from '../../pagination'; export class Policies extends APIResource { /** * Creates a new Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * alert_type: 'universal_ssl_event_type', + * enabled: true, + * mechanisms: {}, + * name: 'SSL Notification Event Policy', + * }); + * ``` */ create(params: PolicyCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -21,6 +32,14 @@ export class Policies extends APIResource { /** * Update a Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.update( + * '0da2b59e-f118-439d-8097-bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ update( policyId: string, @@ -38,6 +57,16 @@ export class Policies extends APIResource { /** * Get a list of all Notification policies. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const policy of client.alerting.policies.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * })) { + * // ... + * } + * ``` */ list( params: PolicyListParams, @@ -53,6 +82,14 @@ export class Policies extends APIResource { /** * Delete a Notification policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.delete( + * '0da2b59e-f118-439d-8097-bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( policyId: string, @@ -65,6 +102,14 @@ export class Policies extends APIResource { /** * Get details for a single policy. + * + * @example + * ```ts + * const policy = await client.alerting.policies.get( + * '0da2b59e-f118-439d-8097-bdfb215203c9', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get(policyId: string, params: PolicyGetParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id } = params; @@ -134,9 +179,19 @@ export namespace MechanismParam { id?: string; } - export interface Pagerduty {} + export interface Pagerduty { + /** + * UUID + */ + id?: string; + } - export interface Webhook {} + export interface Webhook { + /** + * UUID + */ + id?: string; + } } export interface Policy { @@ -166,12 +221,14 @@ export interface Policy { | 'block_notification_block_removed' | 'block_notification_new_block' | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' | 'brand_protection_alert' | 'brand_protection_digest' | 'clickhouse_alert_fw_anomaly' | 'clickhouse_alert_fw_ent_anomaly' | 'cloudforce_one_request_notification' | 'custom_analytics' + | 'custom_bot_detection_alert' | 'custom_ssl_certificate_event_type' | 'dedicated_ssl_certificate_event_type' | 'device_connectivity_anomaly_alert' @@ -766,12 +823,14 @@ export interface PolicyCreateParams { | 'block_notification_block_removed' | 'block_notification_new_block' | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' | 'brand_protection_alert' | 'brand_protection_digest' | 'clickhouse_alert_fw_anomaly' | 'clickhouse_alert_fw_ent_anomaly' | 'cloudforce_one_request_notification' | 'custom_analytics' + | 'custom_bot_detection_alert' | 'custom_ssl_certificate_event_type' | 'dedicated_ssl_certificate_event_type' | 'device_connectivity_anomaly_alert' @@ -885,12 +944,14 @@ export interface PolicyUpdateParams { | 'block_notification_block_removed' | 'block_notification_new_block' | 'block_notification_review_rejected' + | 'bot_traffic_basic_alert' | 'brand_protection_alert' | 'brand_protection_digest' | 'clickhouse_alert_fw_anomaly' | 'clickhouse_alert_fw_ent_anomaly' | 'cloudforce_one_request_notification' | 'custom_analytics' + | 'custom_bot_detection_alert' | 'custom_ssl_certificate_event_type' | 'dedicated_ssl_certificate_event_type' | 'device_connectivity_anomaly_alert' diff --git a/src/resources/api-gateway/configurations.ts b/src/resources/api-gateway/configurations.ts index 5d7bffa1d2..5659e51452 100644 --- a/src/resources/api-gateway/configurations.ts +++ b/src/resources/api-gateway/configurations.ts @@ -7,6 +7,17 @@ import * as UserSchemasAPI from './user-schemas/user-schemas'; export class Configurations extends APIResource { /** * Set configuration properties + * + * @example + * ```ts + * const configuration = + * await client.apiGateway.configurations.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * auth_id_characteristics: [ + * { name: 'authorization', type: 'header' }, + * ], + * }); + * ``` */ update( params: ConfigurationUpdateParams, @@ -18,6 +29,14 @@ export class Configurations extends APIResource { /** * Retrieve information about specific configuration properties + * + * @example + * ```ts + * const configuration = + * await client.apiGateway.configurations.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: ConfigurationGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...query } = params; @@ -80,14 +99,14 @@ export interface ConfigurationUpdateResponse { messages: UserSchemasAPI.Message; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } export interface ConfigurationUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -140,7 +159,7 @@ export namespace ConfigurationUpdateParams { export interface ConfigurationGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/discovery/discovery.ts b/src/resources/api-gateway/discovery/discovery.ts index e0ec7b04b4..dc9185efdb 100644 --- a/src/resources/api-gateway/discovery/discovery.ts +++ b/src/resources/api-gateway/discovery/discovery.ts @@ -19,6 +19,13 @@ export class Discovery extends APIResource { /** * Retrieve the most up to date view of discovered operations, rendered as OpenAPI * schemas + * + * @example + * ```ts + * const discovery = await client.apiGateway.discovery.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get(params: DiscoveryGetParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id } = params; @@ -34,7 +41,7 @@ export class DiscoveryOperationsV4PagePaginationArray extends V4PagePaginationAr export interface DiscoveryOperation { /** - * UUID + * UUID. */ id: string; @@ -61,7 +68,7 @@ export interface DiscoveryOperation { /** * API discovery engine(s) that discovered this operation */ - origin: Array<'ML' | 'SessionIdentifier'>; + origin: Array<'ML' | 'SessionIdentifier' | 'LabelDiscovery'>; /** * State of operation in API Discovery @@ -105,7 +112,7 @@ export interface DiscoveryGetResponse { export interface DiscoveryGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/api-gateway/discovery/operations.ts b/src/resources/api-gateway/discovery/operations.ts index bc92f8b5fe..47b73c4178 100644 --- a/src/resources/api-gateway/discovery/operations.ts +++ b/src/resources/api-gateway/discovery/operations.ts @@ -9,6 +9,16 @@ import { type V4PagePaginationArrayParams } from '../../../pagination'; export class Operations extends APIResource { /** * Retrieve the most up to date view of discovered operations + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const discoveryOperation of client.apiGateway.discovery.operations.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: OperationListParams, @@ -24,6 +34,18 @@ export class Operations extends APIResource { /** * Update the `state` on one or more discovered operations + * + * @example + * ```ts + * const response = + * await client.apiGateway.discovery.operations.bulkEdit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: { + * '3818d821-5901-4147-a474-f5f5aec1d54e': {}, + * 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, + * }, + * }); + * ``` */ bulkEdit( params: OperationBulkEditParams, @@ -40,6 +62,15 @@ export class Operations extends APIResource { /** * Update the `state` on a discovered operation + * + * @example + * ```ts + * const response = + * await client.apiGateway.discovery.operations.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ edit( operationId: string, @@ -86,7 +117,7 @@ export interface OperationEditResponse { export interface OperationListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -129,7 +160,7 @@ export interface OperationListParams extends V4PagePaginationArrayParams { * - `SessionIdentifier` - Discovered operations that were sourced using Session * Identifier API Discovery */ - origin?: 'ML' | 'SessionIdentifier'; + origin?: 'ML' | 'SessionIdentifier' | 'LabelDiscovery'; /** * Query param: Filter results to only include discovery results in a particular @@ -146,7 +177,7 @@ export interface OperationListParams extends V4PagePaginationArrayParams { export interface OperationBulkEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -173,7 +204,7 @@ export namespace OperationBulkEditParams { export interface OperationEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/expression-template/fallthrough.ts b/src/resources/api-gateway/expression-template/fallthrough.ts index fde934fa74..9db217794a 100644 --- a/src/resources/api-gateway/expression-template/fallthrough.ts +++ b/src/resources/api-gateway/expression-template/fallthrough.ts @@ -6,6 +6,17 @@ import * as Core from '../../../core'; export class Fallthrough extends APIResource { /** * Generate fallthrough WAF expression template from a set of API hosts + * + * @example + * ```ts + * const fallthrough = + * await client.apiGateway.expressionTemplate.fallthrough.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * hosts: ['{zone}.domain1.tld', 'domain2.tld'], + * }, + * ); + * ``` */ create( params: FallthroughCreateParams, @@ -35,7 +46,7 @@ export interface FallthroughCreateResponse { export interface FallthroughCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/operations/operations.ts b/src/resources/api-gateway/operations/operations.ts index 88c6bb0ed3..44afc92131 100644 --- a/src/resources/api-gateway/operations/operations.ts +++ b/src/resources/api-gateway/operations/operations.ts @@ -26,6 +26,18 @@ export class Operations extends APIResource { * must be unique on the zone. Inserting an operation that matches an existing one * will return the record of the already existing operation and update its * last_updated date. + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.create( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * endpoint: '/api/v1/users/{var1}', + * host: 'www.example.com', + * method: 'GET', + * }, + * ); + * ``` */ create( params: OperationCreateParams, @@ -42,6 +54,16 @@ export class Operations extends APIResource { /** * Retrieve information about all operations on a zone + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const operationListResponse of client.apiGateway.operations.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: OperationListParams, @@ -57,6 +79,14 @@ export class Operations extends APIResource { /** * Delete an operation + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( operationId: string, @@ -73,6 +103,25 @@ export class Operations extends APIResource { * operation and must be unique on the zone. Inserting an operation that matches an * existing one will return the record of the already existing operation and update * its last_updated date. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const operationBulkCreateResponse of client.apiGateway.operations.bulkCreate( + * { + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * body: [ + * { + * endpoint: '/api/v1/users/{var1}', + * host: 'www.example.com', + * method: 'GET', + * }, + * ], + * }, + * )) { + * // ... + * } + * ``` */ bulkCreate( params: OperationBulkCreateParams, @@ -88,6 +137,14 @@ export class Operations extends APIResource { /** * Delete multiple operations + * + * @example + * ```ts + * const response = + * await client.apiGateway.operations.bulkDelete({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ bulkDelete( params: OperationBulkDeleteParams, @@ -99,6 +156,14 @@ export class Operations extends APIResource { /** * Retrieve information about an operation + * + * @example + * ```ts + * const operation = await client.apiGateway.operations.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( operationId: string, @@ -141,7 +206,7 @@ export interface APIShield { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; } @@ -168,7 +233,7 @@ export interface OperationCreateResponse { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; @@ -402,7 +467,7 @@ export namespace OperationCreateResponse { */ export interface ActiveSchema { /** - * UUID + * UUID. */ id?: string; @@ -444,7 +509,7 @@ export interface OperationListResponse { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; @@ -678,7 +743,7 @@ export namespace OperationListResponse { */ export interface ActiveSchema { /** - * UUID + * UUID. */ id?: string; @@ -704,7 +769,7 @@ export interface OperationDeleteResponse { messages: UserSchemasAPI.Message; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } @@ -731,7 +796,7 @@ export interface OperationBulkCreateResponse { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; @@ -965,7 +1030,7 @@ export namespace OperationBulkCreateResponse { */ export interface ActiveSchema { /** - * UUID + * UUID. */ id?: string; @@ -991,7 +1056,7 @@ export interface OperationBulkDeleteResponse { messages: UserSchemasAPI.Message; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } @@ -1018,7 +1083,7 @@ export interface OperationGetResponse { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; @@ -1252,7 +1317,7 @@ export namespace OperationGetResponse { */ export interface ActiveSchema { /** - * UUID + * UUID. */ id?: string; @@ -1274,7 +1339,7 @@ export namespace OperationGetResponse { export interface OperationCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -1300,7 +1365,7 @@ export interface OperationCreateParams { export interface OperationListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -1340,14 +1405,14 @@ export interface OperationListParams extends V4PagePaginationArrayParams { export interface OperationDeleteParams { /** - * Identifier + * Identifier. */ zone_id: string; } export interface OperationBulkCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -1381,14 +1446,14 @@ export namespace OperationBulkCreateParams { export interface OperationBulkDeleteParams { /** - * Identifier + * Identifier. */ zone_id: string; } export interface OperationGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/operations/schema-validation.ts b/src/resources/api-gateway/operations/schema-validation.ts index 294137164f..8c7a2c0614 100644 --- a/src/resources/api-gateway/operations/schema-validation.ts +++ b/src/resources/api-gateway/operations/schema-validation.ts @@ -6,6 +6,15 @@ import * as Core from '../../../core'; export class SchemaValidation extends APIResource { /** * Updates operation-level schema validation settings on the zone + * + * @example + * ```ts + * const schemaValidation = + * await client.apiGateway.operations.schemaValidation.update( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ update( operationId: string, @@ -21,6 +30,18 @@ export class SchemaValidation extends APIResource { /** * Updates multiple operation-level schema validation settings on the zone + * + * @example + * ```ts + * const settingsMultipleRequest = + * await client.apiGateway.operations.schemaValidation.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * settings_multiple_request: { + * '3818d821-5901-4147-a474-f5f5aec1d54e': {}, + * 'b17c8043-99a0-4202-b7d9-8f7cdbee02cd': {}, + * }, + * }); + * ``` */ edit( params: SchemaValidationEditParams, @@ -37,6 +58,15 @@ export class SchemaValidation extends APIResource { /** * Retrieves operation-level schema validation settings on the zone + * + * @example + * ```ts + * const schemaValidation = + * await client.apiGateway.operations.schemaValidation.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( operationId: string, @@ -105,6 +135,11 @@ export interface SchemaValidationUpdateResponse { * Level Schema Validation Settings for mitigation action that will be applied */ mitigation_action?: 'log' | 'block' | 'none' | null; + + /** + * UUID. + */ + operation_id?: string; } export interface SchemaValidationGetResponse { @@ -119,11 +154,16 @@ export interface SchemaValidationGetResponse { * Level Schema Validation Settings for mitigation action that will be applied */ mitigation_action?: 'log' | 'block' | 'none' | null; + + /** + * UUID. + */ + operation_id?: string; } export interface SchemaValidationUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -142,7 +182,7 @@ export interface SchemaValidationUpdateParams { export interface SchemaValidationEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -154,7 +194,7 @@ export interface SchemaValidationEditParams { export interface SchemaValidationGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/api-gateway/schemas.ts b/src/resources/api-gateway/schemas.ts index 78078da8d1..9e56057d7b 100644 --- a/src/resources/api-gateway/schemas.ts +++ b/src/resources/api-gateway/schemas.ts @@ -6,6 +6,13 @@ import * as Core from '../../core'; export class Schemas extends APIResource { /** * Retrieve operations and features as OpenAPI schemas + * + * @example + * ```ts + * const schemas = await client.apiGateway.schemas.list({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ list(params: SchemaListParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...query } = params; @@ -25,7 +32,7 @@ export interface SchemaListResponse { export interface SchemaListParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/settings/schema-validation.ts b/src/resources/api-gateway/settings/schema-validation.ts index ede2c08181..a6585f8e1f 100644 --- a/src/resources/api-gateway/settings/schema-validation.ts +++ b/src/resources/api-gateway/settings/schema-validation.ts @@ -7,6 +7,15 @@ import * as SettingsAPI from './settings'; export class SchemaValidation extends APIResource { /** * Updates zone level schema validation settings on the zone + * + * @example + * ```ts + * const settings = + * await client.apiGateway.settings.schemaValidation.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * validation_default_mitigation_action: 'block', + * }); + * ``` */ update( params: SchemaValidationUpdateParams, @@ -18,6 +27,14 @@ export class SchemaValidation extends APIResource { /** * Updates zone level schema validation settings on the zone + * + * @example + * ```ts + * const settings = + * await client.apiGateway.settings.schemaValidation.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ edit( params: SchemaValidationEditParams, @@ -32,6 +49,14 @@ export class SchemaValidation extends APIResource { /** * Retrieves zone level schema validation settings currently set on the zone + * + * @example + * ```ts + * const settings = + * await client.apiGateway.settings.schemaValidation.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: SchemaValidationGetParams, @@ -44,7 +69,7 @@ export class SchemaValidation extends APIResource { export interface SchemaValidationUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -76,7 +101,7 @@ export interface SchemaValidationUpdateParams { export interface SchemaValidationEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -109,7 +134,7 @@ export interface SchemaValidationEditParams { export interface SchemaValidationGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/src/resources/api-gateway/user-schemas/hosts.ts b/src/resources/api-gateway/user-schemas/hosts.ts index 01d02af1ef..659a0e41e2 100644 --- a/src/resources/api-gateway/user-schemas/hosts.ts +++ b/src/resources/api-gateway/user-schemas/hosts.ts @@ -7,6 +7,16 @@ import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../. export class Hosts extends APIResource { /** * Retrieve schema hosts in a zone + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const hostListResponse of client.apiGateway.userSchemas.hosts.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: HostListParams, @@ -37,14 +47,14 @@ export interface HostListResponse { name: string; /** - * UUID + * UUID. */ schema_id: string; } export interface HostListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; } diff --git a/src/resources/api-gateway/user-schemas/operations.ts b/src/resources/api-gateway/user-schemas/operations.ts index 7f6ddd5f8e..fc74b36696 100644 --- a/src/resources/api-gateway/user-schemas/operations.ts +++ b/src/resources/api-gateway/user-schemas/operations.ts @@ -8,6 +8,17 @@ export class Operations extends APIResource { /** * Retrieves all operations from the schema. Operations that already exist in API * Shield Endpoint Management will be returned as full operations. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const operationListResponse of client.apiGateway.userSchemas.operations.list( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( schemaId: string, @@ -52,7 +63,7 @@ export namespace OperationListResponse { method: 'GET' | 'POST' | 'HEAD' | 'OPTIONS' | 'PUT' | 'DELETE' | 'CONNECT' | 'PATCH' | 'TRACE'; /** - * UUID + * UUID. */ operation_id: string; @@ -286,7 +297,7 @@ export namespace OperationListResponse { */ export interface ActiveSchema { /** - * UUID + * UUID. */ id?: string; @@ -329,7 +340,7 @@ export namespace OperationListResponse { export interface OperationListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/api-gateway/user-schemas/user-schemas.ts b/src/resources/api-gateway/user-schemas/user-schemas.ts index efec1bd24d..575b0a5a45 100644 --- a/src/resources/api-gateway/user-schemas/user-schemas.ts +++ b/src/resources/api-gateway/user-schemas/user-schemas.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as Shared from '../../shared'; import * as HostsAPI from './hosts'; import { HostListParams, HostListResponse, HostListResponsesV4PagePaginationArray, Hosts } from './hosts'; import * as OperationsAPI from './operations'; @@ -20,6 +19,16 @@ export class UserSchemas extends APIResource { /** * Upload a schema to a zone + * + * @example + * ```ts + * const schemaUpload = + * await client.apiGateway.userSchemas.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * file: fs.createReadStream('path/to/file'), + * kind: 'openapi_v3', + * }); + * ``` */ create(params: UserSchemaCreateParams, options?: Core.RequestOptions): Core.APIPromise { const { zone_id, ...body } = params; @@ -33,6 +42,16 @@ export class UserSchemas extends APIResource { /** * Retrieve information about all schemas on a zone + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const publicSchema of client.apiGateway.userSchemas.list( + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` */ list( params: UserSchemaListParams, @@ -48,6 +67,15 @@ export class UserSchemas extends APIResource { /** * Delete a schema + * + * @example + * ```ts + * const userSchema = + * await client.apiGateway.userSchemas.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ delete( schemaId: string, @@ -60,6 +88,15 @@ export class UserSchemas extends APIResource { /** * Enable validation for a schema + * + * @example + * ```ts + * const publicSchema = + * await client.apiGateway.userSchemas.edit( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ edit( schemaId: string, @@ -77,6 +114,15 @@ export class UserSchemas extends APIResource { /** * Retrieve information about a specific schema on a zone + * + * @example + * ```ts + * const publicSchema = + * await client.apiGateway.userSchemas.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` */ get( schemaId: string, @@ -95,7 +141,25 @@ export class UserSchemas extends APIResource { export class PublicSchemasV4PagePaginationArray extends V4PagePaginationArray {} -export type Message = Array; +export type Message = Array; + +export namespace Message { + export interface MessageItem { + code: number; + + message: string; + + documentation_url?: string; + + source?: MessageItem.Source; + } + + export namespace MessageItem { + export interface Source { + pointer?: string; + } + } +} export interface PublicSchema { created_at: string; @@ -111,7 +175,7 @@ export interface PublicSchema { name: string; /** - * UUID + * UUID. */ schema_id: string; @@ -169,14 +233,14 @@ export interface UserSchemaDeleteResponse { messages: Message; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; } export interface UserSchemaCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -203,7 +267,7 @@ export interface UserSchemaCreateParams { export interface UserSchemaListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -220,14 +284,14 @@ export interface UserSchemaListParams extends V4PagePaginationArrayParams { export interface UserSchemaDeleteParams { /** - * Identifier + * Identifier. */ zone_id: string; } export interface UserSchemaEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -239,7 +303,7 @@ export interface UserSchemaEditParams { export interface UserSchemaGetParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; diff --git a/src/resources/argo/smart-routing.ts b/src/resources/argo/smart-routing.ts index 9ff360910b..fa9e2068e2 100644 --- a/src/resources/argo/smart-routing.ts +++ b/src/resources/argo/smart-routing.ts @@ -6,6 +6,14 @@ import * as Core from '../../core'; export class SmartRouting extends APIResource { /** * Updates enablement of Argo Smart Routing. + * + * @example + * ```ts + * const response = await client.argo.smartRouting.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'on', + * }); + * ``` */ edit( params: SmartRoutingEditParams, @@ -21,6 +29,13 @@ export class SmartRouting extends APIResource { /** * Get Argo Smart Routing setting + * + * @example + * ```ts + * const smartRouting = await client.argo.smartRouting.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: SmartRoutingGetParams, diff --git a/src/resources/argo/tiered-caching.ts b/src/resources/argo/tiered-caching.ts index 180a5ab663..1238b7b0f9 100644 --- a/src/resources/argo/tiered-caching.ts +++ b/src/resources/argo/tiered-caching.ts @@ -16,6 +16,14 @@ export class TieredCaching extends APIResource { * so they come from a small number of data centers rather than the full set of * network locations. This results in fewer open connections using server * resources. + * + * @example + * ```ts + * const response = await client.argo.tieredCaching.edit({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * value: 'on', + * }); + * ``` */ edit( params: TieredCachingEditParams, @@ -41,6 +49,13 @@ export class TieredCaching extends APIResource { * so they come from a small number of data centers rather than the full set of * network locations. This results in fewer open connections using server * resources. + * + * @example + * ```ts + * const tieredCaching = await client.argo.tieredCaching.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: TieredCachingGetParams, diff --git a/src/resources/audit-logs.ts b/src/resources/audit-logs.ts index 51701db2d8..bb07e279be 100644 --- a/src/resources/audit-logs.ts +++ b/src/resources/audit-logs.ts @@ -106,4 +106,8 @@ export namespace AuditLogListParams { } } +export declare namespace AuditLogs { + export { type AuditLogListParams as AuditLogListParams }; +} + export { AuditLogsV4PagePaginationArray }; diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index 7a6976dd47..bc9b69b9c0 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -66,6 +66,17 @@ export class BotManagement extends APIResource { * "fight_mode": false * } * ``` + * + * @example + * ```ts + * const botManagement = await client.botManagement.update({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * ai_bots_protection: 'disabled', + * crawler_protection: 'disabled', + * enable_js: true, + * fight_mode: true, + * }); + * ``` */ update( params: BotManagementUpdateParams, @@ -81,6 +92,13 @@ export class BotManagement extends APIResource { /** * Retrieve a zone's Bot Management Config + * + * @example + * ```ts + * const botManagement = await client.botManagement.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ get( params: BotManagementGetParams, @@ -101,6 +119,11 @@ export interface BotFightModeConfiguration { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -171,6 +194,11 @@ export interface BotFightModeConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -196,6 +224,11 @@ export interface SubscriptionConfiguration { */ auto_update_model?: boolean; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -274,6 +307,11 @@ export interface SubscriptionConfigurationParam { */ auto_update_model?: boolean; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -293,6 +331,11 @@ export interface SuperBotFightModeDefinitelyConfiguration { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -359,6 +402,11 @@ export interface SuperBotFightModeDefinitelyConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -394,6 +442,11 @@ export interface SuperBotFightModeLikelyConfiguration { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -459,6 +512,11 @@ export interface SuperBotFightModeLikelyConfigurationParam { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Use lightweight, invisible JavaScript detections to improve Bot Management. * [Learn more about JavaScript Detections](https://developers.cloudflare.com/bots/reference/javascript-detections/). @@ -514,7 +572,7 @@ export type BotManagementUpdateParams = export declare namespace BotManagementUpdateParams { export interface BotFightModeConfiguration { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -523,6 +581,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Body param: Use lightweight, invisible JavaScript detections to improve Bot * Management. @@ -538,7 +601,7 @@ export declare namespace BotManagementUpdateParams { export interface SuperBotFightModeDefinitelyConfiguration { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -547,6 +610,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Body param: Use lightweight, invisible JavaScript detections to improve Bot * Management. @@ -581,7 +649,7 @@ export declare namespace BotManagementUpdateParams { export interface SuperBotFightModeLikelyConfiguration { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -590,6 +658,11 @@ export declare namespace BotManagementUpdateParams { */ ai_bots_protection?: 'block' | 'disabled'; + /** + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Body param: Use lightweight, invisible JavaScript detections to improve Bot * Management. @@ -630,7 +703,7 @@ export declare namespace BotManagementUpdateParams { export interface SubscriptionConfiguration { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -646,6 +719,11 @@ export declare namespace BotManagementUpdateParams { */ auto_update_model?: boolean; + /** + * Body param: Enable rule to punish AI Scrapers and Crawlers via a link maze. + */ + crawler_protection?: 'enabled' | 'disabled'; + /** * Body param: Use lightweight, invisible JavaScript detections to improve Bot * Management. @@ -663,7 +741,20 @@ export declare namespace BotManagementUpdateParams { export interface BotManagementGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } + +export declare namespace BotManagement { + export { + type BotFightModeConfiguration as BotFightModeConfiguration, + type SubscriptionConfiguration as SubscriptionConfiguration, + type SuperBotFightModeDefinitelyConfiguration as SuperBotFightModeDefinitelyConfiguration, + type SuperBotFightModeLikelyConfiguration as SuperBotFightModeLikelyConfiguration, + type BotManagementUpdateResponse as BotManagementUpdateResponse, + type BotManagementGetResponse as BotManagementGetResponse, + type BotManagementUpdateParams as BotManagementUpdateParams, + type BotManagementGetParams as BotManagementGetParams, + }; +} diff --git a/src/resources/botnet-feed/asn.ts b/src/resources/botnet-feed/asn.ts index a34bca3c98..d15791e65e 100755 --- a/src/resources/botnet-feed/asn.ts +++ b/src/resources/botnet-feed/asn.ts @@ -60,7 +60,7 @@ export interface ASNFullReportResponse { export interface ASNDayReportParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -72,7 +72,7 @@ export interface ASNDayReportParams { export interface ASNFullReportParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/botnet-feed/configs/asn.ts b/src/resources/botnet-feed/configs/asn.ts index 9b1d42013d..6808129973 100755 --- a/src/resources/botnet-feed/configs/asn.ts +++ b/src/resources/botnet-feed/configs/asn.ts @@ -44,14 +44,14 @@ export interface ASNGetResponse { export interface ASNDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ASNGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/brand-protection.ts b/src/resources/brand-protection.ts index c636eabe86..b161cfe451 100644 --- a/src/resources/brand-protection.ts +++ b/src/resources/brand-protection.ts @@ -5,7 +5,14 @@ import * as Core from '../core'; export class BrandProtection extends APIResource { /** - * Submit suspicious URL for scanning + * Submit suspicious URL for scanning. + * + * @example + * ```ts + * const submit = await client.brandProtection.submit({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ submit(params: BrandProtectionSubmitParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...body } = params; @@ -19,6 +26,13 @@ export class BrandProtection extends APIResource { /** * Gets phishing details about a URL. + * + * @example + * ```ts + * const info = await client.brandProtection.urlInfo({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` */ urlInfo(params: BrandProtectionURLInfoParams, options?: Core.RequestOptions): Core.APIPromise { const { account_id, ...query } = params; @@ -138,7 +152,7 @@ export interface Submit { excluded_urls?: Array; /** - * URLs that were skipped because the same URL is currently being scanned + * URLs that were skipped because the same URL is currently being scanned. */ skipped_urls?: Array; @@ -188,26 +202,26 @@ export interface URLInfoModelResults { model_name?: string; /** - * Score output by the model for this submission. + * This is the score that is outputted by the model for this submission. */ model_score?: number; } export interface BrandProtectionSubmitParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Body param: URL(s) to filter submissions results by + * Body param: URL(s) to filter submissions results by. */ url?: string; } export interface BrandProtectionURLInfoParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -221,3 +235,15 @@ export interface BrandProtectionURLInfoParams { */ url_id?: Array; } + +export declare namespace BrandProtection { + export { + type Info as Info, + type RuleMatch as RuleMatch, + type ScanStatus as ScanStatus, + type Submit as Submit, + type URLInfoModelResults as URLInfoModelResults, + type BrandProtectionSubmitParams as BrandProtectionSubmitParams, + type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams, + }; +} diff --git a/src/resources/browser-rendering/browser-rendering.ts b/src/resources/browser-rendering/browser-rendering.ts index fceb64045a..4bc9dab9bd 100644 --- a/src/resources/browser-rendering/browser-rendering.ts +++ b/src/resources/browser-rendering/browser-rendering.ts @@ -3,6 +3,12 @@ import { APIResource } from '../../resource'; import * as ContentAPI from './content'; import { Content, ContentCreateParams, ContentCreateResponse } from './content'; +import * as JsonAPI from './json'; +import { Json, JsonCreateParams, JsonCreateResponse } from './json'; +import * as LinksAPI from './links'; +import { LinkCreateParams, LinkCreateResponse, Links } from './links'; +import * as MarkdownAPI from './markdown'; +import { Markdown, MarkdownCreateParams, MarkdownCreateResponse } from './markdown'; import * as PDFAPI from './pdf'; import { PDF, PDFCreateParams } from './pdf'; import * as ScrapeAPI from './scrape'; @@ -18,6 +24,9 @@ export class BrowserRendering extends APIResource { scrape: ScrapeAPI.Scrape = new ScrapeAPI.Scrape(this._client); screenshot: ScreenshotAPI.Screenshot = new ScreenshotAPI.Screenshot(this._client); snapshot: SnapshotAPI.Snapshot = new SnapshotAPI.Snapshot(this._client); + json: JsonAPI.Json = new JsonAPI.Json(this._client); + links: LinksAPI.Links = new LinksAPI.Links(this._client); + markdown: MarkdownAPI.Markdown = new MarkdownAPI.Markdown(this._client); } BrowserRendering.Content = Content; @@ -25,6 +34,9 @@ BrowserRendering.PDF = PDF; BrowserRendering.Scrape = Scrape; BrowserRendering.Screenshot = Screenshot; BrowserRendering.Snapshot = Snapshot; +BrowserRendering.Json = Json; +BrowserRendering.Links = Links; +BrowserRendering.Markdown = Markdown; export declare namespace BrowserRendering { export { @@ -52,4 +64,22 @@ export declare namespace BrowserRendering { type SnapshotCreateResponse as SnapshotCreateResponse, type SnapshotCreateParams as SnapshotCreateParams, }; + + export { + Json as Json, + type JsonCreateResponse as JsonCreateResponse, + type JsonCreateParams as JsonCreateParams, + }; + + export { + Links as Links, + type LinkCreateResponse as LinkCreateResponse, + type LinkCreateParams as LinkCreateParams, + }; + + export { + Markdown as Markdown, + type MarkdownCreateResponse as MarkdownCreateResponse, + type MarkdownCreateParams as MarkdownCreateParams, + }; } diff --git a/src/resources/browser-rendering/content.ts b/src/resources/browser-rendering/content.ts index 39cfb7333c..1da7dd63be 100644 --- a/src/resources/browser-rendering/content.ts +++ b/src/resources/browser-rendering/content.ts @@ -36,6 +36,14 @@ export interface ContentCreateParams { */ cacheTTL?: number; + /** + * Body param: The maximum duration allowed for the browser action to complete + * after the page has loaded (such as taking screenshots, extracting content, or + * generating PDFs). If this time limit is exceeded, the action stops and returns a + * timeout error. + */ + actionTimeout?: number; + /** * Body param: Adds a `