From d07e22f7c1bab6a9eed16343cdec97d61e39ed7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 20:31:52 +0000 Subject: [PATCH 001/423] feat(api): api update --- .stats.yml | 6 +- api.md | 44 +- scripts/detect-breaking-changes | 4 + src/resources/abuse-reports.ts | 1423 ++++----------- src/resources/accounts/tokens/tokens.ts | 4 +- src/resources/argo/smart-routing.ts | 12 +- .../brand-protection/brand-protection.ts | 239 +-- src/resources/brand-protection/index.ts | 20 +- .../brand-protection/logo-matches.ts | 90 +- src/resources/brand-protection/logos.ts | 74 +- src/resources/brand-protection/matches.ts | 100 +- src/resources/brand-protection/queries.ts | 101 +- src/resources/cache/cache.ts | 5 +- src/resources/dns/records.ts | 220 +-- .../email-security/investigate/investigate.ts | 83 +- .../email-security/investigate/trace.ts | 4 + .../email-security/settings/allow-policies.ts | 5 + .../email-security/settings/block-senders.ts | 5 + .../settings/trusted-domains.ts | 5 + .../magic-transit/connectors/events/events.ts | 5 + src/resources/radar/ai/bots/summary.ts | 2 +- src/resources/radar/ai/inference/summary.ts | 4 +- src/resources/radar/as112/summary.ts | 12 +- src/resources/radar/attacks/layer3/summary.ts | 14 +- src/resources/radar/attacks/layer7/summary.ts | 14 +- src/resources/radar/attacks/layer7/top/top.ts | 6 - src/resources/radar/bots/bots.ts | 2 +- src/resources/radar/bots/web-crawlers.ts | 2 +- src/resources/radar/dns/summary.ts | 20 +- src/resources/radar/email/routing/summary.ts | 12 +- src/resources/radar/email/security/summary.ts | 18 +- src/resources/radar/http/summary.ts | 16 +- .../radar/leaked-credentials/summary.ts | 4 +- src/resources/radar/netflows/netflows.ts | 2 +- src/resources/radar/quality/iqi.ts | 2 +- src/resources/radar/quality/speed/speed.ts | 4 +- src/resources/radar/search.ts | 13 +- src/resources/radar/tcp-resets-timeouts.ts | 2 +- src/resources/rules/lists/bulk-operations.ts | 2 +- src/resources/rules/lists/items.ts | 10 +- src/resources/rules/lists/lists.ts | 28 +- src/resources/shared.ts | 38 +- src/resources/ssl/recommendations.ts | 31 +- src/resources/stream/clip.ts | 2 +- src/resources/stream/stream.ts | 4 +- src/resources/user/tokens/tokens.ts | 4 +- .../dispatch/namespaces/scripts/content.ts | 12 +- .../dispatch/namespaces/scripts/scripts.ts | 14 +- .../dispatch/namespaces/scripts/settings.ts | 46 - src/resources/workers/scripts/content.ts | 32 +- src/resources/workers/scripts/deployments.ts | 69 +- src/resources/workers/scripts/index.ts | 1 - .../scripts/script-and-version-settings.ts | 50 - src/resources/workers/scripts/scripts.ts | 16 +- src/resources/workers/scripts/versions.ts | 1610 ++++++++--------- .../access/applications/applications.ts | 12 +- .../access/applications/policies.ts | 40 +- .../zero-trust/dlp/entries/integration.ts | 3 +- .../zero-trust/dlp/entries/predefined.ts | 3 +- .../zero-trust/dlp/profiles/custom.ts | 20 +- .../zero-trust/dlp/profiles/predefined.ts | 12 +- .../zero-trust/dlp/profiles/profiles.ts | 24 +- src/resources/zero-trust/gateway/rules.ts | 15 + tests/api-resources/abuse-reports.test.ts | 41 +- .../accounts/tokens/tokens.test.ts | 22 +- .../brand-protection/brand-protection.test.ts | 17 +- .../brand-protection/logo-matches.test.ts | 52 + .../brand-protection/logos.test.ts | 48 + .../brand-protection/matches.test.ts | 54 + .../brand-protection/queries.test.ts | 57 + tests/api-resources/cache/cache.test.ts | 4 +- .../investigate/investigate.test.ts | 1 + .../settings/allow-policies.test.ts | 1 + .../settings/block-senders.test.ts | 1 + .../settings/trusted-domains.test.ts | 1 + .../connectors/events/events.test.ts | 1 + .../radar/attacks/layer7/top/top.test.ts | 1 - tests/api-resources/rules/lists/items.test.ts | 4 +- .../api-resources/user/tokens/tokens.test.ts | 22 +- .../namespaces/scripts/content.test.ts | 3 +- .../namespaces/scripts/scripts.test.ts | 3 +- .../workers/scripts/content.test.ts | 3 +- .../workers/scripts/deployments.test.ts | 4 +- .../workers/scripts/scripts.test.ts | 3 +- .../workers/scripts/versions.test.ts | 3 +- .../dlp/profiles/predefined.test.ts | 4 +- 86 files changed, 2558 insertions(+), 2488 deletions(-) create mode 100644 tests/api-resources/brand-protection/logo-matches.test.ts create mode 100644 tests/api-resources/brand-protection/logos.test.ts create mode 100644 tests/api-resources/brand-protection/matches.test.ts create mode 100644 tests/api-resources/brand-protection/queries.test.ts diff --git a/.stats.yml b/.stats.yml index 8839c77cc5..be9d04e575 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1769 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e53659eea1b4f1fb11addaddb82880c177d8fa3e7a93f0d664a65e43ac526f4.yml -openapi_spec_hash: 3e0f59ac2722028954566a4c850e8849 +configured_endpoints: 1777 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9629020f23f4c564925a52c46cdf5a93581a3f6bf35bf8050b0792467f642d33.yml +openapi_spec_hash: 58db5ad168eaa03ed1c9a028636c58f6 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/api.md b/api.md index c9384414c2..c03b9bbb25 100644 --- a/api.md +++ b/api.md @@ -2118,7 +2118,6 @@ Methods: Types: -- Deployment - DeploymentCreateResponse - DeploymentGetResponse @@ -2952,24 +2951,57 @@ Methods: Types: - Info -- RuleMatch -- ScanStatus - Submit -- URLInfoModelResults +- BrandProtectionSubmitResponse +- BrandProtectionURLInfoResponse Methods: -- client.brandProtection.submit({ ...params }) -> Submit -- client.brandProtection.urlInfo({ ...params }) -> Info +- client.brandProtection.submit({ ...params }) -> BrandProtectionSubmitResponse +- client.brandProtection.urlInfo({ ...params }) -> BrandProtectionURLInfoResponse ## Queries +Methods: + +- client.brandProtection.queries.create({ ...params }) -> void +- client.brandProtection.queries.delete({ ...params }) -> void + ## Matches +Types: + +- MatchDownloadResponse +- MatchGetResponse + +Methods: + +- client.brandProtection.matches.download({ ...params }) -> MatchDownloadResponse +- client.brandProtection.matches.get({ ...params }) -> MatchGetResponse + ## Logos +Types: + +- LogoCreateResponse + +Methods: + +- client.brandProtection.logos.create({ ...params }) -> LogoCreateResponse +- client.brandProtection.logos.delete(logoId, { ...params }) -> void + ## LogoMatches +Types: + +- LogoMatchDownloadResponse +- LogoMatchGetResponse + +Methods: + +- client.brandProtection.logoMatches.download({ ...params }) -> LogoMatchDownloadResponse +- client.brandProtection.logoMatches.get({ ...params }) -> LogoMatchGetResponse + # Diagnostics ## Traceroutes diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 051507977d..7ff2f52dfb 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -253,6 +253,10 @@ TEST_PATHS=( tests/api-resources/billing/billing.test.ts tests/api-resources/billing/profiles.test.ts tests/api-resources/brand-protection/brand-protection.test.ts + tests/api-resources/brand-protection/queries.test.ts + tests/api-resources/brand-protection/matches.test.ts + tests/api-resources/brand-protection/logos.test.ts + tests/api-resources/brand-protection/logo-matches.test.ts tests/api-resources/diagnostics/diagnostics.test.ts tests/api-resources/diagnostics/traceroutes.test.ts tests/api-resources/images/images.test.ts diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 9f4c7eb9bf..0ce1da5514 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -6,21 +6,6 @@ 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: @@ -55,7 +40,7 @@ export type AbuseReportCreateParams = | AbuseReportCreateParams.AbuseReportsTrademarkReport | AbuseReportCreateParams.AbuseReportsGeneralReport | AbuseReportCreateParams.AbuseReportsPhishingReport - | AbuseReportCreateParams.AbuseReportsChildrenAbuseReport + | AbuseReportCreateParams.AbuseReportsCsamReport | AbuseReportCreateParams.AbuseReportsThreatReport | AbuseReportCreateParams.AbuseReportsRegistrarWhoisReport | AbuseReportCreateParams.AbuseReportsNcseiReport; @@ -68,7 +53,7 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: The abuse report type + * Body param: */ act: | 'abuse_dmca' @@ -80,132 +65,112 @@ 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 * (https://lumendatabase.org/). */ - address1?: string; + address1: string; /** * Body param: The name of the copyright holder. Text not exceeding 60 characters. * This field may be released by Cloudflare to third parties such as the Lumen * Database (https://lumendatabase.org/). */ - agent_name?: string; + agent_name: string; /** * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA * reports */ - agree?: 0 | 1; + agree: 1; /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - city?: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; + city: string; /** - * Body param: Text not exceeding 100 characters. This field may be released by + * 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/). */ - company?: string; + country: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * 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/). */ - country?: string; + email: 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 - * addresses ought to be unique + * Body param: Should match the value provided in `email` */ - destination_ips?: string; + email2: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. */ - host_notification?: 'send' | 'send-anon' | 'none'; + host_notification: 'send'; /** - * Body param: A detailed description of the infringement, including any necessary - * access details and the exact steps needed to view the content, not exceeding - * 5000 characters + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + name: string; + + /** + * Body param: Text not exceeding 255 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - justification?: string; + original_work: 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'; + owner_notification: 'send'; /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. + * 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 */ - ncsei_subject_representation?: boolean; + signature: string; /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - original_work?: string; + state: 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 ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - owner_notification?: 'send' | 'send-anon' | 'none'; + urls: string; /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters */ - ports_protocols?: string; + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). + */ + company?: string; /** * Body param: Text containing 2 characters @@ -217,27 +182,6 @@ export declare namespace AbuseReportCreateParams { */ 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 - * addresses ought to be unique - */ - 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 @@ -249,21 +193,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 255 characters */ title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; } export interface AbuseReportsTrademarkReport { @@ -273,11 +202,11 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: The abuse report type + * Body param: */ act: - | 'abuse_dmca' | 'abuse_trademark' + | 'abuse_dmca' | 'abuse_general' | 'abuse_phishing' | 'abuse_children' @@ -297,6 +226,19 @@ export declare namespace AbuseReportCreateParams { */ email2: string; + /** + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. + */ + host_notification: 'send'; + + /** + * Body param: A detailed description of the infringement, including any necessary + * access details and the exact steps needed to view the content, not exceeding + * 5000 characters. + */ + justification: string; + /** * Body param: Text not exceeding 255 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database @@ -305,39 +247,33 @@ export declare namespace AbuseReportCreateParams { 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/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - urls: string; + owner_notification: 'send'; /** - * 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/). + * Body param: Text not exceeding 1000 characters */ - address1?: string; + trademark_number: 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: Text not exceeding 1000 characters */ - agent_name?: string; + trademark_office: string; /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports + * Body param: Text not exceeding 1000 characters */ - agree?: 0 | 1; + trademark_symbol: 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: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - city?: string; + urls: string; /** * Body param: Any additional comments about the infringement not exceeding 2000 @@ -353,56 +289,112 @@ export declare namespace AbuseReportCreateParams { company?: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - country?: string; + tele?: 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 - * addresses ought to be unique + * Body param: Text not exceeding 255 characters */ - destination_ips?: string; + title?: string; + } + + export interface AbuseReportsGeneralReport { + /** + * Path param: The account ID of the submitter. + */ + account_id: string; + + /** + * Body param: + */ + act: + | 'abuse_general' + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_phishing' + | 'abuse_children' + | 'abuse_threat' + | '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: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. */ - host_notification?: 'send' | 'send-anon' | 'none'; + host_notification: 'send' | 'send-anon'; /** * Body param: A detailed description of the infringement, including any necessary * access details and the exact steps needed to view the content, not exceeding - * 5000 characters + * 5000 characters. */ - justification?: 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/). + */ + 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'; + owner_notification: 'send' | 'send-anon' | 'none'; /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - ncsei_subject_representation?: boolean; + urls: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - original_work?: string; + company?: string; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The + * list of destination IPs should not exceed 30 IP addresses. Each one of the IP + * addresses ought to be unique. */ - owner_notification?: 'send' | 'send-anon' | 'none'; + destination_ips?: string; /** * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. @@ -423,26 +415,12 @@ export declare namespace AbuseReportCreateParams { 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 + * Body param: A list of IP addresses separated by ‘\n’ (new line character). The * list of source IPs should not exceed 30 IP addresses. Each one of the IP - * addresses ought to be unique + * addresses ought to be unique. */ 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 @@ -454,37 +432,22 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 255 characters */ title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; } - export interface AbuseReportsGeneralReport { + export interface AbuseReportsPhishingReport { /** * Path param: The account ID of the submitter. */ account_id: string; /** - * Body param: The abuse report type + * Body param: */ act: + | 'abuse_phishing' | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' - | 'abuse_phishing' | 'abuse_children' | 'abuse_threat' | 'abuse_registrar_whois' @@ -503,46 +466,38 @@ export declare namespace AbuseReportCreateParams { 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/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - name: string; + host_notification: 'send' | 'send-anon'; /** - * 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/). + * 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. */ - urls: string; + justification: string; /** - * Body param: Text not exceeding 100 characters. This field may be released by + * 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/). */ - address1?: string; + name: 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: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - agent_name?: string; + owner_notification: 'send' | 'send-anon'; /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - 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/). - */ - city?: string; + urls: string; /** * Body param: Any additional comments about the infringement not exceeding 2000 @@ -562,136 +517,161 @@ export declare namespace AbuseReportCreateParams { * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - country?: string; + original_work?: 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 - * addresses ought to be unique + * Body param: Text containing 2 characters */ - destination_ips?: string; + reported_country?: 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 */ - host_notification?: 'send' | 'send-anon' | 'none'; + reported_user_agent?: 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 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - justification?: string; + tele?: 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 */ - ncmec_notification?: 'send' | 'send-anon' | 'none'; + title?: string; + } + export interface AbuseReportsCsamReport { /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. + * Path param: The account ID of the submitter. */ - ncsei_subject_representation?: boolean; + account_id: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: + */ + act: + | 'abuse_children' + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_general' + | 'abuse_phishing' + | 'abuse_threat' + | '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/). */ - original_work?: string; + 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. */ - owner_notification?: 'send' | 'send-anon' | 'none'; + host_notification: 'send' | 'send-anon'; /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. + * 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. */ - ports_protocols?: string; + justification: string; /** - * Body param: Text containing 2 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/). */ - reported_country?: string; + name: string; /** - * Body param: Text not exceeding 255 characters + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - reported_user_agent?: string; + ncmec_notification: 'send' | 'send-anon'; /** - * 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: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - signature?: string; + owner_notification: 'send' | 'send-anon' | 'none'; /** - * 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 - * addresses ought to be unique + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - source_ips?: string; + urls: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters + */ + comments?: string; + + /** + * Body param: Text not exceeding 100 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - state?: string; + company?: string; /** - * Body param: Text not exceeding 20 characters. This field may be released by + * 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/). */ - tele?: string; + country?: string; /** - * Body param: Text not exceeding 255 characters + * Body param: Text containing 2 characters */ - title?: string; + reported_country?: string; /** - * Body param: Text not exceeding 1000 characters + * Body param: Text not exceeding 255 characters */ - trademark_number?: string; + reported_user_agent?: string; /** - * Body param: Text not exceeding 1000 characters + * Body param: Text not exceeding 20 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - trademark_office?: string; + tele?: string; /** - * Body param: Text not exceeding 1000 characters + * Body param: Text not exceeding 255 characters */ - trademark_symbol?: string; + title?: string; } - export interface AbuseReportsPhishingReport { + export interface AbuseReportsThreatReport { /** * Path param: The account ID of the submitter. */ account_id: string; /** - * Body param: The abuse report type + * Body param: */ act: + | 'abuse_threat' | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' | 'abuse_phishing' | 'abuse_children' - | 'abuse_threat' | 'abuse_registrar_whois' | 'abuse_ncsei'; @@ -708,46 +688,38 @@ export declare namespace AbuseReportCreateParams { 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/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - name: string; + host_notification: 'send' | 'send-anon'; /** - * 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/). + * 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. */ - urls: string; + justification: string; /** - * Body param: Text not exceeding 100 characters. This field may be released by + * 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/). */ - address1?: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name?: string; + name: string; /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - agree?: 0 | 1; + owner_notification: 'send' | 'send-anon'; /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - city?: string; + urls: string; /** * Body param: Any additional comments about the infringement not exceeding 2000 @@ -763,95 +735,102 @@ export declare namespace AbuseReportCreateParams { company?: string; /** - * Body param: Text not exceeding 255 characters. This field may be released by + * Body param: Text containing 2 characters + */ + reported_country?: string; + + /** + * Body param: Text not exceeding 255 characters + */ + reported_user_agent?: string; + + /** + * Body param: Text not exceeding 20 characters. This field may be released by * Cloudflare to third parties such as the Lumen Database * (https://lumendatabase.org/). */ - country?: string; + tele?: 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 - * addresses ought to be unique + * Body param: Text not exceeding 255 characters */ - destination_ips?: string; + title?: string; + } + export interface AbuseReportsRegistrarWhoisReport { /** - * 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. */ - host_notification?: 'send' | 'send-anon' | 'none'; + account_id: 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: */ - justification?: string; + act: + | 'abuse_registrar_whois' + | 'abuse_dmca' + | 'abuse_trademark' + | 'abuse_general' + | 'abuse_phishing' + | 'abuse_children' + | 'abuse_threat' + | 'abuse_ncsei'; /** - * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) - * and Trademark reports cannot be anonymous. + * 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/). */ - ncmec_notification?: 'send' | 'send-anon' | 'none'; + email: string; /** - * Body param: If the submitter is the target of NCSEI in the URLs of the abuse - * report. + * Body param: Should match the value provided in `email` */ - ncsei_subject_representation?: boolean; + 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/). */ - original_work?: string; + name: string; /** * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) * and Trademark reports cannot be anonymous. */ - owner_notification?: 'send' | 'send-anon' | 'none'; - - /** - * Body param: A comma separated list of ports and protocols e.g. 80/TCP, 22/UDP. - * The total size of the field should not exceed 2000 characters. Each individual - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; + owner_notification: 'send' | 'send-anon' | 'none'; /** - * Body param: Text containing 2 characters + * Body param: A list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - reported_country?: string; + urls: string; /** - * Body param: Text not exceeding 255 characters + * Body param: Any additional comments about the infringement not exceeding 2000 + * characters */ - reported_user_agent?: string; + comments?: 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: Text not exceeding 100 characters. This field may be released by + * Cloudflare to third parties such as the Lumen Database + * (https://lumendatabase.org/). */ - signature?: string; + company?: 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 - * addresses ought to be unique + * Body param: Text containing 2 characters */ - source_ips?: string; + reported_country?: 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: Text not exceeding 255 characters */ - state?: string; + reported_user_agent?: string; /** * Body param: Text not exceeding 20 characters. This field may be released by @@ -864,41 +843,26 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 255 characters */ title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; } - export interface AbuseReportsChildrenAbuseReport { + export interface AbuseReportsNcseiReport { /** * Path param: The account ID of the submitter. */ account_id: string; /** - * Body param: The abuse report type + * Body param: */ act: + | 'abuse_ncsei' | 'abuse_dmca' | 'abuse_trademark' | 'abuse_general' | 'abuse_phishing' | 'abuse_children' | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + | 'abuse_registrar_whois'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -913,46 +877,37 @@ export declare namespace AbuseReportCreateParams { 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/). + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - urls: string; + host_notification: 'send' | 'send-anon'; /** - * Body param: Text not exceeding 100 characters. This field may be released by + * 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/). */ - address1?: string; + name: 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: If the submitter is the target of NCSEI in the URLs of the abuse + * report. */ - agent_name?: string; + ncsei_subject_representation: boolean; /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports + * Body param: Notification type based on the abuse type. NOTE: Copyright (DMCA) + * and Trademark reports cannot be anonymous. */ - agree?: 0 | 1; + owner_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 list of valid URLs separated by ‘\n’ (new line character). The + * list of the URLs should not exceed 250 URLs. All URLs should have the same + * hostname. Each URL should be unique. This field may be released by Cloudflare to + * third parties such as the Lumen Database (https://lumendatabase.org/). */ - city?: string; + urls: string; /** * Body param: Any additional comments about the infringement not exceeding 2000 @@ -974,674 +929,6 @@ export declare namespace AbuseReportCreateParams { */ 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 - * addresses ought to be unique - */ - destination_ips?: 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. - */ - 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 - * (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 - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - 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 - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; - } - - export interface AbuseReportsThreatReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: 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 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 - * (https://lumendatabase.org/). - */ - address1?: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name?: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree?: 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/). - */ - city?: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - destination_ips?: 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. - */ - 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 - * (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 - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - 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 - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; - } - - export interface AbuseReportsRegistrarWhoisReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: 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 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 - * (https://lumendatabase.org/). - */ - address1?: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name?: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree?: 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/). - */ - city?: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - destination_ips?: 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. - */ - 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 - * (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 - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - - /** - * Body param: Text containing 2 characters - */ - reported_country?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - reported_user_agent?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - 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 - * (https://lumendatabase.org/). - */ - tele?: string; - - /** - * Body param: Text not exceeding 255 characters - */ - title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; - } - - export interface AbuseReportsNcseiReport { - /** - * Path param: The account ID of the submitter. - */ - account_id: 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 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 - * (https://lumendatabase.org/). - */ - address1?: string; - - /** - * Body param: The name of the copyright holder. Text not exceeding 60 characters. - * This field may be released by Cloudflare to third parties such as the Lumen - * Database (https://lumendatabase.org/). - */ - agent_name?: string; - - /** - * Body param: Can be `0` for false or `1` for true. Must be value: 1 for DMCA - * reports - */ - agree?: 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/). - */ - city?: string; - - /** - * Body param: Any additional comments about the infringement not exceeding 2000 - * characters - */ - comments?: string; - - /** - * Body param: Text not exceeding 100 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - company?: string; - - /** - * Body param: Text not exceeding 255 characters. This field may be released by - * Cloudflare to third parties such as the Lumen Database - * (https://lumendatabase.org/). - */ - country?: string; - - /** - * Body param: 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 - * addresses ought to be unique - */ - destination_ips?: 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. - */ - 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 - * (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 - * port/protocol should not exceed 100 characters. The list should not have more - * than 30 unique ports and protocols. - */ - ports_protocols?: string; - /** * Body param: Text containing 2 characters */ @@ -1652,27 +939,6 @@ export declare namespace AbuseReportCreateParams { */ 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 - * addresses ought to be unique - */ - 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 @@ -1684,21 +950,6 @@ export declare namespace AbuseReportCreateParams { * Body param: Text not exceeding 255 characters */ title?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_number?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_office?: string; - - /** - * Body param: Text not exceeding 1000 characters - */ - trademark_symbol?: string; } } diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index 964d4dbf9b..1455bc526d 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -38,7 +38,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: {}, * }, * ], * }); @@ -70,7 +70,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: {}, * }, * ], * }, diff --git a/src/resources/argo/smart-routing.ts b/src/resources/argo/smart-routing.ts index fa9e2068e2..515727cb7a 100644 --- a/src/resources/argo/smart-routing.ts +++ b/src/resources/argo/smart-routing.ts @@ -5,7 +5,7 @@ import * as Core from '../../core'; export class SmartRouting extends APIResource { /** - * Updates enablement of Argo Smart Routing. + * Configures the value of the Argo Smart Routing enablement setting. * * @example * ```ts @@ -28,7 +28,7 @@ export class SmartRouting extends APIResource { } /** - * Get Argo Smart Routing setting + * Retrieves the value of Argo Smart Routing enablement setting. * * @example * ```ts @@ -50,13 +50,13 @@ export class SmartRouting extends APIResource { } } -export type SmartRoutingEditResponse = unknown | string | null; +export type SmartRoutingEditResponse = unknown; -export type SmartRoutingGetResponse = unknown | string | null; +export type SmartRoutingGetResponse = unknown; export interface SmartRoutingEditParams { /** - * Path param: Identifier + * Path param: Specifies the zone associated with the API call. */ zone_id: string; @@ -68,7 +68,7 @@ export interface SmartRoutingEditParams { export interface SmartRoutingGetParams { /** - * Identifier + * Specifies the zone associated with the API call. */ zone_id: string; } diff --git a/src/resources/brand-protection/brand-protection.ts b/src/resources/brand-protection/brand-protection.ts index 35614d25f6..da3918c087 100644 --- a/src/resources/brand-protection/brand-protection.ts +++ b/src/resources/brand-protection/brand-protection.ts @@ -3,13 +3,25 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; import * as LogoMatchesAPI from './logo-matches'; -import { LogoMatches } from './logo-matches'; +import { + LogoMatchDownloadParams, + LogoMatchDownloadResponse, + LogoMatchGetParams, + LogoMatchGetResponse, + LogoMatches, +} from './logo-matches'; import * as LogosAPI from './logos'; -import { Logos } from './logos'; +import { LogoCreateParams, LogoCreateResponse, LogoDeleteParams, Logos } from './logos'; import * as MatchesAPI from './matches'; -import { Matches } from './matches'; +import { + MatchDownloadParams, + MatchDownloadResponse, + MatchGetParams, + MatchGetResponse, + Matches, +} from './matches'; import * as QueriesAPI from './queries'; -import { Queries } from './queries'; +import { Queries, QueryCreateParams, QueryDeleteParams } from './queries'; export class BrandProtection extends APIResource { queries: QueriesAPI.Queries = new QueriesAPI.Queries(this._client); @@ -18,43 +30,25 @@ export class BrandProtection extends APIResource { logoMatches: LogoMatchesAPI.LogoMatches = new LogoMatchesAPI.LogoMatches(this._client); /** - * Submit suspicious URL for scanning. - * - * @example - * ```ts - * const submit = await client.brandProtection.submit({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * Return new URL submissions */ - submit(params: BrandProtectionSubmitParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/brand-protection/submit`, { - body, - ...options, - }) as Core.APIPromise<{ result: Submit }> - )._thenUnwrap((obj) => obj.result); + submit( + params: BrandProtectionSubmitParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/submit`, options); } /** - * Gets phishing details about a URL. - * - * @example - * ```ts - * const info = await client.brandProtection.urlInfo({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * Return submitted URLs based on ID */ - urlInfo(params: BrandProtectionURLInfoParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...query } = params; - return ( - this._client.get(`/accounts/${account_id}/brand-protection/url-info`, { - query, - ...options, - }) as Core.APIPromise<{ result: Info }> - )._thenUnwrap((obj) => obj.result); + urlInfo( + params: BrandProtectionURLInfoParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/url-info`, options); } } @@ -67,18 +61,18 @@ export interface Info { /** * List of model results for completed scans. */ - model_results?: Array; + model_results?: Array; /** * List of signatures that matched against site content found when crawling the * URL. */ - rule_matches?: Array; + rule_matches?: Array; /** * Status of the most recent scan found. */ - scan_status?: ScanStatus; + scan_status?: Info.ScanStatus; /** * For internal use. @@ -108,53 +102,65 @@ export namespace Info { */ verification_status?: string; } -} -export interface RuleMatch { - /** - * For internal use. - */ - banning?: boolean; + export interface ModelResult { + /** + * Name of the model. + */ + model_name?: string; - /** - * For internal use. - */ - blocking?: boolean; + /** + * This is the score that is outputted by the model for this submission. + */ + model_score?: number; + } - /** - * Description of the signature that matched. - */ - description?: string; + export interface RuleMatch { + /** + * For internal use. + */ + banning?: boolean; - /** - * Name of the signature that matched. - */ - name?: string; -} + /** + * For internal use. + */ + blocking?: boolean; -/** - * Status of the most recent scan found. - */ -export interface ScanStatus { - /** - * Timestamp of when the submission was processed. - */ - last_processed?: string; + /** + * Description of the signature that matched. + */ + description?: string; - /** - * For internal use. - */ - scan_complete?: boolean; + /** + * Name of the signature that matched. + */ + name?: string; + } /** - * Status code that the crawler received when loading the submitted URL. + * Status of the most recent scan found. */ - status_code?: number; + export interface ScanStatus { + /** + * Timestamp of when the submission was processed. + */ + last_processed?: string; - /** - * ID of the most recent submission. - */ - submission_id?: number; + /** + * For internal use. + */ + scan_complete?: boolean; + + /** + * Status code that the crawler received when loading the submitted URL. + */ + status_code?: number; + + /** + * ID of the most recent submission. + */ + submission_id?: number; + } } export interface Submit { @@ -208,45 +214,56 @@ export namespace Submit { } } -export interface URLInfoModelResults { +export interface BrandProtectionSubmitResponse { /** - * Name of the model. + * Error code */ - model_name?: string; + code?: number; /** - * This is the score that is outputted by the model for this submission. + * Errors */ - model_score?: number; -} + errors?: { [key: string]: unknown }; -export interface BrandProtectionSubmitParams { /** - * Path param: Identifier. + * Error message */ - account_id: string; + message?: string; /** - * Body param: URL(s) to filter submissions results by. + * Error name */ - url?: string; + status?: string; } -export interface BrandProtectionURLInfoParams { +export interface BrandProtectionURLInfoResponse { /** - * Path param: Identifier. + * Error code */ - account_id: string; + code?: number; /** - * Query param: Submission URL(s) to filter submission results by. + * Errors */ - url?: Array; + errors?: { [key: string]: unknown }; /** - * Query param: Submission ID(s) to filter submission results by. + * Error message */ - url_id?: Array; + message?: string; + + /** + * Error name + */ + status?: string; +} + +export interface BrandProtectionSubmitParams { + account_id: string; +} + +export interface BrandProtectionURLInfoParams { + account_id: string; } BrandProtection.Queries = Queries; @@ -257,19 +274,39 @@ BrandProtection.LogoMatches = LogoMatches; export declare namespace BrandProtection { export { type Info as Info, - type RuleMatch as RuleMatch, - type ScanStatus as ScanStatus, type Submit as Submit, - type URLInfoModelResults as URLInfoModelResults, + type BrandProtectionSubmitResponse as BrandProtectionSubmitResponse, + type BrandProtectionURLInfoResponse as BrandProtectionURLInfoResponse, type BrandProtectionSubmitParams as BrandProtectionSubmitParams, type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams, }; - export { Queries as Queries }; + export { + Queries as Queries, + type QueryCreateParams as QueryCreateParams, + type QueryDeleteParams as QueryDeleteParams, + }; - export { Matches as Matches }; + export { + Matches as Matches, + type MatchDownloadResponse as MatchDownloadResponse, + type MatchGetResponse as MatchGetResponse, + type MatchDownloadParams as MatchDownloadParams, + type MatchGetParams as MatchGetParams, + }; - export { Logos as Logos }; + export { + Logos as Logos, + type LogoCreateResponse as LogoCreateResponse, + type LogoCreateParams as LogoCreateParams, + type LogoDeleteParams as LogoDeleteParams, + }; - export { LogoMatches as LogoMatches }; + export { + LogoMatches as LogoMatches, + type LogoMatchDownloadResponse as LogoMatchDownloadResponse, + type LogoMatchGetResponse as LogoMatchGetResponse, + type LogoMatchDownloadParams as LogoMatchDownloadParams, + type LogoMatchGetParams as LogoMatchGetParams, + }; } diff --git a/src/resources/brand-protection/index.ts b/src/resources/brand-protection/index.ts index 48fb0dbe1e..23abbe5299 100644 --- a/src/resources/brand-protection/index.ts +++ b/src/resources/brand-protection/index.ts @@ -1,7 +1,19 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { BrandProtection } from './brand-protection'; -export { LogoMatches } from './logo-matches'; -export { Logos } from './logos'; -export { Matches } from './matches'; -export { Queries } from './queries'; +export { + LogoMatches, + type LogoMatchDownloadResponse, + type LogoMatchGetResponse, + type LogoMatchDownloadParams, + type LogoMatchGetParams, +} from './logo-matches'; +export { Logos, type LogoCreateResponse, type LogoCreateParams, type LogoDeleteParams } from './logos'; +export { + Matches, + type MatchDownloadResponse, + type MatchGetResponse, + type MatchDownloadParams, + type MatchGetParams, +} from './matches'; +export { Queries, type QueryCreateParams, type QueryDeleteParams } from './queries'; diff --git a/src/resources/brand-protection/logo-matches.ts b/src/resources/brand-protection/logo-matches.ts index 6739017317..bc53041299 100644 --- a/src/resources/brand-protection/logo-matches.ts +++ b/src/resources/brand-protection/logo-matches.ts @@ -1,5 +1,93 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class LogoMatches extends APIResource {} +export class LogoMatches extends APIResource { + /** + * Return matches as CSV for logo queries based on ID + */ + download( + params: LogoMatchDownloadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches/download`, { + query, + ...options, + }); + } + + /** + * Return matches for logo queries based on ID + */ + get(params: LogoMatchGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/logo-matches`, { query, ...options }); + } +} + +export interface LogoMatchDownloadResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface LogoMatchGetResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface LogoMatchDownloadParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + limit?: string; + + /** + * Query param: + */ + logo_id?: Array; + + /** + * Query param: + */ + offset?: string; +} + +export interface LogoMatchGetParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + limit?: string; + + /** + * Query param: + */ + logo_id?: Array; + + /** + * Query param: + */ + offset?: string; +} + +export declare namespace LogoMatches { + export { + type LogoMatchDownloadResponse as LogoMatchDownloadResponse, + type LogoMatchGetResponse as LogoMatchGetResponse, + type LogoMatchDownloadParams as LogoMatchDownloadParams, + type LogoMatchGetParams as LogoMatchGetParams, + }; +} diff --git a/src/resources/brand-protection/logos.ts b/src/resources/brand-protection/logos.ts index 59e15a9aee..dfc6907049 100644 --- a/src/resources/brand-protection/logos.ts +++ b/src/resources/brand-protection/logos.ts @@ -1,5 +1,77 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class Logos extends APIResource {} +export class Logos extends APIResource { + /** + * Return new saved logo queries created from image files + */ + create(params: LogoCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, match_type, tag, threshold, ...body } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/logos`, { + query: { match_type, tag, threshold }, + body, + ...options, + headers: { 'Content-Type': 'application/x-www-form-urlencoded', ...options?.headers }, + }); + } + + /** + * Return a success message after deleting saved logo queries by ID + */ + delete(logoId: string, params: LogoDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/brand-protection/logos/${logoId}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface LogoCreateResponse { + id?: number; + + tag?: string; + + upload_path?: string; +} + +export interface LogoCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + match_type?: string; + + /** + * Query param: + */ + tag?: string; + + /** + * Query param: + */ + threshold?: number; + + /** + * Body param: + */ + image?: Core.Uploadable; +} + +export interface LogoDeleteParams { + account_id: string; +} + +export declare namespace Logos { + export { + type LogoCreateResponse as LogoCreateResponse, + type LogoCreateParams as LogoCreateParams, + type LogoDeleteParams as LogoDeleteParams, + }; +} diff --git a/src/resources/brand-protection/matches.ts b/src/resources/brand-protection/matches.ts index c158fda89e..5ce299de58 100644 --- a/src/resources/brand-protection/matches.ts +++ b/src/resources/brand-protection/matches.ts @@ -1,5 +1,103 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class Matches extends APIResource {} +export class Matches extends APIResource { + /** + * Return matches as CSV for string queries based on ID + */ + download( + params: MatchDownloadParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/matches/download`, { + query, + ...options, + }); + } + + /** + * Return matches for string queries based on ID + */ + get(params: MatchGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...query } = params; + return this._client.get(`/accounts/${account_id}/brand-protection/matches`, { query, ...options }); + } +} + +export interface MatchDownloadResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface MatchGetResponse { + matches?: Array<{ [key: string]: unknown }>; + + total?: number; +} + +export interface MatchDownloadParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + id?: string; + + /** + * Query param: + */ + include_domain_id?: boolean; + + /** + * Query param: + */ + limit?: number; + + /** + * Query param: + */ + offset?: number; +} + +export interface MatchGetParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + id?: string; + + /** + * Query param: + */ + include_domain_id?: boolean; + + /** + * Query param: + */ + limit?: number; + + /** + * Query param: + */ + offset?: number; +} + +export declare namespace Matches { + export { + type MatchDownloadResponse as MatchDownloadResponse, + type MatchGetResponse as MatchGetResponse, + type MatchDownloadParams as MatchDownloadParams, + type MatchGetParams as MatchGetParams, + }; +} diff --git a/src/resources/brand-protection/queries.ts b/src/resources/brand-protection/queries.ts index 1794cc0174..ec7289f369 100644 --- a/src/resources/brand-protection/queries.ts +++ b/src/resources/brand-protection/queries.ts @@ -1,5 +1,104 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class Queries extends APIResource {} +export class Queries extends APIResource { + /** + * Return a success message after creating new saved string queries + */ + create(params: QueryCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, id, query_scan, query_tag, ...body } = params; + return this._client.post(`/accounts/${account_id}/brand-protection/queries`, { + query: { id, scan: query_scan, tag: query_tag }, + body, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } + + /** + * Return a success message after deleting saved string queries by ID + */ + delete(params: QueryDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, id, scan, tag } = params; + return this._client.delete(`/accounts/${account_id}/brand-protection/queries`, { + query: { id, scan, tag }, + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface QueryCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + id?: string; + + /** + * Query param: + */ + query_scan?: boolean; + + /** + * Query param: + */ + query_tag?: string; + + /** + * Body param: + */ + max_time?: string | null; + + /** + * Body param: + */ + min_time?: string | null; + + /** + * Body param: + */ + body_scan?: boolean; + + /** + * Body param: + */ + string_matches?: unknown; + + /** + * Body param: + */ + body_tag?: string; +} + +export interface QueryDeleteParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: + */ + id?: string; + + /** + * Query param: + */ + scan?: boolean; + + /** + * Query param: + */ + tag?: string; +} + +export declare namespace Queries { + export { type QueryCreateParams as QueryCreateParams, type QueryDeleteParams as QueryDeleteParams }; +} diff --git a/src/resources/cache/cache.ts b/src/resources/cache/cache.ts index e62dd3c823..4b57d9c83f 100644 --- a/src/resources/cache/cache.ts +++ b/src/resources/cache/cache.ts @@ -123,7 +123,7 @@ export class Cache extends APIResource { * @example * ```ts * const response = await client.cache.purge({ - * zone_id: 'zone_id', + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * }); * ``` */ @@ -138,9 +138,6 @@ export class Cache extends APIResource { } export interface CachePurgeResponse { - /** - * Identifier. - */ id: string; } diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index 557af9dfac..ec1bbbf851 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -295,7 +295,7 @@ export class RecordResponsesV4PagePaginationArray extends V4PagePaginationArray< export interface ARecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -364,7 +364,7 @@ export namespace ARecord { export interface ARecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -433,7 +433,7 @@ export namespace ARecordParam { export interface AAAARecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -502,7 +502,7 @@ export namespace AAAARecord { export interface AAAARecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -635,7 +635,7 @@ export namespace BatchPatch { id: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -874,7 +874,7 @@ export namespace BatchPatchParam { id: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1113,7 +1113,7 @@ export namespace BatchPut { id: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1352,7 +1352,7 @@ export namespace BatchPutParam { id: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1527,7 +1527,7 @@ export namespace BatchPutParam { export interface CAARecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1621,7 +1621,7 @@ export namespace CAARecord { export interface CAARecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1710,7 +1710,7 @@ export namespace CAARecordParam { export interface CERTRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1809,7 +1809,7 @@ export namespace CERTRecord { export interface CERTRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1903,7 +1903,7 @@ export namespace CERTRecordParam { export interface CNAMERecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -1980,7 +1980,7 @@ export namespace CNAMERecord { export interface CNAMERecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2057,7 +2057,7 @@ export namespace CNAMERecordParam { export interface DNSKEYRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2156,7 +2156,7 @@ export namespace DNSKEYRecord { export interface DNSKEYRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2250,7 +2250,7 @@ export namespace DNSKEYRecordParam { export interface DSRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2349,7 +2349,7 @@ export namespace DSRecord { export interface DSRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2443,7 +2443,7 @@ export namespace DSRecordParam { export interface HTTPSRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2537,7 +2537,7 @@ export namespace HTTPSRecord { export interface HTTPSRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2626,7 +2626,7 @@ export namespace HTTPSRecordParam { export interface LOCRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2765,7 +2765,7 @@ export namespace LOCRecord { export interface LOCRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2899,7 +2899,7 @@ export namespace LOCRecordParam { export interface MXRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -2974,7 +2974,7 @@ export namespace MXRecord { export interface MXRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3049,7 +3049,7 @@ export namespace MXRecordParam { export interface NAPTRRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3158,7 +3158,7 @@ export namespace NAPTRRecord { export interface NAPTRRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3262,7 +3262,7 @@ export namespace NAPTRRecordParam { export interface NSRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3331,7 +3331,7 @@ export namespace NSRecord { export interface NSRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3400,7 +3400,7 @@ export namespace NSRecordParam { export interface PTRRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3469,7 +3469,7 @@ export namespace PTRRecord { export interface PTRRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3562,7 +3562,7 @@ export type Record = export namespace Record { export interface Openpgpkey { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -3872,7 +3872,7 @@ export namespace RecordResponse { modified_on: string; /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4513,7 +4513,7 @@ export type RecordTagsParam = string; export interface SMIMEARecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4612,7 +4612,7 @@ export namespace SMIMEARecord { export interface SMIMEARecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4706,7 +4706,7 @@ export namespace SMIMEARecordParam { export interface SRVRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4807,7 +4807,7 @@ export namespace SRVRecord { export interface SRVRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4902,7 +4902,7 @@ export namespace SRVRecordParam { export interface SSHFPRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -4996,7 +4996,7 @@ export namespace SSHFPRecord { export interface SSHFPRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5085,7 +5085,7 @@ export namespace SSHFPRecordParam { export interface SVCBRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5179,7 +5179,7 @@ export namespace SVCBRecord { export interface SVCBRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5268,7 +5268,7 @@ export namespace SVCBRecordParam { export interface TLSARecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5367,7 +5367,7 @@ export namespace TLSARecord { export interface TLSARecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5475,7 +5475,7 @@ export type TTLParam = number | 1; export interface TXTRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5549,7 +5549,7 @@ export namespace TXTRecord { export interface TXTRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5623,7 +5623,7 @@ export namespace TXTRecordParam { export interface URIRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5718,7 +5718,7 @@ export namespace URIRecord { export interface URIRecordParam { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5883,7 +5883,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -5958,7 +5958,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6033,7 +6033,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6116,7 +6116,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6197,7 +6197,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6272,7 +6272,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6348,7 +6348,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6423,7 +6423,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6503,7 +6503,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6598,7 +6598,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6698,7 +6698,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6798,7 +6798,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6898,7 +6898,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -6993,7 +6993,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7133,7 +7133,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7243,7 +7243,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7343,7 +7343,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7444,7 +7444,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7539,7 +7539,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7634,7 +7634,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7734,7 +7734,7 @@ export declare namespace RecordCreateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7855,7 +7855,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -7930,7 +7930,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8005,7 +8005,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8088,7 +8088,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8169,7 +8169,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8244,7 +8244,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8320,7 +8320,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8395,7 +8395,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8475,7 +8475,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8570,7 +8570,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8670,7 +8670,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8770,7 +8770,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8870,7 +8870,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -8965,7 +8965,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9105,7 +9105,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9215,7 +9215,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9315,7 +9315,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9416,7 +9416,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9511,7 +9511,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9606,7 +9606,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -9706,7 +9706,7 @@ export declare namespace RecordUpdateParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10077,7 +10077,7 @@ export namespace RecordBatchParams { export interface DNSRecordsOpenpgpkeyRecord { /** - * DNS record name (or @ for the zone apex) in Punycode. + * Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10176,7 +10176,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10251,7 +10251,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10326,7 +10326,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10409,7 +10409,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10490,7 +10490,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10565,7 +10565,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10641,7 +10641,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10716,7 +10716,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10796,7 +10796,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10891,7 +10891,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -10991,7 +10991,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11091,7 +11091,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11191,7 +11191,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11286,7 +11286,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11426,7 +11426,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11536,7 +11536,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11636,7 +11636,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11737,7 +11737,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11832,7 +11832,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -11927,7 +11927,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; @@ -12027,7 +12027,7 @@ export declare namespace RecordEditParams { zone_id: string; /** - * Body param: DNS record name (or @ for the zone apex) in Punycode. + * Body param: Complete DNS record name, including the zone name, in Punycode. */ name: string; diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index cdc7e9fe3c..a7dcdefa75 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -148,6 +148,8 @@ export interface InvestigateListResponse { | 'NONE' | null; + findings?: Array | null; + from?: string | null; from_name?: string | null; @@ -169,12 +171,39 @@ export interface InvestigateListResponse { export namespace InvestigateListResponse { export interface Properties { - allowlisted_pattern_type?: string; + allowlisted_pattern?: string; + + allowlisted_pattern_type?: + | 'quarantine_release' + | 'blocked_sender' + | 'acceptable_sender' + | 'allowed_sender' + | 'allowed_recipient' + | 'domain_similarity' + | 'domain_recency' + | 'managed_acceptable_sender'; + + blocklisted_message?: boolean; + + blocklisted_pattern?: string; + + whitelisted_pattern_type?: + | 'quarantine_release' + | 'blocked_sender' + | 'acceptable_sender' + | 'allowed_sender' + | 'allowed_recipient' + | 'domain_similarity' + | 'domain_recency' + | 'managed_acceptable_sender'; + } + + export interface Finding { + detail?: string | null; - /** - * @deprecated - */ - whitelisted_pattern_type?: string; + name?: string | null; + + value?: string | null; } export interface Validation { @@ -241,6 +270,8 @@ export interface InvestigateGetResponse { | 'NONE' | null; + findings?: Array | null; + from?: string | null; from_name?: string | null; @@ -262,12 +293,39 @@ export interface InvestigateGetResponse { export namespace InvestigateGetResponse { export interface Properties { - allowlisted_pattern_type?: string; + allowlisted_pattern?: string; + + allowlisted_pattern_type?: + | 'quarantine_release' + | 'blocked_sender' + | 'acceptable_sender' + | 'allowed_sender' + | 'allowed_recipient' + | 'domain_similarity' + | 'domain_recency' + | 'managed_acceptable_sender'; + + blocklisted_message?: boolean; + + blocklisted_pattern?: string; + + whitelisted_pattern_type?: + | 'quarantine_release' + | 'blocked_sender' + | 'acceptable_sender' + | 'allowed_sender' + | 'allowed_recipient' + | 'domain_similarity' + | 'domain_recency' + | 'managed_acceptable_sender'; + } - /** - * @deprecated - */ - whitelisted_pattern_type?: string; + export interface Finding { + detail?: string | null; + + name?: string | null; + + value?: string | null; } export interface Validation { @@ -376,6 +434,11 @@ export interface InvestigateListParams extends V4PagePaginationArrayParams { * `now - 30 days`. */ start?: string; + + /** + * Query param: + */ + subject?: string; } export interface InvestigateGetParams { diff --git a/src/resources/email-security/investigate/trace.ts b/src/resources/email-security/investigate/trace.ts index da42c4050b..f17ad3b195 100644 --- a/src/resources/email-security/investigate/trace.ts +++ b/src/resources/email-security/investigate/trace.ts @@ -40,6 +40,8 @@ export interface TraceGetResponse { export namespace TraceGetResponse { export interface Inbound { lines?: Array | null; + + pending?: boolean | null; } export namespace Inbound { @@ -54,6 +56,8 @@ export namespace TraceGetResponse { export interface Outbound { lines?: Array | null; + + pending?: boolean | null; } export namespace Outbound { diff --git a/src/resources/email-security/settings/allow-policies.ts b/src/resources/email-security/settings/allow-policies.ts index eb673be7b3..2cd1553022 100644 --- a/src/resources/email-security/settings/allow-policies.ts +++ b/src/resources/email-security/settings/allow-policies.ts @@ -489,6 +489,11 @@ export interface AllowPolicyListParams extends V4PagePaginationArrayParams { */ order?: 'pattern' | 'created_at'; + /** + * Query param: + */ + pattern?: string; + /** * Query param: */ diff --git a/src/resources/email-security/settings/block-senders.ts b/src/resources/email-security/settings/block-senders.ts index 480423debc..edbc87faf9 100644 --- a/src/resources/email-security/settings/block-senders.ts +++ b/src/resources/email-security/settings/block-senders.ts @@ -264,6 +264,11 @@ export interface BlockSenderListParams extends V4PagePaginationArrayParams { */ order?: 'pattern' | 'created_at'; + /** + * Query param: + */ + pattern?: string; + /** * Query param: */ diff --git a/src/resources/email-security/settings/trusted-domains.ts b/src/resources/email-security/settings/trusted-domains.ts index d015ff7252..5d2b18768c 100644 --- a/src/resources/email-security/settings/trusted-domains.ts +++ b/src/resources/email-security/settings/trusted-domains.ts @@ -400,6 +400,11 @@ export interface TrustedDomainListParams extends V4PagePaginationArrayParams { */ order?: 'pattern' | 'created_at'; + /** + * Query param: + */ + pattern?: string; + /** * Query param: Allows searching in multiple properties of a record simultaneously. * This parameter is intended for human users, not automation. Its exact behavior diff --git a/src/resources/magic-transit/connectors/events/events.ts b/src/resources/magic-transit/connectors/events/events.ts index d3a34e8bb1..6e1b1201dd 100644 --- a/src/resources/magic-transit/connectors/events/events.ts +++ b/src/resources/magic-transit/connectors/events/events.ts @@ -274,6 +274,11 @@ export interface EventListParams { */ cursor?: string; + /** + * Query param: Filter by event kind + */ + k?: string; + /** * Query param: */ diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 913238870d..298d84ab48 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -48,7 +48,7 @@ export namespace SummaryUserAgentResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/ai/inference/summary.ts b/src/resources/radar/ai/inference/summary.ts index d53516af97..e09e6de091 100644 --- a/src/resources/radar/ai/inference/summary.ts +++ b/src/resources/radar/ai/inference/summary.ts @@ -70,7 +70,7 @@ export namespace SummaryModelResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -167,7 +167,7 @@ export namespace SummaryTaskResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/as112/summary.ts b/src/resources/radar/as112/summary.ts index 5898de7862..c59fdaeb5a 100644 --- a/src/resources/radar/as112/summary.ts +++ b/src/resources/radar/as112/summary.ts @@ -182,7 +182,7 @@ export namespace SummaryDNSSECResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -291,7 +291,7 @@ export namespace SummaryEdnsResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -400,7 +400,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -509,7 +509,7 @@ export namespace SummaryProtocolResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -628,7 +628,7 @@ export namespace SummaryQueryTypeResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -725,7 +725,7 @@ export namespace SummaryResponseCodesResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/attacks/layer3/summary.ts b/src/resources/radar/attacks/layer3/summary.ts index 707a682c97..73ed7d7c70 100644 --- a/src/resources/radar/attacks/layer3/summary.ts +++ b/src/resources/radar/attacks/layer3/summary.ts @@ -213,7 +213,7 @@ export namespace SummaryBitrateResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -337,7 +337,7 @@ export namespace SummaryDurationResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -466,7 +466,7 @@ export namespace SummaryIndustryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -563,7 +563,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -672,7 +672,7 @@ export namespace SummaryProtocolResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -791,7 +791,7 @@ export namespace SummaryVectorResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -888,7 +888,7 @@ export namespace SummaryVerticalResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/attacks/layer7/summary.ts b/src/resources/radar/attacks/layer7/summary.ts index 20c20213b3..4afa3d68d0 100644 --- a/src/resources/radar/attacks/layer7/summary.ts +++ b/src/resources/radar/attacks/layer7/summary.ts @@ -220,7 +220,7 @@ export namespace SummaryHTTPMethodResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -317,7 +317,7 @@ export namespace SummaryHTTPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -422,7 +422,7 @@ export namespace SummaryIndustryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -519,7 +519,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -622,7 +622,7 @@ export namespace SummaryManagedRulesResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -719,7 +719,7 @@ export namespace SummaryMitigationProductResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -816,7 +816,7 @@ export namespace SummaryVerticalResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/attacks/layer7/top/top.ts b/src/resources/radar/attacks/layer7/top/top.ts index b51891f4c7..74086112c2 100644 --- a/src/resources/radar/attacks/layer7/top/top.ts +++ b/src/resources/radar/attacks/layer7/top/top.ts @@ -469,12 +469,6 @@ export interface TopAttacksParams { */ location?: Array; - /** - * Deprecated parameter. Future support includes only attack magnitude defined by - * total mitigated requests (MITIGATED_REQUESTS). - */ - magnitude?: 'AFFECTED_ZONES' | 'MITIGATED_REQUESTS'; - /** * Filters the results by layer 7 mitigation product. */ diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index 140ad5b529..c75011e6a0 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -248,7 +248,7 @@ export namespace BotSummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/bots/web-crawlers.ts b/src/resources/radar/bots/web-crawlers.ts index d7c9f610a3..d55ac693b1 100644 --- a/src/resources/radar/bots/web-crawlers.ts +++ b/src/resources/radar/bots/web-crawlers.ts @@ -92,7 +92,7 @@ export namespace WebCrawlerSummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/dns/summary.ts b/src/resources/radar/dns/summary.ts index 414edd9bf8..9bc87aa1f9 100644 --- a/src/resources/radar/dns/summary.ts +++ b/src/resources/radar/dns/summary.ts @@ -294,7 +294,7 @@ export namespace SummaryCacheHitResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -403,7 +403,7 @@ export namespace SummaryDNSSECResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -522,7 +522,7 @@ export namespace SummaryDNSSECAwareResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -631,7 +631,7 @@ export namespace SummaryDNSSECE2EResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -740,7 +740,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -849,7 +849,7 @@ export namespace SummaryMatchingAnswerResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -958,7 +958,7 @@ export namespace SummaryProtocolResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -1077,7 +1077,7 @@ export namespace SummaryQueryTypeResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -1174,7 +1174,7 @@ export namespace SummaryResponseCodeResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -1271,7 +1271,7 @@ export namespace SummaryResponseTTLResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/email/routing/summary.ts b/src/resources/radar/email/routing/summary.ts index 90e6565c5f..4085dc05e9 100644 --- a/src/resources/radar/email/routing/summary.ts +++ b/src/resources/radar/email/routing/summary.ts @@ -182,7 +182,7 @@ export namespace SummaryARCResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -279,7 +279,7 @@ export namespace SummaryDKIMResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -376,7 +376,7 @@ export namespace SummaryDMARCResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -473,7 +473,7 @@ export namespace SummaryEncryptedResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -582,7 +582,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -691,7 +691,7 @@ export namespace SummarySPFResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/email/security/summary.ts b/src/resources/radar/email/security/summary.ts index 8b24cb05b7..3a984c2f4f 100644 --- a/src/resources/radar/email/security/summary.ts +++ b/src/resources/radar/email/security/summary.ts @@ -262,7 +262,7 @@ export namespace SummaryARCResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -359,7 +359,7 @@ export namespace SummaryDKIMResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -456,7 +456,7 @@ export namespace SummaryDMARCResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -553,7 +553,7 @@ export namespace SummaryMaliciousResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -662,7 +662,7 @@ export namespace SummarySpamResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -771,7 +771,7 @@ export namespace SummarySPFResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -868,7 +868,7 @@ export namespace SummarySpoofResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -977,7 +977,7 @@ export namespace SummaryThreatCategoryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -1096,7 +1096,7 @@ export namespace SummaryTLSVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/http/summary.ts b/src/resources/radar/http/summary.ts index 65f3ac2037..95ce04817e 100644 --- a/src/resources/radar/http/summary.ts +++ b/src/resources/radar/http/summary.ts @@ -244,7 +244,7 @@ export namespace SummaryBotClassResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -353,7 +353,7 @@ export namespace SummaryDeviceTypeResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -467,7 +467,7 @@ export namespace SummaryHTTPProtocolResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -576,7 +576,7 @@ export namespace SummaryHTTPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -690,7 +690,7 @@ export namespace SummaryIPVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -799,7 +799,7 @@ export namespace SummaryOSResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -908,7 +908,7 @@ export namespace SummaryPostQuantumResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -1017,7 +1017,7 @@ export namespace SummaryTLSVersionResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/leaked-credentials/summary.ts b/src/resources/radar/leaked-credentials/summary.ts index 59234a6375..c1c6b5efee 100644 --- a/src/resources/radar/leaked-credentials/summary.ts +++ b/src/resources/radar/leaked-credentials/summary.ts @@ -79,7 +79,7 @@ export namespace SummaryBotClassResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -188,7 +188,7 @@ export namespace SummaryCompromisedResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/netflows/netflows.ts b/src/resources/radar/netflows/netflows.ts index bdce8f7a70..b46440c98d 100644 --- a/src/resources/radar/netflows/netflows.ts +++ b/src/resources/radar/netflows/netflows.ts @@ -79,7 +79,7 @@ export namespace NetflowSummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/quality/iqi.ts b/src/resources/radar/quality/iqi.ts index 085918eae3..4c3f288361 100644 --- a/src/resources/radar/quality/iqi.ts +++ b/src/resources/radar/quality/iqi.ts @@ -61,7 +61,7 @@ export namespace IQISummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/quality/speed/speed.ts b/src/resources/radar/quality/speed/speed.ts index 4a5486d2e3..f3023aa4a7 100644 --- a/src/resources/radar/quality/speed/speed.ts +++ b/src/resources/radar/quality/speed/speed.ts @@ -91,7 +91,7 @@ export namespace SpeedHistogramResponse { */ bucketSize: number; - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; @@ -190,7 +190,7 @@ export namespace SpeedSummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/radar/search.ts b/src/resources/radar/search.ts index cab2690c3d..ead601f62b 100644 --- a/src/resources/radar/search.ts +++ b/src/resources/radar/search.ts @@ -5,7 +5,8 @@ import * as Core from '../../core'; export class Search extends APIResource { /** - * Searches for locations, autonomous systems, reports, and bots. + * Searches for locations, autonomous systems, reports, bots, certificate logs, and + * certificate authorities. * * @example * ```ts @@ -39,14 +40,16 @@ export namespace SearchGlobalResponse { export interface SearchGlobalParams { /** - * Search for locations, autonomous systems and reports. + * String used to perform the search operation. */ query: string; /** * Search types excluded from results. */ - exclude?: Array<'ASNS' | 'BOTS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; + exclude?: Array< + 'ASNS' | 'BOTS' | 'CERTIFICATE_AUTHORITIES' | 'CERTIFICATE_LOGS' | 'LOCATIONS' | 'NOTEBOOKS' + >; /** * Format in which results will be returned. @@ -56,7 +59,9 @@ export interface SearchGlobalParams { /** * Search types included in results. */ - include?: Array<'ASNS' | 'BOTS' | 'LOCATIONS' | 'NOTEBOOKS' | 'SPECIAL_EVENTS'>; + include?: Array< + 'ASNS' | 'BOTS' | 'CERTIFICATE_AUTHORITIES' | 'CERTIFICATE_LOGS' | 'LOCATIONS' | 'NOTEBOOKS' + >; /** * Limits the number of objects returned in the response. diff --git a/src/resources/radar/tcp-resets-timeouts.ts b/src/resources/radar/tcp-resets-timeouts.ts index e7ef792cab..01cdb209f2 100644 --- a/src/resources/radar/tcp-resets-timeouts.ts +++ b/src/resources/radar/tcp-resets-timeouts.ts @@ -79,7 +79,7 @@ export namespace TCPResetsTimeoutSummaryResponse { * Metadata for the results. */ export interface Meta { - confidenceInfo: Meta.ConfidenceInfo | null; + confidenceInfo: Meta.ConfidenceInfo; dateRange: Array; diff --git a/src/resources/rules/lists/bulk-operations.ts b/src/resources/rules/lists/bulk-operations.ts index c70c6e049d..d14fcc16f2 100644 --- a/src/resources/rules/lists/bulk-operations.ts +++ b/src/resources/rules/lists/bulk-operations.ts @@ -59,7 +59,7 @@ export interface BulkOperationGetResponse { export interface BulkOperationGetParams { /** - * Defines an identifier. + * The Account ID for this resource. */ account_id: string; } diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 6cd68b12a7..092e4c055d 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -276,7 +276,7 @@ export interface ItemGetResponse { export interface ItemCreateParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -318,7 +318,7 @@ export namespace ItemCreateParams { export interface ItemUpdateParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -360,7 +360,7 @@ export namespace ItemUpdateParams { export interface ItemListParams extends CursorPaginationParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -374,7 +374,7 @@ export interface ItemListParams extends CursorPaginationParams { export interface ItemDeleteParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -390,7 +390,7 @@ export namespace ItemDeleteParams { export interface ItemGetParams { /** - * Defines an identifier. + * The Account ID for this resource. */ account_id: string; } diff --git a/src/resources/rules/lists/lists.ts b/src/resources/rules/lists/lists.ts index b080b6eae3..4a1945914e 100644 --- a/src/resources/rules/lists/lists.ts +++ b/src/resources/rules/lists/lists.ts @@ -28,7 +28,7 @@ export class Lists extends APIResource { items: ItemsAPI.Items = new ItemsAPI.Items(this._client); /** - * Creates a new list of the specified type. + * Creates a new list of the specified kind. * * @example * ```ts @@ -151,6 +151,13 @@ export class ListsListsSinglePage extends SinglePage {} */ export interface Hostname { url_hostname: string; + + /** + * Only applies to wildcard hostnames (e.g., \*.example.com). When true (default), + * only subdomains are blocked. When false, both the root domain and subdomains are + * blocked. + */ + exclude_exact_hostname?: boolean; } /** @@ -159,6 +166,13 @@ export interface Hostname { */ export interface HostnameParam { url_hostname: string; + + /** + * Only applies to wildcard hostnames (e.g., \*.example.com). When true (default), + * only subdomains are blocked. When false, both the root domain and subdomains are + * blocked. + */ + exclude_exact_hostname?: boolean; } export interface ListsList { @@ -330,7 +344,7 @@ export interface ListUpdateResponse { export interface ListDeleteResponse { /** - * Defines the unique ID of the item in the List. + * The unique ID of the list. */ id?: string; } @@ -380,7 +394,7 @@ export interface ListGetResponse { export interface ListCreateParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -404,7 +418,7 @@ export interface ListCreateParams { export interface ListUpdateParams { /** - * Path param: Defines an identifier. + * Path param: The Account ID for this resource. */ account_id: string; @@ -416,21 +430,21 @@ export interface ListUpdateParams { export interface ListListParams { /** - * Defines an identifier. + * The Account ID for this resource. */ account_id: string; } export interface ListDeleteParams { /** - * Defines an identifier. + * The Account ID for this resource. */ account_id: string; } export interface ListGetParams { /** - * Defines an identifier. + * The Account ID for this resource. */ account_id: string; } diff --git a/src/resources/shared.ts b/src/resources/shared.ts index f6bea7bc14..69fac18949 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -888,9 +888,9 @@ export interface TokenPolicy { permission_groups: Array; /** - * A list of resource names that the policy applies to. + * Resource permissions for the policy. Use either simple or nested permissions. */ - resources: { [key: string]: string | { [key: string]: string } }; + resources: TokenPolicy.Resources; } export namespace TokenPolicy { @@ -925,6 +925,21 @@ export namespace TokenPolicy { value?: string; } } + + /** + * Resource permissions for the policy. Use either simple or nested permissions. + */ + export interface Resources { + /** + * Nested resource permissions for hierarchical scoping. + */ + nested?: { [key: string]: { [key: string]: string } }; + + /** + * Simple resource permissions where each resource maps to a permission string. + */ + simple?: { [key: string]: string }; + } } export interface TokenPolicyParam { @@ -939,9 +954,9 @@ export interface TokenPolicyParam { permission_groups: Array; /** - * A list of resource names that the policy applies to. + * Resource permissions for the policy. Use either simple or nested permissions. */ - resources: { [key: string]: string | { [key: string]: string } }; + resources: TokenPolicyParam.Resources; } export namespace TokenPolicyParam { @@ -971,6 +986,21 @@ export namespace TokenPolicyParam { value?: string; } } + + /** + * Resource permissions for the policy. Use either simple or nested permissions. + */ + export interface Resources { + /** + * Nested resource permissions for hierarchical scoping. + */ + nested?: { [key: string]: { [key: string]: string } }; + + /** + * Simple resource permissions where each resource maps to a permission string. + */ + simple?: { [key: string]: string }; + } } /** diff --git a/src/resources/ssl/recommendations.ts b/src/resources/ssl/recommendations.ts index dcc7ff0ae0..184192cc6e 100644 --- a/src/resources/ssl/recommendations.ts +++ b/src/resources/ssl/recommendations.ts @@ -7,12 +7,7 @@ export class Recommendations extends APIResource { /** * Retrieve the SSL/TLS Recommender's recommendation for a zone. * - * @example - * ```ts - * const recommendation = await client.ssl.recommendations.get( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * @deprecated SSL/TLS Recommender has been decommissioned in favor of Automatic SSL/TLS */ get( params: RecommendationGetParams, @@ -28,20 +23,30 @@ export class Recommendations extends APIResource { } export interface RecommendationGetResponse { + id: string; + /** - * Identifier of a recommendation result. + * Whether this setting can be updated or not. */ - id?: string; + editable: boolean; - modified_on?: string; + /** + * Last time this setting was modified. + */ + modified_on: string; - value?: 'flexible' | 'full' | 'strict'; -} + /** + * Current setting of the automatic SSL/TLS. + */ + value: 'auto' | 'custom'; -export interface RecommendationGetParams { /** - * Identifier. + * Next time this zone will be scanned by the Automatic SSL/TLS. */ + next_scheduled_scan?: string | null; +} + +export interface RecommendationGetParams { zone_id: string; } diff --git a/src/resources/stream/clip.ts b/src/resources/stream/clip.ts index d4d5658868..36283ca91a 100644 --- a/src/resources/stream/clip.ts +++ b/src/resources/stream/clip.ts @@ -96,7 +96,7 @@ export interface Clip { /** * Specifies the processing status for all quality levels for a video. */ - status?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error'; + status?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error' | 'live-inprogress'; /** * The timestamp for a thumbnail image calculated as a percentage value of the diff --git a/src/resources/stream/stream.ts b/src/resources/stream/stream.ts index c175396511..4d4953be34 100644 --- a/src/resources/stream/stream.ts +++ b/src/resources/stream/stream.ts @@ -413,7 +413,7 @@ export namespace Video { /** * Specifies the processing status for all quality levels for a video. */ - state?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error'; + state?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error' | 'live-inprogress'; } } @@ -502,7 +502,7 @@ export interface StreamListParams { /** * Query param: Specifies the processing status for all quality levels for a video. */ - status?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error'; + status?: 'pendingupload' | 'downloading' | 'queued' | 'inprogress' | 'ready' | 'error' | 'live-inprogress'; /** * Query param: Specifies whether the video is `vod` or `live`. diff --git a/src/resources/user/tokens/tokens.ts b/src/resources/user/tokens/tokens.ts index 9f9e3ddc28..02e0e6fcae 100644 --- a/src/resources/user/tokens/tokens.ts +++ b/src/resources/user/tokens/tokens.ts @@ -36,7 +36,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: {}, * }, * ], * }); @@ -66,7 +66,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: {}, * }, * ], * }, diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts index 6fe6d05afa..0f8b5816e9 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts @@ -96,6 +96,16 @@ export interface ContentUpdateParams { */ metadata: WorkersAPI.WorkerMetadataParam; + /** + * Body param: An array of modules (often JavaScript files) comprising a Worker + * script. At least one module must be present and referenced in the metadata as + * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: + * `application/javascript+module`, `text/javascript+module`, + * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/octet-stream`, `application/source-map`. + */ + files?: Array; + /** * Header param: The multipart name of a script upload part containing script * content in service worker format. Alternative to including in a metadata part. @@ -107,8 +117,6 @@ export interface ContentUpdateParams { * content in es module format. Alternative to including in a metadata part. */ 'CF-WORKER-MAIN-MODULE-PART'?: string; - - [k: string]: Array | string | WorkersAPI.WorkerMetadataParam | undefined; } export interface ContentGetParams { diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index 5d38a78b6c..2c2abe754d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -77,12 +77,12 @@ export class Scripts extends APIResource { params: ScriptUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id, files, ...body } = params; + const { account_id, ...body } = params; return ( this._client.put( `/accounts/${account_id}/workers/dispatch/namespaces/${dispatchNamespace}/scripts/${scriptName}`, Core.maybeMultipartFormRequestOptions({ - body: { ...body, ...files }, + body, ...options, __multipartSyntax: 'json', headers: { 'Content-Type': 'application/javascript', ...options?.headers }, @@ -276,7 +276,15 @@ export interface ScriptUpdateParams { */ metadata: ScriptUpdateParams.Metadata; - files?: { [key: string]: Core.Uploadable }; + /** + * Body param: An array of modules (often JavaScript files) comprising a Worker + * script. At least one module must be present and referenced in the metadata as + * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: + * `application/javascript+module`, `text/javascript+module`, + * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/octet-stream`, `application/source-map`. + */ + files?: Array; } export namespace ScriptUpdateParams { diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts index 7bfd4eecba..effe0197c6 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/settings.ts @@ -118,11 +118,6 @@ export interface SettingEditResponse { */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: WorkersAPI.SingleStepMigration | SettingEditResponse.WorkersMultipleStepMigrations; - /** * Observability settings for the Worker. */ @@ -620,24 +615,6 @@ export namespace SettingEditResponse { cpu_ms?: number; } - export interface WorkersMultipleStepMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - /** * Observability settings for the Worker. */ @@ -751,11 +728,6 @@ export interface SettingGetResponse { */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: WorkersAPI.SingleStepMigration | SettingGetResponse.WorkersMultipleStepMigrations; - /** * Observability settings for the Worker. */ @@ -1253,24 +1225,6 @@ export namespace SettingGetResponse { cpu_ms?: number; } - export interface WorkersMultipleStepMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - /** * Observability settings for the Worker. */ diff --git a/src/resources/workers/scripts/content.ts b/src/resources/workers/scripts/content.ts index 8aa1715764..156a51bc22 100644 --- a/src/resources/workers/scripts/content.ts +++ b/src/resources/workers/scripts/content.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as WorkersAPI from '../workers'; import * as ScriptsAPI from './scripts'; import { type Response } from '../../../_shims/index'; @@ -88,7 +87,17 @@ export interface ContentUpdateParams { * Body param: JSON encoded metadata about the uploaded parts and Worker * configuration. */ - metadata: WorkersAPI.WorkerMetadataParam; + metadata: ContentUpdateParams.Metadata; + + /** + * Body param: An array of modules (often JavaScript files) comprising a Worker + * script. At least one module must be present and referenced in the metadata as + * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: + * `application/javascript+module`, `text/javascript+module`, + * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/octet-stream`, `application/source-map`. + */ + files?: Array; /** * Header param: The multipart name of a script upload part containing script @@ -101,8 +110,25 @@ export interface ContentUpdateParams { * content in es module format. Alternative to including in a metadata part. */ 'CF-WORKER-MAIN-MODULE-PART'?: string; +} - [k: string]: Array | string | WorkersAPI.WorkerMetadataParam | undefined; +export namespace ContentUpdateParams { + /** + * JSON encoded metadata about the uploaded parts and Worker configuration. + */ + export interface Metadata { + /** + * Name of the uploaded file that contains the Worker script (e.g. the file adding + * a listener to the `fetch` event). Indicates a `service worker syntax` Worker. + */ + body_part?: string; + + /** + * Name of the uploaded file that contains the main module (e.g. the file exporting + * a `fetch` handler). Indicates a `module syntax` Worker. + */ + main_module?: string; + } } export interface ContentGetParams { diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index 061a0ef777..50a590fb9a 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as DeploymentsAPI from './deployments'; export class Deployments extends APIResource { /** @@ -23,7 +22,7 @@ export class Deployments extends APIResource { * { * percentage: 100, * version_id: - * 'bcf48806-b317-4351-9ee7-36e7d557d4de', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }, * ], * }, @@ -73,34 +72,20 @@ export class Deployments extends APIResource { } } -export interface Deployment { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; -} +export interface DeploymentCreateResponse { + id: string; -export interface DeploymentParam { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; -} + created_on: string; + + source: string; -export interface DeploymentCreateResponse { strategy: 'percentage'; versions: Array; - id?: string; - - annotations?: Deployment; + annotations?: DeploymentCreateResponse.Annotations; author_email?: string; - - created_on?: string; - - source?: string; } export namespace DeploymentCreateResponse { @@ -109,27 +94,34 @@ export namespace DeploymentCreateResponse { version_id: string; } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + } } export interface DeploymentGetResponse { - deployments?: Array; + deployments: Array; } export namespace DeploymentGetResponse { export interface Deployment { - strategy: 'percentage'; + id: string; - versions: Array; + created_on: string; - id?: string; + source: string; - annotations?: DeploymentsAPI.Deployment; + strategy: 'percentage'; - author_email?: string; + versions: Array; - created_on?: string; + annotations?: Deployment.Annotations; - source?: string; + author_email?: string; } export namespace Deployment { @@ -138,6 +130,13 @@ export namespace DeploymentGetResponse { version_id: string; } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + } } } @@ -167,7 +166,7 @@ export interface DeploymentCreateParams { /** * Body param: */ - annotations?: DeploymentParam; + annotations?: DeploymentCreateParams.Annotations; } export namespace DeploymentCreateParams { @@ -176,6 +175,13 @@ export namespace DeploymentCreateParams { version_id: string; } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + } } export interface DeploymentGetParams { @@ -187,7 +193,6 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type Deployment as Deployment, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 938605d972..1c8290db5c 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,7 +4,6 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type Deployment, type DeploymentCreateResponse, type DeploymentGetResponse, type DeploymentCreateParams, diff --git a/src/resources/workers/scripts/script-and-version-settings.ts b/src/resources/workers/scripts/script-and-version-settings.ts index 407d9c43e5..3472e778f1 100644 --- a/src/resources/workers/scripts/script-and-version-settings.ts +++ b/src/resources/workers/scripts/script-and-version-settings.ts @@ -114,13 +114,6 @@ export interface ScriptAndVersionSettingEditResponse { */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: - | WorkersAPI.SingleStepMigration - | ScriptAndVersionSettingEditResponse.WorkersMultipleStepMigrations; - /** * Observability settings for the Worker. */ @@ -618,24 +611,6 @@ export namespace ScriptAndVersionSettingEditResponse { cpu_ms?: number; } - export interface WorkersMultipleStepMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - /** * Observability settings for the Worker. */ @@ -749,13 +724,6 @@ export interface ScriptAndVersionSettingGetResponse { */ logpush?: boolean; - /** - * Migrations to apply for Durable Objects associated with this Worker. - */ - migrations?: - | WorkersAPI.SingleStepMigration - | ScriptAndVersionSettingGetResponse.WorkersMultipleStepMigrations; - /** * Observability settings for the Worker. */ @@ -1253,24 +1221,6 @@ export namespace ScriptAndVersionSettingGetResponse { cpu_ms?: number; } - export interface WorkersMultipleStepMigrations { - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * Migrations to apply in order. - */ - steps?: Array; - } - /** * Observability settings for the Worker. */ diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 684ea4d3f0..5eb0fca4aa 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,7 +7,6 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { - Deployment, DeploymentCreateParams, DeploymentCreateResponse, DeploymentGetParams, @@ -115,12 +114,12 @@ export class Scripts extends APIResource { params: ScriptUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id, files, ...body } = params; + const { account_id, ...body } = params; return ( this._client.put( `/accounts/${account_id}/workers/scripts/${scriptName}`, Core.maybeMultipartFormRequestOptions({ - body: { ...body, ...files }, + body, ...options, __multipartSyntax: 'json', headers: { 'Content-Type': 'application/javascript', ...options?.headers }, @@ -457,7 +456,15 @@ export interface ScriptUpdateParams { */ metadata: ScriptUpdateParams.Metadata; - files?: { [key: string]: Core.Uploadable }; + /** + * Body param: An array of modules (often JavaScript files) comprising a Worker + * script. At least one module must be present and referenced in the metadata as + * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: + * `application/javascript+module`, `text/javascript+module`, + * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/octet-stream`, `application/source-map`. + */ + files?: Array; } export namespace ScriptUpdateParams { @@ -1290,7 +1297,6 @@ export declare namespace Scripts { export { Deployments as Deployments, - type Deployment as Deployment, type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index c6269a0421..7ed14199a1 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -107,7 +107,36 @@ export interface VersionCreateResponse { export namespace VersionCreateResponse { export interface Resources { - bindings?: Resources.Bindings; + /** + * List of bindings attached to a Worker. You can find more about bindings on our + * docs: + * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + */ + bindings?: Array< + | Resources.WorkersBindingKindAI + | Resources.WorkersBindingKindAnalyticsEngine + | Resources.WorkersBindingKindAssets + | Resources.WorkersBindingKindBrowser + | Resources.WorkersBindingKindD1 + | Resources.WorkersBindingKindDispatchNamespace + | Resources.WorkersBindingKindDurableObjectNamespace + | Resources.WorkersBindingKindHyperdrive + | Resources.WorkersBindingKindJson + | Resources.WorkersBindingKindKVNamespace + | Resources.WorkersBindingKindMTLSCertificate + | Resources.WorkersBindingKindPlainText + | Resources.WorkersBindingKindPipelines + | Resources.WorkersBindingKindQueue + | Resources.WorkersBindingKindR2Bucket + | Resources.WorkersBindingKindSecretText + | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer + | Resources.WorkersBindingKindVectorize + | Resources.WorkersBindingKindVersionMetadata + | Resources.WorkersBindingKindSecretsStoreSecret + | Resources.WorkersBindingKindSecretKey + | Resources.WorkersBindingKindWorkflow + >; script?: Resources.Script; @@ -115,498 +144,463 @@ export namespace VersionCreateResponse { } export namespace Resources { - export interface Bindings { - /** - * List of bindings attached to a Worker. You can find more about bindings on our - * docs: - * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - */ - result?: Array< - | Bindings.WorkersBindingKindAI - | Bindings.WorkersBindingKindAnalyticsEngine - | Bindings.WorkersBindingKindAssets - | Bindings.WorkersBindingKindBrowser - | Bindings.WorkersBindingKindD1 - | Bindings.WorkersBindingKindDispatchNamespace - | Bindings.WorkersBindingKindDurableObjectNamespace - | Bindings.WorkersBindingKindHyperdrive - | Bindings.WorkersBindingKindJson - | Bindings.WorkersBindingKindKVNamespace - | Bindings.WorkersBindingKindMTLSCertificate - | Bindings.WorkersBindingKindPlainText - | Bindings.WorkersBindingKindPipelines - | Bindings.WorkersBindingKindQueue - | Bindings.WorkersBindingKindR2Bucket - | Bindings.WorkersBindingKindSecretText - | Bindings.WorkersBindingKindService - | Bindings.WorkersBindingKindTailConsumer - | Bindings.WorkersBindingKindVectorize - | Bindings.WorkersBindingKindVersionMetadata - | Bindings.WorkersBindingKindSecretsStoreSecret - | Bindings.WorkersBindingKindSecretKey - | Bindings.WorkersBindingKindWorkflow - >; + export interface WorkersBindingKindAI { + /** + * A JavaScript variable name for the binding. + */ + name: string; + + /** + * The kind of resource that the binding provides. + */ + type: 'ai'; } - export namespace Bindings { - export interface WorkersBindingKindAI { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindAnalyticsEngine { + /** + * The name of the dataset to bind to. + */ + dataset: string; - /** - * The kind of resource that the binding provides. - */ - type: 'ai'; - } + /** + * A JavaScript variable name for the binding. + */ + name: string; - export interface WorkersBindingKindAnalyticsEngine { - /** - * The name of the dataset to bind to. - */ - dataset: string; + /** + * The kind of resource that the binding provides. + */ + type: 'analytics_engine'; + } - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindAssets { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'analytics_engine'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'assets'; + } - export interface WorkersBindingKindAssets { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindBrowser { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'assets'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'browser'; + } - export interface WorkersBindingKindBrowser { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindD1 { + /** + * Identifier of the D1 database to bind to. + */ + id: string; - /** - * The kind of resource that the binding provides. - */ - type: 'browser'; - } + /** + * A JavaScript variable name for the binding. + */ + name: string; - export interface WorkersBindingKindD1 { - /** - * Identifier of the D1 database to bind to. - */ - id: string; + /** + * The kind of resource that the binding provides. + */ + type: 'd1'; + } - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindDispatchNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'd1'; - } + /** + * Namespace to bind to. + */ + namespace: string; - export interface WorkersBindingKindDispatchNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'dispatch_namespace'; - /** - * Namespace to bind to. - */ - namespace: string; + /** + * Outbound worker. + */ + outbound?: WorkersBindingKindDispatchNamespace.Outbound; + } + export namespace WorkersBindingKindDispatchNamespace { + /** + * Outbound worker. + */ + export interface Outbound { /** - * The kind of resource that the binding provides. + * Pass information from the Dispatch Worker to the Outbound Worker through the + * parameters. */ - type: 'dispatch_namespace'; + params?: Array; /** * Outbound worker. */ - outbound?: WorkersBindingKindDispatchNamespace.Outbound; + worker?: Outbound.Worker; } - export namespace WorkersBindingKindDispatchNamespace { + export namespace Outbound { /** * Outbound worker. */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters. - */ - params?: Array; - + export interface Worker { /** - * Outbound worker. + * Environment of the outbound worker. */ - worker?: Outbound.Worker; - } + environment?: string; - export namespace Outbound { /** - * Outbound worker. + * Name of the outbound worker. */ - export interface Worker { - /** - * Environment of the outbound worker. - */ - environment?: string; - - /** - * Name of the outbound worker. - */ - service?: string; - } + service?: string; } } + } - export interface WorkersBindingKindDurableObjectNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindDurableObjectNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'durable_object_namespace'; + /** + * The kind of resource that the binding provides. + */ + type: 'durable_object_namespace'; - /** - * The exported class name of the Durable Object. - */ - class_name?: string; + /** + * The exported class name of the Durable Object. + */ + class_name?: string; - /** - * The environment of the script_name to bind to. - */ - environment?: string; + /** + * The environment of the script_name to bind to. + */ + environment?: string; - /** - * Namespace identifier tag. - */ - namespace_id?: string; + /** + * Namespace identifier tag. + */ + namespace_id?: string; - /** - * The script where the Durable Object is defined, if it is external to this - * Worker. - */ - script_name?: string; - } + /** + * The script where the Durable Object is defined, if it is external to this + * Worker. + */ + script_name?: string; + } - export interface WorkersBindingKindHyperdrive { - /** - * Identifier of the Hyperdrive connection to bind to. - */ - id: string; + export interface WorkersBindingKindHyperdrive { + /** + * Identifier of the Hyperdrive connection to bind to. + */ + id: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'hyperdrive'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'hyperdrive'; + } - export interface WorkersBindingKindJson { - /** - * JSON data to use. - */ - json: string; + export interface WorkersBindingKindJson { + /** + * JSON data to use. + */ + json: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'json'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'json'; + } - export interface WorkersBindingKindKVNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindKVNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Namespace identifier tag. - */ - namespace_id: string; + /** + * Namespace identifier tag. + */ + namespace_id: string; - /** - * The kind of resource that the binding provides. - */ - type: 'kv_namespace'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'kv_namespace'; + } - export interface WorkersBindingKindMTLSCertificate { - /** - * Identifier of the certificate to bind to. - */ - certificate_id: string; + export interface WorkersBindingKindMTLSCertificate { + /** + * Identifier of the certificate to bind to. + */ + certificate_id: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'mtls_certificate'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'mtls_certificate'; + } - export interface WorkersBindingKindPlainText { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindPlainText { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The text value to use. - */ - text: string; + /** + * The text value to use. + */ + text: string; - /** - * The kind of resource that the binding provides. - */ - type: 'plain_text'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'plain_text'; + } - export interface WorkersBindingKindPipelines { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindPipelines { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the Pipeline to bind to. - */ - pipeline: string; + /** + * Name of the Pipeline to bind to. + */ + pipeline: string; - /** - * The kind of resource that the binding provides. - */ - type: 'pipelines'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'pipelines'; + } - export interface WorkersBindingKindQueue { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindQueue { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the Queue to bind to. - */ - queue_name: string; + /** + * Name of the Queue to bind to. + */ + queue_name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'queue'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'queue'; + } - export interface WorkersBindingKindR2Bucket { - /** - * R2 bucket to bind to. - */ - bucket_name: string; + export interface WorkersBindingKindR2Bucket { + /** + * R2 bucket to bind to. + */ + bucket_name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'r2_bucket'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'r2_bucket'; + } - export interface WorkersBindingKindSecretText { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindSecretText { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secret_text'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'secret_text'; + } - export interface WorkersBindingKindService { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; + export interface WorkersBindingKindService { + /** + * Optional environment if the Worker utilizes one. + */ + environment: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of Worker to bind to. - */ - service: string; + /** + * Name of Worker to bind to. + */ + service: string; - /** - * The kind of resource that the binding provides. - */ - type: 'service'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'service'; + } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of Tail Worker to bind to. - */ - service: string; + /** + * Name of Tail Worker to bind to. + */ + service: string; - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } - export interface WorkersBindingKindVectorize { - /** - * Name of the Vectorize index to bind to. - */ - index_name: string; + export interface WorkersBindingKindVectorize { + /** + * Name of the Vectorize index to bind to. + */ + index_name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'vectorize'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'vectorize'; + } - export interface WorkersBindingKindVersionMetadata { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindVersionMetadata { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'version_metadata'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'version_metadata'; + } - export interface WorkersBindingKindSecretsStoreSecret { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindSecretsStoreSecret { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the secret in the store. - */ - secret_name: string; + /** + * Name of the secret in the store. + */ + secret_name: string; - /** - * ID of the store containing the secret. - */ - store_id: string; + /** + * ID of the store containing the secret. + */ + store_id: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secrets_store_secret'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'secrets_store_secret'; + } - export interface WorkersBindingKindSecretKey { - /** - * Algorithm-specific key parameters. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). - */ - algorithm: unknown; + export interface WorkersBindingKindSecretKey { + /** + * Algorithm-specific key parameters. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). + */ + algorithm: unknown; - /** - * Data format of the key. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). - */ - format: 'raw' | 'pkcs8' | 'spki' | 'jwk'; + /** + * Data format of the key. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). + */ + format: 'raw' | 'pkcs8' | 'spki' | 'jwk'; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secret_key'; + /** + * The kind of resource that the binding provides. + */ + type: 'secret_key'; - /** - * Allowed operations with the key. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). - */ - usages: Array< - 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'deriveKey' | 'deriveBits' | 'wrapKey' | 'unwrapKey' - >; - } + /** + * Allowed operations with the key. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). + */ + usages: Array< + 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'deriveKey' | 'deriveBits' | 'wrapKey' | 'unwrapKey' + >; + } - export interface WorkersBindingKindWorkflow { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindWorkflow { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'workflow'; + /** + * The kind of resource that the binding provides. + */ + type: 'workflow'; - /** - * Name of the Workflow to bind to. - */ - workflow_name: string; + /** + * Name of the Workflow to bind to. + */ + workflow_name: string; - /** - * Class name of the Workflow. Should only be provided if the Workflow belongs to - * this script. - */ - class_name?: string; + /** + * Class name of the Workflow. Should only be provided if the Workflow belongs to + * this script. + */ + class_name?: string; - /** - * Script name that contains the Workflow. If not provided, defaults to this script - * name. - */ - script_name?: string; - } + /** + * Script name that contains the Workflow. If not provided, defaults to this script + * name. + */ + script_name?: string; } export interface Script { @@ -717,7 +711,36 @@ export interface VersionGetResponse { export namespace VersionGetResponse { export interface Resources { - bindings?: Resources.Bindings; + /** + * List of bindings attached to a Worker. You can find more about bindings on our + * docs: + * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. + */ + bindings?: Array< + | Resources.WorkersBindingKindAI + | Resources.WorkersBindingKindAnalyticsEngine + | Resources.WorkersBindingKindAssets + | Resources.WorkersBindingKindBrowser + | Resources.WorkersBindingKindD1 + | Resources.WorkersBindingKindDispatchNamespace + | Resources.WorkersBindingKindDurableObjectNamespace + | Resources.WorkersBindingKindHyperdrive + | Resources.WorkersBindingKindJson + | Resources.WorkersBindingKindKVNamespace + | Resources.WorkersBindingKindMTLSCertificate + | Resources.WorkersBindingKindPlainText + | Resources.WorkersBindingKindPipelines + | Resources.WorkersBindingKindQueue + | Resources.WorkersBindingKindR2Bucket + | Resources.WorkersBindingKindSecretText + | Resources.WorkersBindingKindService + | Resources.WorkersBindingKindTailConsumer + | Resources.WorkersBindingKindVectorize + | Resources.WorkersBindingKindVersionMetadata + | Resources.WorkersBindingKindSecretsStoreSecret + | Resources.WorkersBindingKindSecretKey + | Resources.WorkersBindingKindWorkflow + >; script?: Resources.Script; @@ -725,498 +748,463 @@ export namespace VersionGetResponse { } export namespace Resources { - export interface Bindings { - /** - * List of bindings attached to a Worker. You can find more about bindings on our - * docs: - * https://developers.cloudflare.com/workers/configuration/multipart-upload-metadata/#bindings. - */ - result?: Array< - | Bindings.WorkersBindingKindAI - | Bindings.WorkersBindingKindAnalyticsEngine - | Bindings.WorkersBindingKindAssets - | Bindings.WorkersBindingKindBrowser - | Bindings.WorkersBindingKindD1 - | Bindings.WorkersBindingKindDispatchNamespace - | Bindings.WorkersBindingKindDurableObjectNamespace - | Bindings.WorkersBindingKindHyperdrive - | Bindings.WorkersBindingKindJson - | Bindings.WorkersBindingKindKVNamespace - | Bindings.WorkersBindingKindMTLSCertificate - | Bindings.WorkersBindingKindPlainText - | Bindings.WorkersBindingKindPipelines - | Bindings.WorkersBindingKindQueue - | Bindings.WorkersBindingKindR2Bucket - | Bindings.WorkersBindingKindSecretText - | Bindings.WorkersBindingKindService - | Bindings.WorkersBindingKindTailConsumer - | Bindings.WorkersBindingKindVectorize - | Bindings.WorkersBindingKindVersionMetadata - | Bindings.WorkersBindingKindSecretsStoreSecret - | Bindings.WorkersBindingKindSecretKey - | Bindings.WorkersBindingKindWorkflow - >; - } + export interface WorkersBindingKindAI { + /** + * A JavaScript variable name for the binding. + */ + name: string; - export namespace Bindings { - export interface WorkersBindingKindAI { - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'ai'; + } - /** - * The kind of resource that the binding provides. - */ - type: 'ai'; - } + export interface WorkersBindingKindAnalyticsEngine { + /** + * The name of the dataset to bind to. + */ + dataset: string; - export interface WorkersBindingKindAnalyticsEngine { - /** - * The name of the dataset to bind to. - */ - dataset: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'analytics_engine'; + } - /** - * The kind of resource that the binding provides. - */ - type: 'analytics_engine'; - } + export interface WorkersBindingKindAssets { + /** + * A JavaScript variable name for the binding. + */ + name: string; - export interface WorkersBindingKindAssets { - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'assets'; + } - /** - * The kind of resource that the binding provides. - */ - type: 'assets'; - } + export interface WorkersBindingKindBrowser { + /** + * A JavaScript variable name for the binding. + */ + name: string; - export interface WorkersBindingKindBrowser { - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'browser'; + } - /** - * The kind of resource that the binding provides. - */ - type: 'browser'; - } + export interface WorkersBindingKindD1 { + /** + * Identifier of the D1 database to bind to. + */ + id: string; - export interface WorkersBindingKindD1 { - /** - * Identifier of the D1 database to bind to. - */ - id: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * The kind of resource that the binding provides. + */ + type: 'd1'; + } - /** - * The kind of resource that the binding provides. - */ - type: 'd1'; - } + export interface WorkersBindingKindDispatchNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - export interface WorkersBindingKindDispatchNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * Namespace to bind to. + */ + namespace: string; - /** - * Namespace to bind to. - */ - namespace: string; + /** + * The kind of resource that the binding provides. + */ + type: 'dispatch_namespace'; + + /** + * Outbound worker. + */ + outbound?: WorkersBindingKindDispatchNamespace.Outbound; + } + export namespace WorkersBindingKindDispatchNamespace { + /** + * Outbound worker. + */ + export interface Outbound { /** - * The kind of resource that the binding provides. + * Pass information from the Dispatch Worker to the Outbound Worker through the + * parameters. */ - type: 'dispatch_namespace'; + params?: Array; /** * Outbound worker. */ - outbound?: WorkersBindingKindDispatchNamespace.Outbound; + worker?: Outbound.Worker; } - export namespace WorkersBindingKindDispatchNamespace { + export namespace Outbound { /** * Outbound worker. */ - export interface Outbound { - /** - * Pass information from the Dispatch Worker to the Outbound Worker through the - * parameters. - */ - params?: Array; - + export interface Worker { /** - * Outbound worker. + * Environment of the outbound worker. */ - worker?: Outbound.Worker; - } + environment?: string; - export namespace Outbound { /** - * Outbound worker. + * Name of the outbound worker. */ - export interface Worker { - /** - * Environment of the outbound worker. - */ - environment?: string; - - /** - * Name of the outbound worker. - */ - service?: string; - } + service?: string; } } + } - export interface WorkersBindingKindDurableObjectNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindDurableObjectNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'durable_object_namespace'; + /** + * The kind of resource that the binding provides. + */ + type: 'durable_object_namespace'; - /** - * The exported class name of the Durable Object. - */ - class_name?: string; + /** + * The exported class name of the Durable Object. + */ + class_name?: string; - /** - * The environment of the script_name to bind to. - */ - environment?: string; + /** + * The environment of the script_name to bind to. + */ + environment?: string; - /** - * Namespace identifier tag. - */ - namespace_id?: string; + /** + * Namespace identifier tag. + */ + namespace_id?: string; - /** - * The script where the Durable Object is defined, if it is external to this - * Worker. - */ - script_name?: string; - } + /** + * The script where the Durable Object is defined, if it is external to this + * Worker. + */ + script_name?: string; + } - export interface WorkersBindingKindHyperdrive { - /** - * Identifier of the Hyperdrive connection to bind to. - */ - id: string; + export interface WorkersBindingKindHyperdrive { + /** + * Identifier of the Hyperdrive connection to bind to. + */ + id: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'hyperdrive'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'hyperdrive'; + } - export interface WorkersBindingKindJson { - /** - * JSON data to use. - */ - json: string; + export interface WorkersBindingKindJson { + /** + * JSON data to use. + */ + json: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'json'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'json'; + } - export interface WorkersBindingKindKVNamespace { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindKVNamespace { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Namespace identifier tag. - */ - namespace_id: string; + /** + * Namespace identifier tag. + */ + namespace_id: string; - /** - * The kind of resource that the binding provides. - */ - type: 'kv_namespace'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'kv_namespace'; + } - export interface WorkersBindingKindMTLSCertificate { - /** - * Identifier of the certificate to bind to. - */ - certificate_id: string; + export interface WorkersBindingKindMTLSCertificate { + /** + * Identifier of the certificate to bind to. + */ + certificate_id: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'mtls_certificate'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'mtls_certificate'; + } - export interface WorkersBindingKindPlainText { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindPlainText { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The text value to use. - */ - text: string; + /** + * The text value to use. + */ + text: string; - /** - * The kind of resource that the binding provides. - */ - type: 'plain_text'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'plain_text'; + } - export interface WorkersBindingKindPipelines { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindPipelines { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the Pipeline to bind to. - */ - pipeline: string; + /** + * Name of the Pipeline to bind to. + */ + pipeline: string; - /** - * The kind of resource that the binding provides. - */ - type: 'pipelines'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'pipelines'; + } - export interface WorkersBindingKindQueue { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindQueue { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the Queue to bind to. - */ - queue_name: string; + /** + * Name of the Queue to bind to. + */ + queue_name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'queue'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'queue'; + } - export interface WorkersBindingKindR2Bucket { - /** - * R2 bucket to bind to. - */ - bucket_name: string; + export interface WorkersBindingKindR2Bucket { + /** + * R2 bucket to bind to. + */ + bucket_name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'r2_bucket'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'r2_bucket'; + } - export interface WorkersBindingKindSecretText { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindSecretText { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secret_text'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'secret_text'; + } - export interface WorkersBindingKindService { - /** - * Optional environment if the Worker utilizes one. - */ - environment: string; + export interface WorkersBindingKindService { + /** + * Optional environment if the Worker utilizes one. + */ + environment: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of Worker to bind to. - */ - service: string; + /** + * Name of Worker to bind to. + */ + service: string; - /** - * The kind of resource that the binding provides. - */ - type: 'service'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'service'; + } - export interface WorkersBindingKindTailConsumer { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindTailConsumer { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of Tail Worker to bind to. - */ - service: string; + /** + * Name of Tail Worker to bind to. + */ + service: string; - /** - * The kind of resource that the binding provides. - */ - type: 'tail_consumer'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'tail_consumer'; + } - export interface WorkersBindingKindVectorize { - /** - * Name of the Vectorize index to bind to. - */ - index_name: string; + export interface WorkersBindingKindVectorize { + /** + * Name of the Vectorize index to bind to. + */ + index_name: string; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'vectorize'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'vectorize'; + } - export interface WorkersBindingKindVersionMetadata { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindVersionMetadata { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'version_metadata'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'version_metadata'; + } - export interface WorkersBindingKindSecretsStoreSecret { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindSecretsStoreSecret { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * Name of the secret in the store. - */ - secret_name: string; + /** + * Name of the secret in the store. + */ + secret_name: string; - /** - * ID of the store containing the secret. - */ - store_id: string; + /** + * ID of the store containing the secret. + */ + store_id: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secrets_store_secret'; - } + /** + * The kind of resource that the binding provides. + */ + type: 'secrets_store_secret'; + } - export interface WorkersBindingKindSecretKey { - /** - * Algorithm-specific key parameters. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). - */ - algorithm: unknown; + export interface WorkersBindingKindSecretKey { + /** + * Algorithm-specific key parameters. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#algorithm). + */ + algorithm: unknown; - /** - * Data format of the key. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). - */ - format: 'raw' | 'pkcs8' | 'spki' | 'jwk'; + /** + * Data format of the key. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#format). + */ + format: 'raw' | 'pkcs8' | 'spki' | 'jwk'; - /** - * A JavaScript variable name for the binding. - */ - name: string; + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'secret_key'; + /** + * The kind of resource that the binding provides. + */ + type: 'secret_key'; - /** - * Allowed operations with the key. - * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). - */ - usages: Array< - 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'deriveKey' | 'deriveBits' | 'wrapKey' | 'unwrapKey' - >; - } + /** + * Allowed operations with the key. + * [Learn more](https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/importKey#keyUsages). + */ + usages: Array< + 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'deriveKey' | 'deriveBits' | 'wrapKey' | 'unwrapKey' + >; + } - export interface WorkersBindingKindWorkflow { - /** - * A JavaScript variable name for the binding. - */ - name: string; + export interface WorkersBindingKindWorkflow { + /** + * A JavaScript variable name for the binding. + */ + name: string; - /** - * The kind of resource that the binding provides. - */ - type: 'workflow'; + /** + * The kind of resource that the binding provides. + */ + type: 'workflow'; - /** - * Name of the Workflow to bind to. - */ - workflow_name: string; + /** + * Name of the Workflow to bind to. + */ + workflow_name: string; - /** - * Class name of the Workflow. Should only be provided if the Workflow belongs to - * this script. - */ - class_name?: string; + /** + * Class name of the Workflow. Should only be provided if the Workflow belongs to + * this script. + */ + class_name?: string; - /** - * Script name that contains the Workflow. If not provided, defaults to this script - * name. - */ - script_name?: string; - } + /** + * Script name that contains the Workflow. If not provided, defaults to this script + * name. + */ + script_name?: string; } export interface Script { @@ -1293,7 +1281,15 @@ export interface VersionCreateParams { */ metadata: VersionCreateParams.Metadata; - [k: string]: Array | string | VersionCreateParams.Metadata | undefined; + /** + * Body param: An array of modules (often JavaScript files) comprising a Worker + * script. At least one module must be present and referenced in the metadata as + * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: + * `application/javascript+module`, `text/javascript+module`, + * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/octet-stream`, `application/source-map`. + */ + files?: Array; } export namespace VersionCreateParams { @@ -1302,9 +1298,9 @@ export namespace VersionCreateParams { */ export interface Metadata { /** - * Name of the part in the multipart request that contains the main module (e.g. - * the file exporting a `fetch` handler). Indicates a `module syntax` Worker, which - * is required for Version Upload. + * Name of the uploaded file that contains the main module (e.g. the file exporting + * a `fetch` handler). Indicates a `module syntax` Worker, which is required for + * Version Upload. */ main_module: string; diff --git a/src/resources/zero-trust/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index 6fcb92daab..d07d5c870a 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -5631,7 +5631,7 @@ export namespace ApplicationCreateResponse { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. @@ -8919,7 +8919,7 @@ export namespace ApplicationUpdateResponse { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. @@ -12207,7 +12207,7 @@ export namespace ApplicationListResponse { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. @@ -15502,7 +15502,7 @@ export namespace ApplicationGetResponse { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. @@ -18596,7 +18596,7 @@ export declare namespace ApplicationCreateParams { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. @@ -21671,7 +21671,7 @@ export declare namespace ApplicationUpdateParams { /** * The communication protocol your application secures. */ - protocol: 'SSH'; + protocol: 'RDP'; /** * Contains a map of target attribute keys to target attribute values. diff --git a/src/resources/zero-trust/access/applications/policies.ts b/src/resources/zero-trust/access/applications/policies.ts index cf5717f666..40bb6d497e 100644 --- a/src/resources/zero-trust/access/applications/policies.ts +++ b/src/resources/zero-trust/access/applications/policies.ts @@ -330,7 +330,8 @@ export type AccessRule = | OktaGroupRule | SAMLGroupRule | AccessRule.AccessOIDCClaimRule - | ServiceTokenRule; + | ServiceTokenRule + | AccessRule.AccessLinkedAppTokenRule; export namespace AccessRule { /** @@ -416,6 +417,23 @@ export namespace AccessRule { identity_provider_id: string; } } + + /** + * Matches OAuth 2.0 access tokens issued by the specified Access OIDC SaaS + * application. Only compatible with non_identity and bypass decisions. + */ + export interface AccessLinkedAppTokenRule { + linked_app_token: AccessLinkedAppTokenRule.LinkedAppToken; + } + + export namespace AccessLinkedAppTokenRule { + export interface LinkedAppToken { + /** + * The ID of an Access OIDC SaaS application + */ + app_uid: string; + } + } } /** @@ -444,7 +462,8 @@ export type AccessRuleParam = | OktaGroupRuleParam | SAMLGroupRuleParam | AccessRuleParam.AccessOIDCClaimRule - | ServiceTokenRuleParam; + | ServiceTokenRuleParam + | AccessRuleParam.AccessLinkedAppTokenRule; export namespace AccessRuleParam { /** @@ -530,6 +549,23 @@ export namespace AccessRuleParam { identity_provider_id: string; } } + + /** + * Matches OAuth 2.0 access tokens issued by the specified Access OIDC SaaS + * application. Only compatible with non_identity and bypass decisions. + */ + export interface AccessLinkedAppTokenRule { + linked_app_token: AccessLinkedAppTokenRule.LinkedAppToken; + } + + export namespace AccessLinkedAppTokenRule { + export interface LinkedAppToken { + /** + * The ID of an Access OIDC SaaS application + */ + app_uid: string; + } + } } /** diff --git a/src/resources/zero-trust/dlp/entries/integration.ts b/src/resources/zero-trust/dlp/entries/integration.ts index bf8fedef54..dea046096c 100644 --- a/src/resources/zero-trust/dlp/entries/integration.ts +++ b/src/resources/zero-trust/dlp/entries/integration.ts @@ -5,7 +5,8 @@ import * as Core from '../../../../core'; export class Integration extends APIResource { /** - * This will update an existing integration entry + * Integration entries can't be created, this will update an existing integration + * entry This is needed for our generated terraform API * * @example * ```ts diff --git a/src/resources/zero-trust/dlp/entries/predefined.ts b/src/resources/zero-trust/dlp/entries/predefined.ts index e1749f4cf5..33e9fc2670 100644 --- a/src/resources/zero-trust/dlp/entries/predefined.ts +++ b/src/resources/zero-trust/dlp/entries/predefined.ts @@ -5,7 +5,8 @@ import * as Core from '../../../../core'; export class Predefined extends APIResource { /** - * This will update an existing predefined entry + * Predefined entries can't be created, this will update an existing predefined + * entry This is needed for our generated terraform API * * @example * ```ts diff --git a/src/resources/zero-trust/dlp/profiles/custom.ts b/src/resources/zero-trust/dlp/profiles/custom.ts index b4f412471b..49b7b93d93 100644 --- a/src/resources/zero-trust/dlp/profiles/custom.ts +++ b/src/resources/zero-trust/dlp/profiles/custom.ts @@ -125,12 +125,6 @@ export interface CustomProfile { */ allowed_match_count: number; - /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. - */ - context_awareness: ProfilesAPI.ContextAwareness; - /** * When the profile was created. */ @@ -161,6 +155,12 @@ export interface CustomProfile { confidence_threshold?: 'low' | 'medium' | 'high' | 'very_high'; + /** + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. + */ + context_awareness?: ProfilesAPI.ContextAwareness; + /** * The description of the profile. */ @@ -339,8 +339,8 @@ export interface CustomCreateParams { confidence_threshold?: string | null; /** - * Body param: Scan the context of predefined entries to only return matches - * surrounded by keywords. + * @deprecated Body param: Scan the context of predefined entries to only return + * matches surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwarenessParam; @@ -452,8 +452,8 @@ export interface CustomUpdateParams { confidence_threshold?: string | null; /** - * Body param: Scan the context of predefined entries to only return matches - * surrounded by keywords. + * @deprecated Body param: Scan the context of predefined entries to only return + * matches surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwarenessParam; diff --git a/src/resources/zero-trust/dlp/profiles/predefined.ts b/src/resources/zero-trust/dlp/profiles/predefined.ts index 1d2ddde8fa..debdd0349f 100644 --- a/src/resources/zero-trust/dlp/profiles/predefined.ts +++ b/src/resources/zero-trust/dlp/profiles/predefined.ts @@ -138,8 +138,8 @@ export interface PredefinedProfile { confidence_threshold?: 'low' | 'medium' | 'high' | 'very_high'; /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwareness; @@ -299,8 +299,8 @@ export interface PredefinedCreateParams { confidence_threshold?: string | null; /** - * Body param: Scan the context of predefined entries to only return matches - * surrounded by keywords. + * @deprecated Body param: Scan the context of predefined entries to only return + * matches surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwarenessParam; @@ -345,8 +345,8 @@ export interface PredefinedUpdateParams { confidence_threshold?: string | null; /** - * Body param: Scan the context of predefined entries to only return matches - * surrounded by keywords. + * @deprecated Body param: Scan the context of predefined entries to only return + * matches surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwarenessParam; diff --git a/src/resources/zero-trust/dlp/profiles/profiles.ts b/src/resources/zero-trust/dlp/profiles/profiles.ts index 4f2ddcea1e..a2b3dcd0ba 100644 --- a/src/resources/zero-trust/dlp/profiles/profiles.ts +++ b/src/resources/zero-trust/dlp/profiles/profiles.ts @@ -78,8 +78,8 @@ export class Profiles extends APIResource { export class ProfilesSinglePage extends SinglePage {} /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. */ export interface ContextAwareness { /** @@ -95,8 +95,8 @@ export interface ContextAwareness { } /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. */ export interface ContextAwarenessParam { /** @@ -125,12 +125,6 @@ export namespace Profile { */ allowed_match_count: number; - /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. - */ - context_awareness: ProfilesAPI.ContextAwareness; - /** * When the profile was created. */ @@ -163,6 +157,12 @@ export namespace Profile { confidence_threshold?: 'low' | 'medium' | 'high' | 'very_high'; + /** + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. + */ + context_awareness?: ProfilesAPI.ContextAwareness; + /** * The description of the profile. */ @@ -317,8 +317,8 @@ export namespace Profile { confidence_threshold?: 'low' | 'medium' | 'high' | 'very_high'; /** - * Scan the context of predefined entries to only return matches surrounded by - * keywords. + * @deprecated Scan the context of predefined entries to only return matches + * surrounded by keywords. */ context_awareness?: ProfilesAPI.ContextAwareness; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index ad8e339400..911269463e 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -337,6 +337,11 @@ export interface GatewayRule { */ name?: string; + /** + * The rule cannot be shared via the Orgs API + */ + not_sharable?: boolean; + /** * Precedence sets the order of your rules. Lower values indicate higher * precedence. At each processing phase, applicable rules are evaluated in @@ -346,6 +351,11 @@ export interface GatewayRule { */ precedence?: number; + /** + * The rule was shared via the Orgs API and cannot be edited by the current account + */ + read_only?: boolean; + /** * Additional settings that modify the rule's action. */ @@ -357,6 +367,11 @@ export interface GatewayRule { */ schedule?: Schedule | null; + /** + * account tag of account that created the rule + */ + source_account?: string; + /** * The wirefilter expression used for traffic matching. */ diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts index dba90c7f42..71e6ac5f86 100644 --- a/tests/api-resources/abuse-reports.test.ts +++ b/tests/api-resources/abuse-reports.test.ts @@ -14,10 +14,20 @@ describe('resource abuseReports', () => { test.skip('create: only required params', async () => { const responsePromise = client.abuseReports.create('abuse_general', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - act: 'abuse_general', + act: 'abuse_dmca', + address1: 'x', + agent_name: 'x', + agree: 1, + city: 'x', + country: 'x', email: 'email', email2: 'email2', + host_notification: 'send', name: 'x', + original_work: 'x', + owner_notification: 'send', + signature: 'signature', + state: 'x', urls: 'urls', }); const rawResponse = await responsePromise.asResponse(); @@ -33,36 +43,27 @@ describe('resource abuseReports', () => { test.skip('create: required and optional params', async () => { const response = await client.abuseReports.create('abuse_general', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - act: 'abuse_general', - email: 'email', - email2: 'email2', - name: 'x', - urls: 'urls', + act: 'abuse_dmca', address1: 'x', agent_name: 'x', - agree: 0, + agree: 1, city: 'x', - comments: 'x', - company: 'x', country: 'x', - destination_ips: 'destination_ips', + email: 'email', + email2: 'email2', host_notification: 'send', - justification: 'x', - ncmec_notification: 'send', - ncsei_subject_representation: true, + name: 'x', original_work: 'x', owner_notification: 'send', - ports_protocols: 'ports_protocols', - reported_country: 'xx', - reported_user_agent: 'x', signature: 'signature', - source_ips: 'source_ips', state: 'x', + urls: 'urls', + comments: 'x', + company: 'x', + reported_country: 'xx', + reported_user_agent: 'x', tele: 'x', title: 'x', - trademark_number: 'x', - trademark_office: 'x', - trademark_symbol: 'x', }); }); }); diff --git a/tests/api-resources/accounts/tokens/tokens.test.ts b/tests/api-resources/accounts/tokens/tokens.test.ts index 0248b48cf9..9834e63c9b 100644 --- a/tests/api-resources/accounts/tokens/tokens.test.ts +++ b/tests/api-resources/accounts/tokens/tokens.test.ts @@ -22,7 +22,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: {}, }, ], }); @@ -47,7 +47,14 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { + nested: { + 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { + 'com.cloudflare.api.account.zone.*': '*', + }, + }, + simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, + }, }, ], condition: { @@ -73,7 +80,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: {}, }, ], }); @@ -98,7 +105,14 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { + nested: { + 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { + 'com.cloudflare.api.account.zone.*': '*', + }, + }, + simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, + }, }, ], condition: { diff --git a/tests/api-resources/brand-protection/brand-protection.test.ts b/tests/api-resources/brand-protection/brand-protection.test.ts index e971478004..6591b92297 100644 --- a/tests/api-resources/brand-protection/brand-protection.test.ts +++ b/tests/api-resources/brand-protection/brand-protection.test.ts @@ -11,7 +11,7 @@ const client = new Cloudflare({ describe('resource brandProtection', () => { test('submit: only required params', async () => { - const responsePromise = client.brandProtection.submit({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.brandProtection.submit({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -22,16 +22,11 @@ describe('resource brandProtection', () => { }); test('submit: required and optional params', async () => { - const response = await client.brandProtection.submit({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - url: 'https://www.cloudflare.com', - }); + const response = await client.brandProtection.submit({ account_id: 'x' }); }); test('urlInfo: only required params', async () => { - const responsePromise = client.brandProtection.urlInfo({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.brandProtection.urlInfo({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -42,10 +37,6 @@ describe('resource brandProtection', () => { }); test('urlInfo: required and optional params', async () => { - const response = await client.brandProtection.urlInfo({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - url: ['string'], - url_id: [0], - }); + const response = await client.brandProtection.urlInfo({ account_id: 'x' }); }); }); diff --git a/tests/api-resources/brand-protection/logo-matches.test.ts b/tests/api-resources/brand-protection/logo-matches.test.ts new file mode 100644 index 0000000000..47ffc05601 --- /dev/null +++ b/tests/api-resources/brand-protection/logo-matches.test.ts @@ -0,0 +1,52 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logoMatches', () => { + test('download: only required params', async () => { + const responsePromise = client.brandProtection.logoMatches.download({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('download: required and optional params', async () => { + const response = await client.brandProtection.logoMatches.download({ + account_id: 'x', + limit: 'limit', + logo_id: ['string'], + offset: 'offset', + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.brandProtection.logoMatches.get({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.brandProtection.logoMatches.get({ + account_id: 'x', + limit: 'limit', + logo_id: ['string'], + offset: 'offset', + }); + }); +}); diff --git a/tests/api-resources/brand-protection/logos.test.ts b/tests/api-resources/brand-protection/logos.test.ts new file mode 100644 index 0000000000..ed48c6070a --- /dev/null +++ b/tests/api-resources/brand-protection/logos.test.ts @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare, { toFile } from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logos', () => { + test('create: only required params', async () => { + const responsePromise = client.brandProtection.logos.create({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.brandProtection.logos.create({ + account_id: 'x', + match_type: 'match_type', + tag: 'tag', + threshold: 0, + image: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.brandProtection.logos.delete('x', { account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.brandProtection.logos.delete('x', { account_id: 'x' }); + }); +}); diff --git a/tests/api-resources/brand-protection/matches.test.ts b/tests/api-resources/brand-protection/matches.test.ts new file mode 100644 index 0000000000..9b9c651497 --- /dev/null +++ b/tests/api-resources/brand-protection/matches.test.ts @@ -0,0 +1,54 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource matches', () => { + test('download: only required params', async () => { + const responsePromise = client.brandProtection.matches.download({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('download: required and optional params', async () => { + const response = await client.brandProtection.matches.download({ + account_id: 'x', + id: 'id', + include_domain_id: true, + limit: 0, + offset: 0, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.brandProtection.matches.get({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.brandProtection.matches.get({ + account_id: 'x', + id: 'id', + include_domain_id: true, + limit: 0, + offset: 0, + }); + }); +}); diff --git a/tests/api-resources/brand-protection/queries.test.ts b/tests/api-resources/brand-protection/queries.test.ts new file mode 100644 index 0000000000..4972f320d6 --- /dev/null +++ b/tests/api-resources/brand-protection/queries.test.ts @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource queries', () => { + test('create: only required params', async () => { + const responsePromise = client.brandProtection.queries.create({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.brandProtection.queries.create({ + account_id: 'x', + id: 'id', + query_scan: true, + query_tag: 'tag', + max_time: '2019-12-27T18:11:19.117Z', + min_time: '2019-12-27T18:11:19.117Z', + body_scan: true, + string_matches: {}, + body_tag: 'tag', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.brandProtection.queries.delete({ account_id: 'x' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.brandProtection.queries.delete({ + account_id: 'x', + id: 'id', + scan: true, + tag: 'tag', + }); + }); +}); diff --git a/tests/api-resources/cache/cache.test.ts b/tests/api-resources/cache/cache.test.ts index c46b109ff9..5604143ce9 100644 --- a/tests/api-resources/cache/cache.test.ts +++ b/tests/api-resources/cache/cache.test.ts @@ -11,7 +11,7 @@ const client = new Cloudflare({ describe('resource cache', () => { test('purge: only required params', async () => { - const responsePromise = client.cache.purge({ zone_id: 'zone_id' }); + const responsePromise = client.cache.purge({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,7 +23,7 @@ describe('resource cache', () => { test('purge: required and optional params', async () => { const response = await client.cache.purge({ - zone_id: 'zone_id', + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', tags: ['a-cache-tag', 'another-cache-tag'], }); }); diff --git a/tests/api-resources/email-security/investigate/investigate.test.ts b/tests/api-resources/email-security/investigate/investigate.test.ts index d1be643f53..241f4a3656 100644 --- a/tests/api-resources/email-security/investigate/investigate.test.ts +++ b/tests/api-resources/email-security/investigate/investigate.test.ts @@ -41,6 +41,7 @@ describe('resource investigate', () => { recipient: 'recipient', sender: 'sender', start: '2019-12-27T18:11:19.117Z', + subject: 'subject', }); }); diff --git a/tests/api-resources/email-security/settings/allow-policies.test.ts b/tests/api-resources/email-security/settings/allow-policies.test.ts index a9b6aa9da2..2f75c20ef6 100644 --- a/tests/api-resources/email-security/settings/allow-policies.test.ts +++ b/tests/api-resources/email-security/settings/allow-policies.test.ts @@ -72,6 +72,7 @@ describe('resource allowPolicies', () => { is_trusted_sender: true, order: 'pattern', page: 1, + pattern: 'pattern', pattern_type: 'EMAIL', per_page: 1, search: 'search', diff --git a/tests/api-resources/email-security/settings/block-senders.test.ts b/tests/api-resources/email-security/settings/block-senders.test.ts index 9188c89aca..a96b78ba94 100644 --- a/tests/api-resources/email-security/settings/block-senders.test.ts +++ b/tests/api-resources/email-security/settings/block-senders.test.ts @@ -55,6 +55,7 @@ describe('resource blockSenders', () => { direction: 'asc', order: 'pattern', page: 1, + pattern: 'pattern', pattern_type: 'EMAIL', per_page: 1, search: 'search', diff --git a/tests/api-resources/email-security/settings/trusted-domains.test.ts b/tests/api-resources/email-security/settings/trusted-domains.test.ts index b0012161f3..177f8168a2 100644 --- a/tests/api-resources/email-security/settings/trusted-domains.test.ts +++ b/tests/api-resources/email-security/settings/trusted-domains.test.ts @@ -61,6 +61,7 @@ describe('resource trustedDomains', () => { is_similarity: true, order: 'pattern', page: 1, + pattern: 'pattern', per_page: 1, search: 'search', }); diff --git a/tests/api-resources/magic-transit/connectors/events/events.test.ts b/tests/api-resources/magic-transit/connectors/events/events.test.ts index fa75c7d5a8..7d5d5f1d32 100644 --- a/tests/api-resources/magic-transit/connectors/events/events.test.ts +++ b/tests/api-resources/magic-transit/connectors/events/events.test.ts @@ -31,6 +31,7 @@ describe('resource events', () => { from: 0, to: 0, cursor: 'cursor', + k: 'k', limit: 0, }); }); diff --git a/tests/api-resources/radar/attacks/layer7/top/top.test.ts b/tests/api-resources/radar/attacks/layer7/top/top.test.ts index 459439ed87..24fcffeef9 100644 --- a/tests/api-resources/radar/attacks/layer7/top/top.test.ts +++ b/tests/api-resources/radar/attacks/layer7/top/top.test.ts @@ -43,7 +43,6 @@ describe('resource top', () => { limitDirection: 'ORIGIN', limitPerLocation: 10, location: ['string'], - magnitude: 'MITIGATED_REQUESTS', mitigationProduct: ['DDOS'], name: ['main_series'], normalization: 'PERCENTAGE', diff --git a/tests/api-resources/rules/lists/items.test.ts b/tests/api-resources/rules/lists/items.test.ts index 4121cd4137..bf248e06bb 100644 --- a/tests/api-resources/rules/lists/items.test.ts +++ b/tests/api-resources/rules/lists/items.test.ts @@ -31,7 +31,7 @@ describe('resource items', () => { { asn: 5567, comment: 'Private IP address', - hostname: { url_hostname: 'example.com' }, + hostname: { url_hostname: 'example.com', exclude_exact_hostname: true }, ip: '10.0.0.1', redirect: { source_url: 'example.com/arch', @@ -68,7 +68,7 @@ describe('resource items', () => { { asn: 5567, comment: 'Private IP address', - hostname: { url_hostname: 'example.com' }, + hostname: { url_hostname: 'example.com', exclude_exact_hostname: true }, ip: '10.0.0.1', redirect: { source_url: 'example.com/arch', diff --git a/tests/api-resources/user/tokens/tokens.test.ts b/tests/api-resources/user/tokens/tokens.test.ts index 6daec91f23..b5b6c1e454 100644 --- a/tests/api-resources/user/tokens/tokens.test.ts +++ b/tests/api-resources/user/tokens/tokens.test.ts @@ -21,7 +21,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: {}, }, ], }); @@ -45,7 +45,14 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { + nested: { + 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { + 'com.cloudflare.api.account.zone.*': '*', + }, + }, + simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, + }, }, ], condition: { @@ -70,7 +77,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: {}, }, ], }); @@ -94,7 +101,14 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { + nested: { + 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { + 'com.cloudflare.api.account.zone.*': '*', + }, + }, + simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, + }, }, ], condition: { diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts index 9f46ab7ef2..054fcff10a 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/content.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -34,6 +34,7 @@ describe('resource content', () => { { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { body_part: 'worker.js', main_module: 'worker.js' }, + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], 'CF-WORKER-BODY-PART': 'CF-WORKER-BODY-PART', 'CF-WORKER-MAIN-MODULE-PART': 'CF-WORKER-MAIN-MODULE-PART', }, diff --git a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts index 802be1989e..e331c0e1b3 100644 --- a/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts +++ b/tests/api-resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -74,6 +74,7 @@ describe('resource scripts', () => { ], usage_model: 'standard', }, + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], }, ); }); diff --git a/tests/api-resources/workers/scripts/content.test.ts b/tests/api-resources/workers/scripts/content.test.ts index 1567728d10..9549b11cd0 100644 --- a/tests/api-resources/workers/scripts/content.test.ts +++ b/tests/api-resources/workers/scripts/content.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -30,6 +30,7 @@ describe('resource content', () => { const response = await client.workers.scripts.content.update('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', metadata: { body_part: 'worker.js', main_module: 'worker.js' }, + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], 'CF-WORKER-BODY-PART': 'CF-WORKER-BODY-PART', 'CF-WORKER-MAIN-MODULE-PART': 'CF-WORKER-MAIN-MODULE-PART', }); diff --git a/tests/api-resources/workers/scripts/deployments.test.ts b/tests/api-resources/workers/scripts/deployments.test.ts index 08559beefc..517a383fc9 100644 --- a/tests/api-resources/workers/scripts/deployments.test.ts +++ b/tests/api-resources/workers/scripts/deployments.test.ts @@ -14,7 +14,7 @@ describe('resource deployments', () => { const responsePromise = client.workers.scripts.deployments.create('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', strategy: 'percentage', - versions: [{ percentage: 100, version_id: 'bcf48806-b317-4351-9ee7-36e7d557d4de' }], + versions: [{ percentage: 100, version_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -29,7 +29,7 @@ describe('resource deployments', () => { const response = await client.workers.scripts.deployments.create('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', strategy: 'percentage', - versions: [{ percentage: 100, version_id: 'bcf48806-b317-4351-9ee7-36e7d557d4de' }], + versions: [{ percentage: 100, version_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' }], force: true, annotations: { 'workers/message': 'Deploy bug fix.' }, }); diff --git a/tests/api-resources/workers/scripts/scripts.test.ts b/tests/api-resources/workers/scripts/scripts.test.ts index 9cd76c3500..a4cdd14332 100644 --- a/tests/api-resources/workers/scripts/scripts.test.ts +++ b/tests/api-resources/workers/scripts/scripts.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -70,6 +70,7 @@ describe('resource scripts', () => { ], usage_model: 'standard', }, + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], }); }); diff --git a/tests/api-resources/workers/scripts/versions.test.ts b/tests/api-resources/workers/scripts/versions.test.ts index 074504bed1..82c89f8328 100644 --- a/tests/api-resources/workers/scripts/versions.test.ts +++ b/tests/api-resources/workers/scripts/versions.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -38,6 +38,7 @@ describe('resource versions', () => { keep_bindings: ['string'], usage_model: 'standard', }, + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], }); }); diff --git a/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts b/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts index e61f3904fa..ec91a23dc4 100644 --- a/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts +++ b/tests/api-resources/zero-trust/dlp/profiles/predefined.test.ts @@ -29,7 +29,7 @@ describe('resource predefined', () => { account_id: 'account_id', profile_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', ai_context_enabled: true, - allowed_match_count: 0, + allowed_match_count: 5, confidence_threshold: 'confidence_threshold', context_awareness: { enabled: true, skip: { files: true } }, entries: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', enabled: true }], @@ -57,7 +57,7 @@ describe('resource predefined', () => { { account_id: 'account_id', ai_context_enabled: true, - allowed_match_count: 0, + allowed_match_count: 5, confidence_threshold: 'confidence_threshold', context_awareness: { enabled: true, skip: { files: true } }, entries: [{ id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', enabled: true }], From 4050818dba45a26ce01ef84d1a3ebf4ee1fb3624 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:02:07 +0000 Subject: [PATCH 002/423] feat(api): api update --- .stats.yml | 4 +- api.md | 2 +- .../brand-protection/brand-protection.ts | 55 +++++-------------- 3 files changed, 17 insertions(+), 44 deletions(-) diff --git a/.stats.yml b/.stats.yml index be9d04e575..7b7de79814 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9629020f23f4c564925a52c46cdf5a93581a3f6bf35bf8050b0792467f642d33.yml -openapi_spec_hash: 58db5ad168eaa03ed1c9a028636c58f6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4d577be5bc8f4a0303c10df020efdc8823f02867d8f74e414c75e747c10e8e2.yml +openapi_spec_hash: 523313d2ea7487505e7913769ecd7e53 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/api.md b/api.md index c03b9bbb25..d32549459c 100644 --- a/api.md +++ b/api.md @@ -2958,7 +2958,7 @@ Types: Methods: - client.brandProtection.submit({ ...params }) -> BrandProtectionSubmitResponse -- client.brandProtection.urlInfo({ ...params }) -> BrandProtectionURLInfoResponse +- client.brandProtection.urlInfo({ ...params }) -> BrandProtectionURLInfoResponsesSinglePage ## Queries diff --git a/src/resources/brand-protection/brand-protection.ts b/src/resources/brand-protection/brand-protection.ts index da3918c087..97b08f3cad 100644 --- a/src/resources/brand-protection/brand-protection.ts +++ b/src/resources/brand-protection/brand-protection.ts @@ -22,6 +22,7 @@ import { } from './matches'; import * as QueriesAPI from './queries'; import { Queries, QueryCreateParams, QueryDeleteParams } from './queries'; +import { SinglePage } from '../../pagination'; export class BrandProtection extends APIResource { queries: QueriesAPI.Queries = new QueriesAPI.Queries(this._client); @@ -46,12 +47,18 @@ export class BrandProtection extends APIResource { urlInfo( params: BrandProtectionURLInfoParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id } = params; - return this._client.get(`/accounts/${account_id}/brand-protection/url-info`, options); + return this._client.getAPIList( + `/accounts/${account_id}/brand-protection/url-info`, + BrandProtectionURLInfoResponsesSinglePage, + options, + ); } } +export class BrandProtectionURLInfoResponsesSinglePage extends SinglePage {} + export interface Info { /** * List of categorizations applied to this submission. @@ -215,48 +222,12 @@ export namespace Submit { } export interface BrandProtectionSubmitResponse { - /** - * Error code - */ - code?: number; - - /** - * Errors - */ - errors?: { [key: string]: unknown }; + skipped_urls?: Array<{ [key: string]: unknown }>; - /** - * Error message - */ - message?: string; - - /** - * Error name - */ - status?: string; + submitted_urls?: Array<{ [key: string]: unknown }>; } -export interface BrandProtectionURLInfoResponse { - /** - * Error code - */ - code?: number; - - /** - * Errors - */ - errors?: { [key: string]: unknown }; - - /** - * Error message - */ - message?: string; - - /** - * Error name - */ - status?: string; -} +export type BrandProtectionURLInfoResponse = { [key: string]: unknown }; export interface BrandProtectionSubmitParams { account_id: string; @@ -266,6 +237,7 @@ export interface BrandProtectionURLInfoParams { account_id: string; } +BrandProtection.BrandProtectionURLInfoResponsesSinglePage = BrandProtectionURLInfoResponsesSinglePage; BrandProtection.Queries = Queries; BrandProtection.Matches = Matches; BrandProtection.Logos = Logos; @@ -277,6 +249,7 @@ export declare namespace BrandProtection { type Submit as Submit, type BrandProtectionSubmitResponse as BrandProtectionSubmitResponse, type BrandProtectionURLInfoResponse as BrandProtectionURLInfoResponse, + BrandProtectionURLInfoResponsesSinglePage as BrandProtectionURLInfoResponsesSinglePage, type BrandProtectionSubmitParams as BrandProtectionSubmitParams, type BrandProtectionURLInfoParams as BrandProtectionURLInfoParams, }; From 731e228751be183f5e1ee9ddcf66e908a10a0080 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:17:30 +0000 Subject: [PATCH 003/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b7de79814..b88b684413 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4d577be5bc8f4a0303c10df020efdc8823f02867d8f74e414c75e747c10e8e2.yml -openapi_spec_hash: 523313d2ea7487505e7913769ecd7e53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc4ca695005c107538e98f4f12ca1c1c5bcd1ec9c8fe4be2470c6b55629e2b52.yml +openapi_spec_hash: 1f434b38b55511e7b30bbd3525ed1a03 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 229a4ad941d87acf97057977716d5d32954d55a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:33:27 +0000 Subject: [PATCH 004/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b88b684413..4f1c27dcf4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc4ca695005c107538e98f4f12ca1c1c5bcd1ec9c8fe4be2470c6b55629e2b52.yml -openapi_spec_hash: 1f434b38b55511e7b30bbd3525ed1a03 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c333ff8d45f220336a87548f57f2efa5b8f987ec5b0772176451df1be2df932e.yml +openapi_spec_hash: 67e665ea8047dc51de40f0e650d69746 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 0f2e1983d7c48e25649b4137525ad31079d311d7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:50:04 +0000 Subject: [PATCH 005/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4f1c27dcf4..14177ab4a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c333ff8d45f220336a87548f57f2efa5b8f987ec5b0772176451df1be2df932e.yml -openapi_spec_hash: 67e665ea8047dc51de40f0e650d69746 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-53f79bd230feef2bc9db2690bd995391cad1470ea71d36ebce98df3e2d7396b7.yml +openapi_spec_hash: f0cbab37a2d3ea65f07e9c14db9bf272 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 0253912397aa8a651571d2cd297489e29582dbc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 22:07:21 +0000 Subject: [PATCH 006/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 14177ab4a2..7d4c188df0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-53f79bd230feef2bc9db2690bd995391cad1470ea71d36ebce98df3e2d7396b7.yml -openapi_spec_hash: f0cbab37a2d3ea65f07e9c14db9bf272 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f905dc0c7502aae22842c5a1dcc841c06aed265b48ea5448409510d0ca32c915.yml +openapi_spec_hash: 07104157083ad19644610ab473882b89 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From e38600cf3cd145e7d0d2a5f9b21ae52d233eb916 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 22:25:14 +0000 Subject: [PATCH 007/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d4c188df0..643130b186 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f905dc0c7502aae22842c5a1dcc841c06aed265b48ea5448409510d0ca32c915.yml -openapi_spec_hash: 07104157083ad19644610ab473882b89 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b887cd7c10651d6035399ac0cac40f37b53b4c9b2e287a23ea7352eca49c052.yml +openapi_spec_hash: 3882002006ca3245b0bfc9dbcc66d0e0 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 059dc1ef33f1a435002aa3302490b8ec458d653f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 01:09:18 +0000 Subject: [PATCH 008/423] feat(api): api update --- .stats.yml | 4 +- src/resources/accounts/tokens/tokens.ts | 4 +- src/resources/shared.ts | 38 ++----------------- src/resources/user/tokens/tokens.ts | 4 +- .../accounts/tokens/tokens.test.ts | 22 ++--------- .../api-resources/user/tokens/tokens.test.ts | 22 ++--------- 6 files changed, 18 insertions(+), 76 deletions(-) diff --git a/.stats.yml b/.stats.yml index 643130b186..bd90df1354 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b887cd7c10651d6035399ac0cac40f37b53b4c9b2e287a23ea7352eca49c052.yml -openapi_spec_hash: 3882002006ca3245b0bfc9dbcc66d0e0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-395fd6e5cc7e27dbdb13689d4d35df1ab79a1341ff126182164b06c91cdd5c37.yml +openapi_spec_hash: 0f73e4a572d51862942a5c0342121887 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index 1455bc526d..964d4dbf9b 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -38,7 +38,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: {}, + * resources: { foo: 'string' }, * }, * ], * }); @@ -70,7 +70,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: {}, + * resources: { foo: 'string' }, * }, * ], * }, diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 69fac18949..f6bea7bc14 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -888,9 +888,9 @@ export interface TokenPolicy { permission_groups: Array; /** - * Resource permissions for the policy. Use either simple or nested permissions. + * A list of resource names that the policy applies to. */ - resources: TokenPolicy.Resources; + resources: { [key: string]: string | { [key: string]: string } }; } export namespace TokenPolicy { @@ -925,21 +925,6 @@ export namespace TokenPolicy { value?: string; } } - - /** - * Resource permissions for the policy. Use either simple or nested permissions. - */ - export interface Resources { - /** - * Nested resource permissions for hierarchical scoping. - */ - nested?: { [key: string]: { [key: string]: string } }; - - /** - * Simple resource permissions where each resource maps to a permission string. - */ - simple?: { [key: string]: string }; - } } export interface TokenPolicyParam { @@ -954,9 +939,9 @@ export interface TokenPolicyParam { permission_groups: Array; /** - * Resource permissions for the policy. Use either simple or nested permissions. + * A list of resource names that the policy applies to. */ - resources: TokenPolicyParam.Resources; + resources: { [key: string]: string | { [key: string]: string } }; } export namespace TokenPolicyParam { @@ -986,21 +971,6 @@ export namespace TokenPolicyParam { value?: string; } } - - /** - * Resource permissions for the policy. Use either simple or nested permissions. - */ - export interface Resources { - /** - * Nested resource permissions for hierarchical scoping. - */ - nested?: { [key: string]: { [key: string]: string } }; - - /** - * Simple resource permissions where each resource maps to a permission string. - */ - simple?: { [key: string]: string }; - } } /** diff --git a/src/resources/user/tokens/tokens.ts b/src/resources/user/tokens/tokens.ts index 02e0e6fcae..9f9e3ddc28 100644 --- a/src/resources/user/tokens/tokens.ts +++ b/src/resources/user/tokens/tokens.ts @@ -36,7 +36,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: {}, + * resources: { foo: 'string' }, * }, * ], * }); @@ -66,7 +66,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: {}, + * resources: { foo: 'string' }, * }, * ], * }, diff --git a/tests/api-resources/accounts/tokens/tokens.test.ts b/tests/api-resources/accounts/tokens/tokens.test.ts index 9834e63c9b..0248b48cf9 100644 --- a/tests/api-resources/accounts/tokens/tokens.test.ts +++ b/tests/api-resources/accounts/tokens/tokens.test.ts @@ -22,7 +22,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: {}, + resources: { foo: 'string' }, }, ], }); @@ -47,14 +47,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - nested: { - 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { - 'com.cloudflare.api.account.zone.*': '*', - }, - }, - simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, - }, + resources: { foo: 'string' }, }, ], condition: { @@ -80,7 +73,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: {}, + resources: { foo: 'string' }, }, ], }); @@ -105,14 +98,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - nested: { - 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { - 'com.cloudflare.api.account.zone.*': '*', - }, - }, - simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, - }, + resources: { foo: 'string' }, }, ], condition: { diff --git a/tests/api-resources/user/tokens/tokens.test.ts b/tests/api-resources/user/tokens/tokens.test.ts index b5b6c1e454..6daec91f23 100644 --- a/tests/api-resources/user/tokens/tokens.test.ts +++ b/tests/api-resources/user/tokens/tokens.test.ts @@ -21,7 +21,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: {}, + resources: { foo: 'string' }, }, ], }); @@ -45,14 +45,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - nested: { - 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { - 'com.cloudflare.api.account.zone.*': '*', - }, - }, - simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, - }, + resources: { foo: 'string' }, }, ], condition: { @@ -77,7 +70,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: {}, + resources: { foo: 'string' }, }, ], }); @@ -101,14 +94,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { - nested: { - 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': { - 'com.cloudflare.api.account.zone.*': '*', - }, - }, - simple: { 'com.cloudflare.api.account.472e41d66440f10635de39c7ffaf6080': '*' }, - }, + resources: { foo: 'string' }, }, ], condition: { From 287d20c3e0fe8dcf0bbd2eb7b4ef56b11ceb8c72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 06:19:03 +0000 Subject: [PATCH 009/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bd90df1354..497c82b36f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-395fd6e5cc7e27dbdb13689d4d35df1ab79a1341ff126182164b06c91cdd5c37.yml -openapi_spec_hash: 0f73e4a572d51862942a5c0342121887 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a5ae323a3ed4fcf76efb43f65dd9ee80169922cda83f7063eae998f8075c947.yml +openapi_spec_hash: 3855b68315bd929a72a3db6a08714a92 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 017e362462b3ac87d51141a69c53388a9f38084b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:02:47 +0000 Subject: [PATCH 010/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 497c82b36f..bdc06e4985 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a5ae323a3ed4fcf76efb43f65dd9ee80169922cda83f7063eae998f8075c947.yml -openapi_spec_hash: 3855b68315bd929a72a3db6a08714a92 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4edbd8644d06987e2acaf18e4310986664fcb8ec2919574b40280b6b8c96657.yml +openapi_spec_hash: 7ce2a4973cbeff394b2b1e23d2986ed9 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From e5a8f93b4c16426b425183a699df77ee82459897 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:11:13 +0000 Subject: [PATCH 011/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bdc06e4985..497c82b36f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4edbd8644d06987e2acaf18e4310986664fcb8ec2919574b40280b6b8c96657.yml -openapi_spec_hash: 7ce2a4973cbeff394b2b1e23d2986ed9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a5ae323a3ed4fcf76efb43f65dd9ee80169922cda83f7063eae998f8075c947.yml +openapi_spec_hash: 3855b68315bd929a72a3db6a08714a92 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 2fa96d63e2eb765d2b173e27994cf0f1d362d37f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:23:08 +0000 Subject: [PATCH 012/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 497c82b36f..bdc06e4985 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0a5ae323a3ed4fcf76efb43f65dd9ee80169922cda83f7063eae998f8075c947.yml -openapi_spec_hash: 3855b68315bd929a72a3db6a08714a92 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4edbd8644d06987e2acaf18e4310986664fcb8ec2919574b40280b6b8c96657.yml +openapi_spec_hash: 7ce2a4973cbeff394b2b1e23d2986ed9 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 4c1618bb28a9d556616eed8b15fb8e9c285833e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 09:31:21 +0000 Subject: [PATCH 013/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bdc06e4985..bd90df1354 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4edbd8644d06987e2acaf18e4310986664fcb8ec2919574b40280b6b8c96657.yml -openapi_spec_hash: 7ce2a4973cbeff394b2b1e23d2986ed9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-395fd6e5cc7e27dbdb13689d4d35df1ab79a1341ff126182164b06c91cdd5c37.yml +openapi_spec_hash: 0f73e4a572d51862942a5c0342121887 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From bf984888dd712673dbea449aeb0b7b1e5ea1a128 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:11:49 +0000 Subject: [PATCH 014/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bd90df1354..58bf9d5ce9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-395fd6e5cc7e27dbdb13689d4d35df1ab79a1341ff126182164b06c91cdd5c37.yml -openapi_spec_hash: 0f73e4a572d51862942a5c0342121887 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-212c971d686d8ed225b692c21487d4a944fd63f33864d182755b84fb8efeeac0.yml +openapi_spec_hash: 8bc75b8e92c2209fc5b7e61ab3298616 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 57e28f1f82e8a083a0788510e7500848f85f984a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:34:13 +0000 Subject: [PATCH 015/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 58bf9d5ce9..22c631e30e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-212c971d686d8ed225b692c21487d4a944fd63f33864d182755b84fb8efeeac0.yml -openapi_spec_hash: 8bc75b8e92c2209fc5b7e61ab3298616 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa33fe9a0fbfcfe0f002d02b244c20bec9ea7e9fb4e888e74c1014eff483112.yml +openapi_spec_hash: 6bcfcc413bbf50a85a686003d689730a config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From b3e96288dc70f6d7644fdb07b557a230d952ca3c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 10:52:50 +0000 Subject: [PATCH 016/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 22c631e30e..558e32e25a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0aa33fe9a0fbfcfe0f002d02b244c20bec9ea7e9fb4e888e74c1014eff483112.yml -openapi_spec_hash: 6bcfcc413bbf50a85a686003d689730a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-007d2e2273bd9776155f7ec832035944f49ba82c60b10e8b9a312f36c8b17681.yml +openapi_spec_hash: 1ccb269b7c0299cfe3e0761c681f2cc5 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From f099ee0db00e5e7b889b230ce5989e31f60c61d4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 12:59:34 +0000 Subject: [PATCH 017/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 558e32e25a..1c48958f3f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-007d2e2273bd9776155f7ec832035944f49ba82c60b10e8b9a312f36c8b17681.yml -openapi_spec_hash: 1ccb269b7c0299cfe3e0761c681f2cc5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56addac653db601bdb057f4eb625527e1e728d156c9d027fbfa7a74721e9c4eb.yml +openapi_spec_hash: ad146e73c28fd73d14716c166bb7826e config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 82a39947b3f330c15524e225289e21ed109bdde2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:21:14 +0000 Subject: [PATCH 018/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1c48958f3f..b99dfdcd51 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56addac653db601bdb057f4eb625527e1e728d156c9d027fbfa7a74721e9c4eb.yml -openapi_spec_hash: ad146e73c28fd73d14716c166bb7826e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd23c6da477929891e05fa806f39200df7e2bab6d0a8ba5ec254dd0b75fd558d.yml +openapi_spec_hash: 106b9adfecb19d55e8e153a3059a384c config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 8081f379ae2cfc7f376868d858804adb256e90a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:24:59 +0000 Subject: [PATCH 019/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b99dfdcd51..1c48958f3f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd23c6da477929891e05fa806f39200df7e2bab6d0a8ba5ec254dd0b75fd558d.yml -openapi_spec_hash: 106b9adfecb19d55e8e153a3059a384c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56addac653db601bdb057f4eb625527e1e728d156c9d027fbfa7a74721e9c4eb.yml +openapi_spec_hash: ad146e73c28fd73d14716c166bb7826e config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 5bd0d8a5b82a88e39f04ee3c240d8976835c0190 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 14:28:35 +0000 Subject: [PATCH 020/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1c48958f3f..b99dfdcd51 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56addac653db601bdb057f4eb625527e1e728d156c9d027fbfa7a74721e9c4eb.yml -openapi_spec_hash: ad146e73c28fd73d14716c166bb7826e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd23c6da477929891e05fa806f39200df7e2bab6d0a8ba5ec254dd0b75fd558d.yml +openapi_spec_hash: 106b9adfecb19d55e8e153a3059a384c config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 5d1228b82518de932e0440857196e68920dd5e78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:13:18 +0000 Subject: [PATCH 021/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b99dfdcd51..a04064f462 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd23c6da477929891e05fa806f39200df7e2bab6d0a8ba5ec254dd0b75fd558d.yml -openapi_spec_hash: 106b9adfecb19d55e8e153a3059a384c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4be3a8b15ab01f44e6bb19eb63dd1ce076955967a90bbf341e45d607ab3f8cf5.yml +openapi_spec_hash: af5f85fb035e8d9b597699f80b464dd1 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 07cc2071c0b121e6a21368bbc83d7434c53d7ed2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:26:57 +0000 Subject: [PATCH 022/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a04064f462..692da085e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4be3a8b15ab01f44e6bb19eb63dd1ce076955967a90bbf341e45d607ab3f8cf5.yml -openapi_spec_hash: af5f85fb035e8d9b597699f80b464dd1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de77f84c8e0f28014bc74d1d9ddf565df62f9e953580bc3048ce8b0a21903af0.yml +openapi_spec_hash: 3c446f85404de27a915e18591b25c4aa config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From ead4c1b0def0d56267316cbf219021fd760fd36f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:32:43 +0000 Subject: [PATCH 023/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 692da085e7..a04064f462 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de77f84c8e0f28014bc74d1d9ddf565df62f9e953580bc3048ce8b0a21903af0.yml -openapi_spec_hash: 3c446f85404de27a915e18591b25c4aa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4be3a8b15ab01f44e6bb19eb63dd1ce076955967a90bbf341e45d607ab3f8cf5.yml +openapi_spec_hash: af5f85fb035e8d9b597699f80b464dd1 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From a39e06ea85bb53599e1f45200b0642d512615573 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:36:26 +0000 Subject: [PATCH 024/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a04064f462..692da085e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4be3a8b15ab01f44e6bb19eb63dd1ce076955967a90bbf341e45d607ab3f8cf5.yml -openapi_spec_hash: af5f85fb035e8d9b597699f80b464dd1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de77f84c8e0f28014bc74d1d9ddf565df62f9e953580bc3048ce8b0a21903af0.yml +openapi_spec_hash: 3c446f85404de27a915e18591b25c4aa config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 866e29d875045a28ba10938d46186410c3a2fb83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 15:49:44 +0000 Subject: [PATCH 025/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 692da085e7..09c0164a5c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de77f84c8e0f28014bc74d1d9ddf565df62f9e953580bc3048ce8b0a21903af0.yml -openapi_spec_hash: 3c446f85404de27a915e18591b25c4aa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f27bc17bed1e3d1c960116531e779b1548f68e5ec82224b37333be704b6a63e.yml +openapi_spec_hash: f869b17bba7a875b93ff76cf66644bbc config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From af9c8397c2c193284387aa7a808a32fd45574192 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:08:19 +0000 Subject: [PATCH 026/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 09c0164a5c..9162d71e71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f27bc17bed1e3d1c960116531e779b1548f68e5ec82224b37333be704b6a63e.yml -openapi_spec_hash: f869b17bba7a875b93ff76cf66644bbc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-331dd5980a50c452913f0761bc28beb0e09f098b8696385a4bc17a286096a342.yml +openapi_spec_hash: 17d991d5c9a11d2df8aa86a3e03ff5e2 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 9bc089b6c19bcb71b2fc48dbb7dddb23cac003f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:16:51 +0000 Subject: [PATCH 027/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9162d71e71..3776429610 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-331dd5980a50c452913f0761bc28beb0e09f098b8696385a4bc17a286096a342.yml -openapi_spec_hash: 17d991d5c9a11d2df8aa86a3e03ff5e2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e67292208399fc218911adb8316e6a6507855a42947cbcf6351036f30c973699.yml +openapi_spec_hash: 2eba0cfb1bd419aca824c4647cd4ef27 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 120d2beb5a04840987a9493eb1f63342454309de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 16:33:49 +0000 Subject: [PATCH 028/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3776429610..48a5631c75 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e67292208399fc218911adb8316e6a6507855a42947cbcf6351036f30c973699.yml -openapi_spec_hash: 2eba0cfb1bd419aca824c4647cd4ef27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4434a74ce6051a9218724e482ba7e0c6d74da606fd5bee1743f159a8ecd435b2.yml +openapi_spec_hash: d497ef192865415ec2e2f4962e372d92 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 9ab90bf7b93b4b9a8aa6b4bba9d04ba0bd89e72a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 17:13:03 +0000 Subject: [PATCH 029/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 48a5631c75..9967edb684 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4434a74ce6051a9218724e482ba7e0c6d74da606fd5bee1743f159a8ecd435b2.yml -openapi_spec_hash: d497ef192865415ec2e2f4962e372d92 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca470d3505ce3ea2b0335ed51d6131ee2739ab2eb952b3c23d0be7229035f259.yml +openapi_spec_hash: 9371c0181431755b5111eb0be1602aab config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 0d4b63d0bce6b19d407f9352cf27e807382e5f7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:24:35 +0000 Subject: [PATCH 030/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9967edb684..0a17f6714c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca470d3505ce3ea2b0335ed51d6131ee2739ab2eb952b3c23d0be7229035f259.yml -openapi_spec_hash: 9371c0181431755b5111eb0be1602aab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f909c745f96f132ac959aace2de9fd36d5d9735bc9673ce9fb6560d3f5ef61fc.yml +openapi_spec_hash: 4b6d18d4376ef59eeb0a6263aff94855 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 559f7954b81ba6b500102597c05f19176f2bd185 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:33:25 +0000 Subject: [PATCH 031/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a17f6714c..9967edb684 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f909c745f96f132ac959aace2de9fd36d5d9735bc9673ce9fb6560d3f5ef61fc.yml -openapi_spec_hash: 4b6d18d4376ef59eeb0a6263aff94855 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca470d3505ce3ea2b0335ed51d6131ee2739ab2eb952b3c23d0be7229035f259.yml +openapi_spec_hash: 9371c0181431755b5111eb0be1602aab config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 3e48b4294f25cd55be364916368260b98c68d8d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 18:58:10 +0000 Subject: [PATCH 032/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9967edb684..f72caee310 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ca470d3505ce3ea2b0335ed51d6131ee2739ab2eb952b3c23d0be7229035f259.yml -openapi_spec_hash: 9371c0181431755b5111eb0be1602aab +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c01dca3c6cd7d96f51102258a07f4cad0ea01c762c926f21a6f7e4a2c0d289c0.yml +openapi_spec_hash: cbe45ecfa992fbbd1e2488e5b600e4f7 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 7a42645614501881c1ee25ca585b6266c5848854 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 19:06:31 +0000 Subject: [PATCH 033/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/ai/finetunes/assets.ts | 22 +++++----------------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index f72caee310..ce109a760a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c01dca3c6cd7d96f51102258a07f4cad0ea01c762c926f21a6f7e4a2c0d289c0.yml -openapi_spec_hash: cbe45ecfa992fbbd1e2488e5b600e4f7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-447723623388aa388d7f61c0481ee7ecfc7300ff3e9824fdec712edc04b3a773.yml +openapi_spec_hash: 2283b188fa369217d0c071720d480e01 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/src/resources/ai/finetunes/assets.ts b/src/resources/ai/finetunes/assets.ts index ec1feaaefd..bd45121e1a 100644 --- a/src/resources/ai/finetunes/assets.ts +++ b/src/resources/ai/finetunes/assets.ts @@ -13,27 +13,15 @@ export class Assets extends APIResource { options?: Core.RequestOptions, ): Core.APIPromise { const { account_id, ...body } = params; - return ( - this._client.post( - `/accounts/${account_id}/ai/finetunes/${finetuneId}/finetune-assets`, - Core.multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: AssetCreateResponse }> - )._thenUnwrap((obj) => obj.result); + return this._client.post( + `/accounts/${account_id}/ai/finetunes/${finetuneId}/finetune-assets`, + Core.multipartFormRequestOptions({ body, ...options }), + ); } } export interface AssetCreateResponse { - id: string; - - bucket_name: string; - - created_at: string; - - file_name: string; - - finetune_id: string; - - modified_at: string; + success: boolean; } export interface AssetCreateParams { From 307781918459f3f04d67ac283e5b798dfc110fbe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 20:59:23 +0000 Subject: [PATCH 034/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ce109a760a..3d5fc42a6e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-447723623388aa388d7f61c0481ee7ecfc7300ff3e9824fdec712edc04b3a773.yml -openapi_spec_hash: 2283b188fa369217d0c071720d480e01 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39b29d31b6b11cfc2edac0217ece0c68aeeb884b7f4b443a0ac1129b395e577f.yml +openapi_spec_hash: 5b8a2397a05161b29e0490b31173028c config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 47630a3b0a6d8bfe6cd3abac7555eda47a1c6c2d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 18 Jul 2025 21:53:36 +0000 Subject: [PATCH 035/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3d5fc42a6e..d644fb5670 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39b29d31b6b11cfc2edac0217ece0c68aeeb884b7f4b443a0ac1129b395e577f.yml -openapi_spec_hash: 5b8a2397a05161b29e0490b31173028c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6e62280570e1f31dd315031fa6fbcaca8e2c3e940b638e75b652f98a6d25e952.yml +openapi_spec_hash: 32aa8798cad51d9833acbc2b2a91dea5 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 75aa7a7c5f04ba304c0112b8d82a046596ae2028 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 19 Jul 2025 06:21:20 +0000 Subject: [PATCH 036/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d644fb5670..f865c6650f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6e62280570e1f31dd315031fa6fbcaca8e2c3e940b638e75b652f98a6d25e952.yml -openapi_spec_hash: 32aa8798cad51d9833acbc2b2a91dea5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d1dccefd8564fd1ea42d264d0f05bf008dd6340fba070f1eaae1c252bcfd3a3.yml +openapi_spec_hash: d80c6947df2d9f0f23d3eec531bc6035 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 9a4963d4c9b9e972a0bc782b0442ae33b50e52f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 20 Jul 2025 06:18:47 +0000 Subject: [PATCH 037/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f865c6650f..d79055f018 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d1dccefd8564fd1ea42d264d0f05bf008dd6340fba070f1eaae1c252bcfd3a3.yml -openapi_spec_hash: d80c6947df2d9f0f23d3eec531bc6035 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c493698a1cde78df7b38557058847107dcc8041a33b8367b7416cd3dc08324e9.yml +openapi_spec_hash: 3202b0c046cd2617b0f8839c941ff334 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 873965e8e52ce3fa30c1321c78f708afbb70e4be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 06:07:12 +0000 Subject: [PATCH 038/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d79055f018..9c25faf4ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c493698a1cde78df7b38557058847107dcc8041a33b8367b7416cd3dc08324e9.yml -openapi_spec_hash: 3202b0c046cd2617b0f8839c941ff334 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a863dd00c5f938422a24a9c5c17ade7d1269c02e046e2dfa588e77849ae3f55c.yml +openapi_spec_hash: 3b3b1b659f41d3719cc36ce5c4e0142e config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From dcdffc42e77b95c73f5347c5f440e8f609b78036 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 07:26:28 +0000 Subject: [PATCH 039/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9c25faf4ed..d0baba980e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a863dd00c5f938422a24a9c5c17ade7d1269c02e046e2dfa588e77849ae3f55c.yml -openapi_spec_hash: 3b3b1b659f41d3719cc36ce5c4e0142e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44e33e11e5d0c9ed23bc9d9dfa9e72e5240994bd3efb154ae54902f6dd4d9afd.yml +openapi_spec_hash: 0586874a995e96c9b3520b70ecf53080 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 03506eb41f3a2f8c683b16f9722e2a3bb9c0dca2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 08:41:52 +0000 Subject: [PATCH 040/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d0baba980e..f865c6650f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-44e33e11e5d0c9ed23bc9d9dfa9e72e5240994bd3efb154ae54902f6dd4d9afd.yml -openapi_spec_hash: 0586874a995e96c9b3520b70ecf53080 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d1dccefd8564fd1ea42d264d0f05bf008dd6340fba070f1eaae1c252bcfd3a3.yml +openapi_spec_hash: d80c6947df2d9f0f23d3eec531bc6035 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From f92c9d096e64d2711158e06b875a7ac85e0112c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 09:37:22 +0000 Subject: [PATCH 041/423] feat(api): api update --- .stats.yml | 4 +- src/resources/rules/lists/bulk-operations.ts | 70 +++++++++--- src/resources/rules/lists/items.ts | 100 +++++++++++++---- src/resources/rules/lists/lists.ts | 106 +++++++++--------- tests/api-resources/rules/lists/items.test.ts | 40 +------ 5 files changed, 188 insertions(+), 132 deletions(-) diff --git a/.stats.yml b/.stats.yml index f865c6650f..82e7704519 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d1dccefd8564fd1ea42d264d0f05bf008dd6340fba070f1eaae1c252bcfd3a3.yml -openapi_spec_hash: d80c6947df2d9f0f23d3eec531bc6035 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3267b5a1548af02ecbcaaab9bd5ff5fdeb620f487802af9edbae8e3fc0797932.yml +openapi_spec_hash: 3cef24d9a1589e92e192cb855de613b0 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/src/resources/rules/lists/bulk-operations.ts b/src/resources/rules/lists/bulk-operations.ts index d14fcc16f2..1fa8d84a43 100644 --- a/src/resources/rules/lists/bulk-operations.ts +++ b/src/resources/rules/lists/bulk-operations.ts @@ -35,26 +35,62 @@ export class BulkOperations extends APIResource { } } -export interface BulkOperationGetResponse { - /** - * The unique operation ID of the asynchronous action. - */ - id: string; +export type BulkOperationGetResponse = + | BulkOperationGetResponse.UnionMember0 + | BulkOperationGetResponse.UnionMember1 + | BulkOperationGetResponse.UnionMember2; - /** - * The current status of the asynchronous operation. - */ - status: 'pending' | 'running' | 'completed' | 'failed'; +export namespace BulkOperationGetResponse { + export interface UnionMember0 { + /** + * The unique operation ID of the asynchronous action. + */ + id: string; - /** - * The RFC 3339 timestamp of when the operation was completed. - */ - completed?: string; + /** + * The RFC 3339 timestamp of when the operation was completed. + */ + completed: string; - /** - * A message describing the error when the status is `failed`. - */ - error?: string; + /** + * A message describing the error when the status is `failed`. + */ + error: string; + + /** + * The current status of the asynchronous operation. + */ + status: 'failed'; + } + + export interface UnionMember1 { + /** + * The unique operation ID of the asynchronous action. + */ + id: string; + + /** + * The current status of the asynchronous operation. + */ + status: 'pending' | 'running'; + } + + export interface UnionMember2 { + /** + * The unique operation ID of the asynchronous action. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the operation was completed. + */ + completed: string; + + /** + * The current status of the asynchronous operation. + */ + status: 'completed'; + } } export interface BulkOperationGetParams { diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 092e4c055d..8260d3a901 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -18,7 +18,7 @@ export class Items extends APIResource { * '2c0fc9fa937b11eaa1b71c4d701ab86e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: [{}], + * body: [{ ip: '10.0.0.1' }], * }, * ); * ``` @@ -50,7 +50,7 @@ export class Items extends APIResource { * '2c0fc9fa937b11eaa1b71c4d701ab86e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: [{}], + * body: [{ ip: '10.0.0.1' }], * }, * ); * ``` @@ -164,21 +164,21 @@ export interface ListItem { /** * The unique operation ID of the asynchronous action. */ - operation_id?: string; + operation_id: string; } export interface ItemCreateResponse { /** * The unique operation ID of the asynchronous action. */ - operation_id?: string; + operation_id: string; } export interface ItemUpdateResponse { /** * The unique operation ID of the asynchronous action. */ - operation_id?: string; + operation_id: string; } export interface ItemListResponse { @@ -228,7 +228,7 @@ export interface ItemDeleteResponse { /** * The unique operation ID of the asynchronous action. */ - operation_id?: string; + operation_id: string; } export interface ItemGetResponse { @@ -283,36 +283,62 @@ export interface ItemCreateParams { /** * Body param: */ - body: Array; + body: Array< + | ItemCreateParams.UnionMember0 + | ItemCreateParams.UnionMember1 + | ItemCreateParams.UnionMember2 + | ItemCreateParams.UnionMember3 + >; } export namespace ItemCreateParams { - export interface Body { + export interface UnionMember0 { /** - * Defines a non-negative 32 bit integer. + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface UnionMember1 { + /** + * The definition of the redirect. */ - asn?: number; + redirect: ListsAPI.RedirectParam; /** * Defines an informative summary of the list item. */ comment?: string; + } + export interface UnionMember2 { /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). */ - hostname?: ListsAPI.HostnameParam; + hostname: ListsAPI.HostnameParam; /** - * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + * Defines an informative summary of the list item. */ - ip?: string; + comment?: string; + } + export interface UnionMember3 { /** - * The definition of the redirect. + * Defines a non-negative 32 bit integer. + */ + asn: number; + + /** + * Defines an informative summary of the list item. */ - redirect?: ListsAPI.RedirectParam; + comment?: string; } } @@ -325,36 +351,62 @@ export interface ItemUpdateParams { /** * Body param: */ - body: Array; + body: Array< + | ItemUpdateParams.UnionMember0 + | ItemUpdateParams.UnionMember1 + | ItemUpdateParams.UnionMember2 + | ItemUpdateParams.UnionMember3 + >; } export namespace ItemUpdateParams { - export interface Body { + export interface UnionMember0 { /** - * Defines a non-negative 32 bit integer. + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface UnionMember1 { + /** + * The definition of the redirect. */ - asn?: number; + redirect: ListsAPI.RedirectParam; /** * Defines an informative summary of the list item. */ comment?: string; + } + export interface UnionMember2 { /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). */ - hostname?: ListsAPI.HostnameParam; + hostname: ListsAPI.HostnameParam; /** - * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + * Defines an informative summary of the list item. */ - ip?: string; + comment?: string; + } + export interface UnionMember3 { /** - * The definition of the redirect. + * Defines a non-negative 32 bit integer. + */ + asn: number; + + /** + * Defines an informative summary of the list item. */ - redirect?: ListsAPI.RedirectParam; + comment?: string; } } diff --git a/src/resources/rules/lists/lists.ts b/src/resources/rules/lists/lists.ts index 4a1945914e..0dceb4b847 100644 --- a/src/resources/rules/lists/lists.ts +++ b/src/resources/rules/lists/lists.ts @@ -179,43 +179,43 @@ export interface ListsList { /** * The unique ID of the list. */ - id?: string; + id: string; /** * The RFC 3339 timestamp of when the list was created. */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; + created_on: string; /** * The type of the list. Each type supports specific list items (IP addresses, * ASNs, hostnames or redirects). */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + kind: 'ip' | 'redirect' | 'hostname' | 'asn'; /** * The RFC 3339 timestamp of when the list was last modified. */ - modified_on?: string; + modified_on: string; /** * An informative name for the list. Use this name in filter and rule expressions. */ - name?: string; + name: string; /** * The number of items in the list. */ - num_items?: number; + num_items: number; + + /** + * The number of [filters](/api/resources/filters/) referencing the list. + */ + num_referencing_filters: number; /** - * The number of [filters](/operations/filters-list-filters) referencing the list. + * An informative summary of the list. */ - num_referencing_filters?: number; + description?: string; } /** @@ -260,136 +260,136 @@ export interface ListCreateResponse { /** * The unique ID of the list. */ - id?: string; + id: string; /** * The RFC 3339 timestamp of when the list was created. */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; + created_on: string; /** * The type of the list. Each type supports specific list items (IP addresses, * ASNs, hostnames or redirects). */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + kind: 'ip' | 'redirect' | 'hostname' | 'asn'; /** * The RFC 3339 timestamp of when the list was last modified. */ - modified_on?: string; + modified_on: string; /** * An informative name for the list. Use this name in filter and rule expressions. */ - name?: string; + name: string; /** * The number of items in the list. */ - num_items?: number; + num_items: number; + + /** + * The number of [filters](/api/resources/filters/) referencing the list. + */ + num_referencing_filters: number; /** - * The number of [filters](/operations/filters-list-filters) referencing the list. + * An informative summary of the list. */ - num_referencing_filters?: number; + description?: string; } export interface ListUpdateResponse { /** * The unique ID of the list. */ - id?: string; + id: string; /** * The RFC 3339 timestamp of when the list was created. */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; + created_on: string; /** * The type of the list. Each type supports specific list items (IP addresses, * ASNs, hostnames or redirects). */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + kind: 'ip' | 'redirect' | 'hostname' | 'asn'; /** * The RFC 3339 timestamp of when the list was last modified. */ - modified_on?: string; + modified_on: string; /** * An informative name for the list. Use this name in filter and rule expressions. */ - name?: string; + name: string; /** * The number of items in the list. */ - num_items?: number; + num_items: number; + + /** + * The number of [filters](/api/resources/filters/) referencing the list. + */ + num_referencing_filters: number; /** - * The number of [filters](/operations/filters-list-filters) referencing the list. + * An informative summary of the list. */ - num_referencing_filters?: number; + description?: string; } export interface ListDeleteResponse { /** * The unique ID of the list. */ - id?: string; + id: string; } export interface ListGetResponse { /** * The unique ID of the list. */ - id?: string; + id: string; /** * The RFC 3339 timestamp of when the list was created. */ - created_on?: string; - - /** - * An informative summary of the list. - */ - description?: string; + created_on: string; /** * The type of the list. Each type supports specific list items (IP addresses, * ASNs, hostnames or redirects). */ - kind?: 'ip' | 'redirect' | 'hostname' | 'asn'; + kind: 'ip' | 'redirect' | 'hostname' | 'asn'; /** * The RFC 3339 timestamp of when the list was last modified. */ - modified_on?: string; + modified_on: string; /** * An informative name for the list. Use this name in filter and rule expressions. */ - name?: string; + name: string; /** * The number of items in the list. */ - num_items?: number; + num_items: number; + + /** + * The number of [filters](/api/resources/filters/) referencing the list. + */ + num_referencing_filters: number; /** - * The number of [filters](/operations/filters-list-filters) referencing the list. + * An informative summary of the list. */ - num_referencing_filters?: number; + description?: string; } export interface ListCreateParams { diff --git a/tests/api-resources/rules/lists/items.test.ts b/tests/api-resources/rules/lists/items.test.ts index bf248e06bb..d93f6908eb 100644 --- a/tests/api-resources/rules/lists/items.test.ts +++ b/tests/api-resources/rules/lists/items.test.ts @@ -13,7 +13,7 @@ describe('resource items', () => { test('create: only required params', async () => { const responsePromise = client.rules.lists.items.create('2c0fc9fa937b11eaa1b71c4d701ab86e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ ip: '10.0.0.1' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -27,30 +27,14 @@ describe('resource items', () => { test('create: required and optional params', async () => { const response = await client.rules.lists.items.create('2c0fc9fa937b11eaa1b71c4d701ab86e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [ - { - asn: 5567, - comment: 'Private IP address', - hostname: { url_hostname: 'example.com', exclude_exact_hostname: true }, - ip: '10.0.0.1', - redirect: { - source_url: 'example.com/arch', - target_url: 'https://archlinux.org/', - include_subdomains: true, - preserve_path_suffix: true, - preserve_query_string: true, - status_code: 301, - subpath_matching: true, - }, - }, - ], + body: [{ ip: '10.0.0.1', comment: 'Private IP address' }], }); }); test('update: only required params', async () => { const responsePromise = client.rules.lists.items.update('2c0fc9fa937b11eaa1b71c4d701ab86e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ ip: '10.0.0.1' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -64,23 +48,7 @@ describe('resource items', () => { test('update: required and optional params', async () => { const response = await client.rules.lists.items.update('2c0fc9fa937b11eaa1b71c4d701ab86e', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [ - { - asn: 5567, - comment: 'Private IP address', - hostname: { url_hostname: 'example.com', exclude_exact_hostname: true }, - ip: '10.0.0.1', - redirect: { - source_url: 'example.com/arch', - target_url: 'https://archlinux.org/', - include_subdomains: true, - preserve_path_suffix: true, - preserve_query_string: true, - status_code: 301, - subpath_matching: true, - }, - }, - ], + body: [{ ip: '10.0.0.1', comment: 'Private IP address' }], }); }); From b5b410e152418a126b8401cf69103312433ebe13 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:18:30 +0000 Subject: [PATCH 042/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 82e7704519..22015b37d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3267b5a1548af02ecbcaaab9bd5ff5fdeb620f487802af9edbae8e3fc0797932.yml -openapi_spec_hash: 3cef24d9a1589e92e192cb855de613b0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8f1275a5b14fe1a16209a1b738cd192b75c92cc4b1083acc12b62084b56ab1c5.yml +openapi_spec_hash: c1176e500a0e648929825c85adaaaf8f config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 6a03019c72933c60cddd8cb4661cca8ccf787d8c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:36:09 +0000 Subject: [PATCH 043/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 22015b37d5..a0a052c23b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8f1275a5b14fe1a16209a1b738cd192b75c92cc4b1083acc12b62084b56ab1c5.yml -openapi_spec_hash: c1176e500a0e648929825c85adaaaf8f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56e800b98ba9548092810a7f79d0eef8a28ea184378c75ea2633d4a657c94317.yml +openapi_spec_hash: 920d7fa0e8ec03a4dcc3752cf228edda config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 57617658db737ff88dd9e795ebe2a94d3cf0a543 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:29:12 +0000 Subject: [PATCH 044/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a0a052c23b..0790c8c5a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-56e800b98ba9548092810a7f79d0eef8a28ea184378c75ea2633d4a657c94317.yml -openapi_spec_hash: 920d7fa0e8ec03a4dcc3752cf228edda +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1ca60bc03c8e9a1f116f4918b34b9155b3840c3c0a4c0dd72cb11d8b72dcb92.yml +openapi_spec_hash: 105040435021e7f54eafdbf27b2e7c5f config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 43b36e53d1a7dd50ff78134f5b1fbe26a91b8849 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 13:57:37 +0000 Subject: [PATCH 045/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0790c8c5a7..6c23dbc8f5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d1ca60bc03c8e9a1f116f4918b34b9155b3840c3c0a4c0dd72cb11d8b72dcb92.yml -openapi_spec_hash: 105040435021e7f54eafdbf27b2e7c5f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34f2968e2180fc45a124dde1935ef1de79fbe486ee2b70a595b71aa8fb3bd10a.yml +openapi_spec_hash: 784a5793565f98565f0a7d405d0046dc config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 213727d5b4a4ee38e59f27ab40bd9a41be9da628 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:28:44 +0000 Subject: [PATCH 046/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6c23dbc8f5..3f669f03b9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34f2968e2180fc45a124dde1935ef1de79fbe486ee2b70a595b71aa8fb3bd10a.yml -openapi_spec_hash: 784a5793565f98565f0a7d405d0046dc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba5b3a3391d644fb13b0a81649c1dcadb159e3790e61ea9bed34bcde8be20ee0.yml +openapi_spec_hash: 620fa62003733bd093cedde424b7cbe6 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 0ed0b3529e5afee4f37b240a0c766c51f452ba7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:39:31 +0000 Subject: [PATCH 047/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3f669f03b9..81c80070eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ba5b3a3391d644fb13b0a81649c1dcadb159e3790e61ea9bed34bcde8be20ee0.yml -openapi_spec_hash: 620fa62003733bd093cedde424b7cbe6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5587a7b51433f461387fdd6cd83772b9186bbf4420fcd0c82396963fa82322e6.yml +openapi_spec_hash: 9478d1ab7ffa8f07b7732806fce00b53 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From b912f9ec819c6542ff3fe5003cad6170e3b16674 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:05:35 +0000 Subject: [PATCH 048/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 81c80070eb..201558d55b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5587a7b51433f461387fdd6cd83772b9186bbf4420fcd0c82396963fa82322e6.yml -openapi_spec_hash: 9478d1ab7ffa8f07b7732806fce00b53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f1f481569f3b98164f374c61eb81c1d85ee7ac300591dee69716c3508d29831.yml +openapi_spec_hash: 6af747a8c0f6c7863011a8406189d185 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From a20cbab0e2a14ef60f5b7e4195b270fb1f2459d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:23:00 +0000 Subject: [PATCH 049/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 201558d55b..6c23dbc8f5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f1f481569f3b98164f374c61eb81c1d85ee7ac300591dee69716c3508d29831.yml -openapi_spec_hash: 6af747a8c0f6c7863011a8406189d185 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34f2968e2180fc45a124dde1935ef1de79fbe486ee2b70a595b71aa8fb3bd10a.yml +openapi_spec_hash: 784a5793565f98565f0a7d405d0046dc config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From ad9fc8c597e0dcdcdeaf789319aa10f956bfc97b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 15:29:03 +0000 Subject: [PATCH 050/423] feat(api): api update --- .stats.yml | 6 +- api.md | 14 -- scripts/detect-breaking-changes | 1 - .../cloudforce-one/threat-events/index.ts | 12 +- .../cloudforce-one/threat-events/insights.ts | 194 +----------------- .../threat-events/threat-events.ts | 44 ++-- .../threat-events/insights.test.ts | 100 --------- .../threat-events/threat-events.test.ts | 2 + 8 files changed, 29 insertions(+), 344 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/threat-events/insights.test.ts diff --git a/.stats.yml b/.stats.yml index 6c23dbc8f5..29a4588e95 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-34f2968e2180fc45a124dde1935ef1de79fbe486ee2b70a595b71aa8fb3bd10a.yml -openapi_spec_hash: 784a5793565f98565f0a7d405d0046dc +configured_endpoints: 1773 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e966b691beb6f28c5d8db69acd25d780a5491ae9dd852027b3b8ba8f07322b50.yml +openapi_spec_hash: 9de7da84cbe53e2fa9833a704dcd1491 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/api.md b/api.md index d32549459c..578ca0711b 100644 --- a/api.md +++ b/api.md @@ -8000,20 +8000,6 @@ Methods: ### Insights -Types: - -- InsightCreateResponse -- InsightDeleteResponse -- InsightEditResponse -- InsightGetResponse - -Methods: - -- client.cloudforceOne.threatEvents.insights.create(eventId, { ...params }) -> InsightCreateResponse -- client.cloudforceOne.threatEvents.insights.delete(eventId, insightId, { ...params }) -> InsightDeleteResponse -- client.cloudforceOne.threatEvents.insights.edit(eventId, insightId, { ...params }) -> InsightEditResponse -- client.cloudforceOne.threatEvents.insights.get(eventId, insightId, { ...params }) -> InsightGetResponse - # AIGateway Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 7ff2f52dfb..bf0c0ba669 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -682,7 +682,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/threat-events/tags.test.ts tests/api-resources/cloudforce-one/threat-events/event-tags.test.ts tests/api-resources/cloudforce-one/threat-events/target-industries.test.ts - tests/api-resources/cloudforce-one/threat-events/insights.test.ts tests/api-resources/ai-gateway/ai-gateway.test.ts tests/api-resources/ai-gateway/evaluation-types.test.ts tests/api-resources/ai-gateway/logs.test.ts diff --git a/src/resources/cloudforce-one/threat-events/index.ts b/src/resources/cloudforce-one/threat-events/index.ts index 146beb3bcc..6a36effbdf 100644 --- a/src/resources/cloudforce-one/threat-events/index.ts +++ b/src/resources/cloudforce-one/threat-events/index.ts @@ -47,17 +47,7 @@ export { type IndicatorTypeListResponse, type IndicatorTypeListParams, } from './indicator-types'; -export { - Insights, - type InsightCreateResponse, - type InsightDeleteResponse, - type InsightEditResponse, - type InsightGetResponse, - type InsightCreateParams, - type InsightDeleteParams, - type InsightEditParams, - type InsightGetParams, -} from './insights'; +export { Insights } from './insights'; export { Raw, type RawEditResponse, type RawGetResponse, type RawEditParams, type RawGetParams } from './raw'; export { Relate, type RelateDeleteResponse, type RelateDeleteParams } from './relate'; export { Tags, type TagCreateResponse, type TagCreateParams } from './tags'; diff --git a/src/resources/cloudforce-one/threat-events/insights.ts b/src/resources/cloudforce-one/threat-events/insights.ts index b20b1bc870..99fabeef7d 100644 --- a/src/resources/cloudforce-one/threat-events/insights.ts +++ b/src/resources/cloudforce-one/threat-events/insights.ts @@ -1,197 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Insights extends APIResource { - /** - * Adds an insight to an event - * - * @example - * ```ts - * const insight = - * await client.cloudforceOne.threatEvents.insights.create( - * 'event_id', - * { - * account_id: 'account_id', - * content: - * 'Here is some additional context _in markdown_', - * }, - * ); - * ``` - */ - create( - eventId: string, - params: InsightCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/cloudforce-one/events/${eventId}/insight/create`, { - body, - ...options, - }) as Core.APIPromise<{ result: InsightCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Deletes an event insight - * - * @example - * ```ts - * const insight = - * await client.cloudforceOne.threatEvents.insights.delete( - * 'event_id', - * 'insight_id', - * { account_id: 'account_id' }, - * ); - * ``` - */ - delete( - eventId: string, - insightId: string, - params: InsightDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete( - `/accounts/${account_id}/cloudforce-one/events/${eventId}/insight/${insightId}`, - options, - ) as Core.APIPromise<{ result: InsightDeleteResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Updates an event insight - * - * @example - * ```ts - * const response = - * await client.cloudforceOne.threatEvents.insights.edit( - * 'event_id', - * 'insight_id', - * { - * account_id: 'account_id', - * content: - * 'Updated: Here is some additional context _in markdown_', - * }, - * ); - * ``` - */ - edit( - eventId: string, - insightId: string, - params: InsightEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/cloudforce-one/events/${eventId}/insight/${insightId}`, { - body, - ...options, - }) as Core.APIPromise<{ result: InsightEditResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Reads an event insight - * - * @example - * ```ts - * const insight = - * await client.cloudforceOne.threatEvents.insights.get( - * 'event_id', - * 'insight_id', - * { account_id: 'account_id' }, - * ); - * ``` - */ - get( - eventId: string, - insightId: string, - params: InsightGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/cloudforce-one/events/${eventId}/insight/${insightId}`, - options, - ) as Core.APIPromise<{ result: InsightGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface InsightCreateResponse { - content: string; - - uuid: string; -} - -export interface InsightDeleteResponse { - success: boolean; -} - -export interface InsightEditResponse { - content: string; - - uuid: string; -} - -export interface InsightGetResponse { - content: string; - - uuid: string; -} - -export interface InsightCreateParams { - /** - * Path param: Account ID. - */ - account_id: string; - - /** - * Body param: - */ - content: string; -} - -export interface InsightDeleteParams { - /** - * Account ID. - */ - account_id: string; -} - -export interface InsightEditParams { - /** - * Path param: Account ID. - */ - account_id: string; - - /** - * Body param: - */ - content: string; -} - -export interface InsightGetParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace Insights { - export { - type InsightCreateResponse as InsightCreateResponse, - type InsightDeleteResponse as InsightDeleteResponse, - type InsightEditResponse as InsightEditResponse, - type InsightGetResponse as InsightGetResponse, - type InsightCreateParams as InsightCreateParams, - type InsightDeleteParams as InsightDeleteParams, - type InsightEditParams as InsightEditParams, - type InsightGetParams as InsightGetParams, - }; -} +export class Insights extends APIResource {} diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 967c7e19e4..e4bb2891e2 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -33,17 +33,7 @@ import { import * as IndicatorTypesAPI from './indicator-types'; import { IndicatorTypeListParams, IndicatorTypeListResponse, IndicatorTypes } from './indicator-types'; import * as InsightsAPI from './insights'; -import { - InsightCreateParams, - InsightCreateResponse, - InsightDeleteParams, - InsightDeleteResponse, - InsightEditParams, - InsightEditResponse, - InsightGetParams, - InsightGetResponse, - Insights, -} from './insights'; +import { Insights } from './insights'; import * as RawAPI from './raw'; import { Raw as RawAPIRaw, RawEditParams, RawEditResponse, RawGetParams, RawGetResponse } from './raw'; import * as RelateAPI from './relate'; @@ -725,6 +715,16 @@ export interface ThreatEventEditParams { */ indicatorType?: string; + /** + * Body param: + */ + insight?: string; + + /** + * Body param: + */ + raw?: ThreatEventEditParams.Raw; + /** * Body param: */ @@ -741,6 +741,16 @@ export interface ThreatEventEditParams { tlp?: string; } +export namespace ThreatEventEditParams { + export interface Raw { + data?: { [key: string]: unknown } | null; + + source?: string; + + tlp?: string; + } +} + export interface ThreatEventGetParams { /** * Account ID. @@ -865,15 +875,5 @@ export declare namespace ThreatEvents { type TargetIndustryListParams as TargetIndustryListParams, }; - export { - Insights as Insights, - type InsightCreateResponse as InsightCreateResponse, - type InsightDeleteResponse as InsightDeleteResponse, - type InsightEditResponse as InsightEditResponse, - type InsightGetResponse as InsightGetResponse, - type InsightCreateParams as InsightCreateParams, - type InsightDeleteParams as InsightDeleteParams, - type InsightEditParams as InsightEditParams, - type InsightGetParams as InsightGetParams, - }; + export { Insights as Insights }; } diff --git a/tests/api-resources/cloudforce-one/threat-events/insights.test.ts b/tests/api-resources/cloudforce-one/threat-events/insights.test.ts deleted file mode 100644 index 1b503085e8..0000000000 --- a/tests/api-resources/cloudforce-one/threat-events/insights.test.ts +++ /dev/null @@ -1,100 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource insights', () => { - // TODO: HTTP 401 from prism - test.skip('create: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.insights.create('event_id', { - account_id: 'account_id', - content: 'Here is some additional context _in markdown_', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: HTTP 401 from prism - test.skip('create: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.insights.create('event_id', { - account_id: 'account_id', - content: 'Here is some additional context _in markdown_', - }); - }); - - // TODO: HTTP 401 from prism - test.skip('delete: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.insights.delete('event_id', 'insight_id', { - account_id: 'account_id', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: HTTP 401 from prism - test.skip('delete: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.insights.delete('event_id', 'insight_id', { - account_id: 'account_id', - }); - }); - - // TODO: HTTP 401 from prism - test.skip('edit: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.insights.edit('event_id', 'insight_id', { - account_id: 'account_id', - content: 'Updated: Here is some additional context _in markdown_', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: HTTP 401 from prism - test.skip('edit: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.insights.edit('event_id', 'insight_id', { - account_id: 'account_id', - content: 'Updated: Here is some additional context _in markdown_', - }); - }); - - // TODO: HTTP 401 from prism - test.skip('get: only required params', async () => { - const responsePromise = client.cloudforceOne.threatEvents.insights.get('event_id', 'insight_id', { - account_id: 'account_id', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: HTTP 401 from prism - test.skip('get: required and optional params', async () => { - const response = await client.cloudforceOne.threatEvents.insights.get('event_id', 'insight_id', { - account_id: 'account_id', - }); - }); -}); diff --git a/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts b/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts index 6e9fdf6100..83816e42ed 100644 --- a/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts +++ b/tests/api-resources/cloudforce-one/threat-events/threat-events.test.ts @@ -170,6 +170,8 @@ describe('resource threatEvents', () => { event: 'An attacker registered the domain domain.com', indicator: 'domain2.com', indicatorType: 'sha256', + insight: 'new insight', + raw: { data: { foo: 'bar' }, source: 'example.com', tlp: 'amber' }, targetCountry: 'US', targetIndustry: 'Insurance', tlp: 'amber', From eb6648b3262f67f8079b24da6aa9aa3a40a6d662 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 16:44:56 +0000 Subject: [PATCH 051/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 29a4588e95..cc6a1ec339 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1773 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e966b691beb6f28c5d8db69acd25d780a5491ae9dd852027b3b8ba8f07322b50.yml -openapi_spec_hash: 9de7da84cbe53e2fa9833a704dcd1491 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8255c9a5d637233c8f672b126cd4d8618730b90a8432b5ea7ba5065df0b82b24.yml +openapi_spec_hash: df2012983c9a3a72569ced61618498d3 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From efcad5706fbfcba07ef8970bcb5b54d81c12420d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 17:29:04 +0000 Subject: [PATCH 052/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc6a1ec339..639a9c665e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1773 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8255c9a5d637233c8f672b126cd4d8618730b90a8432b5ea7ba5065df0b82b24.yml -openapi_spec_hash: df2012983c9a3a72569ced61618498d3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a2a574c41ee9e5cd3b63e8e7c07423be4adc5afa47920b5d1f2c9b8044c9dfb.yml +openapi_spec_hash: 5f5879a4b60876d93bffbb6abc8d2192 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From e01e1c40c0faca8eadf49e7f4721a27fe7db3f23 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 18:27:31 +0000 Subject: [PATCH 053/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 639a9c665e..d8e2022c50 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1773 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a2a574c41ee9e5cd3b63e8e7c07423be4adc5afa47920b5d1f2c9b8044c9dfb.yml -openapi_spec_hash: 5f5879a4b60876d93bffbb6abc8d2192 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-75f338b06c69ebec31979f3b66e3035635e65e4657a126cd5a8866fedac11c5e.yml +openapi_spec_hash: 532bf1ff1cd193bf9d35843c8ac5d5ee config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 From 2f8407c498917aa93b5d2c704aeb393a879c5548 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 18:53:07 +0000 Subject: [PATCH 054/423] feat(api): api update --- .stats.yml | 4 +- src/resources/abuse-reports.ts | 106 ++++------------------ tests/api-resources/abuse-reports.test.ts | 4 +- 3 files changed, 21 insertions(+), 93 deletions(-) diff --git a/.stats.yml b/.stats.yml index d8e2022c50..b5eb8c4a3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1773 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-75f338b06c69ebec31979f3b66e3035635e65e4657a126cd5a8866fedac11c5e.yml -openapi_spec_hash: 532bf1ff1cd193bf9d35843c8ac5d5ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ef60e0a6e6ea360f4ec097f02a529dfc8dd8d2d5e84bd506bed4836463090ff.yml +openapi_spec_hash: 79fb2f57dc2bbdd283d4238878994551 config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 diff --git a/src/resources/abuse-reports.ts b/src/resources/abuse-reports.ts index 0ce1da5514..451e42c504 100644 --- a/src/resources/abuse-reports.ts +++ b/src/resources/abuse-reports.ts @@ -8,15 +8,7 @@ export class AbuseReports extends APIResource { * Submit the Abuse Report of a particular type */ create( - reportType: - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei', + reportType: string, params: AbuseReportCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { @@ -53,17 +45,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_dmca'; /** * Body param: Text not exceeding 100 characters. This field may be released by @@ -202,17 +186,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_trademark' - | 'abuse_dmca' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_trademark'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -318,17 +294,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_general' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_general'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -441,17 +409,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_phishing' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_phishing'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -549,17 +509,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_children' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_threat' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_children'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -663,17 +615,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_threat' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_registrar_whois' - | 'abuse_ncsei'; + act: 'abuse_threat'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -764,17 +708,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_registrar_whois' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_ncsei'; + act: 'abuse_registrar_whois'; /** * Body param: A valid email of the abuse reporter. This field may be released by @@ -852,17 +788,9 @@ export declare namespace AbuseReportCreateParams { account_id: string; /** - * Body param: + * Body param: The abuse report type. */ - act: - | 'abuse_ncsei' - | 'abuse_dmca' - | 'abuse_trademark' - | 'abuse_general' - | 'abuse_phishing' - | 'abuse_children' - | 'abuse_threat' - | 'abuse_registrar_whois'; + act: 'abuse_ncsei'; /** * Body param: A valid email of the abuse reporter. This field may be released by diff --git a/tests/api-resources/abuse-reports.test.ts b/tests/api-resources/abuse-reports.test.ts index 71e6ac5f86..77af5bcdfb 100644 --- a/tests/api-resources/abuse-reports.test.ts +++ b/tests/api-resources/abuse-reports.test.ts @@ -12,7 +12,7 @@ const client = new Cloudflare({ describe('resource abuseReports', () => { // TODO: investigate unauthorized HTTP response test.skip('create: only required params', async () => { - const responsePromise = client.abuseReports.create('abuse_general', { + const responsePromise = client.abuseReports.create('report_type', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', act: 'abuse_dmca', address1: 'x', @@ -41,7 +41,7 @@ describe('resource abuseReports', () => { // TODO: investigate unauthorized HTTP response test.skip('create: required and optional params', async () => { - const response = await client.abuseReports.create('abuse_general', { + const response = await client.abuseReports.create('report_type', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', act: 'abuse_dmca', address1: 'x', From a545b28560f4cb902d8e76bf65af6f603a46aaa2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:10:21 +0000 Subject: [PATCH 055/423] feat(api): api update --- .stats.yml | 4 +- api.md | 6 +- src/resources/workers/scripts/deployments.ts | 157 +++++++++++++++++- src/resources/workers/scripts/index.ts | 4 + src/resources/workers/scripts/scripts.ts | 8 + .../workers/scripts/deployments.test.ts | 54 +++++- 6 files changed, 222 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index b5eb8c4a3a..307bc79987 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1773 +configured_endpoints: 1775 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ef60e0a6e6ea360f4ec097f02a529dfc8dd8d2d5e84bd506bed4836463090ff.yml openapi_spec_hash: 79fb2f57dc2bbdd283d4238878994551 -config_hash: bafeb7666d2b7868c9d4ab8f0cc686e1 +config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/api.md b/api.md index 578ca0711b..fcf8512035 100644 --- a/api.md +++ b/api.md @@ -2119,12 +2119,16 @@ Methods: Types: - DeploymentCreateResponse +- DeploymentListResponse +- DeploymentDeleteResponse - DeploymentGetResponse Methods: - client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse -- client.workers.scripts.deployments.get(scriptName, { ...params }) -> DeploymentGetResponse +- client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse +- client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse ### Versions diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index 50a590fb9a..e75138f7ed 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -50,22 +50,77 @@ export class Deployments extends APIResource { * * @example * ```ts + * const deployments = + * await client.workers.scripts.deployments.list( + * 'this-is_my_script-01', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + list( + scriptName: string, + params: DeploymentListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, + options, + ) as Core.APIPromise<{ result: DeploymentListResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Delete a Worker Deployment. The latest deployment, which is actively serving + * traffic, cannot be deleted. All other deployments can be deleted. + * + * @example + * ```ts + * const deployment = + * await client.workers.scripts.deployments.delete( + * 'this-is_my_script-01', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + scriptName: string, + deploymentId: string, + params: DeploymentDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete( + `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, + options, + ); + } + + /** + * Get information about a Worker Deployment. + * + * @example + * ```ts * const deployment = * await client.workers.scripts.deployments.get( * 'this-is_my_script-01', + * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ get( scriptName: string, + deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.get( - `/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, + `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, ) as Core.APIPromise<{ result: DeploymentGetResponse }> )._thenUnwrap((obj) => obj.result); @@ -103,11 +158,11 @@ export namespace DeploymentCreateResponse { } } -export interface DeploymentGetResponse { - deployments: Array; +export interface DeploymentListResponse { + deployments: Array; } -export namespace DeploymentGetResponse { +export namespace DeploymentListResponse { export interface Deployment { id: string; @@ -140,6 +195,82 @@ export namespace DeploymentGetResponse { } } +export interface DeploymentDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace DeploymentDeleteResponse { + 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 DeploymentGetResponse { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: DeploymentGetResponse.Annotations; + + author_email?: string; +} + +export namespace DeploymentGetResponse { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + } +} + export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -184,6 +315,20 @@ export namespace DeploymentCreateParams { } } +export interface DeploymentListParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface DeploymentDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + export interface DeploymentGetParams { /** * Identifier. @@ -194,8 +339,12 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { type DeploymentCreateResponse as DeploymentCreateResponse, + type DeploymentListResponse as DeploymentListResponse, + type DeploymentDeleteResponse as DeploymentDeleteResponse, type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, + type DeploymentListParams as DeploymentListParams, + type DeploymentDeleteParams as DeploymentDeleteParams, type DeploymentGetParams as DeploymentGetParams, }; } diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 1c8290db5c..ed521aefd1 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -5,8 +5,12 @@ export { Content, type ContentUpdateParams, type ContentGetParams } from './cont export { Deployments, type DeploymentCreateResponse, + type DeploymentListResponse, + type DeploymentDeleteResponse, type DeploymentGetResponse, type DeploymentCreateParams, + type DeploymentListParams, + type DeploymentDeleteParams, type DeploymentGetParams, } from './deployments'; export { diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 5eb0fca4aa..9497455e13 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -9,8 +9,12 @@ import * as DeploymentsAPI from './deployments'; import { DeploymentCreateParams, DeploymentCreateResponse, + DeploymentDeleteParams, + DeploymentDeleteResponse, DeploymentGetParams, DeploymentGetResponse, + DeploymentListParams, + DeploymentListResponse, Deployments, } from './deployments'; import * as SchedulesAPI from './schedules'; @@ -1298,8 +1302,12 @@ export declare namespace Scripts { export { Deployments as Deployments, type DeploymentCreateResponse as DeploymentCreateResponse, + type DeploymentListResponse as DeploymentListResponse, + type DeploymentDeleteResponse as DeploymentDeleteResponse, type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, + type DeploymentListParams as DeploymentListParams, + type DeploymentDeleteParams as DeploymentDeleteParams, type DeploymentGetParams as DeploymentGetParams, }; diff --git a/tests/api-resources/workers/scripts/deployments.test.ts b/tests/api-resources/workers/scripts/deployments.test.ts index 517a383fc9..ed72e63d33 100644 --- a/tests/api-resources/workers/scripts/deployments.test.ts +++ b/tests/api-resources/workers/scripts/deployments.test.ts @@ -35,8 +35,8 @@ describe('resource deployments', () => { }); }); - test('get: only required params', async () => { - const responsePromise = client.workers.scripts.deployments.get('this-is_my_script-01', { + test('list: only required params', async () => { + const responsePromise = client.workers.scripts.deployments.list('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); const rawResponse = await responsePromise.asResponse(); @@ -48,9 +48,55 @@ describe('resource deployments', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { - const response = await client.workers.scripts.deployments.get('this-is_my_script-01', { + test('list: required and optional params', async () => { + const response = await client.workers.scripts.deployments.list('this-is_my_script-01', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); + + test('delete: only required params', async () => { + const responsePromise = client.workers.scripts.deployments.delete( + 'this-is_my_script-01', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.workers.scripts.deployments.delete( + 'this-is_my_script-01', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); + + test('get: only required params', async () => { + const responsePromise = client.workers.scripts.deployments.get( + 'this-is_my_script-01', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.workers.scripts.deployments.get( + 'this-is_my_script-01', + '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); From 32ec2358fb3b13960b22b2b982876482cffe8a2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 20:21:20 +0000 Subject: [PATCH 056/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 307bc79987..233e36de72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ef60e0a6e6ea360f4ec097f02a529dfc8dd8d2d5e84bd506bed4836463090ff.yml -openapi_spec_hash: 79fb2f57dc2bbdd283d4238878994551 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d261d2afe3855ce9280b3637dcb74230f2983d8fede1904eea4fa09ef21815c.yml +openapi_spec_hash: 4b5c51bfdd7250d2428bfd147aa71fcb config_hash: 4a37da9893560914a7ac1a75cc01202a From 3637dad9ce1beacdfa27a9fd9f4d738eb4bdbf69 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 21:03:05 +0000 Subject: [PATCH 057/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 233e36de72..fadadd3c81 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d261d2afe3855ce9280b3637dcb74230f2983d8fede1904eea4fa09ef21815c.yml -openapi_spec_hash: 4b5c51bfdd7250d2428bfd147aa71fcb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-06d2f63d5264a92aeb69617a5fe4c285a100154b1f1d21d142571ce72272d5d0.yml +openapi_spec_hash: cef43ab586521b87b45148240a4afd08 config_hash: 4a37da9893560914a7ac1a75cc01202a From f6953aba85347db746c9d79f82614b249ca673ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 21:26:45 +0000 Subject: [PATCH 058/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/accounts/tokens/tokens.ts | 4 ++-- src/resources/shared.ts | 4 ++-- src/resources/user/tokens/tokens.ts | 4 ++-- tests/api-resources/accounts/tokens/tokens.test.ts | 8 ++++---- tests/api-resources/user/tokens/tokens.test.ts | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index fadadd3c81..971a4f5203 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-06d2f63d5264a92aeb69617a5fe4c285a100154b1f1d21d142571ce72272d5d0.yml -openapi_spec_hash: cef43ab586521b87b45148240a4afd08 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7236570f7fb137229c57fa7922558babb89b8237d6d6d379600875e6a30a1f0.yml +openapi_spec_hash: 9c7de431e765ad603b3428f08f797b9e config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index 964d4dbf9b..b692b07568 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -38,7 +38,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: { object: 'bar', string: 'bar' }, * }, * ], * }); @@ -70,7 +70,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: { object: 'bar', string: 'bar' }, * }, * ], * }, diff --git a/src/resources/shared.ts b/src/resources/shared.ts index f6bea7bc14..76cb6f7b97 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -890,7 +890,7 @@ export interface TokenPolicy { /** * A list of resource names that the policy applies to. */ - resources: { [key: string]: string | { [key: string]: string } }; + resources: { [key: string]: unknown }; } export namespace TokenPolicy { @@ -941,7 +941,7 @@ export interface TokenPolicyParam { /** * A list of resource names that the policy applies to. */ - resources: { [key: string]: string | { [key: string]: string } }; + resources: { [key: string]: unknown }; } export namespace TokenPolicyParam { diff --git a/src/resources/user/tokens/tokens.ts b/src/resources/user/tokens/tokens.ts index 9f9e3ddc28..5feaa17123 100644 --- a/src/resources/user/tokens/tokens.ts +++ b/src/resources/user/tokens/tokens.ts @@ -36,7 +36,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: { object: 'bar', string: 'bar' }, * }, * ], * }); @@ -66,7 +66,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { foo: 'string' }, + * resources: { object: 'bar', string: 'bar' }, * }, * ], * }, diff --git a/tests/api-resources/accounts/tokens/tokens.test.ts b/tests/api-resources/accounts/tokens/tokens.test.ts index 0248b48cf9..b5000c5d8c 100644 --- a/tests/api-resources/accounts/tokens/tokens.test.ts +++ b/tests/api-resources/accounts/tokens/tokens.test.ts @@ -22,7 +22,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], }); @@ -47,7 +47,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], condition: { @@ -73,7 +73,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], }); @@ -98,7 +98,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], condition: { diff --git a/tests/api-resources/user/tokens/tokens.test.ts b/tests/api-resources/user/tokens/tokens.test.ts index 6daec91f23..943353be3a 100644 --- a/tests/api-resources/user/tokens/tokens.test.ts +++ b/tests/api-resources/user/tokens/tokens.test.ts @@ -21,7 +21,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], }); @@ -45,7 +45,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], condition: { @@ -70,7 +70,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], }); @@ -94,7 +94,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { foo: 'string' }, + resources: { object: 'bar', string: 'bar' }, }, ], condition: { From 99e7d541186ba209783a1977fa04886af844e0f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:17:39 +0000 Subject: [PATCH 059/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 971a4f5203..8026c4aecf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b7236570f7fb137229c57fa7922558babb89b8237d6d6d379600875e6a30a1f0.yml -openapi_spec_hash: 9c7de431e765ad603b3428f08f797b9e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0e4192cef7b489c4d61e055667ff40a9ac086247f84e07f2db68247ec8e61d4b.yml +openapi_spec_hash: 92890d32e06728dad81a9613c60e7264 config_hash: 4a37da9893560914a7ac1a75cc01202a From 5a332f7ef9c90d9cecfb2cab3a999da3321fb69c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:34:23 +0000 Subject: [PATCH 060/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8026c4aecf..5e51a89006 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0e4192cef7b489c4d61e055667ff40a9ac086247f84e07f2db68247ec8e61d4b.yml -openapi_spec_hash: 92890d32e06728dad81a9613c60e7264 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-78d57beeb3345afbf4080e1966d72f6350a8d8a965bde9b81ae43101f971fdc3.yml +openapi_spec_hash: 6887e410fed128ffec6a86d38669beb8 config_hash: 4a37da9893560914a7ac1a75cc01202a From 30e2f1682a800b717ab018a20775f388ea59a7bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 22:45:27 +0000 Subject: [PATCH 061/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5e51a89006..5cad8418a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-78d57beeb3345afbf4080e1966d72f6350a8d8a965bde9b81ae43101f971fdc3.yml -openapi_spec_hash: 6887e410fed128ffec6a86d38669beb8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4509efd70f60632a97fb735ccd436c3afbc8fe77c7b871d06fe00b27f2d7bd2f.yml +openapi_spec_hash: c614f5b658079d60ee69cb61106f51e8 config_hash: 4a37da9893560914a7ac1a75cc01202a From 650924497f9909bc8e82bb2ccb6473a886488583 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 21 Jul 2025 23:27:04 +0000 Subject: [PATCH 062/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5cad8418a5..8fde3dfe80 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4509efd70f60632a97fb735ccd436c3afbc8fe77c7b871d06fe00b27f2d7bd2f.yml -openapi_spec_hash: c614f5b658079d60ee69cb61106f51e8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3642238a0fcdc091efbca5515455c92c73e4d66478c4dca432a6109fa97e130f.yml +openapi_spec_hash: 24a2895c05baa9100b3cda54d3ab9e19 config_hash: 4a37da9893560914a7ac1a75cc01202a From 47946c52c6644bc2889b184284c00dc0996d656c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 01:21:36 +0000 Subject: [PATCH 063/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/accounts/tokens/tokens.ts | 4 ++-- src/resources/shared.ts | 4 ++-- src/resources/user/tokens/tokens.ts | 4 ++-- tests/api-resources/accounts/tokens/tokens.test.ts | 8 ++++---- tests/api-resources/user/tokens/tokens.test.ts | 8 ++++---- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8fde3dfe80..5d81a1bdc4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3642238a0fcdc091efbca5515455c92c73e4d66478c4dca432a6109fa97e130f.yml -openapi_spec_hash: 24a2895c05baa9100b3cda54d3ab9e19 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cb6b87f45c66e5a30eb913c34f701a5609b2761a5cc0c6ae3a9dd56632ab4cc.yml +openapi_spec_hash: 805bdec318dc4e872b6bed9e2789a4f0 config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/src/resources/accounts/tokens/tokens.ts b/src/resources/accounts/tokens/tokens.ts index b692b07568..964d4dbf9b 100644 --- a/src/resources/accounts/tokens/tokens.ts +++ b/src/resources/accounts/tokens/tokens.ts @@ -38,7 +38,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { object: 'bar', string: 'bar' }, + * resources: { foo: 'string' }, * }, * ], * }); @@ -70,7 +70,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { object: 'bar', string: 'bar' }, + * resources: { foo: 'string' }, * }, * ], * }, diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 76cb6f7b97..7f91d0aad0 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -890,7 +890,7 @@ export interface TokenPolicy { /** * A list of resource names that the policy applies to. */ - resources: { [key: string]: unknown }; + resources: { [key: string]: string } | { [key: string]: { [key: string]: string } }; } export namespace TokenPolicy { @@ -941,7 +941,7 @@ export interface TokenPolicyParam { /** * A list of resource names that the policy applies to. */ - resources: { [key: string]: unknown }; + resources: { [key: string]: string } | { [key: string]: { [key: string]: string } }; } export namespace TokenPolicyParam { diff --git a/src/resources/user/tokens/tokens.ts b/src/resources/user/tokens/tokens.ts index 5feaa17123..9f9e3ddc28 100644 --- a/src/resources/user/tokens/tokens.ts +++ b/src/resources/user/tokens/tokens.ts @@ -36,7 +36,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { object: 'bar', string: 'bar' }, + * resources: { foo: 'string' }, * }, * ], * }); @@ -66,7 +66,7 @@ export class Tokens extends APIResource { * { id: 'c8fed203ed3043cba015a93ad1616f1f' }, * { id: '82e64a83756745bbbb1c9c2701bf816b' }, * ], - * resources: { object: 'bar', string: 'bar' }, + * resources: { foo: 'string' }, * }, * ], * }, diff --git a/tests/api-resources/accounts/tokens/tokens.test.ts b/tests/api-resources/accounts/tokens/tokens.test.ts index b5000c5d8c..0248b48cf9 100644 --- a/tests/api-resources/accounts/tokens/tokens.test.ts +++ b/tests/api-resources/accounts/tokens/tokens.test.ts @@ -22,7 +22,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], }); @@ -47,7 +47,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], condition: { @@ -73,7 +73,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], }); @@ -98,7 +98,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], condition: { diff --git a/tests/api-resources/user/tokens/tokens.test.ts b/tests/api-resources/user/tokens/tokens.test.ts index 943353be3a..6daec91f23 100644 --- a/tests/api-resources/user/tokens/tokens.test.ts +++ b/tests/api-resources/user/tokens/tokens.test.ts @@ -21,7 +21,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], }); @@ -45,7 +45,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], condition: { @@ -70,7 +70,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f' }, { id: '82e64a83756745bbbb1c9c2701bf816b' }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], }); @@ -94,7 +94,7 @@ describe('resource tokens', () => { { id: 'c8fed203ed3043cba015a93ad1616f1f', meta: { key: 'key', value: 'value' } }, { id: '82e64a83756745bbbb1c9c2701bf816b', meta: { key: 'key', value: 'value' } }, ], - resources: { object: 'bar', string: 'bar' }, + resources: { foo: 'string' }, }, ], condition: { From c507acb8869d894945277be74dd49f8476cd19d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 06:11:37 +0000 Subject: [PATCH 064/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d81a1bdc4..87a4f924a2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cb6b87f45c66e5a30eb913c34f701a5609b2761a5cc0c6ae3a9dd56632ab4cc.yml -openapi_spec_hash: 805bdec318dc4e872b6bed9e2789a4f0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c8b54845ed67539699f6055140320768b6c96bad028bf089511ee5aaf153a0e7.yml +openapi_spec_hash: fda520cb2574281d90bd1a9e6a2b36d3 config_hash: 4a37da9893560914a7ac1a75cc01202a From 0ed72a4ac4000672f7564137b24fafb343ef9519 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 06:24:21 +0000 Subject: [PATCH 065/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 87a4f924a2..81764a7e20 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c8b54845ed67539699f6055140320768b6c96bad028bf089511ee5aaf153a0e7.yml -openapi_spec_hash: fda520cb2574281d90bd1a9e6a2b36d3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-203c8c7034527bc2c3feb3b0e26522813574fa0f150833b436a35c6f70f14d76.yml +openapi_spec_hash: 02236f066f9b3b9c5fd1ac42a70beb8a config_hash: 4a37da9893560914a7ac1a75cc01202a From 38acd23484f050c10fea106d2d41e58c5e51d2d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 08:35:10 +0000 Subject: [PATCH 066/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 81764a7e20..e56690a48f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-203c8c7034527bc2c3feb3b0e26522813574fa0f150833b436a35c6f70f14d76.yml -openapi_spec_hash: 02236f066f9b3b9c5fd1ac42a70beb8a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7041628cf0d2afed7b64536d404b91abad90d4203c64c6289c02c5d65aa2f8c8.yml +openapi_spec_hash: fc297d0a0a93df81a66c090a3d1ac374 config_hash: 4a37da9893560914a7ac1a75cc01202a From f5ed79d9d2040c90e04f18e7798c2e34da606d9f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:12:14 +0000 Subject: [PATCH 067/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/rulesets/rules.ts | 32 ++++++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index e56690a48f..d6e9e17878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7041628cf0d2afed7b64536d404b91abad90d4203c64c6289c02c5d65aa2f8c8.yml -openapi_spec_hash: fc297d0a0a93df81a66c090a3d1ac374 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f759309b015ca845e3ba5577121deedfa5cce762cb1df35e6bf2d846f485cf59.yml +openapi_spec_hash: 5fcc8f88643596819d2afd717be92c53 config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/src/resources/rulesets/rules.ts b/src/resources/rulesets/rules.ts index 1bb54af0c9..7fa53d2d14 100644 --- a/src/resources/rulesets/rules.ts +++ b/src/resources/rulesets/rules.ts @@ -4828,7 +4828,7 @@ export namespace SetCacheSettingsRule { /** * Determines which browser ttl mode to use. */ - mode: 'respect_origin' | 'bypass_by_default' | 'override_origin'; + mode: 'respect_origin' | 'bypass_by_default' | 'override_origin' | 'bypass'; /** * The TTL (in seconds) if you choose override_origin mode. @@ -5344,7 +5344,7 @@ export namespace SetCacheSettingsRuleParam { /** * Determines which browser ttl mode to use. */ - mode: 'respect_origin' | 'bypass_by_default' | 'override_origin'; + mode: 'respect_origin' | 'bypass_by_default' | 'override_origin' | 'bypass'; /** * The TTL (in seconds) if you choose override_origin mode. @@ -6273,6 +6273,12 @@ export namespace SkipRule { * The parameters configuring the rule's action. */ export interface ActionParameters { + /** + * A phase to skip the execution of. This property is only compatible with + * products. + */ + phase?: 'current'; + /** * A list of phases to skip the execution of. This option is incompatible with the * rulesets option. @@ -6427,6 +6433,12 @@ export namespace SkipRuleParam { * The parameters configuring the rule's action. */ export interface ActionParameters { + /** + * A phase to skip the execution of. This property is only compatible with + * products. + */ + phase?: 'current'; + /** * A list of phases to skip the execution of. This option is incompatible with the * rulesets option. @@ -10359,6 +10371,12 @@ export declare namespace RuleCreateParams { * The parameters configuring the rule's action. */ export interface ActionParameters { + /** + * A phase to skip the execution of. This property is only compatible with + * products. + */ + phase?: 'current'; + /** * A list of phases to skip the execution of. This option is incompatible with the * rulesets option. @@ -10646,7 +10664,7 @@ export declare namespace RuleCreateParams { /** * Determines which browser ttl mode to use. */ - mode: 'respect_origin' | 'bypass_by_default' | 'override_origin'; + mode: 'respect_origin' | 'bypass_by_default' | 'override_origin' | 'bypass'; /** * The TTL (in seconds) if you choose override_origin mode. @@ -14501,6 +14519,12 @@ export declare namespace RuleEditParams { * The parameters configuring the rule's action. */ export interface ActionParameters { + /** + * A phase to skip the execution of. This property is only compatible with + * products. + */ + phase?: 'current'; + /** * A list of phases to skip the execution of. This option is incompatible with the * rulesets option. @@ -14788,7 +14812,7 @@ export declare namespace RuleEditParams { /** * Determines which browser ttl mode to use. */ - mode: 'respect_origin' | 'bypass_by_default' | 'override_origin'; + mode: 'respect_origin' | 'bypass_by_default' | 'override_origin' | 'bypass'; /** * The TTL (in seconds) if you choose override_origin mode. From ef2198a349838ba6224e0b4c129471ea150d4c6f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 09:54:42 +0000 Subject: [PATCH 068/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/images/v1/v1.ts | 21 +++++++++++++++++++ src/resources/images/v2/direct-uploads.ts | 5 +++++ src/resources/images/v2/v2.ts | 6 ++++++ tests/api-resources/images/v1/v1.test.ts | 3 +++ .../images/v2/direct-uploads.test.ts | 1 + tests/api-resources/images/v2/v2.test.ts | 1 + 7 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6e9e17878..51618582db 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f759309b015ca845e3ba5577121deedfa5cce762cb1df35e6bf2d846f485cf59.yml -openapi_spec_hash: 5fcc8f88643596819d2afd717be92c53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-59241dbd4fa8b7b8cca89221a611c2b835cdb65ffb8e0c6f2626581cdafb5280.yml +openapi_spec_hash: e1b565911799ceedcc1aec7b0d3ced13 config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/src/resources/images/v1/v1.ts b/src/resources/images/v1/v1.ts index cb64db9ee9..7ce33e9224 100644 --- a/src/resources/images/v1/v1.ts +++ b/src/resources/images/v1/v1.ts @@ -151,6 +151,11 @@ export interface Image { */ id?: string; + /** + * Can set the creator field with an internal user ID. + */ + creator?: string | null; + /** * Image file name. */ @@ -196,6 +201,11 @@ export interface V1CreateParams { */ id?: string; + /** + * Body param: Can set the creator field with an internal user ID. + */ + creator?: string; + /** * Body param: An image binary data. Only needed when type is uploading a file. */ @@ -225,6 +235,12 @@ export interface V1ListParams extends V4PagePaginationParams { * Path param: Account identifier tag. */ account_id: string; + + /** + * Query param: Internal user ID set within the creator field. Setting to empty + * string "" will return images where creator field is not set + */ + creator?: string | null; } export interface V1DeleteParams { @@ -240,6 +256,11 @@ export interface V1EditParams { */ account_id: string; + /** + * Body param: Can set the creator field with an internal user ID. + */ + creator?: string; + /** * Body param: User modifiable key-value store. Can be used for keeping references * to another system of record for managing images. No change if not specified. diff --git a/src/resources/images/v2/direct-uploads.ts b/src/resources/images/v2/direct-uploads.ts index fa7ddfc176..a38db90b45 100644 --- a/src/resources/images/v2/direct-uploads.ts +++ b/src/resources/images/v2/direct-uploads.ts @@ -61,6 +61,11 @@ export interface DirectUploadCreateParams { */ id?: string; + /** + * Body param: Can set the creator field with an internal user ID. + */ + creator?: string; + /** * Body param: The date after which the upload will not be accepted. Minimum: Now + * 2 minutes. Maximum: Now + 6 hours. diff --git a/src/resources/images/v2/v2.ts b/src/resources/images/v2/v2.ts index 30f06e231f..63d32823e7 100644 --- a/src/resources/images/v2/v2.ts +++ b/src/resources/images/v2/v2.ts @@ -53,6 +53,12 @@ export interface V2ListParams { */ continuation_token?: string | null; + /** + * Query param: Internal user ID set within the creator field. Setting to empty + * string "" will return images where creator field is not set + */ + creator?: string | null; + /** * Query param: Number of items per page. */ diff --git a/tests/api-resources/images/v1/v1.test.ts b/tests/api-resources/images/v1/v1.test.ts index ba9a063400..870ee3171d 100644 --- a/tests/api-resources/images/v1/v1.test.ts +++ b/tests/api-resources/images/v1/v1.test.ts @@ -27,6 +27,7 @@ describe('resource v1', () => { const response = await client.images.v1.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', id: 'id', + creator: 'creator', file: await toFile(Buffer.from('# my file contents'), 'README.md'), metadata: {}, requireSignedURLs: true, @@ -48,6 +49,7 @@ describe('resource v1', () => { test('list: required and optional params', async () => { const response = await client.images.v1.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + creator: 'creator', page: 1, per_page: 10, }); @@ -88,6 +90,7 @@ describe('resource v1', () => { test('edit: required and optional params', async () => { const response = await client.images.v1.edit('image_id', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + creator: 'creator', metadata: {}, requireSignedURLs: true, }); diff --git a/tests/api-resources/images/v2/direct-uploads.test.ts b/tests/api-resources/images/v2/direct-uploads.test.ts index 7322e2c265..5496076bff 100644 --- a/tests/api-resources/images/v2/direct-uploads.test.ts +++ b/tests/api-resources/images/v2/direct-uploads.test.ts @@ -29,6 +29,7 @@ describe('resource directUploads', () => { const response = await client.images.v2.directUploads.create({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', id: 'this/is/my-customid', + creator: 'creator', expiry: '2021-01-02T02:20:00Z', metadata: {}, requireSignedURLs: true, diff --git a/tests/api-resources/images/v2/v2.test.ts b/tests/api-resources/images/v2/v2.test.ts index 4ab436dde7..f024297c79 100644 --- a/tests/api-resources/images/v2/v2.test.ts +++ b/tests/api-resources/images/v2/v2.test.ts @@ -25,6 +25,7 @@ describe('resource v2', () => { const response = await client.images.v2.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', continuation_token: 'continuation_token', + creator: 'creator', per_page: 10, sort_order: 'asc', }); From f53e9b088a4793980b998209e693f0eaef473ca2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:26:35 +0000 Subject: [PATCH 069/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 51618582db..b1fc020729 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-59241dbd4fa8b7b8cca89221a611c2b835cdb65ffb8e0c6f2626581cdafb5280.yml -openapi_spec_hash: e1b565911799ceedcc1aec7b0d3ced13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-adb37d2cf4c59719d13ef439e4bafbbf0d9626f50d4237e18a89a8945f678b9e.yml +openapi_spec_hash: c97c7f85a9d3d9f7ae00b38cc2cc4d02 config_hash: 4a37da9893560914a7ac1a75cc01202a From 626b59b2f28ac06ad49e090b97779106089c6bca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 10:55:49 +0000 Subject: [PATCH 070/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b1fc020729..e162adaf8d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-adb37d2cf4c59719d13ef439e4bafbbf0d9626f50d4237e18a89a8945f678b9e.yml -openapi_spec_hash: c97c7f85a9d3d9f7ae00b38cc2cc4d02 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4e0fc975f26165c1665bb22edc2976c1fcc8eaa913d7a3746d9c46a04ab08208.yml +openapi_spec_hash: c28459aa1d5b1e3f78bbacf881a1c475 config_hash: 4a37da9893560914a7ac1a75cc01202a From 8df45d24c3500f412643a146f8403df8d9f7151b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 11:08:59 +0000 Subject: [PATCH 071/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e162adaf8d..e54179f2ff 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4e0fc975f26165c1665bb22edc2976c1fcc8eaa913d7a3746d9c46a04ab08208.yml -openapi_spec_hash: c28459aa1d5b1e3f78bbacf881a1c475 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29e381db5eafe31a9ad5bcd56383804b78e1563b55775c600d1c15357a6aab25.yml +openapi_spec_hash: fbf07cecb8ffa77ff1fc391bd14881d1 config_hash: 4a37da9893560914a7ac1a75cc01202a From f8be97292ea7d9cbc3f0615d70ffd2f422668367 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 12:42:24 +0000 Subject: [PATCH 072/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e54179f2ff..be78bfb642 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29e381db5eafe31a9ad5bcd56383804b78e1563b55775c600d1c15357a6aab25.yml -openapi_spec_hash: fbf07cecb8ffa77ff1fc391bd14881d1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db576e0ecd56bb9bf5bdd2d8c4bd3df8b4a1eafda5469528e6b25f8292b31764.yml +openapi_spec_hash: 328863e07a37d5f467c422e5a610aaa9 config_hash: 4a37da9893560914a7ac1a75cc01202a From ac613fef6b14c267457c9c64c3c2ff284bb4d4f0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:18:59 +0000 Subject: [PATCH 073/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index be78bfb642..0a62a36fb9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-db576e0ecd56bb9bf5bdd2d8c4bd3df8b4a1eafda5469528e6b25f8292b31764.yml -openapi_spec_hash: 328863e07a37d5f467c422e5a610aaa9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac18a3d5dcd7820ecac9febb1237496d5e8c47ad800bea3e88a933f071286785.yml +openapi_spec_hash: 633b0a64325e6d8f62e555641c93ea0d config_hash: 4a37da9893560914a7ac1a75cc01202a From 848483c4772d15a65cde1f8b0219d3b755d0ab52 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:33:32 +0000 Subject: [PATCH 074/423] feat(api): api update --- .stats.yml | 4 +- api.md | 16 +- src/resources/snippets/content.ts | 15 +- src/resources/snippets/index.ts | 1 + src/resources/snippets/rules.ts | 183 ++++++++++++------ src/resources/snippets/snippets.ts | 166 ++++++++-------- tests/api-resources/snippets/content.test.ts | 4 +- tests/api-resources/snippets/rules.test.ts | 23 ++- tests/api-resources/snippets/snippets.test.ts | 38 ++-- 9 files changed, 263 insertions(+), 187 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a62a36fb9..56b0f33d11 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ac18a3d5dcd7820ecac9febb1237496d5e8c47ad800bea3e88a933f071286785.yml -openapi_spec_hash: 633b0a64325e6d8f62e555641c93ea0d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11f530e0accb1d6d9ee14a3a1fdf9e99ebff98e60ac7f59edbd17aafb11e2007.yml +openapi_spec_hash: 185fb53ac70e4b381c40c7e8d291df98 config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/api.md b/api.md index fcf8512035..94ccf2b19e 100644 --- a/api.md +++ b/api.md @@ -7671,15 +7671,17 @@ Methods: Types: -- Snippet +- SnippetUpdateResponse +- SnippetListResponse - SnippetDeleteResponse +- SnippetGetResponse Methods: -- client.snippets.update(snippetName, { ...params }) -> Snippet -- client.snippets.list({ ...params }) -> SnippetsSinglePage -- client.snippets.delete(snippetName, { ...params }) -> SnippetDeleteResponse -- client.snippets.get(snippetName, { ...params }) -> Snippet +- client.snippets.update(snippetName, { ...params }) -> SnippetUpdateResponse +- client.snippets.list({ ...params }) -> SnippetListResponsesV4PagePaginationArray +- client.snippets.delete(snippetName, { ...params }) -> SnippetDeleteResponse | null +- client.snippets.get(snippetName, { ...params }) -> SnippetGetResponse ## Content @@ -7697,9 +7699,9 @@ Types: Methods: -- client.snippets.rules.update({ ...params }) -> RuleUpdateResponsesSinglePage +- client.snippets.rules.update([ ...body ]) -> RuleUpdateResponsesSinglePage - client.snippets.rules.list({ ...params }) -> RuleListResponsesSinglePage -- client.snippets.rules.delete({ ...params }) -> RuleDeleteResponse +- client.snippets.rules.delete({ ...params }) -> RuleDeleteResponsesSinglePage # Calls diff --git a/src/resources/snippets/content.ts b/src/resources/snippets/content.ts index 219beeca59..4f651ea537 100644 --- a/src/resources/snippets/content.ts +++ b/src/resources/snippets/content.ts @@ -6,18 +6,7 @@ import { type Response } from '../../_shims/index'; export class Content extends APIResource { /** - * Snippet Content - * - * @example - * ```ts - * const content = await client.snippets.content.get( - * 'snippet_name_01', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * - * const data = await content.blob(); - * console.log(data); - * ``` + * Fetches the content of a snippet belonging to the zone. */ get( snippetName: string, @@ -35,7 +24,7 @@ export class Content extends APIResource { export interface ContentGetParams { /** - * Identifier + * The unique ID of the zone. */ zone_id: string; } diff --git a/src/resources/snippets/index.ts b/src/resources/snippets/index.ts index 66e9b771d0..0402f0d9f7 100644 --- a/src/resources/snippets/index.ts +++ b/src/resources/snippets/index.ts @@ -4,6 +4,7 @@ export { Content, type ContentGetParams } from './content'; export { RuleUpdateResponsesSinglePage, RuleListResponsesSinglePage, + RuleDeleteResponsesSinglePage, Rules, type RuleUpdateResponse, type RuleListResponse, diff --git a/src/resources/snippets/rules.ts b/src/resources/snippets/rules.ts index 69cf9823b9..407f9e5612 100644 --- a/src/resources/snippets/rules.ts +++ b/src/resources/snippets/rules.ts @@ -2,47 +2,26 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; import { SinglePage } from '../../pagination'; export class Rules extends APIResource { /** - * Put Rules - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const ruleUpdateResponse of client.snippets.rules.update( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * Updates all snippet rules belonging to the zone. */ update( params: RuleUpdateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, ...body } = params; + const { zone_id, body } = params; return this._client.getAPIList( `/zones/${zone_id}/snippets/snippet_rules`, RuleUpdateResponsesSinglePage, - { body, method: 'put', ...options }, + { body: body, method: 'put', ...options }, ); } /** - * Rules - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const ruleListResponse of client.snippets.rules.list( - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` + * Fetches all snippet rules belonging to the zone. */ list( params: RuleListParams, @@ -57,18 +36,18 @@ export class Rules extends APIResource { } /** - * Delete All Rules - * - * @example - * ```ts - * const rule = await client.snippets.rules.delete({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` + * Deletes all snippet rules belonging to the zone. */ - delete(params: RuleDeleteParams, options?: Core.RequestOptions): Core.APIPromise { + delete( + params: RuleDeleteParams, + options?: Core.RequestOptions, + ): Core.PagePromise { const { zone_id } = params; - return this._client.delete(`/zones/${zone_id}/snippets/snippet_rules`, options); + return this._client.getAPIList( + `/zones/${zone_id}/snippets/snippet_rules`, + RuleDeleteResponsesSinglePage, + { method: 'delete', ...options }, + ); } } @@ -76,86 +55,169 @@ export class RuleUpdateResponsesSinglePage extends SinglePage {} +export class RuleDeleteResponsesSinglePage extends SinglePage {} + +/** + * A snippet rule. + */ export interface RuleUpdateResponse { - description?: string; + /** + * The unique ID of the rule. + */ + id: string; - enabled?: boolean; + /** + * The expression defining which traffic will match the rule. + */ + expression: string; - expression?: string; + /** + * The timestamp of when the rule was last modified. + */ + last_updated: string; /** - * Snippet identifying name + * The identifying name of the snippet. */ - snippet_name?: string; -} + snippet_name: string; -export interface RuleListResponse { + /** + * An informative description of the rule. + */ description?: string; + /** + * Whether the rule should be executed. + */ enabled?: boolean; +} + +/** + * A snippet rule. + */ +export interface RuleListResponse { + /** + * The unique ID of the rule. + */ + id: string; + + /** + * The expression defining which traffic will match the rule. + */ + expression: string; + + /** + * The timestamp of when the rule was last modified. + */ + last_updated: string; + + /** + * The identifying name of the snippet. + */ + snippet_name: string; - expression?: string; + /** + * An informative description of the rule. + */ + description?: string; /** - * Snippet identifying name + * Whether the rule should be executed. */ - snippet_name?: string; + enabled?: boolean; } +/** + * A snippet rule. + */ export interface RuleDeleteResponse { - errors: Array; + /** + * The unique ID of the rule. + */ + id: string; + + /** + * The expression defining which traffic will match the rule. + */ + expression: string; + + /** + * The timestamp of when the rule was last modified. + */ + last_updated: string; + + /** + * The identifying name of the snippet. + */ + snippet_name: string; - messages: Array; + /** + * An informative description of the rule. + */ + description?: string; /** - * Whether the API call was successful + * Whether the rule should be executed. */ - success: true; + enabled?: boolean; } export interface RuleUpdateParams { /** - * Path param: Identifier + * Path param: The unique ID of the zone. */ zone_id: string; /** - * Body param: List of snippet rules + * Body param: A list of snippet rules. */ - rules?: Array; + body: Array; } export namespace RuleUpdateParams { - export interface Rule { - description?: string; + /** + * A snippet rule. + */ + export interface Body { + /** + * The expression defining which traffic will match the rule. + */ + expression: string; - enabled?: boolean; + /** + * The identifying name of the snippet. + */ + snippet_name: string; - expression?: string; + /** + * An informative description of the rule. + */ + description?: string; /** - * Snippet identifying name + * Whether the rule should be executed. */ - snippet_name?: string; + enabled?: boolean; } } export interface RuleListParams { /** - * Identifier + * The unique ID of the zone. */ zone_id: string; } export interface RuleDeleteParams { /** - * Identifier + * The unique ID of the zone. */ zone_id: string; } Rules.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage; Rules.RuleListResponsesSinglePage = RuleListResponsesSinglePage; +Rules.RuleDeleteResponsesSinglePage = RuleDeleteResponsesSinglePage; export declare namespace Rules { export { @@ -164,6 +226,7 @@ export declare namespace Rules { type RuleDeleteResponse as RuleDeleteResponse, RuleUpdateResponsesSinglePage as RuleUpdateResponsesSinglePage, RuleListResponsesSinglePage as RuleListResponsesSinglePage, + RuleDeleteResponsesSinglePage as RuleDeleteResponsesSinglePage, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, diff --git a/src/resources/snippets/snippets.ts b/src/resources/snippets/snippets.ts index 8eb0182537..41075b61da 100644 --- a/src/resources/snippets/snippets.ts +++ b/src/resources/snippets/snippets.ts @@ -2,13 +2,13 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; import * as ContentAPI from './content'; import { Content, ContentGetParams } from './content'; import * as RulesAPI from './rules'; import { RuleDeleteParams, RuleDeleteResponse, + RuleDeleteResponsesSinglePage, RuleListParams, RuleListResponse, RuleListResponsesSinglePage, @@ -17,194 +17,207 @@ import { RuleUpdateResponsesSinglePage, Rules, } from './rules'; -import { SinglePage } from '../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; export class Snippets extends APIResource { content: ContentAPI.Content = new ContentAPI.Content(this._client); rules: RulesAPI.Rules = new RulesAPI.Rules(this._client); /** - * Put Snippet - * - * @example - * ```ts - * const snippet = await client.snippets.update( - * 'snippet_name_01', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * Creates or updates a snippet belonging to the zone. */ update( snippetName: string, params: SnippetUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id, ...body } = params; return ( this._client.put( `/zones/${zone_id}/snippets/${snippetName}`, Core.multipartFormRequestOptions({ body, ...options }), - ) as Core.APIPromise<{ result: Snippet }> + ) as Core.APIPromise<{ result: SnippetUpdateResponse }> )._thenUnwrap((obj) => obj.result); } /** - * All Snippets - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const snippet of client.snippets.list({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * })) { - * // ... - * } - * ``` + * Fetches all snippets belonging to the zone. */ list( params: SnippetListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList(`/zones/${zone_id}/snippets`, SnippetsSinglePage, options); + ): Core.PagePromise { + const { zone_id, ...query } = params; + return this._client.getAPIList(`/zones/${zone_id}/snippets`, SnippetListResponsesV4PagePaginationArray, { + query, + ...options, + }); } /** - * Delete Snippet - * - * @example - * ```ts - * const snippet = await client.snippets.delete( - * 'snippet_name_01', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * Deletes a snippet belonging to the zone. */ delete( snippetName: string, params: SnippetDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id } = params; - return this._client.delete(`/zones/${zone_id}/snippets/${snippetName}`, options); + return ( + this._client.delete(`/zones/${zone_id}/snippets/${snippetName}`, options) as Core.APIPromise<{ + result: SnippetDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); } /** - * Snippet - * - * @example - * ```ts - * const snippet = await client.snippets.get( - * 'snippet_name_01', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` + * Fetches a snippet belonging to the zone. */ get( snippetName: string, params: SnippetGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id } = params; return ( this._client.get(`/zones/${zone_id}/snippets/${snippetName}`, options) as Core.APIPromise<{ - result: Snippet; + result: SnippetGetResponse; }> )._thenUnwrap((obj) => obj.result); } } -export class SnippetsSinglePage extends SinglePage {} +export class SnippetListResponsesV4PagePaginationArray extends V4PagePaginationArray {} /** - * Snippet Information + * A result. */ -export interface Snippet { +export interface SnippetUpdateResponse { /** - * Creation time of the snippet + * The timestamp of when the snippet was created. */ - created_on?: string; + created_on: string; /** - * Modification time of the snippet + * The identifying name of the snippet. + */ + snippet_name: string; + + /** + * The timestamp of when the snippet was last modified. */ modified_on?: string; +} +/** + * A snippet object. + */ +export interface SnippetListResponse { /** - * Snippet identifying name + * The timestamp of when the snippet was created. */ - snippet_name?: string; + created_on: string; + + /** + * The identifying name of the snippet. + */ + snippet_name: string; + + /** + * The timestamp of when the snippet was last modified. + */ + modified_on?: string; } -export interface SnippetDeleteResponse { - errors: Array; +/** + * A result. + */ +export type SnippetDeleteResponse = string | null; + +/** + * A result. + */ +export interface SnippetGetResponse { + /** + * The timestamp of when the snippet was created. + */ + created_on: string; - messages: Array; + /** + * The identifying name of the snippet. + */ + snippet_name: string; /** - * Whether the API call was successful + * The timestamp of when the snippet was last modified. */ - success: true; + modified_on?: string; } export interface SnippetUpdateParams { /** - * Path param: Identifier + * Path param: The unique ID of the zone. */ zone_id: string; /** - * Body param: Content files of uploaded snippet + * Body param: The list of files belonging to the snippet. */ - files?: string; + files: Array; /** - * Body param: + * Body param: Metadata about the snippet. */ - metadata?: SnippetUpdateParams.Metadata; + metadata: SnippetUpdateParams.Metadata; } export namespace SnippetUpdateParams { + /** + * Metadata about the snippet. + */ export interface Metadata { /** - * Main module name of uploaded snippet + * Name of the file that contains the main module of the snippet. */ - main_module?: string; + main_module: string; } } -export interface SnippetListParams { +export interface SnippetListParams extends V4PagePaginationArrayParams { /** - * Identifier + * Path param: The unique ID of the zone. */ zone_id: string; } export interface SnippetDeleteParams { /** - * Identifier + * The unique ID of the zone. */ zone_id: string; } export interface SnippetGetParams { /** - * Identifier + * The unique ID of the zone. */ zone_id: string; } -Snippets.SnippetsSinglePage = SnippetsSinglePage; +Snippets.SnippetListResponsesV4PagePaginationArray = SnippetListResponsesV4PagePaginationArray; Snippets.Content = Content; Snippets.Rules = Rules; Snippets.RuleUpdateResponsesSinglePage = RuleUpdateResponsesSinglePage; Snippets.RuleListResponsesSinglePage = RuleListResponsesSinglePage; +Snippets.RuleDeleteResponsesSinglePage = RuleDeleteResponsesSinglePage; export declare namespace Snippets { export { - type Snippet as Snippet, + type SnippetUpdateResponse as SnippetUpdateResponse, + type SnippetListResponse as SnippetListResponse, type SnippetDeleteResponse as SnippetDeleteResponse, - SnippetsSinglePage as SnippetsSinglePage, + type SnippetGetResponse as SnippetGetResponse, + SnippetListResponsesV4PagePaginationArray as SnippetListResponsesV4PagePaginationArray, type SnippetUpdateParams as SnippetUpdateParams, type SnippetListParams as SnippetListParams, type SnippetDeleteParams as SnippetDeleteParams, @@ -220,6 +233,7 @@ export declare namespace Snippets { type RuleDeleteResponse as RuleDeleteResponse, RuleUpdateResponsesSinglePage as RuleUpdateResponsesSinglePage, RuleListResponsesSinglePage as RuleListResponsesSinglePage, + RuleDeleteResponsesSinglePage as RuleDeleteResponsesSinglePage, type RuleUpdateParams as RuleUpdateParams, type RuleListParams as RuleListParams, type RuleDeleteParams as RuleDeleteParams, diff --git a/tests/api-resources/snippets/content.test.ts b/tests/api-resources/snippets/content.test.ts index 7342ace674..81c65cbd3e 100644 --- a/tests/api-resources/snippets/content.test.ts +++ b/tests/api-resources/snippets/content.test.ts @@ -11,8 +11,8 @@ const client = new Cloudflare({ describe('resource content', () => { // throwing HTTP 415 test.skip('get: required and optional params', async () => { - const response = await client.snippets.content.get('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const response = await client.snippets.content.get('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', }); }); }); diff --git a/tests/api-resources/snippets/rules.test.ts b/tests/api-resources/snippets/rules.test.ts index e36c30e5f4..3552adbd0c 100644 --- a/tests/api-resources/snippets/rules.test.ts +++ b/tests/api-resources/snippets/rules.test.ts @@ -11,7 +11,10 @@ const client = new Cloudflare({ describe('resource rules', () => { test('update: only required params', async () => { - const responsePromise = client.snippets.rules.update({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.snippets.rules.update({ + zone_id: '9f1839b6152d298aca64c4e906b6d074', + body: [{ expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet' }], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,20 +26,20 @@ describe('resource rules', () => { test('update: required and optional params', async () => { const response = await client.snippets.rules.update({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - rules: [ + zone_id: '9f1839b6152d298aca64c4e906b6d074', + body: [ { - description: 'Rule description', + expression: 'ip.src ne 1.1.1.1', + snippet_name: 'my_snippet', + description: 'Execute my_snippet when IP address is 1.1.1.1.', enabled: true, - expression: 'http.cookie eq "a=b"', - snippet_name: 'snippet_name_01', }, ], }); }); test('list: only required params', async () => { - const responsePromise = client.snippets.rules.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.snippets.rules.list({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -47,11 +50,11 @@ describe('resource rules', () => { }); test('list: required and optional params', async () => { - const response = await client.snippets.rules.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.snippets.rules.list({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); }); test('delete: only required params', async () => { - const responsePromise = client.snippets.rules.delete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.snippets.rules.delete({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -62,6 +65,6 @@ describe('resource rules', () => { }); test('delete: required and optional params', async () => { - const response = await client.snippets.rules.delete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.snippets.rules.delete({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); }); }); diff --git a/tests/api-resources/snippets/snippets.test.ts b/tests/api-resources/snippets/snippets.test.ts index 4973e797db..9f116ac439 100644 --- a/tests/api-resources/snippets/snippets.test.ts +++ b/tests/api-resources/snippets/snippets.test.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import Cloudflare from 'cloudflare'; +import Cloudflare, { toFile } from 'cloudflare'; import { Response } from 'node-fetch'; const client = new Cloudflare({ @@ -12,8 +12,10 @@ const client = new Cloudflare({ describe('resource snippets', () => { // throwing HTTP 415 test.skip('update: only required params', async () => { - const responsePromise = client.snippets.update('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const responsePromise = client.snippets.update('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], + metadata: { main_module: 'main.js' }, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -26,15 +28,15 @@ describe('resource snippets', () => { // throwing HTTP 415 test.skip('update: required and optional params', async () => { - const response = await client.snippets.update('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - files: "export { async function fetch(request, env) {return new Response('some_response') } }", + const response = await client.snippets.update('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', + files: [await toFile(Buffer.from('# my file contents'), 'README.md')], metadata: { main_module: 'main.js' }, }); }); test('list: only required params', async () => { - const responsePromise = client.snippets.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.snippets.list({ zone_id: '9f1839b6152d298aca64c4e906b6d074' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -45,12 +47,16 @@ describe('resource snippets', () => { }); test('list: required and optional params', async () => { - const response = await client.snippets.list({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.snippets.list({ + zone_id: '9f1839b6152d298aca64c4e906b6d074', + page: 1, + per_page: 25, + }); }); test('delete: only required params', async () => { - const responsePromise = client.snippets.delete('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const responsePromise = client.snippets.delete('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -62,14 +68,14 @@ describe('resource snippets', () => { }); test('delete: required and optional params', async () => { - const response = await client.snippets.delete('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const response = await client.snippets.delete('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', }); }); test('get: only required params', async () => { - const responsePromise = client.snippets.get('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + const responsePromise = client.snippets.get('my_snippet', { + zone_id: '9f1839b6152d298aca64c4e906b6d074', }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -81,8 +87,6 @@ describe('resource snippets', () => { }); test('get: required and optional params', async () => { - const response = await client.snippets.get('snippet_name_01', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.snippets.get('my_snippet', { zone_id: '9f1839b6152d298aca64c4e906b6d074' }); }); }); From acc5399ecb219784ee1bc21ac94fad486585d144 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:45:57 +0000 Subject: [PATCH 075/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 56b0f33d11..6b375fe48e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11f530e0accb1d6d9ee14a3a1fdf9e99ebff98e60ac7f59edbd17aafb11e2007.yml -openapi_spec_hash: 185fb53ac70e4b381c40c7e8d291df98 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8b1bca944f110e0de0f19fbbbc170d58e47b8996f8b945ede7c55e289c1f5f1e.yml +openapi_spec_hash: 2022aee5dbc58b0b3fb146ee4c7ee9ba config_hash: 4a37da9893560914a7ac1a75cc01202a From 03f5ba5c779f4cbaac1b748558044f4c1c205f80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 13:57:43 +0000 Subject: [PATCH 076/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b375fe48e..6ae16abc5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8b1bca944f110e0de0f19fbbbc170d58e47b8996f8b945ede7c55e289c1f5f1e.yml -openapi_spec_hash: 2022aee5dbc58b0b3fb146ee4c7ee9ba +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-709bddd6b91a5e681c2ec5e0dfa5ff72e54ee14172c94106f686244a75e616ab.yml +openapi_spec_hash: fa579adf5353c39192ab0b879e22257a config_hash: 4a37da9893560914a7ac1a75cc01202a From 51ad3285e1aa37641f029f100314c07e6592df7b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:08:46 +0000 Subject: [PATCH 077/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6ae16abc5e..bdd313b133 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-709bddd6b91a5e681c2ec5e0dfa5ff72e54ee14172c94106f686244a75e616ab.yml -openapi_spec_hash: fa579adf5353c39192ab0b879e22257a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd6f617d40367c9138edd2c312e02e8d9ba159df60316a0cb6b05f5da9def51c.yml +openapi_spec_hash: 4f291eb8643640c1b842ad73043d0492 config_hash: 4a37da9893560914a7ac1a75cc01202a From 25af83781e8eac27cd781eb7094bfffef3fc0ef5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:36:28 +0000 Subject: [PATCH 078/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bdd313b133..ff45cef6e0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fd6f617d40367c9138edd2c312e02e8d9ba159df60316a0cb6b05f5da9def51c.yml -openapi_spec_hash: 4f291eb8643640c1b842ad73043d0492 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-760ea76244cfa1bdcc28baac89ead8a7066e9868531aaddffb6ccc8802e2e5b4.yml +openapi_spec_hash: c893540155dbb485039a5b57e64ece61 config_hash: 4a37da9893560914a7ac1a75cc01202a From 5a015ad2d0fa8a3cdb30893cd5e3c768b3a71c6e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:11:12 +0000 Subject: [PATCH 079/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff45cef6e0..d1dc29991b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-760ea76244cfa1bdcc28baac89ead8a7066e9868531aaddffb6ccc8802e2e5b4.yml -openapi_spec_hash: c893540155dbb485039a5b57e64ece61 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b6f2b687bf8f447895124119e1438771342734068a0821516f5047b83d5d3ec7.yml +openapi_spec_hash: 429cfdf0d358d327d26a56f274631db1 config_hash: 4a37da9893560914a7ac1a75cc01202a From 4ca3ca0c8a4282a31315c091392536d43d3c5257 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:34:51 +0000 Subject: [PATCH 080/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d1dc29991b..f7c0ec5d2e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b6f2b687bf8f447895124119e1438771342734068a0821516f5047b83d5d3ec7.yml -openapi_spec_hash: 429cfdf0d358d327d26a56f274631db1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e0538866d9e5c4160420a6fa355975d6d67ed9afe8baa485bab806895b4ebee.yml +openapi_spec_hash: 99927ea5b698f1e5f9d27222e2cd3d4e config_hash: 4a37da9893560914a7ac1a75cc01202a From 7111f2cb97b98d9444339f7d39064673b4541fe7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 15:55:43 +0000 Subject: [PATCH 081/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f7c0ec5d2e..a6a431990e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8e0538866d9e5c4160420a6fa355975d6d67ed9afe8baa485bab806895b4ebee.yml -openapi_spec_hash: 99927ea5b698f1e5f9d27222e2cd3d4e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df3e57fc009b3288e627cc200018db5b00f119bf7af968734eaa7abb101d9243.yml +openapi_spec_hash: 721c84387f1cfda7d1c2ad8479a5212c config_hash: 4a37da9893560914a7ac1a75cc01202a From a8dc4b368721dca82861e71267516554411d6c84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:06:58 +0000 Subject: [PATCH 082/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a6a431990e..edc924b977 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-df3e57fc009b3288e627cc200018db5b00f119bf7af968734eaa7abb101d9243.yml -openapi_spec_hash: 721c84387f1cfda7d1c2ad8479a5212c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1962c1a0bc4e6b1375f948f59a159bc652792b4296de38d0e6d7e922cab4ed9b.yml +openapi_spec_hash: 7192f11a8354eea8625d87a6f0f6c45a config_hash: 4a37da9893560914a7ac1a75cc01202a From 0cbd3f853405de992c03554f8e88c685886d4c5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:17:56 +0000 Subject: [PATCH 083/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index edc924b977..9d5e9c10ba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1962c1a0bc4e6b1375f948f59a159bc652792b4296de38d0e6d7e922cab4ed9b.yml -openapi_spec_hash: 7192f11a8354eea8625d87a6f0f6c45a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7fec511369a0cdd1964ae80a4c5494a2cf1c32edffe9e0c357cc0e954d4b364d.yml +openapi_spec_hash: 7e7412d812db9d97d204be8b6313c6ff config_hash: 4a37da9893560914a7ac1a75cc01202a From bc78a551c0662bd220c6b7d7bc5f93c81f2e3776 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:29:25 +0000 Subject: [PATCH 084/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/locations.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d5e9c10ba..b8625f0e24 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7fec511369a0cdd1964ae80a4c5494a2cf1c32edffe9e0c357cc0e954d4b364d.yml -openapi_spec_hash: 7e7412d812db9d97d204be8b6313c6ff +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4595f0857b20ab50f25d4659de8bb3f52d17e97902891e93ffe81d2eb2996477.yml +openapi_spec_hash: 93099cd50af0c833278cc49acbbef94e config_hash: 4a37da9893560914a7ac1a75cc01202a diff --git a/src/resources/zero-trust/gateway/locations.ts b/src/resources/zero-trust/gateway/locations.ts index ba5328529e..958bbd3ad8 100644 --- a/src/resources/zero-trust/gateway/locations.ts +++ b/src/resources/zero-trust/gateway/locations.ts @@ -143,7 +143,7 @@ export interface DOHEndpoint { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; /** * True if the endpoint requires @@ -164,7 +164,7 @@ export interface DOHEndpointParam { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; /** * True if the endpoint requires @@ -185,7 +185,7 @@ export interface DOTEndpoint { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } export interface DOTEndpointParam { @@ -199,7 +199,7 @@ export interface DOTEndpointParam { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } /** @@ -271,7 +271,7 @@ export interface IPV6Endpoint { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } export interface IPV6EndpointParam { @@ -285,7 +285,7 @@ export interface IPV6EndpointParam { * source IPs are allowed. A non-empty list is only effective if the endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } export interface IPV6Network { @@ -371,7 +371,7 @@ export interface Location { * A non-empty list is only effective if the ipv4 endpoint is enabled for this * location. */ - networks?: Array; + networks?: Array | null; updated_at?: string; } @@ -429,7 +429,7 @@ export interface LocationCreateParams { * originate from. A non-empty list is only effective if the ipv4 endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } export namespace LocationCreateParams { @@ -483,7 +483,7 @@ export interface LocationUpdateParams { * originate from. A non-empty list is only effective if the ipv4 endpoint is * enabled for this location. */ - networks?: Array; + networks?: Array | null; } export namespace LocationUpdateParams { From 8aa24cdbd6f36b814cf1fff665739bb3fd7fa6c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 16:47:10 +0000 Subject: [PATCH 085/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b8625f0e24..1c0132889a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4595f0857b20ab50f25d4659de8bb3f52d17e97902891e93ffe81d2eb2996477.yml -openapi_spec_hash: 93099cd50af0c833278cc49acbbef94e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b95716ec1c8bc841b8d32a0b497db9febe63e55303936425b8893baf1d7986ef.yml +openapi_spec_hash: 09e1ee2bc47c77d94ea52c371ed3d404 config_hash: 4a37da9893560914a7ac1a75cc01202a From 859df28c93ae12a784e9b453e4454f01da6114e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:12:24 +0000 Subject: [PATCH 086/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1c0132889a..015585af35 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b95716ec1c8bc841b8d32a0b497db9febe63e55303936425b8893baf1d7986ef.yml -openapi_spec_hash: 09e1ee2bc47c77d94ea52c371ed3d404 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d433472b23ca82769dcf5d6214c6851f4495eda7fd882db77d0caf3a4328153a.yml +openapi_spec_hash: c7054c3968d7b19eb13fac5367799953 config_hash: 4a37da9893560914a7ac1a75cc01202a From 50acb8e5b06a2570537eb96abe4ce036ba21189f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:24:01 +0000 Subject: [PATCH 087/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 015585af35..69f259d928 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d433472b23ca82769dcf5d6214c6851f4495eda7fd882db77d0caf3a4328153a.yml -openapi_spec_hash: c7054c3968d7b19eb13fac5367799953 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-13b57e45981685a6b8372240c11216748658b990017d0b2f64477bbbb978259a.yml +openapi_spec_hash: 6d0d5ce614a7d6c63ef3e4709751cbf0 config_hash: 4a37da9893560914a7ac1a75cc01202a From d8f9de3bae2df04f869938f9bc2b52173dab6152 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:35:39 +0000 Subject: [PATCH 088/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 69f259d928..cf0dba6cae 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-13b57e45981685a6b8372240c11216748658b990017d0b2f64477bbbb978259a.yml -openapi_spec_hash: 6d0d5ce614a7d6c63ef3e4709751cbf0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c093d3b152ec3c14cc6288a14385a18efab4f12d99e86cadd923342c565c7c4e.yml +openapi_spec_hash: 608b058a8d7bd197a14dab04e018739f config_hash: 4a37da9893560914a7ac1a75cc01202a From 4e3ef51761bcc247d167d40d40481ea967976f34 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 17:59:00 +0000 Subject: [PATCH 089/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf0dba6cae..f075e4a3f5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1775 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c093d3b152ec3c14cc6288a14385a18efab4f12d99e86cadd923342c565c7c4e.yml -openapi_spec_hash: 608b058a8d7bd197a14dab04e018739f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be33ed716939444c958b96a8d44b4c5cadd6ca31e9f8a482499af3b9e02a32a1.yml +openapi_spec_hash: 0eaa6c9fe834ee3f0dd40c71033e412e config_hash: 4a37da9893560914a7ac1a75cc01202a From fbfaa98ac04a1a4b45a14c54fcf34595ada5db6a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 18:15:36 +0000 Subject: [PATCH 090/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 13 ++ scripts/detect-breaking-changes | 1 + src/resources/diagnostics/diagnostics.ts | 21 +++ .../diagnostics/endpoint-healthchecks.ts | 156 ++++++++++++++++++ src/resources/diagnostics/index.ts | 8 + .../diagnostics/endpoint-healthchecks.test.ts | 55 ++++++ 7 files changed, 256 insertions(+), 2 deletions(-) create mode 100644 src/resources/diagnostics/endpoint-healthchecks.ts create mode 100644 tests/api-resources/diagnostics/endpoint-healthchecks.test.ts diff --git a/.stats.yml b/.stats.yml index f075e4a3f5..3c2931e9e7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1775 +configured_endpoints: 1777 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be33ed716939444c958b96a8d44b4c5cadd6ca31e9f8a482499af3b9e02a32a1.yml openapi_spec_hash: 0eaa6c9fe834ee3f0dd40c71033e412e -config_hash: 4a37da9893560914a7ac1a75cc01202a +config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/api.md b/api.md index 94ccf2b19e..edb1f81f32 100644 --- a/api.md +++ b/api.md @@ -3018,6 +3018,19 @@ Methods: - client.diagnostics.traceroutes.create({ ...params }) -> TraceroutesSinglePage +## EndpointHealthchecks + +Types: + +- EndpointHealthcheck +- EndpointHealthcheckCreateResponse +- EndpointHealthcheckListResponse + +Methods: + +- client.diagnostics.endpointHealthchecks.create({ ...params }) -> EndpointHealthcheckCreateResponse +- client.diagnostics.endpointHealthchecks.list({ ...params }) -> EndpointHealthcheckListResponse + # Images ## V1 diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index bf0c0ba669..a8024d0304 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -259,6 +259,7 @@ TEST_PATHS=( tests/api-resources/brand-protection/logo-matches.test.ts tests/api-resources/diagnostics/diagnostics.test.ts tests/api-resources/diagnostics/traceroutes.test.ts + tests/api-resources/diagnostics/endpoint-healthchecks.test.ts tests/api-resources/images/images.test.ts tests/api-resources/images/v1/v1.test.ts tests/api-resources/images/v1/keys.test.ts diff --git a/src/resources/diagnostics/diagnostics.ts b/src/resources/diagnostics/diagnostics.ts index f8ee339f11..6c9d2f6991 100644 --- a/src/resources/diagnostics/diagnostics.ts +++ b/src/resources/diagnostics/diagnostics.ts @@ -1,15 +1,27 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as EndpointHealthchecksAPI from './endpoint-healthchecks'; +import { + EndpointHealthcheck, + EndpointHealthcheckCreateParams, + EndpointHealthcheckCreateResponse, + EndpointHealthcheckListParams, + EndpointHealthcheckListResponse, + EndpointHealthchecks, +} from './endpoint-healthchecks'; import * as TraceroutesAPI from './traceroutes'; import { Traceroute, TracerouteCreateParams, Traceroutes, TraceroutesSinglePage } from './traceroutes'; export class Diagnostics extends APIResource { traceroutes: TraceroutesAPI.Traceroutes = new TraceroutesAPI.Traceroutes(this._client); + endpointHealthchecks: EndpointHealthchecksAPI.EndpointHealthchecks = + new EndpointHealthchecksAPI.EndpointHealthchecks(this._client); } Diagnostics.Traceroutes = Traceroutes; Diagnostics.TraceroutesSinglePage = TraceroutesSinglePage; +Diagnostics.EndpointHealthchecks = EndpointHealthchecks; export declare namespace Diagnostics { export { @@ -18,4 +30,13 @@ export declare namespace Diagnostics { TraceroutesSinglePage as TraceroutesSinglePage, type TracerouteCreateParams as TracerouteCreateParams, }; + + export { + EndpointHealthchecks as EndpointHealthchecks, + type EndpointHealthcheck as EndpointHealthcheck, + type EndpointHealthcheckCreateResponse as EndpointHealthcheckCreateResponse, + type EndpointHealthcheckListResponse as EndpointHealthcheckListResponse, + type EndpointHealthcheckCreateParams as EndpointHealthcheckCreateParams, + type EndpointHealthcheckListParams as EndpointHealthcheckListParams, + }; } diff --git a/src/resources/diagnostics/endpoint-healthchecks.ts b/src/resources/diagnostics/endpoint-healthchecks.ts new file mode 100644 index 0000000000..382d852431 --- /dev/null +++ b/src/resources/diagnostics/endpoint-healthchecks.ts @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; +import * as Core from '../../core'; + +export class EndpointHealthchecks extends APIResource { + /** + * Create Endpoint Health Check. + * + * @example + * ```ts + * const endpointHealthcheck = + * await client.diagnostics.endpointHealthchecks.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * check_type: 'icmp', + * endpoint: '203.0.113.1', + * }); + * ``` + */ + create( + params: EndpointHealthcheckCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/diagnostics/endpoint-healthchecks`, { + body, + ...options, + }) as Core.APIPromise<{ result: EndpointHealthcheckCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List Endpoint Health Checks. + * + * @example + * ```ts + * const endpointHealthchecks = + * await client.diagnostics.endpointHealthchecks.list({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + list( + params: EndpointHealthcheckListParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/diagnostics/endpoint-healthchecks`, + options, + ) as Core.APIPromise<{ result: EndpointHealthcheckListResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface EndpointHealthcheck { + /** + * type of check to perform + */ + check_type: 'icmp'; + + /** + * the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * Optional name associated with this check + */ + name?: string; +} + +export interface EndpointHealthcheckCreateResponse { + /** + * type of check to perform + */ + check_type: 'icmp'; + + /** + * the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * UUID. + */ + id?: string; + + /** + * Optional name associated with this check + */ + name?: string; +} + +export interface EndpointHealthcheckListResponse { + /** + * type of check to perform + */ + check_type: 'icmp'; + + /** + * the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * UUID. + */ + id?: string; + + /** + * Optional name associated with this check + */ + name?: string; +} + +export interface EndpointHealthcheckCreateParams { + /** + * Path param: Identifier + */ + account_id: string; + + /** + * Body param: type of check to perform + */ + check_type: 'icmp'; + + /** + * Body param: the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * Body param: Optional name associated with this check + */ + name?: string; +} + +export interface EndpointHealthcheckListParams { + /** + * Identifier + */ + account_id: string; +} + +export declare namespace EndpointHealthchecks { + export { + type EndpointHealthcheck as EndpointHealthcheck, + type EndpointHealthcheckCreateResponse as EndpointHealthcheckCreateResponse, + type EndpointHealthcheckListResponse as EndpointHealthcheckListResponse, + type EndpointHealthcheckCreateParams as EndpointHealthcheckCreateParams, + type EndpointHealthcheckListParams as EndpointHealthcheckListParams, + }; +} diff --git a/src/resources/diagnostics/index.ts b/src/resources/diagnostics/index.ts index 50517481ab..63498a9d67 100644 --- a/src/resources/diagnostics/index.ts +++ b/src/resources/diagnostics/index.ts @@ -1,6 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Diagnostics } from './diagnostics'; +export { + EndpointHealthchecks, + type EndpointHealthcheck, + type EndpointHealthcheckCreateResponse, + type EndpointHealthcheckListResponse, + type EndpointHealthcheckCreateParams, + type EndpointHealthcheckListParams, +} from './endpoint-healthchecks'; export { TraceroutesSinglePage, Traceroutes, diff --git a/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts b/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts new file mode 100644 index 0000000000..f436743078 --- /dev/null +++ b/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts @@ -0,0 +1,55 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource endpointHealthchecks', () => { + test('create: only required params', async () => { + const responsePromise = client.diagnostics.endpointHealthchecks.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + check_type: 'icmp', + endpoint: '203.0.113.1', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.diagnostics.endpointHealthchecks.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + check_type: 'icmp', + endpoint: '203.0.113.1', + name: 'My Endpoint', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.diagnostics.endpointHealthchecks.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.diagnostics.endpointHealthchecks.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); From b49b11197d7a1bf795d23680ae049755a3d746f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 18:37:44 +0000 Subject: [PATCH 091/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c2931e9e7..059fe0d756 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be33ed716939444c958b96a8d44b4c5cadd6ca31e9f8a482499af3b9e02a32a1.yml -openapi_spec_hash: 0eaa6c9fe834ee3f0dd40c71033e412e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ef60678cddeb091bc65b798a4584f0d5a9ceab87046435a85aa4872c190bf40.yml +openapi_spec_hash: a391f4e0b5029905a26bd289e022401e config_hash: a35e9eb0436652c704bebf7c0a38085b From ff21e6d55174f8f7b9333cd3626f5a709d53f332 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 18:59:10 +0000 Subject: [PATCH 092/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/locations.ts | 2 +- src/resources/zero-trust/gateway/rules.ts | 10 +++++----- tests/api-resources/zero-trust/gateway/rules.test.ts | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 059fe0d756..8b746a70df 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0ef60678cddeb091bc65b798a4584f0d5a9ceab87046435a85aa4872c190bf40.yml -openapi_spec_hash: a391f4e0b5029905a26bd289e022401e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d3e8222346377faccd40549dbab761650548e52d51c924da09b1607f6ce7cb5.yml +openapi_spec_hash: 88ae18e728960e49b36ba049c8f3d13b config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/zero-trust/gateway/locations.ts b/src/resources/zero-trust/gateway/locations.ts index 958bbd3ad8..db4a0730a2 100644 --- a/src/resources/zero-trust/gateway/locations.ts +++ b/src/resources/zero-trust/gateway/locations.ts @@ -320,7 +320,7 @@ export interface Location { /** * The uuid identifier of the IPv6 block brought to the gateway, so that this * location's IPv6 address is allocated from the Bring Your Own Ipv6(BYOIPv6) block - * and not from the standard CloudFlare IPv6 block. + * and not from the standard Cloudflare IPv6 block. */ dns_destination_ipv6_block_id?: string | null; diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 911269463e..8a10ecf2f5 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -270,7 +270,7 @@ export interface GatewayRule { id?: string; /** - * The action to preform when the associated traffic, identity, and device posture + * The action to perform when the associated traffic, identity, and device posture * expressions are either absent or evaluate to `true`. */ action?: @@ -432,7 +432,7 @@ export interface RuleSetting { * Add custom headers to allowed requests, in the form of key-value pairs. Keys are * header names, pointing to an array with its header value(s). */ - add_headers?: { [key: string]: string } | null; + add_headers?: { [key: string]: Array } | null; /** * Set by parent MSP accounts to enable their children to bypass this rule. @@ -861,7 +861,7 @@ export interface RuleSettingParam { * Add custom headers to allowed requests, in the form of key-value pairs. Keys are * header names, pointing to an array with its header value(s). */ - add_headers?: { [key: string]: string } | null; + add_headers?: { [key: string]: Array } | null; /** * Set by parent MSP accounts to enable their children to bypass this rule. @@ -1423,7 +1423,7 @@ export interface RuleCreateParams { account_id: string; /** - * Body param: The action to preform when the associated traffic, identity, and + * Body param: The action to perform when the associated traffic, identity, and * device posture expressions are either absent or evaluate to `true`. */ action: @@ -1545,7 +1545,7 @@ export interface RuleUpdateParams { account_id: string; /** - * Body param: The action to preform when the associated traffic, identity, and + * Body param: The action to perform when the associated traffic, identity, and * device posture expressions are either absent or evaluate to `true`. */ action: diff --git a/tests/api-resources/zero-trust/gateway/rules.test.ts b/tests/api-resources/zero-trust/gateway/rules.test.ts index 4f73bd9c4c..e9d65365a9 100644 --- a/tests/api-resources/zero-trust/gateway/rules.test.ts +++ b/tests/api-resources/zero-trust/gateway/rules.test.ts @@ -38,7 +38,7 @@ describe('resource rules', () => { identity: 'any(identity.groups.name[*] in {"finance"})', precedence: 0, rule_settings: { - add_headers: { foo: 'string' }, + add_headers: { 'My-Next-Header': ['foo', 'bar'], 'X-Custom-Header-Name': ['somecustomvalue'] }, allow_child_bypass: false, audit_ssh: { command_logging: false }, biso_admin_controls: { @@ -142,7 +142,7 @@ describe('resource rules', () => { identity: 'any(identity.groups.name[*] in {"finance"})', precedence: 0, rule_settings: { - add_headers: { foo: 'string' }, + add_headers: { 'My-Next-Header': ['foo', 'bar'], 'X-Custom-Header-Name': ['somecustomvalue'] }, allow_child_bypass: false, audit_ssh: { command_logging: false }, biso_admin_controls: { From 5d712b8f9c1c4a26ce71bffac7b171305ef5564e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:35:12 +0000 Subject: [PATCH 093/423] feat(api): api update --- .stats.yml | 4 +-- .../addressing/prefixes/bgp-prefixes.ts | 29 ++++++++++--------- .../addressing/prefixes/bgp-prefixes.test.ts | 2 +- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b746a70df..fb093c4939 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d3e8222346377faccd40549dbab761650548e52d51c924da09b1607f6ce7cb5.yml -openapi_spec_hash: 88ae18e728960e49b36ba049c8f3d13b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39ccadcddaa1e181eb29efb2f50fc4d2df982a526c68bc31e34f28e8d4dc2c08.yml +openapi_spec_hash: 34225107db418f33a43166f75ff9c18a config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/addressing/prefixes/bgp-prefixes.ts b/src/resources/addressing/prefixes/bgp-prefixes.ts index 519a372d99..1945d1a5b1 100644 --- a/src/resources/addressing/prefixes/bgp-prefixes.ts +++ b/src/resources/addressing/prefixes/bgp-prefixes.ts @@ -139,6 +139,14 @@ export interface BGPPrefix { */ asn_prepend_count?: number; + /** + * Determines if Cloudflare advertises a BYOIP BGP prefix even when there is no + * matching BGP prefix in the Magic routing table. When true, Cloudflare will + * automatically withdraw the BGP prefix when there are no matching BGP routes, and + * will resume advertising when there is at least one matching BGP route. + */ + auto_advertise_withdraw?: boolean; + bgp_signal_opts?: BGPPrefix.BGPSignalOpts; /** @@ -151,13 +159,6 @@ 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 { @@ -234,16 +235,18 @@ export interface BGPPrefixEditParams { asn_prepend_count?: number; /** - * Body param: + * Body param: Determines if Cloudflare advertises a BYOIP BGP prefix even when + * there is no matching BGP prefix in the Magic routing table. When true, + * Cloudflare will automatically withdraw the BGP prefix when there are no matching + * BGP routes, and will resume advertising when there is at least one matching BGP + * route. */ - on_demand?: BGPPrefixEditParams.OnDemand; + auto_advertise_withdraw?: boolean; /** - * 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) + * Body param: */ - withdraw_if_no_route?: boolean; + on_demand?: BGPPrefixEditParams.OnDemand; } export namespace BGPPrefixEditParams { diff --git a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts index f9e50f1d0b..3dad394acf 100644 --- a/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts +++ b/tests/api-resources/addressing/prefixes/bgp-prefixes.test.ts @@ -72,8 +72,8 @@ describe('resource bgpPrefixes', () => { { account_id: '258def64c72dae45f3e4c8516e2111f2', asn_prepend_count: 2, + auto_advertise_withdraw: true, on_demand: { advertised: true }, - withdraw_if_no_route: true, }, ); }); From a0c8d659a62106b31fa2111758c8b5727123bc9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:43:44 +0000 Subject: [PATCH 094/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fb093c4939..0b0bd9b1e8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-39ccadcddaa1e181eb29efb2f50fc4d2df982a526c68bc31e34f28e8d4dc2c08.yml -openapi_spec_hash: 34225107db418f33a43166f75ff9c18a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7dbd2ac7bae53825fd3ded2997b259098d4c5dd987a66fb38b83ea09dee8d239.yml +openapi_spec_hash: cc9b3a584447a605d7c5f9ef40d57983 config_hash: a35e9eb0436652c704bebf7c0a38085b From 5847404fa9718dddf32c587b075df8f960d5702d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 19:52:40 +0000 Subject: [PATCH 095/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0b0bd9b1e8..462bfc30d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7dbd2ac7bae53825fd3ded2997b259098d4c5dd987a66fb38b83ea09dee8d239.yml -openapi_spec_hash: cc9b3a584447a605d7c5f9ef40d57983 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098b42406d85453fbe5f6c8931277341f8979be9878b359cb56fc399ee7f5086.yml +openapi_spec_hash: add54049e6d4fbcbf98b8e3a0f1e8562 config_hash: a35e9eb0436652c704bebf7c0a38085b From b11a6dc50f61ffec22eafecca94ed23b5a06d5cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 20:18:20 +0000 Subject: [PATCH 096/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 462bfc30d7..9830110ceb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-098b42406d85453fbe5f6c8931277341f8979be9878b359cb56fc399ee7f5086.yml -openapi_spec_hash: add54049e6d4fbcbf98b8e3a0f1e8562 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7b23ea3c9f7383673139b078fe639ae38801d0a68c7374f30376fa02a0bda758.yml +openapi_spec_hash: dd7cec948badb7be8e94d9c391f09bf4 config_hash: a35e9eb0436652c704bebf7c0a38085b From 2bbeda74cbdadafdb1fe83b7409b2904b7a69d28 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 21:01:03 +0000 Subject: [PATCH 097/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/locations.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9830110ceb..a302e9e796 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7b23ea3c9f7383673139b078fe639ae38801d0a68c7374f30376fa02a0bda758.yml -openapi_spec_hash: dd7cec948badb7be8e94d9c391f09bf4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66ad1267235a1a436819d010460f34a9353d872bfee0f838bea4872f629dcf74.yml +openapi_spec_hash: 4c3dd18c52c008305ae377c0dd7734b7 config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/zero-trust/gateway/locations.ts b/src/resources/zero-trust/gateway/locations.ts index db4a0730a2..c31a9d38aa 100644 --- a/src/resources/zero-trust/gateway/locations.ts +++ b/src/resources/zero-trust/gateway/locations.ts @@ -340,7 +340,7 @@ export interface Location { * location, if this field is absent or set with null, the endpoints configuration * remains unchanged. */ - endpoints?: Endpoint; + endpoints?: Endpoint | null; /** * IPV6 destination ip assigned to this location. DNS requests sent to this IP will @@ -422,7 +422,7 @@ export interface LocationCreateParams { * updating a location, if this field is absent or set with null, the endpoints * configuration remains unchanged. */ - endpoints?: EndpointParam; + endpoints?: EndpointParam | null; /** * Body param: A list of network ranges that requests from this location would @@ -476,7 +476,7 @@ export interface LocationUpdateParams { * updating a location, if this field is absent or set with null, the endpoints * configuration remains unchanged. */ - endpoints?: EndpointParam; + endpoints?: EndpointParam | null; /** * Body param: A list of network ranges that requests from this location would From 070f9e9ee577d59c0f7dfe05d6c797cb79cacf85 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 21:49:28 +0000 Subject: [PATCH 098/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a302e9e796..3c09ca9db1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-66ad1267235a1a436819d010460f34a9353d872bfee0f838bea4872f629dcf74.yml -openapi_spec_hash: 4c3dd18c52c008305ae377c0dd7734b7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-20bfaaab2ac288ba55eb06e517261549b3233bb667f47e7acd549d79b94b441e.yml +openapi_spec_hash: e028533c4b565592871f70066dff3a55 config_hash: a35e9eb0436652c704bebf7c0a38085b From 403dc312d147e431d61fcb40c46067920ec9f28a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 22:05:21 +0000 Subject: [PATCH 099/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c09ca9db1..c4cc66d1d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-20bfaaab2ac288ba55eb06e517261549b3233bb667f47e7acd549d79b94b441e.yml -openapi_spec_hash: e028533c4b565592871f70066dff3a55 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-086ef16f104ede15ec076d62462ded699d7de104bc6eecb86a27a46ab1ba7d66.yml +openapi_spec_hash: 28aaf21d2be023eb8f641e0f7a76c028 config_hash: a35e9eb0436652c704bebf7c0a38085b From c3654c701b519933db89959708a0e6b52dc306c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 23:01:31 +0000 Subject: [PATCH 100/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/rules.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index c4cc66d1d7..9492a462b8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-086ef16f104ede15ec076d62462ded699d7de104bc6eecb86a27a46ab1ba7d66.yml -openapi_spec_hash: 28aaf21d2be023eb8f641e0f7a76c028 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c2ed86779626c93ec8c0ef9d0100bf399b7339722e8f9f256db590a733b07d6f.yml +openapi_spec_hash: 48144f26df6a82c7bc8bb4baddc6e188 config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 8a10ecf2f5..3dceff068b 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -447,7 +447,7 @@ export interface RuleSetting { /** * Configure how browser isolation behaves. */ - biso_admin_controls?: RuleSetting.BISOAdminControls | null; + biso_admin_controls?: RuleSetting.BISOAdminControls; /** * Custom block page settings. If missing/null, blocking will use the the account @@ -876,7 +876,7 @@ export interface RuleSettingParam { /** * Configure how browser isolation behaves. */ - biso_admin_controls?: RuleSettingParam.BISOAdminControls | null; + biso_admin_controls?: RuleSettingParam.BISOAdminControls; /** * Custom block page settings. If missing/null, blocking will use the the account From 03159d02db3bbf00b2aad5ae2e3cf5679ce4aebf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 22 Jul 2025 23:13:56 +0000 Subject: [PATCH 101/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/logpush/jobs.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9492a462b8..badc3f846e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c2ed86779626c93ec8c0ef9d0100bf399b7339722e8f9f256db590a733b07d6f.yml -openapi_spec_hash: 48144f26df6a82c7bc8bb4baddc6e188 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4f690382f570f545a035c6a1c0e0e77ec55d8070a52f245dc46b069fb3c6009.yml +openapi_spec_hash: 7fb90352e3acc8b7bad0718ec46e6c30 config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index fa64a74139..ebb9b098e1 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -375,7 +375,7 @@ export interface LogpushJob { * minimum file size; this means that log files may be much smaller than this batch * size. */ - max_upload_bytes?: 0 | unknown | null; + max_upload_bytes?: 0 | number | null; /** * The maximum interval in seconds for log batches. This setting must be between 30 @@ -383,7 +383,7 @@ export interface LogpushJob { * a minimum interval for log batches; this means that log files may be sent in * shorter intervals than this. */ - max_upload_interval_seconds?: 0 | unknown | null; + max_upload_interval_seconds?: 0 | number | null; /** * The maximum number of log lines per batch. This setting must be between 1000 and @@ -391,7 +391,7 @@ export interface LogpushJob { * number of log lines per batch; this means that log files may contain many fewer * lines than this. */ - max_upload_records?: 0 | unknown | null; + max_upload_records?: 0 | number | null; /** * Optional human readable job name. Not unique. Cloudflare suggests that you set @@ -660,7 +660,7 @@ export interface JobCreateParams { * cannot set a minimum file size; this means that log files may be much smaller * than this batch size. */ - max_upload_bytes?: 0 | unknown | null; + max_upload_bytes?: 0 | number | null; /** * Body param: The maximum interval in seconds for log batches. This setting must @@ -668,7 +668,7 @@ export interface JobCreateParams { * cannot specify a minimum interval for log batches; this means that log files may * be sent in shorter intervals than this. */ - max_upload_interval_seconds?: 0 | unknown | null; + max_upload_interval_seconds?: 0 | number | null; /** * Body param: The maximum number of log lines per batch. This setting must be @@ -676,7 +676,7 @@ export interface JobCreateParams { * specify a minimum number of log lines per batch; this means that log files may * contain many fewer lines than this. */ - max_upload_records?: 0 | unknown | null; + max_upload_records?: 0 | number | null; /** * Body param: Optional human readable job name. Not unique. Cloudflare suggests @@ -759,7 +759,7 @@ export interface JobUpdateParams { * cannot set a minimum file size; this means that log files may be much smaller * than this batch size. */ - max_upload_bytes?: 0 | unknown | null; + max_upload_bytes?: 0 | number | null; /** * Body param: The maximum interval in seconds for log batches. This setting must @@ -767,7 +767,7 @@ export interface JobUpdateParams { * cannot specify a minimum interval for log batches; this means that log files may * be sent in shorter intervals than this. */ - max_upload_interval_seconds?: 0 | unknown | null; + max_upload_interval_seconds?: 0 | number | null; /** * Body param: The maximum number of log lines per batch. This setting must be @@ -775,7 +775,7 @@ export interface JobUpdateParams { * specify a minimum number of log lines per batch; this means that log files may * contain many fewer lines than this. */ - max_upload_records?: 0 | unknown | null; + max_upload_records?: 0 | number | null; /** * Body param: Optional human readable job name. Not unique. Cloudflare suggests From f5b38b190e54e607c2726310ad0b90148154f90c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 04:25:17 +0000 Subject: [PATCH 102/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/zero-trust/gateway/locations.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index badc3f846e..f80a13d88c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a4f690382f570f545a035c6a1c0e0e77ec55d8070a52f245dc46b069fb3c6009.yml -openapi_spec_hash: 7fb90352e3acc8b7bad0718ec46e6c30 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d07750284af5d32083cde2ea5f50c31f1d02b2eaf1b549fd5038ebc4e04aac3e.yml +openapi_spec_hash: c0969d735c1e7c616d8bece6c9954bfc config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/zero-trust/gateway/locations.ts b/src/resources/zero-trust/gateway/locations.ts index c31a9d38aa..4b7f6da058 100644 --- a/src/resources/zero-trust/gateway/locations.ts +++ b/src/resources/zero-trust/gateway/locations.ts @@ -208,13 +208,13 @@ export interface DOTEndpointParam { * remains unchanged. */ export interface Endpoint { - doh?: DOHEndpoint; + doh: DOHEndpoint; - dot?: DOTEndpoint; + dot: DOTEndpoint; - ipv4?: IPV4Endpoint; + ipv4: IPV4Endpoint; - ipv6?: IPV6Endpoint; + ipv6: IPV6Endpoint; } /** @@ -223,13 +223,13 @@ export interface Endpoint { * remains unchanged. */ export interface EndpointParam { - doh?: DOHEndpointParam; + doh: DOHEndpointParam; - dot?: DOTEndpointParam; + dot: DOTEndpointParam; - ipv4?: IPV4EndpointParam; + ipv4: IPV4EndpointParam; - ipv6?: IPV6EndpointParam; + ipv6: IPV6EndpointParam; } export interface IPNetwork { From edd05ddd8b63a874a4274dfce68c1728bee6cca1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 06:07:07 +0000 Subject: [PATCH 103/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f80a13d88c..350fd4ebbd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d07750284af5d32083cde2ea5f50c31f1d02b2eaf1b549fd5038ebc4e04aac3e.yml -openapi_spec_hash: c0969d735c1e7c616d8bece6c9954bfc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee1f74ed9649f61cb6d532bd75a1154b1aa7163f104f71c1fdaddf4d0323d2b6.yml +openapi_spec_hash: 46e5a87acf60c3dbb6bbfd3ad1f38bc0 config_hash: a35e9eb0436652c704bebf7c0a38085b From 341a5b0c39497df6ee4734e7a442b8e22854bebc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:10:32 +0000 Subject: [PATCH 104/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 350fd4ebbd..4280148faf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee1f74ed9649f61cb6d532bd75a1154b1aa7163f104f71c1fdaddf4d0323d2b6.yml -openapi_spec_hash: 46e5a87acf60c3dbb6bbfd3ad1f38bc0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-997d6ac2d82c716b9c52aa4512234c4f46f04d97f6b06454432a0212d9181a45.yml +openapi_spec_hash: e2490f45375d27f43927925013962de0 config_hash: a35e9eb0436652c704bebf7c0a38085b From 9ff61263112b61d1546f0975d0dda60ba6fd56aa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:24:12 +0000 Subject: [PATCH 105/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4280148faf..372317ddc6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-997d6ac2d82c716b9c52aa4512234c4f46f04d97f6b06454432a0212d9181a45.yml -openapi_spec_hash: e2490f45375d27f43927925013962de0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa87a510170ff77c7aa6353af59872ec50c23261354ab04c8c54c57f62e401ab.yml +openapi_spec_hash: 2b7ae60e34fd4d2a595e21f9cec0a129 config_hash: a35e9eb0436652c704bebf7c0a38085b From 7432734998675a37871afc475629d69bca582f99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:57:43 +0000 Subject: [PATCH 106/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 372317ddc6..f80a13d88c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aa87a510170ff77c7aa6353af59872ec50c23261354ab04c8c54c57f62e401ab.yml -openapi_spec_hash: 2b7ae60e34fd4d2a595e21f9cec0a129 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d07750284af5d32083cde2ea5f50c31f1d02b2eaf1b549fd5038ebc4e04aac3e.yml +openapi_spec_hash: c0969d735c1e7c616d8bece6c9954bfc config_hash: a35e9eb0436652c704bebf7c0a38085b From 2577fa5cdfb8bbdc4c9613d093efd17379023f03 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:33:00 +0000 Subject: [PATCH 107/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f80a13d88c..0e866b2010 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d07750284af5d32083cde2ea5f50c31f1d02b2eaf1b549fd5038ebc4e04aac3e.yml -openapi_spec_hash: c0969d735c1e7c616d8bece6c9954bfc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2d6bd4db9e997928ce840a5f7ea06357f057c26107366b2edc94115a6b1b1d71.yml +openapi_spec_hash: c0ba8bc429135aedb6a8a71b9a7885a8 config_hash: a35e9eb0436652c704bebf7c0a38085b From b8ce4ec2b18e84227931ea2fcbaeb55ebe7be7c0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:59:01 +0000 Subject: [PATCH 108/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0e866b2010..f80b7b451b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2d6bd4db9e997928ce840a5f7ea06357f057c26107366b2edc94115a6b1b1d71.yml -openapi_spec_hash: c0ba8bc429135aedb6a8a71b9a7885a8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37ba57715cc6fab6f930381e1698a1a5ead8662da38e20ecc7a903e9eef88de6.yml +openapi_spec_hash: a5f8daf79763209818b8fe4a280380cb config_hash: a35e9eb0436652c704bebf7c0a38085b From cce4053288f836b4b4826814504d593606d960b8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 13:05:47 +0000 Subject: [PATCH 109/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f80b7b451b..93e376fefd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37ba57715cc6fab6f930381e1698a1a5ead8662da38e20ecc7a903e9eef88de6.yml -openapi_spec_hash: a5f8daf79763209818b8fe4a280380cb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dd01ef7125febc2e802576bf90e0e72ecb8274f5d7c8106d7742709bc5c0877.yml +openapi_spec_hash: f095759f7f2a9fda8626852b05c00e86 config_hash: a35e9eb0436652c704bebf7c0a38085b From 21160f4dc2ec4452c0b50427997b2efa516bf149 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 13:25:04 +0000 Subject: [PATCH 110/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 93e376fefd..cebfb78b4f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4dd01ef7125febc2e802576bf90e0e72ecb8274f5d7c8106d7742709bc5c0877.yml -openapi_spec_hash: f095759f7f2a9fda8626852b05c00e86 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fe90498b1af1ae6857487527e7d640527ecc04677c90f916f141994848fccb56.yml +openapi_spec_hash: b0e2b8f4595bc6c809a62703461a3366 config_hash: a35e9eb0436652c704bebf7c0a38085b From 311ce536b6eae43742ea280b7ca631586d6a040e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 13:59:28 +0000 Subject: [PATCH 111/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cebfb78b4f..516516dfed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fe90498b1af1ae6857487527e7d640527ecc04677c90f916f141994848fccb56.yml -openapi_spec_hash: b0e2b8f4595bc6c809a62703461a3366 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd8a16a72645133e9f0352650b8aa3e733e25f68df33987af26b3146b978d5d5.yml +openapi_spec_hash: 9feb54928ff2dd5d0b30d394f574c12e config_hash: a35e9eb0436652c704bebf7c0a38085b From a1b3d31ceadd6c6b8d97fc1b2eb5411a65dc00c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:32:07 +0000 Subject: [PATCH 112/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 516516dfed..fff0f2d338 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd8a16a72645133e9f0352650b8aa3e733e25f68df33987af26b3146b978d5d5.yml -openapi_spec_hash: 9feb54928ff2dd5d0b30d394f574c12e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e55a34665a45f59c0fcba5a5f7205e25d3974a03ffd6c26a100b8f5559a804f2.yml +openapi_spec_hash: e1a0d61d1059488b3659f8cd575f03cd config_hash: a35e9eb0436652c704bebf7c0a38085b From 2bded2e0df25f4eef22b341489d5a64c380eef8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:42:56 +0000 Subject: [PATCH 113/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fff0f2d338..db83a287d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e55a34665a45f59c0fcba5a5f7205e25d3974a03ffd6c26a100b8f5559a804f2.yml -openapi_spec_hash: e1a0d61d1059488b3659f8cd575f03cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bddeedf66ade6409222f645befe0f629c46da0e5f791ec5550232db180ca9471.yml +openapi_spec_hash: 3fee717477ece51e9add6a31fab4de98 config_hash: a35e9eb0436652c704bebf7c0a38085b From 5d00d106eec22b77d2e5e7544ed320a118bf93da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 14:54:02 +0000 Subject: [PATCH 114/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index db83a287d4..711ce7a9a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bddeedf66ade6409222f645befe0f629c46da0e5f791ec5550232db180ca9471.yml -openapi_spec_hash: 3fee717477ece51e9add6a31fab4de98 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7484ce9010ed66c1828f97b181539a0b5418d1a4cb6be789a12e06a00f4faa0c.yml +openapi_spec_hash: 6a8937b703b594465742ddf82652e181 config_hash: a35e9eb0436652c704bebf7c0a38085b From 9013f355cc42cb80b97ff4cdb5f506041d1f74e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 15:28:54 +0000 Subject: [PATCH 115/423] feat(api): api update --- .stats.yml | 4 +- src/resources/zero-trust/gateway/rules.ts | 72 +++++++++++------------ 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index 711ce7a9a7..a22bf87126 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7484ce9010ed66c1828f97b181539a0b5418d1a4cb6be789a12e06a00f4faa0c.yml -openapi_spec_hash: 6a8937b703b594465742ddf82652e181 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-19d313507009812541708ad5f07abc94e1b76a04125edbb739349275e00200ee.yml +openapi_spec_hash: 913c40ac2c619698530376e0da8d6a6b config_hash: a35e9eb0436652c704bebf7c0a38085b diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index 3dceff068b..aa9a45d142 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -264,16 +264,11 @@ export type GatewayFilter = 'http' | 'dns' | 'l4' | 'egress' | 'dns_resolver'; export type GatewayFilterParam = 'http' | 'dns' | 'l4' | 'egress' | 'dns_resolver'; export interface GatewayRule { - /** - * The API resource UUID. - */ - id?: string; - /** * The action to perform when the associated traffic, identity, and device posture * expressions are either absent or evaluate to `true`. */ - action?: + action: | 'on' | 'off' | 'allow' @@ -291,6 +286,41 @@ export interface GatewayRule { | 'quarantine' | 'redirect'; + /** + * True if the rule is enabled. + */ + enabled: boolean; + + /** + * The protocol or layer to evaluate the traffic, identity, and device posture + * expressions. + */ + filters: Array; + + /** + * The name of the rule. + */ + name: string; + + /** + * Precedence sets the order of your rules. Lower values indicate higher + * precedence. At each processing phase, applicable rules are evaluated in + * ascending order of this value. Refer to + * [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) + * docs on how to manage precedence via Terraform. + */ + precedence: number; + + /** + * The wirefilter expression used for traffic matching. + */ + traffic: string; + + /** + * The API resource UUID. + */ + id?: string; + created_at?: string; /** @@ -308,11 +338,6 @@ export interface GatewayRule { */ device_posture?: string; - /** - * True if the rule is enabled. - */ - enabled?: boolean; - /** * The expiration time stamp and default duration of a DNS policy. Takes precedence * over the policy's `schedule` configuration, if any. @@ -321,36 +346,16 @@ export interface GatewayRule { */ expiration?: GatewayRule.Expiration | null; - /** - * The protocol or layer to evaluate the traffic, identity, and device posture - * expressions. - */ - filters?: Array; - /** * The wirefilter expression used for identity matching. */ identity?: string; - /** - * The name of the rule. - */ - name?: string; - /** * The rule cannot be shared via the Orgs API */ not_sharable?: boolean; - /** - * Precedence sets the order of your rules. Lower values indicate higher - * precedence. At each processing phase, applicable rules are evaluated in - * ascending order of this value. Refer to - * [Order of enforcement](http://developers.cloudflare.com/learning-paths/secure-internet-traffic/understand-policies/order-of-enforcement/#manage-precedence-with-terraform) - * docs on how to manage precedence via Terraform. - */ - precedence?: number; - /** * The rule was shared via the Orgs API and cannot be edited by the current account */ @@ -372,11 +377,6 @@ export interface GatewayRule { */ source_account?: string; - /** - * The wirefilter expression used for traffic matching. - */ - traffic?: string; - updated_at?: string; /** From 07db7f006d36f18a3a3b244bf33c2f3c71976316 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 15:40:28 +0000 Subject: [PATCH 116/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a22bf87126..747ab69750 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-19d313507009812541708ad5f07abc94e1b76a04125edbb739349275e00200ee.yml -openapi_spec_hash: 913c40ac2c619698530376e0da8d6a6b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aab37cb84849907fc8ab8085493d6eea220dbca7d56f6ba60c110036308beb62.yml +openapi_spec_hash: 8fc60d7c347d88f3675e7898567334db config_hash: a35e9eb0436652c704bebf7c0a38085b From 107dc3f7a0d7086867c2d703cdf10fb5bf69d426 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 15:52:35 +0000 Subject: [PATCH 117/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 747ab69750..1011a0e82c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aab37cb84849907fc8ab8085493d6eea220dbca7d56f6ba60c110036308beb62.yml -openapi_spec_hash: 8fc60d7c347d88f3675e7898567334db +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82baac74c5e16f270edd35a2c506d5ae16a45d2180486cb8cc79b3794279ccc0.yml +openapi_spec_hash: 5583712ebf7b0a1d0b95288ee29cab44 config_hash: a35e9eb0436652c704bebf7c0a38085b From 327b5c933cdbfd5a66528219d137405345d98703 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:07:02 +0000 Subject: [PATCH 118/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1011a0e82c..2de069ba00 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-82baac74c5e16f270edd35a2c506d5ae16a45d2180486cb8cc79b3794279ccc0.yml -openapi_spec_hash: 5583712ebf7b0a1d0b95288ee29cab44 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-891506dc0c433a487d38684bf9df74c357aa8584fb265826731125a39436aa23.yml +openapi_spec_hash: e713302156c7ca1df84dee0eb049a65b config_hash: a35e9eb0436652c704bebf7c0a38085b From 93928a26bf2e5f86244e4486be5ac44cc1c6612d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:15:15 +0000 Subject: [PATCH 119/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2de069ba00..bdef65a3bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-891506dc0c433a487d38684bf9df74c357aa8584fb265826731125a39436aa23.yml -openapi_spec_hash: e713302156c7ca1df84dee0eb049a65b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb01309e687cc50b692a896b9b6498d404aa10169dcb4eec73d9c60e89ea4410.yml +openapi_spec_hash: 61caedfb39d33da63eb905dea5edc1e5 config_hash: a35e9eb0436652c704bebf7c0a38085b From 4d740ba3e12c7c680ac62bc201f02eefed147c3b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:26:35 +0000 Subject: [PATCH 120/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bdef65a3bf..1d215b9ea7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb01309e687cc50b692a896b9b6498d404aa10169dcb4eec73d9c60e89ea4410.yml -openapi_spec_hash: 61caedfb39d33da63eb905dea5edc1e5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-74100e43d1f1e33055a586ee43ee875d68d79aa5e5d328e5e60e419c24b5040d.yml +openapi_spec_hash: 42a59f61dbd5e5ab177e2b0c68e38a53 config_hash: a35e9eb0436652c704bebf7c0a38085b From f4996b517007da41d187e6e27aa3df663c9af842 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:38:18 +0000 Subject: [PATCH 121/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1d215b9ea7..77c7c9ecd4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-74100e43d1f1e33055a586ee43ee875d68d79aa5e5d328e5e60e419c24b5040d.yml -openapi_spec_hash: 42a59f61dbd5e5ab177e2b0c68e38a53 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b981591723b42ad37b5926897d57f9a412f809f1927de8f7bf43a0798cde5c42.yml +openapi_spec_hash: 08743068750f7f906b74ca605aa6e2bf config_hash: a35e9eb0436652c704bebf7c0a38085b From c55a3c680dbdc2a422d04729e71c23e62001cb41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 16:49:43 +0000 Subject: [PATCH 122/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 77c7c9ecd4..f4dcbe9f7b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b981591723b42ad37b5926897d57f9a412f809f1927de8f7bf43a0798cde5c42.yml -openapi_spec_hash: 08743068750f7f906b74ca605aa6e2bf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-303d6b3a12762312df5b41fd3c78e4aa8c124898a550d6d1f79c796a90cf42d5.yml +openapi_spec_hash: b96deae37d1d1fd77660d71ddeccb755 config_hash: a35e9eb0436652c704bebf7c0a38085b From 7905b8d1f57f17da654c0119997df0e2f419fab4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:09:28 +0000 Subject: [PATCH 123/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f4dcbe9f7b..8a0ab7ee4e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1777 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-303d6b3a12762312df5b41fd3c78e4aa8c124898a550d6d1f79c796a90cf42d5.yml -openapi_spec_hash: b96deae37d1d1fd77660d71ddeccb755 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0c2ca3fbbaded8b0f563e8d979466dab86e823a4f4f5dead506b60d4d2cab351.yml +openapi_spec_hash: f562c78a9e77633ea56d23996bdf95af config_hash: a35e9eb0436652c704bebf7c0a38085b From afdba327d64702324a88c179d15bdd9ebe0eddbc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:14:41 +0000 Subject: [PATCH 124/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 6 + src/resources/diagnostics/diagnostics.ts | 12 + .../diagnostics/endpoint-healthchecks.ts | 208 ++++++++++++++++++ src/resources/diagnostics/index.ts | 6 + .../diagnostics/endpoint-healthchecks.test.ts | 68 ++++++ 6 files changed, 302 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8a0ab7ee4e..4ff07e5cf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1777 +configured_endpoints: 1780 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0c2ca3fbbaded8b0f563e8d979466dab86e823a4f4f5dead506b60d4d2cab351.yml openapi_spec_hash: f562c78a9e77633ea56d23996bdf95af -config_hash: a35e9eb0436652c704bebf7c0a38085b +config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/api.md b/api.md index edb1f81f32..8241145e71 100644 --- a/api.md +++ b/api.md @@ -3024,12 +3024,18 @@ Types: - EndpointHealthcheck - EndpointHealthcheckCreateResponse +- EndpointHealthcheckUpdateResponse - EndpointHealthcheckListResponse +- EndpointHealthcheckDeleteResponse +- EndpointHealthcheckGetResponse Methods: - client.diagnostics.endpointHealthchecks.create({ ...params }) -> EndpointHealthcheckCreateResponse +- client.diagnostics.endpointHealthchecks.update(id, { ...params }) -> EndpointHealthcheckUpdateResponse - client.diagnostics.endpointHealthchecks.list({ ...params }) -> EndpointHealthcheckListResponse +- client.diagnostics.endpointHealthchecks.delete(id, { ...params }) -> EndpointHealthcheckDeleteResponse +- client.diagnostics.endpointHealthchecks.get(id, { ...params }) -> EndpointHealthcheckGetResponse # Images diff --git a/src/resources/diagnostics/diagnostics.ts b/src/resources/diagnostics/diagnostics.ts index 6c9d2f6991..395bc5f6a3 100644 --- a/src/resources/diagnostics/diagnostics.ts +++ b/src/resources/diagnostics/diagnostics.ts @@ -6,8 +6,14 @@ import { EndpointHealthcheck, EndpointHealthcheckCreateParams, EndpointHealthcheckCreateResponse, + EndpointHealthcheckDeleteParams, + EndpointHealthcheckDeleteResponse, + EndpointHealthcheckGetParams, + EndpointHealthcheckGetResponse, EndpointHealthcheckListParams, EndpointHealthcheckListResponse, + EndpointHealthcheckUpdateParams, + EndpointHealthcheckUpdateResponse, EndpointHealthchecks, } from './endpoint-healthchecks'; import * as TraceroutesAPI from './traceroutes'; @@ -35,8 +41,14 @@ export declare namespace Diagnostics { EndpointHealthchecks as EndpointHealthchecks, type EndpointHealthcheck as EndpointHealthcheck, type EndpointHealthcheckCreateResponse as EndpointHealthcheckCreateResponse, + type EndpointHealthcheckUpdateResponse as EndpointHealthcheckUpdateResponse, type EndpointHealthcheckListResponse as EndpointHealthcheckListResponse, + type EndpointHealthcheckDeleteResponse as EndpointHealthcheckDeleteResponse, + type EndpointHealthcheckGetResponse as EndpointHealthcheckGetResponse, type EndpointHealthcheckCreateParams as EndpointHealthcheckCreateParams, + type EndpointHealthcheckUpdateParams as EndpointHealthcheckUpdateParams, type EndpointHealthcheckListParams as EndpointHealthcheckListParams, + type EndpointHealthcheckDeleteParams as EndpointHealthcheckDeleteParams, + type EndpointHealthcheckGetParams as EndpointHealthcheckGetParams, }; } diff --git a/src/resources/diagnostics/endpoint-healthchecks.ts b/src/resources/diagnostics/endpoint-healthchecks.ts index 382d852431..ed1fbfa81f 100644 --- a/src/resources/diagnostics/endpoint-healthchecks.ts +++ b/src/resources/diagnostics/endpoint-healthchecks.ts @@ -30,6 +30,36 @@ export class EndpointHealthchecks extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Update a Endpoint Health Check. + * + * @example + * ```ts + * const endpointHealthcheck = + * await client.diagnostics.endpointHealthchecks.update( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * check_type: 'icmp', + * endpoint: '203.0.113.1', + * }, + * ); + * ``` + */ + update( + id: string, + params: EndpointHealthcheckUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, { + body, + ...options, + }) as Core.APIPromise<{ result: EndpointHealthcheckUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * List Endpoint Health Checks. * @@ -53,6 +83,53 @@ export class EndpointHealthchecks extends APIResource { ) as Core.APIPromise<{ result: EndpointHealthcheckListResponse }> )._thenUnwrap((obj) => obj.result); } + + /** + * Delete Endpoint Health Check. + * + * @example + * ```ts + * const endpointHealthcheck = + * await client.diagnostics.endpointHealthchecks.delete( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + delete( + id: string, + params: EndpointHealthcheckDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return this._client.delete(`/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, options); + } + + /** + * Get a single Endpoint Health Check. + * + * @example + * ```ts + * const endpointHealthcheck = + * await client.diagnostics.endpointHealthchecks.get( + * 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + id: string, + params: EndpointHealthcheckGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/diagnostics/endpoint-healthchecks/${id}`, + options, + ) as Core.APIPromise<{ result: EndpointHealthcheckGetResponse }> + )._thenUnwrap((obj) => obj.result); + } } export interface EndpointHealthcheck { @@ -94,6 +171,28 @@ export interface EndpointHealthcheckCreateResponse { name?: string; } +export interface EndpointHealthcheckUpdateResponse { + /** + * type of check to perform + */ + check_type: 'icmp'; + + /** + * the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * UUID. + */ + id?: string; + + /** + * Optional name associated with this check + */ + name?: string; +} + export interface EndpointHealthcheckListResponse { /** * type of check to perform @@ -116,6 +215,73 @@ export interface EndpointHealthcheckListResponse { name?: string; } +export interface EndpointHealthcheckDeleteResponse { + errors: Array; + + messages: Array; + + /** + * Whether the API call was successful. + */ + success: true; +} + +export namespace EndpointHealthcheckDeleteResponse { + 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 EndpointHealthcheckGetResponse { + /** + * type of check to perform + */ + check_type: 'icmp'; + + /** + * the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * UUID. + */ + id?: string; + + /** + * Optional name associated with this check + */ + name?: string; +} + export interface EndpointHealthcheckCreateParams { /** * Path param: Identifier @@ -138,6 +304,28 @@ export interface EndpointHealthcheckCreateParams { name?: string; } +export interface EndpointHealthcheckUpdateParams { + /** + * Path param: Identifier + */ + account_id: string; + + /** + * Body param: type of check to perform + */ + check_type: 'icmp'; + + /** + * Body param: the IP address of the host to perform checks against + */ + endpoint: string; + + /** + * Body param: Optional name associated with this check + */ + name?: string; +} + export interface EndpointHealthcheckListParams { /** * Identifier @@ -145,12 +333,32 @@ export interface EndpointHealthcheckListParams { account_id: string; } +export interface EndpointHealthcheckDeleteParams { + /** + * Identifier + */ + account_id: string; +} + +export interface EndpointHealthcheckGetParams { + /** + * Identifier + */ + account_id: string; +} + export declare namespace EndpointHealthchecks { export { type EndpointHealthcheck as EndpointHealthcheck, type EndpointHealthcheckCreateResponse as EndpointHealthcheckCreateResponse, + type EndpointHealthcheckUpdateResponse as EndpointHealthcheckUpdateResponse, type EndpointHealthcheckListResponse as EndpointHealthcheckListResponse, + type EndpointHealthcheckDeleteResponse as EndpointHealthcheckDeleteResponse, + type EndpointHealthcheckGetResponse as EndpointHealthcheckGetResponse, type EndpointHealthcheckCreateParams as EndpointHealthcheckCreateParams, + type EndpointHealthcheckUpdateParams as EndpointHealthcheckUpdateParams, type EndpointHealthcheckListParams as EndpointHealthcheckListParams, + type EndpointHealthcheckDeleteParams as EndpointHealthcheckDeleteParams, + type EndpointHealthcheckGetParams as EndpointHealthcheckGetParams, }; } diff --git a/src/resources/diagnostics/index.ts b/src/resources/diagnostics/index.ts index 63498a9d67..01dfb6f682 100644 --- a/src/resources/diagnostics/index.ts +++ b/src/resources/diagnostics/index.ts @@ -5,9 +5,15 @@ export { EndpointHealthchecks, type EndpointHealthcheck, type EndpointHealthcheckCreateResponse, + type EndpointHealthcheckUpdateResponse, type EndpointHealthcheckListResponse, + type EndpointHealthcheckDeleteResponse, + type EndpointHealthcheckGetResponse, type EndpointHealthcheckCreateParams, + type EndpointHealthcheckUpdateParams, type EndpointHealthcheckListParams, + type EndpointHealthcheckDeleteParams, + type EndpointHealthcheckGetParams, } from './endpoint-healthchecks'; export { TraceroutesSinglePage, diff --git a/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts b/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts index f436743078..0f501fea66 100644 --- a/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts +++ b/tests/api-resources/diagnostics/endpoint-healthchecks.test.ts @@ -34,6 +34,32 @@ describe('resource endpointHealthchecks', () => { }); }); + test('update: only required params', async () => { + const responsePromise = client.diagnostics.endpointHealthchecks.update( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353', check_type: 'icmp', endpoint: '203.0.113.1' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.diagnostics.endpointHealthchecks.update( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + check_type: 'icmp', + endpoint: '203.0.113.1', + name: 'My Endpoint', + }, + ); + }); + test('list: only required params', async () => { const responsePromise = client.diagnostics.endpointHealthchecks.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -52,4 +78,46 @@ describe('resource endpointHealthchecks', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', }); }); + + test('delete: only required params', async () => { + const responsePromise = client.diagnostics.endpointHealthchecks.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.diagnostics.endpointHealthchecks.delete( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); + + test('get: only required params', async () => { + const responsePromise = client.diagnostics.endpointHealthchecks.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.diagnostics.endpointHealthchecks.get( + 'f174e90a-fafe-4643-bbbc-4a0ed4fc8415', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); + }); }); From e7fe21ec14b727273368ec9ae9b3e80bb30a4814 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:19:27 +0000 Subject: [PATCH 125/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4ff07e5cf9..b87fd717d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0c2ca3fbbaded8b0f563e8d979466dab86e823a4f4f5dead506b60d4d2cab351.yml -openapi_spec_hash: f562c78a9e77633ea56d23996bdf95af +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ec9c31d7802b1b1a2aac86bdffe03935e39d15f399b7c49bb7e9d21ba6db04ff.yml +openapi_spec_hash: 73f4334042f8cfd103e0eae66c61de69 config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From f92b16fa1a24e5be95180d509f82833b723cce8c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 17:31:58 +0000 Subject: [PATCH 126/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b87fd717d0..3bfa47bb5b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ec9c31d7802b1b1a2aac86bdffe03935e39d15f399b7c49bb7e9d21ba6db04ff.yml -openapi_spec_hash: 73f4334042f8cfd103e0eae66c61de69 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b981591723b42ad37b5926897d57f9a412f809f1927de8f7bf43a0798cde5c42.yml +openapi_spec_hash: 08743068750f7f906b74ca605aa6e2bf config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From 813f0ad4119e5aa3972ce63513652df77b60fa3e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:12:43 +0000 Subject: [PATCH 127/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3bfa47bb5b..4bff989fd2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b981591723b42ad37b5926897d57f9a412f809f1927de8f7bf43a0798cde5c42.yml -openapi_spec_hash: 08743068750f7f906b74ca605aa6e2bf +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-95dde46a0da42ec3504f393080a7c6cb0cc285327cca6e07861a42c75e77a0d2.yml +openapi_spec_hash: ab1401deb52e7780d381fe3558219083 config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From b65a81ebb4395a2ecdf5d67cf29c835522419ab1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 18:29:41 +0000 Subject: [PATCH 128/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4bff989fd2..73a1c00c7b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-95dde46a0da42ec3504f393080a7c6cb0cc285327cca6e07861a42c75e77a0d2.yml -openapi_spec_hash: ab1401deb52e7780d381fe3558219083 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c0247a93639846d39cfcc99d38e7c5e98b2637591e856ec3a6c6b8f5ded8483.yml +openapi_spec_hash: 63874e2c079e61d488da4dabbd830029 config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From b7e31b03815ae55e92fe394714d8e48d521520b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:03:20 +0000 Subject: [PATCH 129/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/email-security/investigate/investigate.ts | 4 ---- src/resources/email-security/submissions.ts | 5 +++++ tests/api-resources/email-security/submissions.test.ts | 1 + 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 73a1c00c7b..6b90f8204a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c0247a93639846d39cfcc99d38e7c5e98b2637591e856ec3a6c6b8f5ded8483.yml -openapi_spec_hash: 63874e2c079e61d488da4dabbd830029 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c7a7b078b5674b19aa554cb9420deade6c92807a40680c28f364a206ba3f2721.yml +openapi_spec_hash: 3831e836bc45fc02aa8fb688c14aa2ca config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/src/resources/email-security/investigate/investigate.ts b/src/resources/email-security/investigate/investigate.ts index a7dcdefa75..9c881bfe72 100644 --- a/src/resources/email-security/investigate/investigate.ts +++ b/src/resources/email-security/investigate/investigate.ts @@ -175,7 +175,6 @@ export namespace InvestigateListResponse { allowlisted_pattern_type?: | 'quarantine_release' - | 'blocked_sender' | 'acceptable_sender' | 'allowed_sender' | 'allowed_recipient' @@ -189,7 +188,6 @@ export namespace InvestigateListResponse { whitelisted_pattern_type?: | 'quarantine_release' - | 'blocked_sender' | 'acceptable_sender' | 'allowed_sender' | 'allowed_recipient' @@ -297,7 +295,6 @@ export namespace InvestigateGetResponse { allowlisted_pattern_type?: | 'quarantine_release' - | 'blocked_sender' | 'acceptable_sender' | 'allowed_sender' | 'allowed_recipient' @@ -311,7 +308,6 @@ export namespace InvestigateGetResponse { whitelisted_pattern_type?: | 'quarantine_release' - | 'blocked_sender' | 'acceptable_sender' | 'allowed_sender' | 'allowed_recipient' diff --git a/src/resources/email-security/submissions.ts b/src/resources/email-security/submissions.ts index 0cfc78492c..f8764b948a 100644 --- a/src/resources/email-security/submissions.ts +++ b/src/resources/email-security/submissions.ts @@ -127,6 +127,11 @@ export interface SubmissionListParams extends V4PagePaginationArrayParams { */ start?: string; + /** + * Query param: + */ + status?: string; + /** * Query param: */ diff --git a/tests/api-resources/email-security/submissions.test.ts b/tests/api-resources/email-security/submissions.test.ts index 99bea4b4d5..8175013af4 100644 --- a/tests/api-resources/email-security/submissions.test.ts +++ b/tests/api-resources/email-security/submissions.test.ts @@ -34,6 +34,7 @@ describe('resource submissions', () => { query: 'query', requested_disposition: 'MALICIOUS', start: '2019-12-27T18:11:19.117Z', + status: 'status', submission_id: 'submission_id', type: 'TEAM', }); From e3828e39679780dcbe6394a27c1c4f04c9f487d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 19:32:35 +0000 Subject: [PATCH 130/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b90f8204a..97df418203 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c7a7b078b5674b19aa554cb9420deade6c92807a40680c28f364a206ba3f2721.yml -openapi_spec_hash: 3831e836bc45fc02aa8fb688c14aa2ca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c7237ed6d5ee19e525c3555a30308dda8493b11cf438458ae8f746e4e93b2108.yml +openapi_spec_hash: 3f3c013862b57c163dec46404e70561b config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From c4b2633c9bc2def4a0bc68d597b6aec431ddc49e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:03:29 +0000 Subject: [PATCH 131/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 97df418203..9a01af9438 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c7237ed6d5ee19e525c3555a30308dda8493b11cf438458ae8f746e4e93b2108.yml -openapi_spec_hash: 3f3c013862b57c163dec46404e70561b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5997d66d1cb9cde95c412ad1ad1ad9a5b63a066f0a453a5f96e40e5d9c5192ca.yml +openapi_spec_hash: b38dcd3eea422e41e45f5fe85ecd15eb config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 From 650101c9e51fa0ac85e4ed2d6bae56df1b9a602e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 20:51:49 +0000 Subject: [PATCH 132/423] feat(api): api update --- .stats.yml | 4 ++-- .../gateway/configurations/configurations.ts | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9a01af9438..e034521044 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5997d66d1cb9cde95c412ad1ad1ad9a5b63a066f0a453a5f96e40e5d9c5192ca.yml -openapi_spec_hash: b38dcd3eea422e41e45f5fe85ecd15eb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d23d05052d02bb368fe9c777172efa371c6be9d1855f3851d42f89c05b57370.yml +openapi_spec_hash: 57e8b58a5c0f3ffa1dfb7a9e68486641 config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 2261c3d520..28499fc2ba 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -236,6 +236,11 @@ export interface BlockPageSettings { * If mode is redirect_uri: URI to which the user should be redirected. */ target_uri?: string; + + /** + * Version number of the setting + */ + version?: number; } /** @@ -416,6 +421,11 @@ export interface ExtendedEmailMatching { * Account tag of account that shared this setting */ source_account?: string; + + /** + * Version number of the setting + */ + version?: number; } /** From f137333345c22547290d25df05786a1c3b42f212 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:16:38 +0000 Subject: [PATCH 133/423] feat(api): api update --- .stats.yml | 4 ++-- .../network-interconnects/interconnects.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e034521044..82644a77fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d23d05052d02bb368fe9c777172efa371c6be9d1855f3851d42f89c05b57370.yml -openapi_spec_hash: 57e8b58a5c0f3ffa1dfb7a9e68486641 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml +openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/src/resources/network-interconnects/interconnects.ts b/src/resources/network-interconnects/interconnects.ts index 5a041c2d04..0ba927420e 100644 --- a/src/resources/network-interconnects/interconnects.ts +++ b/src/resources/network-interconnects/interconnects.ts @@ -174,6 +174,11 @@ export namespace InterconnectCreateResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -226,6 +231,11 @@ export namespace InterconnectListResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -273,6 +283,11 @@ export namespace InterconnectGetResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } From 0af28fa5f637984c8e15df6b0f0a07b3329e8a7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:28:04 +0000 Subject: [PATCH 134/423] feat(api): api update --- .stats.yml | 4 ++-- .../network-interconnects/interconnects.ts | 15 --------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index 82644a77fd..e034521044 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml -openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d23d05052d02bb368fe9c777172efa371c6be9d1855f3851d42f89c05b57370.yml +openapi_spec_hash: 57e8b58a5c0f3ffa1dfb7a9e68486641 config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/src/resources/network-interconnects/interconnects.ts b/src/resources/network-interconnects/interconnects.ts index 0ba927420e..5a041c2d04 100644 --- a/src/resources/network-interconnects/interconnects.ts +++ b/src/resources/network-interconnects/interconnects.ts @@ -174,11 +174,6 @@ export namespace InterconnectCreateResponse { type: string; owner?: string; - - /** - * Bandwidth structure as visible through the customer-facing API. - */ - speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -231,11 +226,6 @@ export namespace InterconnectListResponse { type: string; owner?: string; - - /** - * Bandwidth structure as visible through the customer-facing API. - */ - speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -283,11 +273,6 @@ export namespace InterconnectGetResponse { type: string; owner?: string; - - /** - * Bandwidth structure as visible through the customer-facing API. - */ - speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } From 0672db1eaaa43679f36b0b772b79ca6679783889 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:43:06 +0000 Subject: [PATCH 135/423] feat(api): api update --- .stats.yml | 4 ++-- .../network-interconnects/interconnects.ts | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e034521044..82644a77fd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4d23d05052d02bb368fe9c777172efa371c6be9d1855f3851d42f89c05b57370.yml -openapi_spec_hash: 57e8b58a5c0f3ffa1dfb7a9e68486641 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml +openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 diff --git a/src/resources/network-interconnects/interconnects.ts b/src/resources/network-interconnects/interconnects.ts index 5a041c2d04..0ba927420e 100644 --- a/src/resources/network-interconnects/interconnects.ts +++ b/src/resources/network-interconnects/interconnects.ts @@ -174,6 +174,11 @@ export namespace InterconnectCreateResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -226,6 +231,11 @@ export namespace InterconnectListResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } @@ -273,6 +283,11 @@ export namespace InterconnectGetResponse { type: string; owner?: string; + + /** + * Bandwidth structure as visible through the customer-facing API. + */ + speed?: '50M' | '100M' | '200M' | '300M' | '400M' | '500M' | '1G' | '2G' | '5G' | '10G' | '20G' | '50G'; } } From 602dffcf3740c0dfb8dfb190e15c3a76174d3760 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:46:09 +0000 Subject: [PATCH 136/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 2 ++ src/resources/cloudforce-one/binary-storage.ts | 5 +++++ src/resources/cloudforce-one/cloudforce-one.ts | 6 ++++++ src/resources/cloudforce-one/index.ts | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/resources/cloudforce-one/binary-storage.ts diff --git a/.stats.yml b/.stats.yml index 82644a77fd..f3b52b1ee2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a -config_hash: d0e248ca79b5e8c02f412a9f5cbf5fc5 +config_hash: 3c3eb4d2344e048ccefb763165bb4e9f diff --git a/api.md b/api.md index 8241145e71..d62ab2c75a 100644 --- a/api.md +++ b/api.md @@ -7791,6 +7791,8 @@ Methods: - client.cloudforceOne.scans.config.delete(configId, { ...params }) -> ConfigDeleteResponse - client.cloudforceOne.scans.config.edit(configId, { ...params }) -> ConfigEditResponse +## BinaryStorage + ## Requests Types: diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts new file mode 100644 index 0000000000..4503305f01 --- /dev/null +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class BinaryStorage extends APIResource {} diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index 758dc12742..78a81868ad 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -1,6 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as BinaryStorageAPI from './binary-storage'; +import { BinaryStorage } from './binary-storage'; import * as RequestsAPI from './requests/requests'; import { Item, @@ -43,11 +45,13 @@ import { export class CloudforceOne extends APIResource { scans: ScansAPI.Scans = new ScansAPI.Scans(this._client); + binaryStorage: BinaryStorageAPI.BinaryStorage = new BinaryStorageAPI.BinaryStorage(this._client); requests: RequestsAPI.Requests = new RequestsAPI.Requests(this._client); threatEvents: ThreatEventsAPI.ThreatEvents = new ThreatEventsAPI.ThreatEvents(this._client); } CloudforceOne.Scans = Scans; +CloudforceOne.BinaryStorage = BinaryStorage; CloudforceOne.Requests = Requests; CloudforceOne.ListItemsSinglePage = ListItemsSinglePage; CloudforceOne.RequestTypesResponsesSinglePage = RequestTypesResponsesSinglePage; @@ -56,6 +60,8 @@ CloudforceOne.ThreatEvents = ThreatEvents; export declare namespace CloudforceOne { export { Scans as Scans }; + export { BinaryStorage as BinaryStorage }; + export { Requests as Requests, type Item as Item, diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index 49d822b613..4b9cb0ccb5 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -1,5 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. +export { BinaryStorage } from './binary-storage'; export { CloudforceOne } from './cloudforce-one'; export { ListItemsSinglePage, From 6426864befc8b13e8435f28592c30b52d1ab7fc4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 23 Jul 2025 22:52:16 +0000 Subject: [PATCH 137/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f3b52b1ee2..14ee94d849 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml -openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f8febc5db94b6b0fea6a7843b253fbf5024b84e64a48306997d9b1060836564.yml +openapi_spec_hash: 54c94bc53f742b3d2ccd490e21d13bb9 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 4db8867b778b0d447662ae9ae1296068c4300bdc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 06:09:36 +0000 Subject: [PATCH 138/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 14ee94d849..f3b52b1ee2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f8febc5db94b6b0fea6a7843b253fbf5024b84e64a48306997d9b1060836564.yml -openapi_spec_hash: 54c94bc53f742b3d2ccd490e21d13bb9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml +openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From ecd1b0f9beb71debc60adec2f1e833079b55e0f4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 07:58:06 +0000 Subject: [PATCH 139/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 9 ++ scripts/detect-breaking-changes | 1 + .../cloudforce-one/binary-storage.ts | 89 ++++++++++++++++++- .../cloudforce-one/cloudforce-one.ts | 14 ++- src/resources/cloudforce-one/index.ts | 7 +- .../cloudforce-one/binary-storage.test.ts | 48 ++++++++++ 7 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/binary-storage.test.ts diff --git a/.stats.yml b/.stats.yml index f3b52b1ee2..781877f8bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1780 +configured_endpoints: 1782 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a -config_hash: 3c3eb4d2344e048ccefb763165bb4e9f +config_hash: 82511e0d291f7ff3bac22f87ded4e0a5 diff --git a/api.md b/api.md index d62ab2c75a..8b93a44cd7 100644 --- a/api.md +++ b/api.md @@ -7793,6 +7793,15 @@ Methods: ## BinaryStorage +Types: + +- BinaryStorageCreateResponse + +Methods: + +- client.cloudforceOne.binaryStorage.create({ ...params }) -> BinaryStorageCreateResponse +- client.cloudforceOne.binaryStorage.get(hash, { ...params }) -> void + ## Requests Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index a8024d0304..b039f24cfa 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -666,6 +666,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/scans/scans.test.ts tests/api-resources/cloudforce-one/scans/results.test.ts tests/api-resources/cloudforce-one/scans/config.test.ts + tests/api-resources/cloudforce-one/binary-storage.test.ts tests/api-resources/cloudforce-one/requests/requests.test.ts tests/api-resources/cloudforce-one/requests/message.test.ts tests/api-resources/cloudforce-one/requests/priority.test.ts diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts index 4503305f01..817cd48722 100644 --- a/src/resources/cloudforce-one/binary-storage.ts +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -1,5 +1,92 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class BinaryStorage extends APIResource {} +export class BinaryStorage extends APIResource { + /** + * Posts a file to BinDB + * + * @example + * ```ts + * const binaryStorage = + * await client.cloudforceOne.binaryStorage.create({ + * account_id: 'account_id', + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + create( + params: BinaryStorageCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post( + `/accounts/${account_id}/cloudforce-one/binary`, + Core.multipartFormRequestOptions({ body, ...options }), + ); + } + + /** + * Posts a file to BinDB + * + * @example + * ```ts + * await client.cloudforceOne.binaryStorage.get('hash', { + * account_id: 'account_id', + * }); + * ``` + */ + get(hash: string, params: BinaryStorageGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/binary/${hash}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface BinaryStorageCreateResponse { + accountIds: Array; + + content_type: string; + + filenames: Array; + + first_seen: number; + + is_private: boolean; + + md5: string; + + sha1: string; + + sha256: string; +} + +export interface BinaryStorageCreateParams { + /** + * Path param: Account ID. + */ + account_id: string; + + /** + * Body param: The binary file content to upload. + */ + file: Core.Uploadable; +} + +export interface BinaryStorageGetParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace BinaryStorage { + export { + type BinaryStorageCreateResponse as BinaryStorageCreateResponse, + type BinaryStorageCreateParams as BinaryStorageCreateParams, + type BinaryStorageGetParams as BinaryStorageGetParams, + }; +} diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index 78a81868ad..aeabfa782e 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -2,7 +2,12 @@ import { APIResource } from '../../resource'; import * as BinaryStorageAPI from './binary-storage'; -import { BinaryStorage } from './binary-storage'; +import { + BinaryStorage, + BinaryStorageCreateParams, + BinaryStorageCreateResponse, + BinaryStorageGetParams, +} from './binary-storage'; import * as RequestsAPI from './requests/requests'; import { Item, @@ -60,7 +65,12 @@ CloudforceOne.ThreatEvents = ThreatEvents; export declare namespace CloudforceOne { export { Scans as Scans }; - export { BinaryStorage as BinaryStorage }; + export { + BinaryStorage as BinaryStorage, + type BinaryStorageCreateResponse as BinaryStorageCreateResponse, + type BinaryStorageCreateParams as BinaryStorageCreateParams, + type BinaryStorageGetParams as BinaryStorageGetParams, + }; export { Requests as Requests, diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index 4b9cb0ccb5..f69388911d 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -1,6 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { BinaryStorage } from './binary-storage'; +export { + BinaryStorage, + type BinaryStorageCreateResponse, + type BinaryStorageCreateParams, + type BinaryStorageGetParams, +} from './binary-storage'; export { CloudforceOne } from './cloudforce-one'; export { ListItemsSinglePage, diff --git a/tests/api-resources/cloudforce-one/binary-storage.test.ts b/tests/api-resources/cloudforce-one/binary-storage.test.ts new file mode 100644 index 0000000000..0c50b97af3 --- /dev/null +++ b/tests/api-resources/cloudforce-one/binary-storage.test.ts @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare, { toFile } from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource binaryStorage', () => { + test('create: only required params', async () => { + const responsePromise = client.cloudforceOne.binaryStorage.create({ + account_id: 'account_id', + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.cloudforceOne.binaryStorage.create({ + account_id: 'account_id', + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); + }); +}); From 3b2317c217af3f35c7352148dc41a0893885855f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 08:10:41 +0000 Subject: [PATCH 140/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 9 -- scripts/detect-breaking-changes | 1 - .../cloudforce-one/binary-storage.ts | 89 +------------------ .../cloudforce-one/cloudforce-one.ts | 14 +-- src/resources/cloudforce-one/index.ts | 7 +- .../cloudforce-one/binary-storage.test.ts | 48 ---------- 7 files changed, 6 insertions(+), 166 deletions(-) delete mode 100644 tests/api-resources/cloudforce-one/binary-storage.test.ts diff --git a/.stats.yml b/.stats.yml index 781877f8bf..f3b52b1ee2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1782 +configured_endpoints: 1780 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a -config_hash: 82511e0d291f7ff3bac22f87ded4e0a5 +config_hash: 3c3eb4d2344e048ccefb763165bb4e9f diff --git a/api.md b/api.md index 8b93a44cd7..d62ab2c75a 100644 --- a/api.md +++ b/api.md @@ -7793,15 +7793,6 @@ Methods: ## BinaryStorage -Types: - -- BinaryStorageCreateResponse - -Methods: - -- client.cloudforceOne.binaryStorage.create({ ...params }) -> BinaryStorageCreateResponse -- client.cloudforceOne.binaryStorage.get(hash, { ...params }) -> void - ## Requests Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index b039f24cfa..a8024d0304 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -666,7 +666,6 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/scans/scans.test.ts tests/api-resources/cloudforce-one/scans/results.test.ts tests/api-resources/cloudforce-one/scans/config.test.ts - tests/api-resources/cloudforce-one/binary-storage.test.ts tests/api-resources/cloudforce-one/requests/requests.test.ts tests/api-resources/cloudforce-one/requests/message.test.ts tests/api-resources/cloudforce-one/requests/priority.test.ts diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts index 817cd48722..4503305f01 100644 --- a/src/resources/cloudforce-one/binary-storage.ts +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -1,92 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as Core from '../../core'; -export class BinaryStorage extends APIResource { - /** - * Posts a file to BinDB - * - * @example - * ```ts - * const binaryStorage = - * await client.cloudforceOne.binaryStorage.create({ - * account_id: 'account_id', - * file: fs.createReadStream('path/to/file'), - * }); - * ``` - */ - create( - params: BinaryStorageCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return this._client.post( - `/accounts/${account_id}/cloudforce-one/binary`, - Core.multipartFormRequestOptions({ body, ...options }), - ); - } - - /** - * Posts a file to BinDB - * - * @example - * ```ts - * await client.cloudforceOne.binaryStorage.get('hash', { - * account_id: 'account_id', - * }); - * ``` - */ - get(hash: string, params: BinaryStorageGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return this._client.get(`/accounts/${account_id}/cloudforce-one/binary/${hash}`, { - ...options, - headers: { Accept: '*/*', ...options?.headers }, - }); - } -} - -export interface BinaryStorageCreateResponse { - accountIds: Array; - - content_type: string; - - filenames: Array; - - first_seen: number; - - is_private: boolean; - - md5: string; - - sha1: string; - - sha256: string; -} - -export interface BinaryStorageCreateParams { - /** - * Path param: Account ID. - */ - account_id: string; - - /** - * Body param: The binary file content to upload. - */ - file: Core.Uploadable; -} - -export interface BinaryStorageGetParams { - /** - * Account ID. - */ - account_id: string; -} - -export declare namespace BinaryStorage { - export { - type BinaryStorageCreateResponse as BinaryStorageCreateResponse, - type BinaryStorageCreateParams as BinaryStorageCreateParams, - type BinaryStorageGetParams as BinaryStorageGetParams, - }; -} +export class BinaryStorage extends APIResource {} diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index aeabfa782e..78a81868ad 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -2,12 +2,7 @@ import { APIResource } from '../../resource'; import * as BinaryStorageAPI from './binary-storage'; -import { - BinaryStorage, - BinaryStorageCreateParams, - BinaryStorageCreateResponse, - BinaryStorageGetParams, -} from './binary-storage'; +import { BinaryStorage } from './binary-storage'; import * as RequestsAPI from './requests/requests'; import { Item, @@ -65,12 +60,7 @@ CloudforceOne.ThreatEvents = ThreatEvents; export declare namespace CloudforceOne { export { Scans as Scans }; - export { - BinaryStorage as BinaryStorage, - type BinaryStorageCreateResponse as BinaryStorageCreateResponse, - type BinaryStorageCreateParams as BinaryStorageCreateParams, - type BinaryStorageGetParams as BinaryStorageGetParams, - }; + export { BinaryStorage as BinaryStorage }; export { Requests as Requests, diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index f69388911d..4b9cb0ccb5 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -1,11 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - BinaryStorage, - type BinaryStorageCreateResponse, - type BinaryStorageCreateParams, - type BinaryStorageGetParams, -} from './binary-storage'; +export { BinaryStorage } from './binary-storage'; export { CloudforceOne } from './cloudforce-one'; export { ListItemsSinglePage, diff --git a/tests/api-resources/cloudforce-one/binary-storage.test.ts b/tests/api-resources/cloudforce-one/binary-storage.test.ts deleted file mode 100644 index 0c50b97af3..0000000000 --- a/tests/api-resources/cloudforce-one/binary-storage.test.ts +++ /dev/null @@ -1,48 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare, { toFile } from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource binaryStorage', () => { - test('create: only required params', async () => { - const responsePromise = client.cloudforceOne.binaryStorage.create({ - account_id: 'account_id', - file: await toFile(Buffer.from('# my file contents'), 'README.md'), - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.cloudforceOne.binaryStorage.create({ - account_id: 'account_id', - file: await toFile(Buffer.from('# my file contents'), 'README.md'), - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); - }); -}); From 64b3f23b39b48a8905966b18ba2ac739a9824a5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 08:36:23 +0000 Subject: [PATCH 141/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f3b52b1ee2..38c1233cbc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e11ecd82283dd3f7b3656cad55808ac97ed1580774b39d374ad31e8177dd90d1.yml -openapi_spec_hash: 7164ecdc98d777ab3e0fcff08126b34a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a7b9afd705816e07f0c69e5eab91182da30d5601ba9bbb439e843d5672e30eb.yml +openapi_spec_hash: b498b104bd7e8c4c5d63e53155b23852 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From bdb0505e04d084bddbc0f3375d8873f38e5b2a72 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 08:53:00 +0000 Subject: [PATCH 142/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 38c1233cbc..468287feb0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4a7b9afd705816e07f0c69e5eab91182da30d5601ba9bbb439e843d5672e30eb.yml -openapi_spec_hash: b498b104bd7e8c4c5d63e53155b23852 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d00d916b32b09629886a8e6ca9256f1f5beb18e6eedf1786cc46a66b56e6205.yml +openapi_spec_hash: d6b6f374cb430ce88a082c612cf5bdd2 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 68e79c7b38085513a91e66e5c950e38e8681023c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 10:58:38 +0000 Subject: [PATCH 143/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 468287feb0..9a1eabc394 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1d00d916b32b09629886a8e6ca9256f1f5beb18e6eedf1786cc46a66b56e6205.yml -openapi_spec_hash: d6b6f374cb430ce88a082c612cf5bdd2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3596b977492353fac110b002849ae8244ce926fd928e5f44c146aeb28f3387dc.yml +openapi_spec_hash: 89300979da805cae5cb78504fc9ac113 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 1e88d70999925b02f6e9e23f3c0e344bc000c83f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 11:07:50 +0000 Subject: [PATCH 144/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9a1eabc394..e9419e1659 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3596b977492353fac110b002849ae8244ce926fd928e5f44c146aeb28f3387dc.yml -openapi_spec_hash: 89300979da805cae5cb78504fc9ac113 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-450567753ca183069b96996e2e60442502c02df6619085798783c77af75270ec.yml +openapi_spec_hash: e05b99de95bc1cd0caad8fd6881023de config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 0f690c86cc09d44208263ab6f5ab6130b00fb800 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 11:22:49 +0000 Subject: [PATCH 145/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e9419e1659..e1c134095f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-450567753ca183069b96996e2e60442502c02df6619085798783c77af75270ec.yml -openapi_spec_hash: e05b99de95bc1cd0caad8fd6881023de +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a9f64de98a0a9e12306aff313d35e4218cde94bc8b4ab4318d22bdbf3986211f.yml +openapi_spec_hash: 1016848980cfeeb85894024f78418944 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 8d9092bb4a064385004a7f0b06c33aba5222d57d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 11:37:39 +0000 Subject: [PATCH 146/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e1c134095f..45dfa2fbf1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a9f64de98a0a9e12306aff313d35e4218cde94bc8b4ab4318d22bdbf3986211f.yml -openapi_spec_hash: 1016848980cfeeb85894024f78418944 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7ad98c17d3bea0196151881e245763bebd88f944aeecef092e613b15c9b7b01c.yml +openapi_spec_hash: 0d1e08a12631396c6d587f4f5f2ff571 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 55a01385583658196ca8bf63645b9d766dfcc5dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 12:38:44 +0000 Subject: [PATCH 147/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 45dfa2fbf1..84f0d44981 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7ad98c17d3bea0196151881e245763bebd88f944aeecef092e613b15c9b7b01c.yml -openapi_spec_hash: 0d1e08a12631396c6d587f4f5f2ff571 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ec8164298449e164e445477b9b3c6faccfbc4943f6a726ad4127506f73fc4e5.yml +openapi_spec_hash: 1a19f10668a2d9bd975ccfc5c5151758 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 21c72f1a1c3c78f1fa976cf99438f63ebc781b5c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 12:52:33 +0000 Subject: [PATCH 148/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 84f0d44981..18d251b1e6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ec8164298449e164e445477b9b3c6faccfbc4943f6a726ad4127506f73fc4e5.yml -openapi_spec_hash: 1a19f10668a2d9bd975ccfc5c5151758 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-92436eb10b7072de80468ea3269ea4abb5b3c48c70aa944c7842952c3be6b859.yml +openapi_spec_hash: 225bb66ab77075df98cc7e4cf1ac13db config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 4d8d1328964365386b1b3e4abd1bd20b5f6ad6e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:02:09 +0000 Subject: [PATCH 149/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 18d251b1e6..9a1eabc394 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-92436eb10b7072de80468ea3269ea4abb5b3c48c70aa944c7842952c3be6b859.yml -openapi_spec_hash: 225bb66ab77075df98cc7e4cf1ac13db +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3596b977492353fac110b002849ae8244ce926fd928e5f44c146aeb28f3387dc.yml +openapi_spec_hash: 89300979da805cae5cb78504fc9ac113 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From aee6d3b8fb34e8b1aadf1c09493d6906fd0cab99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 13:41:50 +0000 Subject: [PATCH 150/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9a1eabc394..79fc3e7ba2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3596b977492353fac110b002849ae8244ce926fd928e5f44c146aeb28f3387dc.yml -openapi_spec_hash: 89300979da805cae5cb78504fc9ac113 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a837feeabc450c652ac59be041ee2cb2546fa5c7cfaa3d2e51190220d2af9e66.yml +openapi_spec_hash: db09b8ec8133ba3ae4a03d428839d7c9 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 43789e25c06b554e34e8a416a350aa90dec9c2a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:02:59 +0000 Subject: [PATCH 151/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 79fc3e7ba2..639e9544c2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a837feeabc450c652ac59be041ee2cb2546fa5c7cfaa3d2e51190220d2af9e66.yml -openapi_spec_hash: db09b8ec8133ba3ae4a03d428839d7c9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bfa6b9356860951553abac7bcfd2656f1d059ee0a33d915524d056bd024d291d.yml +openapi_spec_hash: a1f952a275f2079ff2e47f0264da8d5e config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 1eaf42bef6bf38fff8a9bdb931fd5de0364edf8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:36:20 +0000 Subject: [PATCH 152/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 639e9544c2..00fabd62d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bfa6b9356860951553abac7bcfd2656f1d059ee0a33d915524d056bd024d291d.yml -openapi_spec_hash: a1f952a275f2079ff2e47f0264da8d5e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c1b67390b1d24c9d11e6b37b50c993f4042dad1ce19c45dd5624c33e02042e2d.yml +openapi_spec_hash: 497fc49f28c7f12fabfb592028d92da4 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 1d6e6bb45e6b4457ae12486804dfca3d4001d260 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:44:39 +0000 Subject: [PATCH 153/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 00fabd62d0..c82ee4f28a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c1b67390b1d24c9d11e6b37b50c993f4042dad1ce19c45dd5624c33e02042e2d.yml -openapi_spec_hash: 497fc49f28c7f12fabfb592028d92da4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6be68a06f407865b91692cbaceef98a4f4be80650ad4d1529648dbc051844f07.yml +openapi_spec_hash: 421a451fd52df6a7be16b806aba72d76 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 81943ba584ab22c54720a3e264deb6e70679f1e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 14:53:49 +0000 Subject: [PATCH 154/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c82ee4f28a..5f2b961c4d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6be68a06f407865b91692cbaceef98a4f4be80650ad4d1529648dbc051844f07.yml -openapi_spec_hash: 421a451fd52df6a7be16b806aba72d76 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-130167656dd396cd4e53e5a62689b5e37ceecff47d359cfe90a584abac810179.yml +openapi_spec_hash: 45f5620cfbb304c89957869054bdd05f config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 7439e73c10bf9a9d00cfb5f539c7cdef9a840f70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:53:45 +0000 Subject: [PATCH 155/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5f2b961c4d..23a0b6bf2f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-130167656dd396cd4e53e5a62689b5e37ceecff47d359cfe90a584abac810179.yml -openapi_spec_hash: 45f5620cfbb304c89957869054bdd05f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4ddcc496e9a6b05c392906ea022e6fbd394bf9e139a19c97734fcb32be967c8b.yml +openapi_spec_hash: 9acf3bcad7c52b5ca797047f77796e01 config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 8aa9e3b998ab24b98f2cc4dab3aa10a64321f719 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 15:56:31 +0000 Subject: [PATCH 156/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 23a0b6bf2f..f45948d92f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1780 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4ddcc496e9a6b05c392906ea022e6fbd394bf9e139a19c97734fcb32be967c8b.yml -openapi_spec_hash: 9acf3bcad7c52b5ca797047f77796e01 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4685df3ca2087423cddb4a4de339931859a09c4fa49e4e221dca73d558d1ed50.yml +openapi_spec_hash: 55c6bba2524de7539961a878afedaa6c config_hash: 3c3eb4d2344e048ccefb763165bb4e9f From 452be6b9b9a6d45894b3cee30c8931ced7fd2e86 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:12:18 +0000 Subject: [PATCH 157/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 9 ++ scripts/detect-breaking-changes | 1 + .../cloudforce-one/binary-storage.ts | 89 ++++++++++++++++++- .../cloudforce-one/cloudforce-one.ts | 14 ++- src/resources/cloudforce-one/index.ts | 7 +- .../cloudforce-one/binary-storage.test.ts | 48 ++++++++++ 7 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 tests/api-resources/cloudforce-one/binary-storage.test.ts diff --git a/.stats.yml b/.stats.yml index f45948d92f..7fde7ff3cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1780 +configured_endpoints: 1782 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4685df3ca2087423cddb4a4de339931859a09c4fa49e4e221dca73d558d1ed50.yml openapi_spec_hash: 55c6bba2524de7539961a878afedaa6c -config_hash: 3c3eb4d2344e048ccefb763165bb4e9f +config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index d62ab2c75a..8b93a44cd7 100644 --- a/api.md +++ b/api.md @@ -7793,6 +7793,15 @@ Methods: ## BinaryStorage +Types: + +- BinaryStorageCreateResponse + +Methods: + +- client.cloudforceOne.binaryStorage.create({ ...params }) -> BinaryStorageCreateResponse +- client.cloudforceOne.binaryStorage.get(hash, { ...params }) -> void + ## Requests Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index a8024d0304..b039f24cfa 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -666,6 +666,7 @@ TEST_PATHS=( tests/api-resources/cloudforce-one/scans/scans.test.ts tests/api-resources/cloudforce-one/scans/results.test.ts tests/api-resources/cloudforce-one/scans/config.test.ts + tests/api-resources/cloudforce-one/binary-storage.test.ts tests/api-resources/cloudforce-one/requests/requests.test.ts tests/api-resources/cloudforce-one/requests/message.test.ts tests/api-resources/cloudforce-one/requests/priority.test.ts diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts index 4503305f01..817cd48722 100644 --- a/src/resources/cloudforce-one/binary-storage.ts +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -1,5 +1,92 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class BinaryStorage extends APIResource {} +export class BinaryStorage extends APIResource { + /** + * Posts a file to BinDB + * + * @example + * ```ts + * const binaryStorage = + * await client.cloudforceOne.binaryStorage.create({ + * account_id: 'account_id', + * file: fs.createReadStream('path/to/file'), + * }); + * ``` + */ + create( + params: BinaryStorageCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post( + `/accounts/${account_id}/cloudforce-one/binary`, + Core.multipartFormRequestOptions({ body, ...options }), + ); + } + + /** + * Posts a file to BinDB + * + * @example + * ```ts + * await client.cloudforceOne.binaryStorage.get('hash', { + * account_id: 'account_id', + * }); + * ``` + */ + get(hash: string, params: BinaryStorageGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return this._client.get(`/accounts/${account_id}/cloudforce-one/binary/${hash}`, { + ...options, + headers: { Accept: '*/*', ...options?.headers }, + }); + } +} + +export interface BinaryStorageCreateResponse { + accountIds: Array; + + content_type: string; + + filenames: Array; + + first_seen: number; + + is_private: boolean; + + md5: string; + + sha1: string; + + sha256: string; +} + +export interface BinaryStorageCreateParams { + /** + * Path param: Account ID. + */ + account_id: string; + + /** + * Body param: The binary file content to upload. + */ + file: Core.Uploadable; +} + +export interface BinaryStorageGetParams { + /** + * Account ID. + */ + account_id: string; +} + +export declare namespace BinaryStorage { + export { + type BinaryStorageCreateResponse as BinaryStorageCreateResponse, + type BinaryStorageCreateParams as BinaryStorageCreateParams, + type BinaryStorageGetParams as BinaryStorageGetParams, + }; +} diff --git a/src/resources/cloudforce-one/cloudforce-one.ts b/src/resources/cloudforce-one/cloudforce-one.ts index 78a81868ad..aeabfa782e 100644 --- a/src/resources/cloudforce-one/cloudforce-one.ts +++ b/src/resources/cloudforce-one/cloudforce-one.ts @@ -2,7 +2,12 @@ import { APIResource } from '../../resource'; import * as BinaryStorageAPI from './binary-storage'; -import { BinaryStorage } from './binary-storage'; +import { + BinaryStorage, + BinaryStorageCreateParams, + BinaryStorageCreateResponse, + BinaryStorageGetParams, +} from './binary-storage'; import * as RequestsAPI from './requests/requests'; import { Item, @@ -60,7 +65,12 @@ CloudforceOne.ThreatEvents = ThreatEvents; export declare namespace CloudforceOne { export { Scans as Scans }; - export { BinaryStorage as BinaryStorage }; + export { + BinaryStorage as BinaryStorage, + type BinaryStorageCreateResponse as BinaryStorageCreateResponse, + type BinaryStorageCreateParams as BinaryStorageCreateParams, + type BinaryStorageGetParams as BinaryStorageGetParams, + }; export { Requests as Requests, diff --git a/src/resources/cloudforce-one/index.ts b/src/resources/cloudforce-one/index.ts index 4b9cb0ccb5..f69388911d 100644 --- a/src/resources/cloudforce-one/index.ts +++ b/src/resources/cloudforce-one/index.ts @@ -1,6 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { BinaryStorage } from './binary-storage'; +export { + BinaryStorage, + type BinaryStorageCreateResponse, + type BinaryStorageCreateParams, + type BinaryStorageGetParams, +} from './binary-storage'; export { CloudforceOne } from './cloudforce-one'; export { ListItemsSinglePage, diff --git a/tests/api-resources/cloudforce-one/binary-storage.test.ts b/tests/api-resources/cloudforce-one/binary-storage.test.ts new file mode 100644 index 0000000000..0c50b97af3 --- /dev/null +++ b/tests/api-resources/cloudforce-one/binary-storage.test.ts @@ -0,0 +1,48 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare, { toFile } from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource binaryStorage', () => { + test('create: only required params', async () => { + const responsePromise = client.cloudforceOne.binaryStorage.create({ + account_id: 'account_id', + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.cloudforceOne.binaryStorage.create({ + account_id: 'account_id', + file: await toFile(Buffer.from('# my file contents'), 'README.md'), + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); + }); +}); From af56aa24fa408716d5cf0f8dc521ac5326cd8f99 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:31:29 +0000 Subject: [PATCH 158/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7fde7ff3cf..8f2d9992e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4685df3ca2087423cddb4a4de339931859a09c4fa49e4e221dca73d558d1ed50.yml -openapi_spec_hash: 55c6bba2524de7539961a878afedaa6c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5a9e4e64f34dc59079889c275ddbd6f494d8cc254715692171d6ca552f107558.yml +openapi_spec_hash: 266f17fcd5836275e487d9f2396cbab9 config_hash: eda5b3d9487ce675d1fadf88153b457d From 159580f86af239393ab877019dfa3afe2052b140 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 16:39:45 +0000 Subject: [PATCH 159/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8f2d9992e3..8ac72bd149 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5a9e4e64f34dc59079889c275ddbd6f494d8cc254715692171d6ca552f107558.yml -openapi_spec_hash: 266f17fcd5836275e487d9f2396cbab9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-83c715755757eadb320e513757f90202f61501ea78b23e2559143d6617d5ed07.yml +openapi_spec_hash: a24be1c8c4ed5386dda17a9a60e0f0bd config_hash: eda5b3d9487ce675d1fadf88153b457d From d8cadc1df566d8b9c5227b265a3fb8feb1928b95 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:11:30 +0000 Subject: [PATCH 160/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8ac72bd149..7b4d57d946 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-83c715755757eadb320e513757f90202f61501ea78b23e2559143d6617d5ed07.yml -openapi_spec_hash: a24be1c8c4ed5386dda17a9a60e0f0bd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0b4c0330087402b19fe37773b4d18a5e41484cc85ab48137362f942d75f1ac70.yml +openapi_spec_hash: 5262d319f34f75f10ba929e00af12ba5 config_hash: eda5b3d9487ce675d1fadf88153b457d From 2a6608c675a84da9791457ed12cf43fcb8c73d22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:26:57 +0000 Subject: [PATCH 161/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/cloudforce-one/binary-storage.ts | 8 -------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b4d57d946..7cbda4bcb9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0b4c0330087402b19fe37773b4d18a5e41484cc85ab48137362f942d75f1ac70.yml -openapi_spec_hash: 5262d319f34f75f10ba929e00af12ba5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a153ca4eacb45553c9af7ce24f4bbad169f877ab0dfd123a1bbe070f3956134.yml +openapi_spec_hash: ed9973218349279ce585e175e731ec9b config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts index 817cd48722..cd46ee2cad 100644 --- a/src/resources/cloudforce-one/binary-storage.ts +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -47,16 +47,8 @@ export class BinaryStorage extends APIResource { } export interface BinaryStorageCreateResponse { - accountIds: Array; - content_type: string; - filenames: Array; - - first_seen: number; - - is_private: boolean; - md5: string; sha1: string; From 45b7f3aee8ce43e219b055edcf372c19f383b81f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 17:38:42 +0000 Subject: [PATCH 162/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7cbda4bcb9..bc6a4f170e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1a153ca4eacb45553c9af7ce24f4bbad169f877ab0dfd123a1bbe070f3956134.yml -openapi_spec_hash: ed9973218349279ce585e175e731ec9b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4df1ba4b0704f8fb1bafede27296a546adcdfe4d9a855f8b796b5f5874c5f5eb.yml +openapi_spec_hash: 6d4bb62c53c4b7a96e712c1111428500 config_hash: eda5b3d9487ce675d1fadf88153b457d From 9f8e823859fe9276cce0176b9e442c9421b28869 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:17:43 +0000 Subject: [PATCH 163/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index bc6a4f170e..27e932ed9e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4df1ba4b0704f8fb1bafede27296a546adcdfe4d9a855f8b796b5f5874c5f5eb.yml -openapi_spec_hash: 6d4bb62c53c4b7a96e712c1111428500 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-63dee2ea2074a05a12be2424a90cf07824a344d76f5d36a9a92628475f04865b.yml +openapi_spec_hash: 8b479e1bea4edb1322399d8c0b87d755 config_hash: eda5b3d9487ce675d1fadf88153b457d From b612a6b3a9956b190cfa73263bcd8d7fcadd9e1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 18:29:59 +0000 Subject: [PATCH 164/423] feat(api): api update --- .stats.yml | 4 ++-- .../cloudforce-one/threat-events/threat-events.ts | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27e932ed9e..5425084792 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-63dee2ea2074a05a12be2424a90cf07824a344d76f5d36a9a92628475f04865b.yml -openapi_spec_hash: 8b479e1bea4edb1322399d8c0b87d755 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40c07ef8632f57de126ee942ec6fb7825531ead759a525f0818d1f857e7df689.yml +openapi_spec_hash: 439492f25df369220720aa93f8a61ad5 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index e4bb2891e2..e939bc9ed1 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -74,10 +74,10 @@ export class ThreatEvents extends APIResource { insights: InsightsAPI.Insights = new InsightsAPI.Insights(this._client); /** - * Events must be created in a client-specific dataset, which means the `datasetId` - * parameter must be defined. To create a dataset, see the + * To create a dataset, see the * [`Create Dataset`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/create/) - * endpoint. + * endpoint. When `datasetId` parameter is unspecified, it will be created in a + * default dataset named `Cloudforce One Threat Events`. * * @example * ```ts @@ -102,8 +102,9 @@ export class ThreatEvents extends APIResource { } /** - * The `datasetId` must be defined (to list existing datasets (and their IDs), use - * the + * When `datasetId` is unspecified, events will be listed from the + * `Cloudforce One Threat Events` dataset. To list existing datasets (and their + * IDs), use the * [`List Datasets`](https://developers.cloudflare.com/api/resources/cloudforce_one/subresources/threat_events/subresources/datasets/methods/list/) * endpoint). Also, must provide query parameters. * From 23851a4ecb2b2f39ad9a4bbbc21c673c1ac3cede Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 19:03:59 +0000 Subject: [PATCH 165/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5425084792..612fd28450 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40c07ef8632f57de126ee942ec6fb7825531ead759a525f0818d1f857e7df689.yml -openapi_spec_hash: 439492f25df369220720aa93f8a61ad5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d50b83eb9562fa21c5b0cddd0f8e35901bae52669b6da925a5b9ccb2972090.yml +openapi_spec_hash: 69438faf019cbfa3ba56fe0e66c9d20a config_hash: eda5b3d9487ce675d1fadf88153b457d From c7b690acf381020638a90cb453ac2ca2f68e8790 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:10:09 +0000 Subject: [PATCH 166/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 612fd28450..ef5e373796 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9d50b83eb9562fa21c5b0cddd0f8e35901bae52669b6da925a5b9ccb2972090.yml -openapi_spec_hash: 69438faf019cbfa3ba56fe0e66c9d20a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-965cde604d129fa9ce1aee892f1d851c2c08f687e968d7244c9e7eaac1bebd35.yml +openapi_spec_hash: 58cf3c2b2316b22dcca0b5ec2e66c1fd config_hash: eda5b3d9487ce675d1fadf88153b457d From 6760fad45f77594720e245eb14c02292273858ab Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:31:50 +0000 Subject: [PATCH 167/423] feat(api): api update --- .stats.yml | 4 +- .../gateway/configurations/configurations.ts | 132 ++++++++++++------ .../configurations/configurations.test.ts | 10 +- 3 files changed, 94 insertions(+), 52 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef5e373796..df99553d10 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-965cde604d129fa9ce1aee892f1d851c2c08f687e968d7244c9e7eaac1bebd35.yml -openapi_spec_hash: 58cf3c2b2316b22dcca0b5ec2e66c1fd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a70ee5e2ed74bb497eaeab36c8bac4e915d0ccceffcac0d49c506286379bb557.yml +openapi_spec_hash: c286686962046e02f46ef991dd5a0e1b config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 28499fc2ba..9cf33c34b3 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -93,7 +93,7 @@ export interface ActivityLogSettings { /** * Enable activity logging. */ - enabled?: boolean; + enabled?: boolean | null; } /** @@ -103,7 +103,7 @@ export interface ActivityLogSettingsParam { /** * Enable activity logging. */ - enabled?: boolean; + enabled?: boolean | null; } /** @@ -113,17 +113,17 @@ export interface AntiVirusSettings { /** * Enable anti-virus scanning on downloads. */ - enabled_download_phase?: boolean; + enabled_download_phase?: boolean | null; /** * Enable anti-virus scanning on uploads. */ - enabled_upload_phase?: boolean; + enabled_upload_phase?: boolean | null; /** * Block requests for files that cannot be scanned. */ - fail_closed?: boolean; + fail_closed?: boolean | null; /** * Configure a message to display on the user's device when an antivirus search is @@ -139,17 +139,17 @@ export interface AntiVirusSettingsParam { /** * Enable anti-virus scanning on downloads. */ - enabled_download_phase?: boolean; + enabled_download_phase?: boolean | null; /** * Enable anti-virus scanning on uploads. */ - enabled_upload_phase?: boolean; + enabled_upload_phase?: boolean | null; /** * Block requests for files that cannot be scanned. */ - fail_closed?: boolean; + fail_closed?: boolean | null; /** * Configure a message to display on the user's device when an antivirus search is @@ -163,14 +163,20 @@ export interface AntiVirusSettingsParam { */ export interface BlockPageSettings { /** - * If mode is customized_block_page: block page background color in #rrggbb format. + * Enable only cipher suites and TLS versions compliant with FIPS 140-2. */ - background_color?: string; + enabled: boolean | null; /** - * Enable only cipher suites and TLS versions compliant with FIPS 140-2. + * Controls whether the user is redirected to a Cloudflare-hosted block page or to + * a customer-provided URI. */ - enabled?: boolean; + mode: 'customized_block_page' | 'redirect_uri'; + + /** + * If mode is customized_block_page: block page background color in #rrggbb format. + */ + background_color?: string; /** * If mode is customized_block_page: block page footer text. @@ -204,12 +210,6 @@ export interface BlockPageSettings { */ mailto_subject?: string; - /** - * Controls whether the user is redirected to a Cloudflare-hosted block page or to - * a customer-provided URI. - */ - mode?: 'customized_block_page' | 'redirect_uri'; - /** * If mode is customized_block_page: block page title. */ @@ -219,12 +219,12 @@ export interface BlockPageSettings { * This setting was shared via the Orgs API and cannot be edited by the current * account */ - read_only?: boolean; + read_only?: boolean | null; /** * Account tag of account that shared this setting */ - source_account?: string; + source_account?: string | null; /** * If mode is customized_block_page: suppress detailed info at the bottom of the @@ -240,7 +240,7 @@ export interface BlockPageSettings { /** * Version number of the setting */ - version?: number; + version?: number | null; } /** @@ -248,14 +248,20 @@ export interface BlockPageSettings { */ export interface BlockPageSettingsParam { /** - * If mode is customized_block_page: block page background color in #rrggbb format. + * Enable only cipher suites and TLS versions compliant with FIPS 140-2. */ - background_color?: string; + enabled: boolean | null; /** - * Enable only cipher suites and TLS versions compliant with FIPS 140-2. + * Controls whether the user is redirected to a Cloudflare-hosted block page or to + * a customer-provided URI. */ - enabled?: boolean; + mode: 'customized_block_page' | 'redirect_uri'; + + /** + * If mode is customized_block_page: block page background color in #rrggbb format. + */ + background_color?: string; /** * If mode is customized_block_page: block page footer text. @@ -289,12 +295,6 @@ export interface BlockPageSettingsParam { */ mailto_subject?: string; - /** - * Controls whether the user is redirected to a Cloudflare-hosted block page or to - * a customer-provided URI. - */ - mode?: 'customized_block_page' | 'redirect_uri'; - /** * If mode is customized_block_page: block page title. */ @@ -319,7 +319,7 @@ export interface BodyScanningSettings { /** * Set the inspection mode to either `deep` or `shallow`. */ - inspection_mode?: string; + inspection_mode?: 'deep' | 'shallow'; } /** @@ -329,7 +329,7 @@ export interface BodyScanningSettingsParam { /** * Set the inspection mode to either `deep` or `shallow`. */ - inspection_mode?: string; + inspection_mode?: 'deep' | 'shallow'; } /** @@ -370,7 +370,7 @@ export interface CustomCertificateSettings { /** * Enable use of custom certificate authority for signing Gateway traffic. */ - enabled: boolean; + enabled: boolean | null; /** * UUID of certificate (ID from MTLS certificate store). @@ -393,7 +393,7 @@ export interface CustomCertificateSettingsParam { /** * Enable use of custom certificate authority for signing Gateway traffic. */ - enabled: boolean; + enabled: boolean | null; /** * UUID of certificate (ID from MTLS certificate store). @@ -409,23 +409,23 @@ export interface ExtendedEmailMatching { * Enable matching all variants of user emails (with + or . modifiers) used as * criteria in Firewall policies. */ - enabled?: boolean; + enabled?: boolean | null; /** * This setting was shared via the Orgs API and cannot be edited by the current * account */ - read_only?: boolean; + read_only?: boolean | null; /** * Account tag of account that shared this setting */ - source_account?: string; + source_account?: string | null; /** * Version number of the setting */ - version?: number; + version?: number | null; } /** @@ -436,7 +436,7 @@ export interface ExtendedEmailMatchingParam { * Enable matching all variants of user emails (with + or . modifiers) used as * criteria in Firewall policies. */ - enabled?: boolean; + enabled?: boolean | null; } /** @@ -515,6 +515,11 @@ export interface GatewayConfigurationSettings { */ host_selector?: GatewayConfigurationSettings.HostSelector | null; + /** + * Setting to define inspection settings + */ + inspection?: GatewayConfigurationSettings.Inspection | null; + /** * Protocol Detection settings. */ @@ -552,7 +557,22 @@ export namespace GatewayConfigurationSettings { /** * Enable filtering via hosts for egress policies. */ - enabled?: boolean; + enabled?: boolean | null; + } + + /** + * Setting to define inspection settings + */ + export interface Inspection { + /** + * Defines the mode of inspection the proxy will use. + * + * - static: Gateway will use static inspection to inspect HTTP on TCP(80). If TLS + * decryption is on, Gateway will inspect HTTPS traffic on TCP(443) & UDP(443). + * - dynamic: Gateway will use protocol detection to dynamically inspect HTTP and + * HTTPS traffic on any port. TLS decryption must be on to inspect HTTPS traffic. + */ + mode?: 'static' | 'dynamic'; } /** @@ -562,7 +582,7 @@ export namespace GatewayConfigurationSettings { /** * Enable sandbox. */ - enabled?: boolean; + enabled?: boolean | null; /** * Action to take when the file cannot be scanned. @@ -627,6 +647,11 @@ export interface GatewayConfigurationSettingsParam { */ host_selector?: GatewayConfigurationSettingsParam.HostSelector | null; + /** + * Setting to define inspection settings + */ + inspection?: GatewayConfigurationSettingsParam.Inspection | null; + /** * Protocol Detection settings. */ @@ -664,7 +689,22 @@ export namespace GatewayConfigurationSettingsParam { /** * Enable filtering via hosts for egress policies. */ - enabled?: boolean; + enabled?: boolean | null; + } + + /** + * Setting to define inspection settings + */ + export interface Inspection { + /** + * Defines the mode of inspection the proxy will use. + * + * - static: Gateway will use static inspection to inspect HTTP on TCP(80). If TLS + * decryption is on, Gateway will inspect HTTPS traffic on TCP(443) & UDP(443). + * - dynamic: Gateway will use protocol detection to dynamically inspect HTTP and + * HTTPS traffic on any port. TLS decryption must be on to inspect HTTPS traffic. + */ + mode?: 'static' | 'dynamic'; } /** @@ -674,7 +714,7 @@ export namespace GatewayConfigurationSettingsParam { /** * Enable sandbox. */ - enabled?: boolean; + enabled?: boolean | null; /** * Action to take when the file cannot be scanned. @@ -744,7 +784,7 @@ export interface ProtocolDetection { /** * Enable detecting protocol on initial bytes of client traffic. */ - enabled?: boolean; + enabled?: boolean | null; } /** @@ -754,7 +794,7 @@ export interface ProtocolDetectionParam { /** * Enable detecting protocol on initial bytes of client traffic. */ - enabled?: boolean; + enabled?: boolean | null; } /** diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index 7600e505ed..7d38e6bcec 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -40,15 +40,15 @@ describe('resource configurations', () => { }, }, block_page: { - background_color: 'background_color', enabled: true, + mode: 'customized_block_page', + background_color: 'background_color', footer_text: '--footer--', header_text: '--header--', include_context: true, logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -60,6 +60,7 @@ describe('resource configurations', () => { extended_email_matching: { enabled: true }, fips: { tls: true }, host_selector: { enabled: false }, + inspection: { mode: 'static' }, protocol_detection: { enabled: true }, sandbox: { enabled: true, fallback_action: 'allow' }, tls_decrypt: { enabled: true }, @@ -97,15 +98,15 @@ describe('resource configurations', () => { }, }, block_page: { - background_color: 'background_color', enabled: true, + mode: 'customized_block_page', + background_color: 'background_color', footer_text: '--footer--', header_text: '--header--', include_context: true, logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -117,6 +118,7 @@ describe('resource configurations', () => { extended_email_matching: { enabled: true }, fips: { tls: true }, host_selector: { enabled: false }, + inspection: { mode: 'static' }, protocol_detection: { enabled: true }, sandbox: { enabled: true, fallback_action: 'allow' }, tls_decrypt: { enabled: true }, From 8069564ea4cdd6094f0eb5c03b0e7ba9906ba4b0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 20:34:58 +0000 Subject: [PATCH 168/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/cloudforce-one/binary-storage.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index df99553d10..0c410966a7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a70ee5e2ed74bb497eaeab36c8bac4e915d0ccceffcac0d49c506286379bb557.yml -openapi_spec_hash: c286686962046e02f46ef991dd5a0e1b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37baa5bf56cb5d922c72fa374252a211dfc396eeb8d9628d9763470983f799c2.yml +openapi_spec_hash: df85101112d7aad9a1e0cb8dd01e6d8b config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/cloudforce-one/binary-storage.ts b/src/resources/cloudforce-one/binary-storage.ts index cd46ee2cad..f5aefc3772 100644 --- a/src/resources/cloudforce-one/binary-storage.ts +++ b/src/resources/cloudforce-one/binary-storage.ts @@ -5,7 +5,7 @@ import * as Core from '../../core'; export class BinaryStorage extends APIResource { /** - * Posts a file to BinDB + * Posts a file to Binary Storage * * @example * ```ts @@ -28,7 +28,7 @@ export class BinaryStorage extends APIResource { } /** - * Posts a file to BinDB + * Retrieves a file from Binary Storage * * @example * ```ts From 686d46139316ca172a934668d6043eb608f60ae7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 21:00:20 +0000 Subject: [PATCH 169/423] feat(api): api update --- .stats.yml | 4 +- .../magic-transit/cf-interconnects.ts | 40 ++++++++++++ src/resources/magic-transit/gre-tunnels.ts | 64 +++++++++++++++++++ src/resources/magic-transit/ipsec-tunnels.ts | 64 +++++++++++++++++++ .../magic-transit/cf-interconnects.test.ts | 1 + .../magic-transit/gre-tunnels.test.ts | 2 + .../magic-transit/ipsec-tunnels.test.ts | 2 + 7 files changed, 175 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0c410966a7..6e4d4d1d08 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37baa5bf56cb5d922c72fa374252a211dfc396eeb8d9628d9763470983f799c2.yml -openapi_spec_hash: df85101112d7aad9a1e0cb8dd01e6d8b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c7ea16df9e6779bde93724a1b17ec38fc7921fdffc77fec8df85457573b6711.yml +openapi_spec_hash: 49a080f1a33a4bd9c7e6cab08709ea0e config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/magic-transit/cf-interconnects.ts b/src/resources/magic-transit/cf-interconnects.ts index 0bed94719d..3d365e8f1e 100644 --- a/src/resources/magic-transit/cf-interconnects.ts +++ b/src/resources/magic-transit/cf-interconnects.ts @@ -175,6 +175,14 @@ export namespace CfInterconnectUpdateResponse { */ interface_address?: string; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -246,6 +254,14 @@ export namespace CfInterconnectListResponse { */ interface_address?: string; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -319,6 +335,14 @@ export namespace CfInterconnectBulkUpdateResponse { */ interface_address?: string; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -390,6 +414,14 @@ export namespace CfInterconnectGetResponse { */ interface_address?: string; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -449,6 +481,14 @@ export interface CfInterconnectUpdateParams { */ interface_address?: string; + /** + * Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space + * with the address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * Body param: The Maximum Transmission Unit (MTU) in bytes for the interconnect. * The minimum value is 576. diff --git a/src/resources/magic-transit/gre-tunnels.ts b/src/resources/magic-transit/gre-tunnels.ts index 69212eb74a..b1472863d2 100644 --- a/src/resources/magic-transit/gre-tunnels.ts +++ b/src/resources/magic-transit/gre-tunnels.ts @@ -241,6 +241,14 @@ export interface GRETunnelCreateResponse { health_check?: GRETunnelCreateResponse.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -368,6 +376,14 @@ export namespace GRETunnelUpdateResponse { health_check?: ModifiedGRETunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -494,6 +510,14 @@ export namespace GRETunnelListResponse { health_check?: GRETunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -622,6 +646,14 @@ export namespace GRETunnelDeleteResponse { health_check?: DeletedGRETunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -750,6 +782,14 @@ export namespace GRETunnelBulkUpdateResponse { health_check?: ModifiedGRETunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -876,6 +916,14 @@ export namespace GRETunnelGetResponse { health_check?: GRETunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -996,6 +1044,14 @@ export interface GRETunnelCreateParams { */ health_check?: GRETunnelCreateParams.HealthCheck; + /** + * Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space + * with the address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * Body param: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The * minimum value is 576. @@ -1109,6 +1165,14 @@ export interface GRETunnelUpdateParams { */ health_check?: GRETunnelUpdateParams.HealthCheck; + /** + * Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space + * with the address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * Body param: Maximum Transmission Unit (MTU) in bytes for the GRE tunnel. The * minimum value is 576. diff --git a/src/resources/magic-transit/ipsec-tunnels.ts b/src/resources/magic-transit/ipsec-tunnels.ts index f7a9f4e477..19b172deb7 100644 --- a/src/resources/magic-transit/ipsec-tunnels.ts +++ b/src/resources/magic-transit/ipsec-tunnels.ts @@ -297,6 +297,14 @@ export interface IPSECTunnelCreateResponse { health_check?: IPSECTunnelCreateResponse.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -430,6 +438,14 @@ export namespace IPSECTunnelUpdateResponse { health_check?: ModifiedIPSECTunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -562,6 +578,14 @@ export namespace IPSECTunnelListResponse { health_check?: IPSECTunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -696,6 +720,14 @@ export namespace IPSECTunnelDeleteResponse { health_check?: DeletedIPSECTunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -830,6 +862,14 @@ export namespace IPSECTunnelBulkUpdateResponse { health_check?: ModifiedIPSECTunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -962,6 +1002,14 @@ export namespace IPSECTunnelGetResponse { health_check?: IPSECTunnel.HealthCheck; + /** + * A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space with the + * address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * The date and time the tunnel was last modified. */ @@ -1099,6 +1147,14 @@ export interface IPSECTunnelCreateParams { */ health_check?: IPSECTunnelCreateParams.HealthCheck; + /** + * Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space + * with the address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * Body param: A randomly generated or provided string for use in the IPsec tunnel. */ @@ -1212,6 +1268,14 @@ export interface IPSECTunnelUpdateParams { */ health_check?: IPSECTunnelUpdateParams.HealthCheck; + /** + * Body param: A 127 bit IPV6 prefix from within the virtual_subnet6 prefix space + * with the address being the first IP of the subnet and not same as the address of + * virtual_subnet6. Eg if virtual_subnet6 is 2606:54c1:7:0:a9fe:12d2::/127 , + * interface_address6 could be 2606:54c1:7:0:a9fe:12d2:1:200/127 + */ + interface_address6?: string; + /** * Body param: A randomly generated or provided string for use in the IPsec tunnel. */ diff --git a/tests/api-resources/magic-transit/cf-interconnects.test.ts b/tests/api-resources/magic-transit/cf-interconnects.test.ts index 7bd0b7f7be..44b23fa547 100644 --- a/tests/api-resources/magic-transit/cf-interconnects.test.ts +++ b/tests/api-resources/magic-transit/cf-interconnects.test.ts @@ -32,6 +32,7 @@ describe('resource cfInterconnects', () => { gre: { cloudflare_endpoint: '203.0.113.1' }, health_check: { enabled: true, rate: 'low', target: { saved: '203.0.113.1' }, type: 'request' }, interface_address: '192.0.2.0/31', + interface_address6: '2606:54c1:7:0:a9fe:12d2:1:200/127', mtu: 0, 'x-magic-new-hc-target': true, }); diff --git a/tests/api-resources/magic-transit/gre-tunnels.test.ts b/tests/api-resources/magic-transit/gre-tunnels.test.ts index e9ca33b39a..5568d31620 100644 --- a/tests/api-resources/magic-transit/gre-tunnels.test.ts +++ b/tests/api-resources/magic-transit/gre-tunnels.test.ts @@ -44,6 +44,7 @@ describe('resource greTunnels', () => { target: { saved: '203.0.113.1' }, type: 'request', }, + interface_address6: '2606:54c1:7:0:a9fe:12d2:1:200/127', mtu: 0, ttl: 0, 'x-magic-new-hc-target': true, @@ -84,6 +85,7 @@ describe('resource greTunnels', () => { target: { saved: '203.0.113.1' }, type: 'request', }, + interface_address6: '2606:54c1:7:0:a9fe:12d2:1:200/127', mtu: 0, ttl: 0, 'x-magic-new-hc-target': true, diff --git a/tests/api-resources/magic-transit/ipsec-tunnels.test.ts b/tests/api-resources/magic-transit/ipsec-tunnels.test.ts index ec8bd888c7..805b70cd2b 100644 --- a/tests/api-resources/magic-transit/ipsec-tunnels.test.ts +++ b/tests/api-resources/magic-transit/ipsec-tunnels.test.ts @@ -41,6 +41,7 @@ describe('resource ipsecTunnels', () => { target: { saved: '203.0.113.1' }, type: 'request', }, + interface_address6: '2606:54c1:7:0:a9fe:12d2:1:200/127', psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy', replay_protection: false, 'x-magic-new-hc-target': true, @@ -80,6 +81,7 @@ describe('resource ipsecTunnels', () => { target: { saved: '203.0.113.1' }, type: 'request', }, + interface_address6: '2606:54c1:7:0:a9fe:12d2:1:200/127', psk: 'O3bwKSjnaoCxDoUxjcq4Rk8ZKkezQUiy', replay_protection: false, 'x-magic-new-hc-target': true, From e37af9b3e6f0012f3dc9712555967baa62a17b2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 22:10:41 +0000 Subject: [PATCH 170/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6e4d4d1d08..2b1b563dfd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c7ea16df9e6779bde93724a1b17ec38fc7921fdffc77fec8df85457573b6711.yml -openapi_spec_hash: 49a080f1a33a4bd9c7e6cab08709ea0e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6c14a5bd189695e83b9eb23d65dd4df52855b48d38c23454a6fe9720bd7dd8b5.yml +openapi_spec_hash: 93d6a5e86b1141f5c14d2f5bb637c18c config_hash: eda5b3d9487ce675d1fadf88153b457d From 84b1115b10888b1611f16639a6fd3c9d7a8f4d06 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 22:26:29 +0000 Subject: [PATCH 171/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2b1b563dfd..03ef23b014 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6c14a5bd189695e83b9eb23d65dd4df52855b48d38c23454a6fe9720bd7dd8b5.yml -openapi_spec_hash: 93d6a5e86b1141f5c14d2f5bb637c18c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9d37189ba0821a9e074c94182b491ec920401804ebff31b07abede4a1b31c2c6.yml +openapi_spec_hash: 255bd53a903ba6b3f7bec61a4eff5b97 config_hash: eda5b3d9487ce675d1fadf88153b457d From 3b798cc63aeb61a4d78ceb3271bacaae9a9b543d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 23:18:17 +0000 Subject: [PATCH 172/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 03ef23b014..94b98d98a4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9d37189ba0821a9e074c94182b491ec920401804ebff31b07abede4a1b31c2c6.yml -openapi_spec_hash: 255bd53a903ba6b3f7bec61a4eff5b97 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f10ef6e83d3ea7abd1532da0e75ff41ba5cf5574acfd67cfd3716838f699487.yml +openapi_spec_hash: 0f400ed00a01d4aadb5a89d051dacf27 config_hash: eda5b3d9487ce675d1fadf88153b457d From b4f5ed213e542f79525e5df589e0c48f9a35e18c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 24 Jul 2025 23:47:13 +0000 Subject: [PATCH 173/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 94b98d98a4..947d3db4e5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0f10ef6e83d3ea7abd1532da0e75ff41ba5cf5574acfd67cfd3716838f699487.yml -openapi_spec_hash: 0f400ed00a01d4aadb5a89d051dacf27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c21e8487457cb12a9e2c24003a2969900a1f21882def8a7730d6b58d120da3fb.yml +openapi_spec_hash: 3ef6a8e51ec172808b07118708e6b78d config_hash: eda5b3d9487ce675d1fadf88153b457d From 9d083d37084b179c437d82cce7ae29572a31a63e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 00:24:04 +0000 Subject: [PATCH 174/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 947d3db4e5..eeaf6334cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c21e8487457cb12a9e2c24003a2969900a1f21882def8a7730d6b58d120da3fb.yml -openapi_spec_hash: 3ef6a8e51ec172808b07118708e6b78d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cb9134bc7b4478ba5af7d25fa4d5ff07de83546cb159b29e870725872f7cfbe.yml +openapi_spec_hash: fc643a96f77f21afdde60e2f57fb622f config_hash: eda5b3d9487ce675d1fadf88153b457d From b8e1aa7f9d6eeee984e656e2e0b754e556ea7e50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 00:32:53 +0000 Subject: [PATCH 175/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eeaf6334cd..97b7b1d34e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cb9134bc7b4478ba5af7d25fa4d5ff07de83546cb159b29e870725872f7cfbe.yml -openapi_spec_hash: fc643a96f77f21afdde60e2f57fb622f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b5b01c20be9e9f2c8867e3518694ceeac351b09bf9e756d6995c4ee05812eeb4.yml +openapi_spec_hash: 5344d32cc5ea0dbaaa424f73a29d886b config_hash: eda5b3d9487ce675d1fadf88153b457d From 809e039691193f036419066892f85cb7514c4cfd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 06:11:51 +0000 Subject: [PATCH 176/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 97b7b1d34e..f93106a355 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b5b01c20be9e9f2c8867e3518694ceeac351b09bf9e756d6995c4ee05812eeb4.yml -openapi_spec_hash: 5344d32cc5ea0dbaaa424f73a29d886b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b4de2e600c3a87708e34ca0362965a914f90dd00d0d71a23c0a28f64eec49c3.yml +openapi_spec_hash: 3f22bfddf899eadb869d723af18ad333 config_hash: eda5b3d9487ce675d1fadf88153b457d From 64f50457c0be0060e0949d355aa21f9f5f3b9a5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 07:41:56 +0000 Subject: [PATCH 177/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f93106a355..ccb590f0cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1b4de2e600c3a87708e34ca0362965a914f90dd00d0d71a23c0a28f64eec49c3.yml -openapi_spec_hash: 3f22bfddf899eadb869d723af18ad333 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864730e68e80398ab97c491e1e74b3f541559562d9c2825a39410df79457eec4.yml +openapi_spec_hash: 047b838f908ff670022da549419fcd35 config_hash: eda5b3d9487ce675d1fadf88153b457d From 9552afad3fa853dbb1ebdd17824a7afed8ff3f30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 09:26:45 +0000 Subject: [PATCH 178/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ccb590f0cd..486caf2da2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864730e68e80398ab97c491e1e74b3f541559562d9c2825a39410df79457eec4.yml -openapi_spec_hash: 047b838f908ff670022da549419fcd35 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af739dbd44c46af4a2d215d04d547fa84c663941790c5954051103b2bab5db77.yml +openapi_spec_hash: 8ecc205329740dac959e16801e64b147 config_hash: eda5b3d9487ce675d1fadf88153b457d From 491455b8c14938c217debb40c8e015ed6cc35af7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 10:25:55 +0000 Subject: [PATCH 179/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 486caf2da2..d6054baa1d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af739dbd44c46af4a2d215d04d547fa84c663941790c5954051103b2bab5db77.yml -openapi_spec_hash: 8ecc205329740dac959e16801e64b147 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8d65575a0c66290def85ba288cabb41417ac7e860c4714e813c86c8b226c97e9.yml +openapi_spec_hash: 9e42be0a2ff7ab0ee4b23d7e90b11bbe config_hash: eda5b3d9487ce675d1fadf88153b457d From 8cbbe9d4b4770e2092cbe1381e8252048fdacb22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 13:52:25 +0000 Subject: [PATCH 180/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6054baa1d..e65a0e23d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8d65575a0c66290def85ba288cabb41417ac7e860c4714e813c86c8b226c97e9.yml -openapi_spec_hash: 9e42be0a2ff7ab0ee4b23d7e90b11bbe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e612435069aea7bf057456641e107df4729db05d9de0105a7925ba37c891961.yml +openapi_spec_hash: 069716e9087717d4d10c891925d83f57 config_hash: eda5b3d9487ce675d1fadf88153b457d From 32a7c64709bf2694574bd9c54c9eef1f0f712bd3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 14:50:45 +0000 Subject: [PATCH 181/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e65a0e23d1..020bc852a3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2e612435069aea7bf057456641e107df4729db05d9de0105a7925ba37c891961.yml -openapi_spec_hash: 069716e9087717d4d10c891925d83f57 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afa8b9f5cf3861626e3c475b281fcebfef1ce09c2f4c5a3394a8287ad131720c.yml +openapi_spec_hash: 67e100638190210fecd641aa6348ee16 config_hash: eda5b3d9487ce675d1fadf88153b457d From 2ca034574dd5c697ebeb55239cae0032d2e76bf6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 14:53:34 +0000 Subject: [PATCH 182/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 020bc852a3..fc5abffc05 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afa8b9f5cf3861626e3c475b281fcebfef1ce09c2f4c5a3394a8287ad131720c.yml -openapi_spec_hash: 67e100638190210fecd641aa6348ee16 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ada4c76176186d42d3046423e4bf8a3b89eaeaaf783f62cf530e64bf68c2923.yml +openapi_spec_hash: 37d6e54916afb9f81a8d9b7cd9a2cb96 config_hash: eda5b3d9487ce675d1fadf88153b457d From 11705a8a2265ff9ef55fbcf32801ac3ba836b448 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 15:34:28 +0000 Subject: [PATCH 183/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fc5abffc05..57aa6dff7f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ada4c76176186d42d3046423e4bf8a3b89eaeaaf783f62cf530e64bf68c2923.yml -openapi_spec_hash: 37d6e54916afb9f81a8d9b7cd9a2cb96 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9a71a653465d3dc8c8acd1949782f4793d6da5d46cdf1a241b669da61ed2ae2.yml +openapi_spec_hash: b271c0c22b691bfcfff78b8b641775c0 config_hash: eda5b3d9487ce675d1fadf88153b457d From bef79f4b4aa90ae1cb84192bdb0ff59eefeae337 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 15:46:51 +0000 Subject: [PATCH 184/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 57aa6dff7f..ac33ed88f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b9a71a653465d3dc8c8acd1949782f4793d6da5d46cdf1a241b669da61ed2ae2.yml -openapi_spec_hash: b271c0c22b691bfcfff78b8b641775c0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afbfd5a36e65622bdb552299d2cebc610ca58fac54af57bc72e12a6deb943310.yml +openapi_spec_hash: 6f8c9beb9ead635cc670ab234d0c08df config_hash: eda5b3d9487ce675d1fadf88153b457d From 0f92a669590070c1c8db1fb34d4b8f5f9dc25d2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:17:33 +0000 Subject: [PATCH 185/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ac33ed88f8..497b162222 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afbfd5a36e65622bdb552299d2cebc610ca58fac54af57bc72e12a6deb943310.yml -openapi_spec_hash: 6f8c9beb9ead635cc670ab234d0c08df +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e7797ecacd3efc15f8977a77864b436a909f4121011dd23f9c61d9190b04551.yml +openapi_spec_hash: 33d6ec2cc00ae8409e70963afda32be5 config_hash: eda5b3d9487ce675d1fadf88153b457d From 589d9aa641c85ecf88943c812e20669adaa20a65 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:52:52 +0000 Subject: [PATCH 186/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 497b162222..a3ba48c800 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e7797ecacd3efc15f8977a77864b436a909f4121011dd23f9c61d9190b04551.yml -openapi_spec_hash: 33d6ec2cc00ae8409e70963afda32be5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9437feb23d81453829170341fd809fd1f6899c8b9f94fd1f65be90772be4ec83.yml +openapi_spec_hash: d9006e1941cceabd20a5c883069a7424 config_hash: eda5b3d9487ce675d1fadf88153b457d From 5f69e4827a734597369cb9695a38529e7067f7f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:07:09 +0000 Subject: [PATCH 187/423] feat(api): api update --- .stats.yml | 4 +- .../gateway/configurations/configurations.ts | 40 +++++++++---------- src/resources/zero-trust/gateway/rules.ts | 4 +- .../configurations/configurations.test.ts | 8 ++-- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.stats.yml b/.stats.yml index a3ba48c800..b53b6a01ea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9437feb23d81453829170341fd809fd1f6899c8b9f94fd1f65be90772be4ec83.yml -openapi_spec_hash: d9006e1941cceabd20a5c883069a7424 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24631e39af233973e51129ca7090195b430ab835af32564981169e12e5f6eedf.yml +openapi_spec_hash: 743b8f14b73519c3b813ed9159cbe6e3 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 9cf33c34b3..796df5f5b9 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -163,20 +163,14 @@ export interface AntiVirusSettingsParam { */ export interface BlockPageSettings { /** - * Enable only cipher suites and TLS versions compliant with FIPS 140-2. - */ - enabled: boolean | null; - - /** - * Controls whether the user is redirected to a Cloudflare-hosted block page or to - * a customer-provided URI. + * If mode is customized_block_page: block page background color in #rrggbb format. */ - mode: 'customized_block_page' | 'redirect_uri'; + background_color?: string; /** - * If mode is customized_block_page: block page background color in #rrggbb format. + * Enable only cipher suites and TLS versions compliant with FIPS 140-2. */ - background_color?: string; + enabled?: boolean | null; /** * If mode is customized_block_page: block page footer text. @@ -210,6 +204,12 @@ export interface BlockPageSettings { */ mailto_subject?: string; + /** + * Controls whether the user is redirected to a Cloudflare-hosted block page or to + * a customer-provided URI. + */ + mode?: 'customized_block_page' | 'redirect_uri'; + /** * If mode is customized_block_page: block page title. */ @@ -248,20 +248,14 @@ export interface BlockPageSettings { */ export interface BlockPageSettingsParam { /** - * Enable only cipher suites and TLS versions compliant with FIPS 140-2. - */ - enabled: boolean | null; - - /** - * Controls whether the user is redirected to a Cloudflare-hosted block page or to - * a customer-provided URI. + * If mode is customized_block_page: block page background color in #rrggbb format. */ - mode: 'customized_block_page' | 'redirect_uri'; + background_color?: string; /** - * If mode is customized_block_page: block page background color in #rrggbb format. + * Enable only cipher suites and TLS versions compliant with FIPS 140-2. */ - background_color?: string; + enabled?: boolean | null; /** * If mode is customized_block_page: block page footer text. @@ -295,6 +289,12 @@ export interface BlockPageSettingsParam { */ mailto_subject?: string; + /** + * Controls whether the user is redirected to a Cloudflare-hosted block page or to + * a customer-provided URI. + */ + mode?: 'customized_block_page' | 'redirect_uri'; + /** * If mode is customized_block_page: block page title. */ diff --git a/src/resources/zero-trust/gateway/rules.ts b/src/resources/zero-trust/gateway/rules.ts index aa9a45d142..dc3539720c 100644 --- a/src/resources/zero-trust/gateway/rules.ts +++ b/src/resources/zero-trust/gateway/rules.ts @@ -464,7 +464,7 @@ export interface RuleSetting { * The text describing why this block occurred, displayed on the custom block page * (if enabled). */ - block_reason?: string; + block_reason?: string | null; /** * Set by children MSP accounts to bypass their parent's rules. @@ -893,7 +893,7 @@ export interface RuleSettingParam { * The text describing why this block occurred, displayed on the custom block page * (if enabled). */ - block_reason?: string; + block_reason?: string | null; /** * Set by children MSP accounts to bypass their parent's rules. diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index 7d38e6bcec..563c3a8cd6 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -40,15 +40,15 @@ describe('resource configurations', () => { }, }, block_page: { - enabled: true, - mode: 'customized_block_page', background_color: 'background_color', + enabled: true, footer_text: '--footer--', header_text: '--header--', include_context: true, logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', + mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -98,15 +98,15 @@ describe('resource configurations', () => { }, }, block_page: { - enabled: true, - mode: 'customized_block_page', background_color: 'background_color', + enabled: true, footer_text: '--footer--', header_text: '--header--', include_context: true, logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', + mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', From 9e955973d0599b4d1eb3b11e01090dd40e7c3c14 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:19:13 +0000 Subject: [PATCH 188/423] feat(api): api update --- .stats.yml | 4 +- .../dispatch/namespaces/scripts/content.ts | 3 +- .../dispatch/namespaces/scripts/scripts.ts | 3 +- src/resources/workers/scripts/content.ts | 3 +- src/resources/workers/scripts/scripts.ts | 3 +- src/resources/workers/scripts/versions.ts | 3 +- src/resources/workers/workers.ts | 99 +------------------ 7 files changed, 14 insertions(+), 104 deletions(-) diff --git a/.stats.yml b/.stats.yml index b53b6a01ea..3a3af661cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-24631e39af233973e51129ca7090195b430ab835af32564981169e12e5f6eedf.yml -openapi_spec_hash: 743b8f14b73519c3b813ed9159cbe6e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d3310bd3b099150aac2ff45d5c489dd819cf0ce91b2fa718874203ff4bc0c77.yml +openapi_spec_hash: c3166501df45e337eef760b29e12a9f0 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts index 0f8b5816e9..334fb51e5d 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts @@ -101,7 +101,8 @@ export interface ContentUpdateParams { * script. At least one module must be present and referenced in the metadata as * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: * `application/javascript+module`, `text/javascript+module`, - * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/javascript`, `text/javascript`, `text/x-python`, + * `text/x-python-requirement`, `application/wasm`, `text/plain`, * `application/octet-stream`, `application/source-map`. */ files?: Array; diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index 2c2abe754d..292612c7bf 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -281,7 +281,8 @@ export interface ScriptUpdateParams { * script. At least one module must be present and referenced in the metadata as * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: * `application/javascript+module`, `text/javascript+module`, - * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/javascript`, `text/javascript`, `text/x-python`, + * `text/x-python-requirement`, `application/wasm`, `text/plain`, * `application/octet-stream`, `application/source-map`. */ files?: Array; diff --git a/src/resources/workers/scripts/content.ts b/src/resources/workers/scripts/content.ts index 156a51bc22..169a50c4d7 100644 --- a/src/resources/workers/scripts/content.ts +++ b/src/resources/workers/scripts/content.ts @@ -94,7 +94,8 @@ export interface ContentUpdateParams { * script. At least one module must be present and referenced in the metadata as * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: * `application/javascript+module`, `text/javascript+module`, - * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/javascript`, `text/javascript`, `text/x-python`, + * `text/x-python-requirement`, `application/wasm`, `text/plain`, * `application/octet-stream`, `application/source-map`. */ files?: Array; diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 9497455e13..8edb05a665 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -465,7 +465,8 @@ export interface ScriptUpdateParams { * script. At least one module must be present and referenced in the metadata as * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: * `application/javascript+module`, `text/javascript+module`, - * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/javascript`, `text/javascript`, `text/x-python`, + * `text/x-python-requirement`, `application/wasm`, `text/plain`, * `application/octet-stream`, `application/source-map`. */ files?: Array; diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index 7ed14199a1..38d224812b 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -1286,7 +1286,8 @@ export interface VersionCreateParams { * script. At least one module must be present and referenced in the metadata as * `main_module` or `body_part` by filename.
Possible Content-Type(s) are: * `application/javascript+module`, `text/javascript+module`, - * `application/javascript`, `text/javascript`, `application/wasm`, `text/plain`, + * `application/javascript`, `text/javascript`, `text/x-python`, + * `text/x-python-requirement`, `application/wasm`, `text/plain`, * `application/octet-stream`, `application/source-map`. */ files?: Array; diff --git a/src/resources/workers/workers.ts b/src/resources/workers/workers.ts index dbac4cf23f..62145d430b 100644 --- a/src/resources/workers/workers.ts +++ b/src/resources/workers/workers.ts @@ -71,49 +71,7 @@ export class Workers extends APIResource { observability: ObservabilityAPI.Observability = new ObservabilityAPI.Observability(this._client); } -export interface MigrationStep { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces with SQLite from. - */ - new_sqlite_classes?: Array; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; -} - -export namespace MigrationStep { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } -} +export interface MigrationStep {} export interface MigrationStepParam { /** @@ -162,60 +120,7 @@ export namespace MigrationStepParam { /** * A single set of migrations to apply. */ -export interface SingleStepMigration { - /** - * A list of classes to delete Durable Object namespaces from. - */ - deleted_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces from. - */ - new_classes?: Array; - - /** - * A list of classes to create Durable Object namespaces with SQLite from. - */ - new_sqlite_classes?: Array; - - /** - * Tag to set as the latest migration tag. - */ - new_tag?: string; - - /** - * Tag used to verify against the latest migration tag for this Worker. If they - * don't match, the upload is rejected. - */ - old_tag?: string; - - /** - * A list of classes with Durable Object namespaces that were renamed. - */ - renamed_classes?: Array; - - /** - * A list of transfers for Durable Object namespaces from a different Worker and - * class to a class defined in this Worker. - */ - transferred_classes?: Array; -} - -export namespace SingleStepMigration { - export interface RenamedClass { - from?: string; - - to?: string; - } - - export interface TransferredClass { - from?: string; - - from_script?: string; - - to?: string; - } -} +export interface SingleStepMigration {} /** * A single set of migrations to apply. From ebf948beb2bcbea1dc88df39fca9bbd8bab50bfc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 17:30:43 +0000 Subject: [PATCH 189/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3a3af661cd..0cb18b31bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0d3310bd3b099150aac2ff45d5c489dd819cf0ce91b2fa718874203ff4bc0c77.yml -openapi_spec_hash: c3166501df45e337eef760b29e12a9f0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6a846ae8d949c6cfe14b6ce91d5e3d1ca2939484230ecd82cc774a06c88f4f3.yml +openapi_spec_hash: fb0bc14822d58f31c2089cf2bae0fcd4 config_hash: eda5b3d9487ce675d1fadf88153b457d From f7e6e22aeaa520409b5f1464aab4e84771f21486 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:03:46 +0000 Subject: [PATCH 190/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0cb18b31bf..9403496f0f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e6a846ae8d949c6cfe14b6ce91d5e3d1ca2939484230ecd82cc774a06c88f4f3.yml -openapi_spec_hash: fb0bc14822d58f31c2089cf2bae0fcd4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4e32750b44d420937da2b850ba017d92f418560466b8b07c345f4a4c6bb147b.yml +openapi_spec_hash: 61c4a73ba2944fc9e02c381e5af99923 config_hash: eda5b3d9487ce675d1fadf88153b457d From cb1a3a029fa5dba6f9e746bdcfa270811f6277e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 19:09:02 +0000 Subject: [PATCH 191/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9403496f0f..6a93ba48f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4e32750b44d420937da2b850ba017d92f418560466b8b07c345f4a4c6bb147b.yml -openapi_spec_hash: 61c4a73ba2944fc9e02c381e5af99923 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f76a0646a7b2642dfec78a7abcf1db8beef95d4901bc30994cc4db814268452.yml +openapi_spec_hash: 5bb42fa424c0580104ca0c11ed15257c config_hash: eda5b3d9487ce675d1fadf88153b457d From 53f92d873687dd71e9515b2514143f6392dd1b2b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:23:41 +0000 Subject: [PATCH 192/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6a93ba48f7..571c6fa6aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7f76a0646a7b2642dfec78a7abcf1db8beef95d4901bc30994cc4db814268452.yml -openapi_spec_hash: 5bb42fa424c0580104ca0c11ed15257c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e7916ad0608dfb4b8daa31bbe30966789554aa1b381003d8a9d9b21b71b6a124.yml +openapi_spec_hash: 3725222d2a794ce30e10778cdacfa1fd config_hash: eda5b3d9487ce675d1fadf88153b457d From c7cfe83a204ec82e3d60716d6faf20fbf675ca1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:35:06 +0000 Subject: [PATCH 193/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 571c6fa6aa..825cf37c19 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e7916ad0608dfb4b8daa31bbe30966789554aa1b381003d8a9d9b21b71b6a124.yml -openapi_spec_hash: 3725222d2a794ce30e10778cdacfa1fd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d54bd50aadad161204ea46fc4ed374b82a684e7c8b4caa59a399827804de2ff6.yml +openapi_spec_hash: 94c63c10a15d68d0353882ac7d8b8b55 config_hash: eda5b3d9487ce675d1fadf88153b457d From 09f79d291b9e176589846c6c7cfe632ea34599f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 20:46:49 +0000 Subject: [PATCH 194/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 825cf37c19..42902e3114 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d54bd50aadad161204ea46fc4ed374b82a684e7c8b4caa59a399827804de2ff6.yml -openapi_spec_hash: 94c63c10a15d68d0353882ac7d8b8b55 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-87d2a19618534651e063c89ac1554cb21a4e89567058ad246c0ed6a4747d27ec.yml +openapi_spec_hash: dbeb96a9b60de1e053dfc40bdb5fdbb6 config_hash: eda5b3d9487ce675d1fadf88153b457d From a02d9ee916b478f4a4feb9bcabe9b8198e88ad41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 21:38:28 +0000 Subject: [PATCH 195/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 42902e3114..d980782370 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-87d2a19618534651e063c89ac1554cb21a4e89567058ad246c0ed6a4747d27ec.yml -openapi_spec_hash: dbeb96a9b60de1e053dfc40bdb5fdbb6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-72bd871039f4cc0c4ca7b89af1f47b881c7b633e901c85717b6674bb2eabd57c.yml +openapi_spec_hash: 5114f403dbd62a51f9401d46e16e7a58 config_hash: eda5b3d9487ce675d1fadf88153b457d From 373881d9258af43e87b8cba2dbdff6c9e9ab3a8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 21:43:21 +0000 Subject: [PATCH 196/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d980782370..a7f2ca2f2e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-72bd871039f4cc0c4ca7b89af1f47b881c7b633e901c85717b6674bb2eabd57c.yml -openapi_spec_hash: 5114f403dbd62a51f9401d46e16e7a58 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8d83e0d7cc5a9f27a6e31336f35564080cac6d8bfce0cc6922f88cf6bd01fa41.yml +openapi_spec_hash: 3960ae0f8fc4c68c3c1f99b91e7bb387 config_hash: eda5b3d9487ce675d1fadf88153b457d From a2faa39bf160a2a1ee9ee6c56041b2063955081e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 22:20:29 +0000 Subject: [PATCH 197/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a7f2ca2f2e..3e40f161b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8d83e0d7cc5a9f27a6e31336f35564080cac6d8bfce0cc6922f88cf6bd01fa41.yml -openapi_spec_hash: 3960ae0f8fc4c68c3c1f99b91e7bb387 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a42d6c77ba1caf82fc785a2c8e1297a649ac14796ad0ed3d1ebc07b8fc034ea8.yml +openapi_spec_hash: 0bf44e518946f028fab4b1a88e981e0f config_hash: eda5b3d9487ce675d1fadf88153b457d From 2d545a0f5ec14b641755888edd5526958f494161 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 25 Jul 2025 22:31:46 +0000 Subject: [PATCH 198/423] feat(api): api update --- .stats.yml | 4 +- src/resources/secrets-store/stores/secrets.ts | 38 ++++++++++++------- .../secrets-store/stores/secrets.test.ts | 32 ++++++++++++---- 3 files changed, 51 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3e40f161b0..7c489fc21e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a42d6c77ba1caf82fc785a2c8e1297a649ac14796ad0ed3d1ebc07b8fc034ea8.yml -openapi_spec_hash: 0bf44e518946f028fab4b1a88e981e0f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2bf95334cf3f1af41a97db60a94ad12c0af730ad744c13d83982bc6daf92b6e7.yml +openapi_spec_hash: 0d843a9d846c2e6d6eb0a6538bc66f8d config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/secrets-store/stores/secrets.ts b/src/resources/secrets-store/stores/secrets.ts index 226f6c00d5..1ab72e50dc 100644 --- a/src/resources/secrets-store/stores/secrets.ts +++ b/src/resources/secrets-store/stores/secrets.ts @@ -18,7 +18,7 @@ export class Secrets extends APIResource { * body: [ * { * name: 'MY_API_KEY', - * scopes: ['workers'], + * scopes: ['workers', 'ai_gateway'], * value: 'api-token-secret-123', * }, * ], @@ -135,6 +135,7 @@ export class Secrets extends APIResource { * { * account_id: '985e105f4ecef8ad9ca31a8372d0c353', * name: 'MY_API_KEY', + * scopes: ['workers', 'ai_gateway'], * }, * ); * ``` @@ -163,10 +164,7 @@ export class Secrets extends APIResource { * await client.secretsStore.stores.secrets.edit( * '023e105f4ecef8ad9ca31a8372d0c353', * '3fd85f74b32742f1bff64a85009dda07', - * { - * account_id: '985e105f4ecef8ad9ca31a8372d0c353', - * name: 'MY_API_KEY', - * }, + * { account_id: '985e105f4ecef8ad9ca31a8372d0c353' }, * ); * ``` */ @@ -486,6 +484,11 @@ export namespace SecretCreateParams { * provide this value, it is only used to create/modify secrets. */ value: string; + + /** + * Freeform text describing the secret + */ + comment?: string; } } @@ -505,6 +508,11 @@ export interface SecretListParams extends V4PagePaginationArrayParams { */ order?: 'name' | 'comment' | 'created' | 'modified' | 'status'; + /** + * Query param: Only secrets with the given scopes will be returned + */ + scopes?: Array>; + /** * Query param: Search secrets using a filter string, filtering across name and * comment @@ -536,6 +544,16 @@ export interface SecretDuplicateParams { * Body param: The name of the secret */ name: string; + + /** + * Body param: The list of services that can use this secret. + */ + scopes: Array; + + /** + * Body param: Freeform text describing the secret + */ + comment?: string; } export interface SecretEditParams { @@ -545,20 +563,14 @@ export interface SecretEditParams { account_id: string; /** - * Body param: The name of the secret + * Body param: Freeform text describing the secret */ - name: string; + comment?: string; /** * Body param: The list of services that can use this secret. */ scopes?: Array; - - /** - * Body param: The value of the secret. Note that this is 'write only' - no API - * reponse will provide this value, it is only used to create/modify secrets. - */ - value?: string; } export interface SecretGetParams { diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index 7841545a31..91cd2bb269 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -13,7 +13,7 @@ describe('resource secrets', () => { test('create: only required params', async () => { const responsePromise = client.secretsStore.stores.secrets.create('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '985e105f4ecef8ad9ca31a8372d0c353', - body: [{ name: 'MY_API_KEY', scopes: ['workers'], value: 'api-token-secret-123' }], + body: [{ name: 'MY_API_KEY', scopes: ['workers', 'ai_gateway'], value: 'api-token-secret-123' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -27,7 +27,14 @@ describe('resource secrets', () => { test('create: required and optional params', async () => { const response = await client.secretsStore.stores.secrets.create('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '985e105f4ecef8ad9ca31a8372d0c353', - body: [{ name: 'MY_API_KEY', scopes: ['workers'], value: 'api-token-secret-123' }], + body: [ + { + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway'], + value: 'api-token-secret-123', + comment: 'info about my secret', + }, + ], }); }); @@ -51,6 +58,7 @@ describe('resource secrets', () => { order: 'name', page: 2, per_page: 20, + scopes: [['workers', 'ai_gateway']], search: 'search', }); }); @@ -103,7 +111,11 @@ describe('resource secrets', () => { const responsePromise = client.secretsStore.stores.secrets.duplicate( '023e105f4ecef8ad9ca31a8372d0c353', '3fd85f74b32742f1bff64a85009dda07', - { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY' }, + { + account_id: '985e105f4ecef8ad9ca31a8372d0c353', + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway'], + }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -119,7 +131,12 @@ describe('resource secrets', () => { const response = await client.secretsStore.stores.secrets.duplicate( '023e105f4ecef8ad9ca31a8372d0c353', '3fd85f74b32742f1bff64a85009dda07', - { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY' }, + { + account_id: '985e105f4ecef8ad9ca31a8372d0c353', + name: 'MY_API_KEY', + scopes: ['workers', 'ai_gateway'], + comment: 'info about my secret', + }, ); }); @@ -127,7 +144,7 @@ describe('resource secrets', () => { const responsePromise = client.secretsStore.stores.secrets.edit( '023e105f4ecef8ad9ca31a8372d0c353', '3fd85f74b32742f1bff64a85009dda07', - { account_id: '985e105f4ecef8ad9ca31a8372d0c353', name: 'MY_API_KEY' }, + { account_id: '985e105f4ecef8ad9ca31a8372d0c353' }, ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -144,9 +161,8 @@ describe('resource secrets', () => { '3fd85f74b32742f1bff64a85009dda07', { account_id: '985e105f4ecef8ad9ca31a8372d0c353', - name: 'MY_API_KEY', - scopes: ['workers'], - value: 'api-token-secret-123', + comment: 'info about my secret', + scopes: ['workers', 'ai_gateway'], }, ); }); From 2656fd0448829402018d6264c36aaf95f646e5d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 06:10:01 +0000 Subject: [PATCH 199/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7c489fc21e..19b4a7fd45 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2bf95334cf3f1af41a97db60a94ad12c0af730ad744c13d83982bc6daf92b6e7.yml -openapi_spec_hash: 0d843a9d846c2e6d6eb0a6538bc66f8d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29835a008a8127968fac14e97e3d7d2245b37c7529e92057f4101526fb364fc1.yml +openapi_spec_hash: a54c8189c9e72ec5afb0fa563c258109 config_hash: eda5b3d9487ce675d1fadf88153b457d From e128703a1dbac98df5ad06c19692a49943354f52 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 22:29:16 +0000 Subject: [PATCH 200/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 19b4a7fd45..58dca14081 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-29835a008a8127968fac14e97e3d7d2245b37c7529e92057f4101526fb364fc1.yml -openapi_spec_hash: a54c8189c9e72ec5afb0fa563c258109 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4d509b065b117caeaef60b81dc212caf56b72f4837b4f50ae8d625a854576a0.yml +openapi_spec_hash: 301159a0319fdf6a3dac4d5975336221 config_hash: eda5b3d9487ce675d1fadf88153b457d From ec5e4c4f8e60927943701caacab5db5813aad5b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 26 Jul 2025 23:26:14 +0000 Subject: [PATCH 201/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 58dca14081..8379f7acaf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e4d509b065b117caeaef60b81dc212caf56b72f4837b4f50ae8d625a854576a0.yml -openapi_spec_hash: 301159a0319fdf6a3dac4d5975336221 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b0ea3058d0a2e4fb1d74b9506b7f334fade7f6774fd2ec1a5d0dd1355662036a.yml +openapi_spec_hash: 7686dd16af71b38ef3917a9f29f12c31 config_hash: eda5b3d9487ce675d1fadf88153b457d From d1321f1633fc7017cf1bedc2774ecf61f1fffbb0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 27 Jul 2025 06:09:32 +0000 Subject: [PATCH 202/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8379f7acaf..f1fd38c9f6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b0ea3058d0a2e4fb1d74b9506b7f334fade7f6774fd2ec1a5d0dd1355662036a.yml -openapi_spec_hash: 7686dd16af71b38ef3917a9f29f12c31 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25f2f9d9689723a6ff65df1dd5184e09b2801e69175b28d897349e0782792594.yml +openapi_spec_hash: f795608e54fb9a713b734669a069d6e3 config_hash: eda5b3d9487ce675d1fadf88153b457d From 0e4fbd0d05a157803fc5dd77a9460601f16e6e6c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 06:11:10 +0000 Subject: [PATCH 203/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f1fd38c9f6..ba02761ee8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25f2f9d9689723a6ff65df1dd5184e09b2801e69175b28d897349e0782792594.yml -openapi_spec_hash: f795608e54fb9a713b734669a069d6e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a215f5954278b3f9a0d4358b9d03303f8d705d4b395e991fb7b37cc1bf94d25b.yml +openapi_spec_hash: 3475d1a019af893db151f9be77adb448 config_hash: eda5b3d9487ce675d1fadf88153b457d From 9aef12a3aaca050af2aa7598a594723ffb7f601a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 06:22:59 +0000 Subject: [PATCH 204/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ba02761ee8..da7f170c98 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a215f5954278b3f9a0d4358b9d03303f8d705d4b395e991fb7b37cc1bf94d25b.yml -openapi_spec_hash: 3475d1a019af893db151f9be77adb448 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aeab33d0a1514e4d377670d02e152fc1a8d5ca161341287caf7242496e5c5f60.yml +openapi_spec_hash: 94ec5bb06a71f6a58f531fb2eeeaae01 config_hash: eda5b3d9487ce675d1fadf88153b457d From 8e026d898579f9352309f0203f2250106e7150ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:20:42 +0000 Subject: [PATCH 205/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index da7f170c98..5eabe551d9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aeab33d0a1514e4d377670d02e152fc1a8d5ca161341287caf7242496e5c5f60.yml -openapi_spec_hash: 94ec5bb06a71f6a58f531fb2eeeaae01 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-416dcf9dbbc22c36118cf28908287f1509638616c3bf6772c06ea4c5912dcf62.yml +openapi_spec_hash: dd9791a6bf33fc43ec408b067e67f87c config_hash: eda5b3d9487ce675d1fadf88153b457d From 3d877f04df1354bd546211d17c2f74e2151b05f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:32:32 +0000 Subject: [PATCH 206/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5eabe551d9..8f0a5ff01e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-416dcf9dbbc22c36118cf28908287f1509638616c3bf6772c06ea4c5912dcf62.yml -openapi_spec_hash: dd9791a6bf33fc43ec408b067e67f87c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8fe65acfa2ab4a3b99003c46f422c27865538243a31637eaa79ca3baa3e2994a.yml +openapi_spec_hash: df62d02c999bd30e7c637fef3a962390 config_hash: eda5b3d9487ce675d1fadf88153b457d From 9185c1d2f1abd2208eeefa11ccfb477fbb01f371 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 08:44:01 +0000 Subject: [PATCH 207/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8f0a5ff01e..86ed65e14b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8fe65acfa2ab4a3b99003c46f422c27865538243a31637eaa79ca3baa3e2994a.yml -openapi_spec_hash: df62d02c999bd30e7c637fef3a962390 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b5b0c8e83f279b4776ef5ca44c6fb345ff64c19a44be35eda76dbb91d97985d3.yml +openapi_spec_hash: 4ee1b788eb519ff993c064b0b69dd131 config_hash: eda5b3d9487ce675d1fadf88153b457d From 9d769e8821e8b9c2c9ac56f432458c03d1789958 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 10:28:54 +0000 Subject: [PATCH 208/423] feat(api): api update --- .stats.yml | 4 +- src/resources/rules/lists/bulk-operations.ts | 38 +++--- src/resources/rules/lists/items.ts | 118 +++---------------- 3 files changed, 39 insertions(+), 121 deletions(-) diff --git a/.stats.yml b/.stats.yml index 86ed65e14b..928b25f374 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b5b0c8e83f279b4776ef5ca44c6fb345ff64c19a44be35eda76dbb91d97985d3.yml -openapi_spec_hash: 4ee1b788eb519ff993c064b0b69dd131 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2166aa56e7272ad216c6228d41fc306578dc0e5f0ad0dbce7626ae6c8dad4cdd.yml +openapi_spec_hash: 30f44d6784a0b7386c5edd38c4076f78 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/rules/lists/bulk-operations.ts b/src/resources/rules/lists/bulk-operations.ts index 1fa8d84a43..aa47037761 100644 --- a/src/resources/rules/lists/bulk-operations.ts +++ b/src/resources/rules/lists/bulk-operations.ts @@ -36,46 +36,41 @@ export class BulkOperations extends APIResource { } export type BulkOperationGetResponse = - | BulkOperationGetResponse.UnionMember0 - | BulkOperationGetResponse.UnionMember1 - | BulkOperationGetResponse.UnionMember2; + | BulkOperationGetResponse.ListsPendingOrRunningBulkOperation + | BulkOperationGetResponse.ListsCompletedBulkOperation + | BulkOperationGetResponse.ListsFailedBulkOperation; export namespace BulkOperationGetResponse { - export interface UnionMember0 { + export interface ListsPendingOrRunningBulkOperation { /** * The unique operation ID of the asynchronous action. */ id: string; - /** - * The RFC 3339 timestamp of when the operation was completed. - */ - completed: string; - - /** - * A message describing the error when the status is `failed`. - */ - error: string; - /** * The current status of the asynchronous operation. */ - status: 'failed'; + status: 'pending' | 'running'; } - export interface UnionMember1 { + export interface ListsCompletedBulkOperation { /** * The unique operation ID of the asynchronous action. */ id: string; + /** + * The RFC 3339 timestamp of when the operation was completed. + */ + completed: string; + /** * The current status of the asynchronous operation. */ - status: 'pending' | 'running'; + status: 'completed'; } - export interface UnionMember2 { + export interface ListsFailedBulkOperation { /** * The unique operation ID of the asynchronous action. */ @@ -86,10 +81,15 @@ export namespace BulkOperationGetResponse { */ completed: string; + /** + * A message describing the error when the status is `failed`. + */ + error: string; + /** * The current status of the asynchronous operation. */ - status: 'completed'; + status: 'failed'; } } diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 8260d3a901..9ace9d4bac 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -181,48 +181,7 @@ export interface ItemUpdateResponse { operation_id: string; } -export interface ItemListResponse { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * Defines a non-negative 32 bit integer. - */ - asn?: number; - - /** - * Defines an informative summary of the list item. - */ - comment?: string; - - /** - * The RFC 3339 timestamp of when the item was created. - */ - created_on?: string; - - /** - * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - * 0 to 9, wildcards (\*), and the hyphen (-). - */ - hostname?: ListsAPI.Hostname; - - /** - * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. - */ - ip?: string; - - /** - * The RFC 3339 timestamp of when the item was last modified. - */ - modified_on?: string; - - /** - * The definition of the redirect. - */ - redirect?: ListsAPI.Redirect; -} +export type ItemListResponse = unknown; export interface ItemDeleteResponse { /** @@ -231,48 +190,7 @@ export interface ItemDeleteResponse { operation_id: string; } -export interface ItemGetResponse { - /** - * The unique ID of the list. - */ - id?: string; - - /** - * Defines a non-negative 32 bit integer. - */ - asn?: number; - - /** - * Defines an informative summary of the list item. - */ - comment?: string; - - /** - * The RFC 3339 timestamp of when the item was created. - */ - created_on?: string; - - /** - * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from - * 0 to 9, wildcards (\*), and the hyphen (-). - */ - hostname?: ListsAPI.Hostname; - - /** - * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. - */ - ip?: string; - - /** - * The RFC 3339 timestamp of when the item was last modified. - */ - modified_on?: string; - - /** - * The definition of the redirect. - */ - redirect?: ListsAPI.Redirect; -} +export type ItemGetResponse = unknown; export interface ItemCreateParams { /** @@ -284,15 +202,15 @@ export interface ItemCreateParams { * Body param: */ body: Array< - | ItemCreateParams.UnionMember0 - | ItemCreateParams.UnionMember1 - | ItemCreateParams.UnionMember2 - | ItemCreateParams.UnionMember3 + | ItemCreateParams.ListsListItemIPComment + | ItemCreateParams.ListsListItemRedirectComment + | ItemCreateParams.ListsListItemHostnameComment + | ItemCreateParams.ListsListItemASNComment >; } export namespace ItemCreateParams { - export interface UnionMember0 { + export interface ListsListItemIPComment { /** * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. */ @@ -304,7 +222,7 @@ export namespace ItemCreateParams { comment?: string; } - export interface UnionMember1 { + export interface ListsListItemRedirectComment { /** * The definition of the redirect. */ @@ -316,7 +234,7 @@ export namespace ItemCreateParams { comment?: string; } - export interface UnionMember2 { + export interface ListsListItemHostnameComment { /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). @@ -329,7 +247,7 @@ export namespace ItemCreateParams { comment?: string; } - export interface UnionMember3 { + export interface ListsListItemASNComment { /** * Defines a non-negative 32 bit integer. */ @@ -352,15 +270,15 @@ export interface ItemUpdateParams { * Body param: */ body: Array< - | ItemUpdateParams.UnionMember0 - | ItemUpdateParams.UnionMember1 - | ItemUpdateParams.UnionMember2 - | ItemUpdateParams.UnionMember3 + | ItemUpdateParams.ListsListItemIPComment + | ItemUpdateParams.ListsListItemRedirectComment + | ItemUpdateParams.ListsListItemHostnameComment + | ItemUpdateParams.ListsListItemASNComment >; } export namespace ItemUpdateParams { - export interface UnionMember0 { + export interface ListsListItemIPComment { /** * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. */ @@ -372,7 +290,7 @@ export namespace ItemUpdateParams { comment?: string; } - export interface UnionMember1 { + export interface ListsListItemRedirectComment { /** * The definition of the redirect. */ @@ -384,7 +302,7 @@ export namespace ItemUpdateParams { comment?: string; } - export interface UnionMember2 { + export interface ListsListItemHostnameComment { /** * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from * 0 to 9, wildcards (\*), and the hyphen (-). @@ -397,7 +315,7 @@ export namespace ItemUpdateParams { comment?: string; } - export interface UnionMember3 { + export interface ListsListItemASNComment { /** * Defines a non-negative 32 bit integer. */ From ca02ffb9632a8af5a5c28ee18e7f25e54403beed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 11:27:08 +0000 Subject: [PATCH 209/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 928b25f374..3c47c761ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2166aa56e7272ad216c6228d41fc306578dc0e5f0ad0dbce7626ae6c8dad4cdd.yml -openapi_spec_hash: 30f44d6784a0b7386c5edd38c4076f78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d78d917b2fec0bbd84060d2b5fda39c6d2ba6f08b161d7308599985b34b081a3.yml +openapi_spec_hash: 186a809929ac565890c4b9264e870e01 config_hash: eda5b3d9487ce675d1fadf88153b457d From b6649c7034c3da9e2636893879d37102eb78e935 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 12:43:47 +0000 Subject: [PATCH 210/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3c47c761ce..32de79d782 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d78d917b2fec0bbd84060d2b5fda39c6d2ba6f08b161d7308599985b34b081a3.yml -openapi_spec_hash: 186a809929ac565890c4b9264e870e01 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c79095896cff3d2f87501c486572bb600c4608fc9376720b2676fa011860560.yml +openapi_spec_hash: 23a87f8967e08e6a0337fe2e0bb6771e config_hash: eda5b3d9487ce675d1fadf88153b457d From 001929be410599feb62e3f99d99ab9a3c8f33be2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 14:21:25 +0000 Subject: [PATCH 211/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 32de79d782..784eac2944 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c79095896cff3d2f87501c486572bb600c4608fc9376720b2676fa011860560.yml -openapi_spec_hash: 23a87f8967e08e6a0337fe2e0bb6771e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afce46f2c075f4f5b66c3653c0729cdb44dc838a82eeec631472dcc75c371577.yml +openapi_spec_hash: 618a89d49bb3448ceed747c49e61687c config_hash: eda5b3d9487ce675d1fadf88153b457d From 9668aa8c055f33d37cefe9f5fa8314372e251dd3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 15:40:14 +0000 Subject: [PATCH 212/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 784eac2944..23b539d94f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-afce46f2c075f4f5b66c3653c0729cdb44dc838a82eeec631472dcc75c371577.yml -openapi_spec_hash: 618a89d49bb3448ceed747c49e61687c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a232ad1994562c414c3b8a1ba01e9e88a31ed162add316377eba6211a76ae4a8.yml +openapi_spec_hash: 20b293ab803278ccce452f011b8b2a1d config_hash: eda5b3d9487ce675d1fadf88153b457d From a91ddae8ef08a46751f71cfe8c6cb06282767f02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 15:52:27 +0000 Subject: [PATCH 213/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 23b539d94f..abd4dd446e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a232ad1994562c414c3b8a1ba01e9e88a31ed162add316377eba6211a76ae4a8.yml -openapi_spec_hash: 20b293ab803278ccce452f011b8b2a1d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11773fc095c487ca057d86e381314b9d838d023cbeefdbc297ac5c3ad60ee9de.yml +openapi_spec_hash: f90f1416d0bc48f9a017b0977efb7fe9 config_hash: eda5b3d9487ce675d1fadf88153b457d From a28396004f32b4312fdb636846371ce022da19b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 15:55:13 +0000 Subject: [PATCH 214/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index abd4dd446e..8908ffc388 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-11773fc095c487ca057d86e381314b9d838d023cbeefdbc297ac5c3ad60ee9de.yml -openapi_spec_hash: f90f1416d0bc48f9a017b0977efb7fe9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68172e08bc1ac1650ba78a0f83db4e4c1d4d892f9ba8a3cdc67f6676351bba32.yml +openapi_spec_hash: 4ceb2ae62721dff40fede4d69ff88eca config_hash: eda5b3d9487ce675d1fadf88153b457d From a59d705439b58eb9790674242355fa6591b78d30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 16:09:16 +0000 Subject: [PATCH 215/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8908ffc388..7f37a74493 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68172e08bc1ac1650ba78a0f83db4e4c1d4d892f9ba8a3cdc67f6676351bba32.yml -openapi_spec_hash: 4ceb2ae62721dff40fede4d69ff88eca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a1c5fd9691f33a0da9a3df3ad0814aecb1769cfbb4361630805fa97a5ae6b595.yml +openapi_spec_hash: cdeed9b7f345c7f4532411ce4fe297c6 config_hash: eda5b3d9487ce675d1fadf88153b457d From 86085411ddd6dc8e78e62fbba3e158b4e0861f01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:17:07 +0000 Subject: [PATCH 216/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f37a74493..1143bd7cf1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a1c5fd9691f33a0da9a3df3ad0814aecb1769cfbb4361630805fa97a5ae6b595.yml -openapi_spec_hash: cdeed9b7f345c7f4532411ce4fe297c6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-59bc3f9824ac60956bd5124536fde8500e9377fe5f2c2b1625fbb6745e2e383e.yml +openapi_spec_hash: f703e132c1474fa54552b2f390fc534f config_hash: eda5b3d9487ce675d1fadf88153b457d From 16b0fed402a3261a2d9a7ccc9f573eaf3b715cee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 17:28:49 +0000 Subject: [PATCH 217/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1143bd7cf1..4665a4c15b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-59bc3f9824ac60956bd5124536fde8500e9377fe5f2c2b1625fbb6745e2e383e.yml -openapi_spec_hash: f703e132c1474fa54552b2f390fc534f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-515fd4b9a3ac7cb51edff8e5cc585ace6af310d2db8345978dc4a7c6a4b701d1.yml +openapi_spec_hash: 297c1c42aa261c8397da7e428721f1ac config_hash: eda5b3d9487ce675d1fadf88153b457d From d452f2ece7389b25fd8190b3f510a6fdc40f408f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:29:47 +0000 Subject: [PATCH 218/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4665a4c15b..7c688232f2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-515fd4b9a3ac7cb51edff8e5cc585ace6af310d2db8345978dc4a7c6a4b701d1.yml -openapi_spec_hash: 297c1c42aa261c8397da7e428721f1ac +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b2af1e5b2ed540f3c1555eb99f99c6d436112e9226a46495e969de9275cdee7a.yml +openapi_spec_hash: 721d7d0c8a4c229be793e10f96e8b88e config_hash: eda5b3d9487ce675d1fadf88153b457d From d534979d1dcdf97dc8740e246fe5dd49ec9bb052 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 19:17:39 +0000 Subject: [PATCH 219/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7c688232f2..8908ffc388 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b2af1e5b2ed540f3c1555eb99f99c6d436112e9226a46495e969de9275cdee7a.yml -openapi_spec_hash: 721d7d0c8a4c229be793e10f96e8b88e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68172e08bc1ac1650ba78a0f83db4e4c1d4d892f9ba8a3cdc67f6676351bba32.yml +openapi_spec_hash: 4ceb2ae62721dff40fede4d69ff88eca config_hash: eda5b3d9487ce675d1fadf88153b457d From d190c87c7d551fae7a7ca91e3ce0075ae33b39e8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 20:49:10 +0000 Subject: [PATCH 220/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8908ffc388..7c688232f2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68172e08bc1ac1650ba78a0f83db4e4c1d4d892f9ba8a3cdc67f6676351bba32.yml -openapi_spec_hash: 4ceb2ae62721dff40fede4d69ff88eca +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b2af1e5b2ed540f3c1555eb99f99c6d436112e9226a46495e969de9275cdee7a.yml +openapi_spec_hash: 721d7d0c8a4c229be793e10f96e8b88e config_hash: eda5b3d9487ce675d1fadf88153b457d From bc407732814b387e052ba15a314cd7a535bc83e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 21:48:17 +0000 Subject: [PATCH 221/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7c688232f2..e61870dde1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b2af1e5b2ed540f3c1555eb99f99c6d436112e9226a46495e969de9275cdee7a.yml -openapi_spec_hash: 721d7d0c8a4c229be793e10f96e8b88e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be202d5c4affe095699b4c61762fdd3983e8294e5aa05b0a86d3485d6c68764b.yml +openapi_spec_hash: fde7c59b33eec246d618002f3c0ece66 config_hash: eda5b3d9487ce675d1fadf88153b457d From bb31516145402eecd2cc484a90eab5c214e9567f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 22:37:36 +0000 Subject: [PATCH 222/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e61870dde1..56661646b2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-be202d5c4affe095699b4c61762fdd3983e8294e5aa05b0a86d3485d6c68764b.yml -openapi_spec_hash: fde7c59b33eec246d618002f3c0ece66 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbf89e6656f667d56bb9f74bfe562e6681825512139e92acafb480c4a396beee.yml +openapi_spec_hash: 0a12c2b08679f09b5b8f622bc233c70b config_hash: eda5b3d9487ce675d1fadf88153b457d From a5b2179a25be33eaf92c61256b8a3c74ac7102a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 06:12:31 +0000 Subject: [PATCH 223/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 56661646b2..d9cfda3dca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbf89e6656f667d56bb9f74bfe562e6681825512139e92acafb480c4a396beee.yml -openapi_spec_hash: 0a12c2b08679f09b5b8f622bc233c70b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f9a9cd849ada2651098643665d1a2dfa3e901173b3c2a0896bde2c784b9b90f.yml +openapi_spec_hash: 6d72ea670937a575d7894728edfcb1d8 config_hash: eda5b3d9487ce675d1fadf88153b457d From d0b32e88368cf46057066bda5536965a85799a0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 06:32:34 +0000 Subject: [PATCH 224/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d9cfda3dca..fada290044 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f9a9cd849ada2651098643665d1a2dfa3e901173b3c2a0896bde2c784b9b90f.yml -openapi_spec_hash: 6d72ea670937a575d7894728edfcb1d8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fb3be60c71e334ffb9966b47725d9bb911d441063cd271a584ca5b163562189a.yml +openapi_spec_hash: b4899f357099b018d879fec81272f6e3 config_hash: eda5b3d9487ce675d1fadf88153b457d From 29a5177759404566a8c01c46988f57e7ec8f850f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:40:56 +0000 Subject: [PATCH 225/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/rules/lists/bulk-operations.ts | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index fada290044..5c976b187a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fb3be60c71e334ffb9966b47725d9bb911d441063cd271a584ca5b163562189a.yml -openapi_spec_hash: b4899f357099b018d879fec81272f6e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d3fc261af1dcfd29dc261b9693276ed85a63fd68bb9fd32f3338dc56890f487.yml +openapi_spec_hash: 5b0319bba3aa3b4ee74ceb0c9a3e565a config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/rules/lists/bulk-operations.ts b/src/resources/rules/lists/bulk-operations.ts index aa47037761..2a9186839b 100644 --- a/src/resources/rules/lists/bulk-operations.ts +++ b/src/resources/rules/lists/bulk-operations.ts @@ -36,12 +36,12 @@ export class BulkOperations extends APIResource { } export type BulkOperationGetResponse = - | BulkOperationGetResponse.ListsPendingOrRunningBulkOperation - | BulkOperationGetResponse.ListsCompletedBulkOperation - | BulkOperationGetResponse.ListsFailedBulkOperation; + | BulkOperationGetResponse.ListsBulkOperationPendingOrRunning + | BulkOperationGetResponse.ListsBulkOperationCompleted + | BulkOperationGetResponse.ListsBulkOperationFailed; export namespace BulkOperationGetResponse { - export interface ListsPendingOrRunningBulkOperation { + export interface ListsBulkOperationPendingOrRunning { /** * The unique operation ID of the asynchronous action. */ @@ -53,7 +53,7 @@ export namespace BulkOperationGetResponse { status: 'pending' | 'running'; } - export interface ListsCompletedBulkOperation { + export interface ListsBulkOperationCompleted { /** * The unique operation ID of the asynchronous action. */ @@ -70,7 +70,7 @@ export namespace BulkOperationGetResponse { status: 'completed'; } - export interface ListsFailedBulkOperation { + export interface ListsBulkOperationFailed { /** * The unique operation ID of the asynchronous action. */ From 278b0fcab7ab5dcca86a8960dd05bb46d97634b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 09:53:03 +0000 Subject: [PATCH 226/423] feat(api): api update --- .stats.yml | 4 +- api.md | 4 +- src/resources/custom-pages.ts | 125 ++++++++++++++++++++--- tests/api-resources/custom-pages.test.ts | 8 +- 4 files changed, 118 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5c976b187a..fe96a75aa2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3d3fc261af1dcfd29dc261b9693276ed85a63fd68bb9fd32f3338dc56890f487.yml -openapi_spec_hash: 5b0319bba3aa3b4ee74ceb0c9a3e565a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-919d342c1261dd7a87ae8a67fc6c2117465be3579aefd581f12a35e6e1dd9d35.yml +openapi_spec_hash: e76db51836ef60b3a31b1e1e340908be config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index 8b93a44cd7..510ffa267f 100644 --- a/api.md +++ b/api.md @@ -8654,9 +8654,9 @@ Types: Methods: -- client.customPages.update(identifier, { ...params }) -> CustomPageUpdateResponse | null +- client.customPages.update(identifier, { ...params }) -> CustomPageUpdateResponse - client.customPages.list({ ...params }) -> CustomPageListResponsesSinglePage -- client.customPages.get(identifier, { ...params }) -> CustomPageGetResponse | null +- client.customPages.get(identifier, { ...params }) -> CustomPageGetResponse # SecretsStore diff --git a/src/resources/custom-pages.ts b/src/resources/custom-pages.ts index 38ab076687..6bd1b13cf7 100644 --- a/src/resources/custom-pages.ts +++ b/src/resources/custom-pages.ts @@ -13,7 +13,7 @@ export class CustomPages extends APIResource { * @example * ```ts * const customPage = await client.customPages.update( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'ratelimit_block', * { * state: 'default', * url: 'http://www.example.com', @@ -23,10 +23,17 @@ export class CustomPages extends APIResource { * ``` */ update( - identifier: string, + identifier: + | 'waf_block' + | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' + | 'managed_challenge' + | 'ratelimit_block', params: CustomPageUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, zone_id, ...body } = params; if (!account_id && !zone_id) { throw new CloudflareError('You must provide either account_id or zone_id.'); @@ -48,7 +55,7 @@ export class CustomPages extends APIResource { this._client.put(`/${accountOrZone}/${accountOrZoneId}/custom_pages/${identifier}`, { body, ...options, - }) as Core.APIPromise<{ result: CustomPageUpdateResponse | null }> + }) as Core.APIPromise<{ result: CustomPageUpdateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -109,22 +116,46 @@ export class CustomPages extends APIResource { * @example * ```ts * const customPage = await client.customPages.get( - * '023e105f4ecef8ad9ca31a8372d0c353', + * 'ratelimit_block', * { account_id: 'account_id' }, * ); * ``` */ get( - identifier: string, + identifier: + | 'waf_block' + | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' + | 'managed_challenge' + | 'ratelimit_block', params?: CustomPageGetParams, options?: Core.RequestOptions, - ): Core.APIPromise; - get(identifier: string, options?: Core.RequestOptions): Core.APIPromise; + ): Core.APIPromise; get( - identifier: string, + identifier: + | 'waf_block' + | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' + | 'managed_challenge' + | 'ratelimit_block', + options?: Core.RequestOptions, + ): Core.APIPromise; + get( + identifier: + | 'waf_block' + | 'ip_block' + | 'country_challenge' + | '500_errors' + | '1000_errors' + | 'managed_challenge' + | 'ratelimit_block', params: CustomPageGetParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { if (isRequestOptions(params)) { return this.get(identifier, {}, params); } @@ -149,18 +180,84 @@ export class CustomPages extends APIResource { this._client.get( `/${accountOrZone}/${accountOrZoneId}/custom_pages/${identifier}`, options, - ) as Core.APIPromise<{ result: CustomPageGetResponse | null }> + ) as Core.APIPromise<{ result: CustomPageGetResponse }> )._thenUnwrap((obj) => obj.result); } } export class CustomPageListResponsesSinglePage extends SinglePage {} -export type CustomPageUpdateResponse = unknown | string; +export interface CustomPageUpdateResponse { + id?: string; + + created_on?: string; + + description?: string; + + modified_on?: string; + + preview_target?: string; + + required_tokens?: Array; + + /** + * The custom page state. + */ + state?: 'default' | 'customized'; + + /** + * The URL associated with the custom page. + */ + url?: string; +} + +export interface CustomPageListResponse { + id?: string; + + created_on?: string; + + description?: string; + + modified_on?: string; + + preview_target?: string; -export type CustomPageListResponse = unknown; + required_tokens?: Array; -export type CustomPageGetResponse = unknown | string; + /** + * The custom page state. + */ + state?: 'default' | 'customized'; + + /** + * The URL associated with the custom page. + */ + url?: string; +} + +export interface CustomPageGetResponse { + id?: string; + + created_on?: string; + + description?: string; + + modified_on?: string; + + preview_target?: string; + + required_tokens?: Array; + + /** + * The custom page state. + */ + state?: 'default' | 'customized'; + + /** + * The URL associated with the custom page. + */ + url?: string; +} export interface CustomPageUpdateParams { /** diff --git a/tests/api-resources/custom-pages.test.ts b/tests/api-resources/custom-pages.test.ts index 515f099bbb..d0d2db4f44 100644 --- a/tests/api-resources/custom-pages.test.ts +++ b/tests/api-resources/custom-pages.test.ts @@ -11,7 +11,7 @@ const client = new Cloudflare({ describe('resource customPages', () => { test('update: only required params', async () => { - const responsePromise = client.customPages.update('023e105f4ecef8ad9ca31a8372d0c353', { + const responsePromise = client.customPages.update('ratelimit_block', { state: 'default', url: 'http://www.example.com', account_id: 'account_id', @@ -26,7 +26,7 @@ describe('resource customPages', () => { }); test('update: required and optional params', async () => { - const response = await client.customPages.update('023e105f4ecef8ad9ca31a8372d0c353', { + const response = await client.customPages.update('ratelimit_block', { state: 'default', url: 'http://www.example.com', account_id: 'account_id', @@ -45,9 +45,7 @@ describe('resource customPages', () => { }); test('get', async () => { - const responsePromise = client.customPages.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: 'account_id', - }); + const responsePromise = client.customPages.get('ratelimit_block', { account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; From 908a772429007c187ec12e7af43d348c828e77bb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 12:09:35 +0000 Subject: [PATCH 227/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fe96a75aa2..afccfaaa5e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-919d342c1261dd7a87ae8a67fc6c2117465be3579aefd581f12a35e6e1dd9d35.yml -openapi_spec_hash: e76db51836ef60b3a31b1e1e340908be +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc48a89e92a531da0ce2a5db8cf5f71a1c53c56dfff3de38aac6049c44b3d62f.yml +openapi_spec_hash: eeec589cb3879bf634e814a937487af0 config_hash: eda5b3d9487ce675d1fadf88153b457d From f8cb016f454f0ab6a3d545e3eebcb3d5fee63ecc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 13:42:33 +0000 Subject: [PATCH 228/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index afccfaaa5e..e5fdd3e6c2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fc48a89e92a531da0ce2a5db8cf5f71a1c53c56dfff3de38aac6049c44b3d62f.yml -openapi_spec_hash: eeec589cb3879bf634e814a937487af0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-19e05a72a4ccddf41c4f5ef7bd55b6f9c531becbb0299d6b2c383c6327ed0342.yml +openapi_spec_hash: 66ae9c7252298dc68f2e6a28544c3e61 config_hash: eda5b3d9487ce675d1fadf88153b457d From e1b7792a758a04aa5de7aaff04407f665bafbe51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:11:02 +0000 Subject: [PATCH 229/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e5fdd3e6c2..14da885f13 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-19e05a72a4ccddf41c4f5ef7bd55b6f9c531becbb0299d6b2c383c6327ed0342.yml -openapi_spec_hash: 66ae9c7252298dc68f2e6a28544c3e61 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c7b4c3d72d12f9bc2d42b480f5a775211c94849084ec5cd8b702741da21999f.yml +openapi_spec_hash: 4e34ee58e19ad697d6c5d803203606d7 config_hash: eda5b3d9487ce675d1fadf88153b457d From c7a6dfeaf7c4c3d083d297d4fec22a6f52edbb2c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:24:08 +0000 Subject: [PATCH 230/423] feat(api): api update --- .stats.yml | 4 ++-- .../zero-trust/gateway/configurations/configurations.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 14da885f13..e289592ca5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c7b4c3d72d12f9bc2d42b480f5a775211c94849084ec5cd8b702741da21999f.yml -openapi_spec_hash: 4e34ee58e19ad697d6c5d803203606d7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cea8c0c5482c999b7241fa9a19362dd8504dfee40bb5f704f88822a73abd134.yml +openapi_spec_hash: e3cadc523ac8c8a891d9aa1104b1c357 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 796df5f5b9..63b0edfdc7 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -415,17 +415,17 @@ export interface ExtendedEmailMatching { * This setting was shared via the Orgs API and cannot be edited by the current * account */ - read_only?: boolean | null; + read_only?: boolean; /** * Account tag of account that shared this setting */ - source_account?: string | null; + source_account?: string; /** * Version number of the setting */ - version?: number | null; + version?: number; } /** From 07e9e91b07d9774b8d150c6109aeeb6027bbfee3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 15:19:21 +0000 Subject: [PATCH 231/423] chore(internal): remove redundant imports config --- package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/package.json b/package.json index ae9cd435d7..37aa9320f6 100644 --- a/package.json +++ b/package.json @@ -58,10 +58,6 @@ "./shims/web.js", "./shims/web.mjs" ], - "imports": { - "cloudflare": ".", - "cloudflare/*": "./src/*" - }, "exports": { "./_shims/auto/*": { "deno": { From 3fea26677bd61a57ee2dae35e6814ab3d0bb501d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:11:37 +0000 Subject: [PATCH 232/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e289592ca5..969892e139 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6cea8c0c5482c999b7241fa9a19362dd8504dfee40bb5f704f88822a73abd134.yml -openapi_spec_hash: e3cadc523ac8c8a891d9aa1104b1c357 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f0bef2c69abaf974203b4d41ea65e1c5b9702d9754bc83b57c8e3ef625fa4662.yml +openapi_spec_hash: 593b5fb7192509728a0cfba5b588ddc1 config_hash: eda5b3d9487ce675d1fadf88153b457d From ef8e627c46d0679a3e2623bdabc9a2b456e8fa51 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:23:01 +0000 Subject: [PATCH 233/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 969892e139..fa9b363452 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f0bef2c69abaf974203b4d41ea65e1c5b9702d9754bc83b57c8e3ef625fa4662.yml -openapi_spec_hash: 593b5fb7192509728a0cfba5b588ddc1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-530288a62cbbb61afb35c013b20d55d98af189fdd8d851ab86236705b33661ec.yml +openapi_spec_hash: 6840ef040a5a8a6b6058487e8ec937cb config_hash: eda5b3d9487ce675d1fadf88153b457d From 47184e06c2903b6891e4ba9726a27ce14a4262f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:34:36 +0000 Subject: [PATCH 234/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fa9b363452..2e23482aea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-530288a62cbbb61afb35c013b20d55d98af189fdd8d851ab86236705b33661ec.yml -openapi_spec_hash: 6840ef040a5a8a6b6058487e8ec937cb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bb8fc9bb71a4e7e3e6011912397651a82ea4d31c511d1c3d866f3203519e4c0.yml +openapi_spec_hash: 564270bb7d332d44dc92d1940b64311f config_hash: eda5b3d9487ce675d1fadf88153b457d From 68389564e3f97e99c35cdb7d2e0505f2b21fdbd2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 16:46:12 +0000 Subject: [PATCH 235/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2e23482aea..1efc15bb5f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bb8fc9bb71a4e7e3e6011912397651a82ea4d31c511d1c3d866f3203519e4c0.yml -openapi_spec_hash: 564270bb7d332d44dc92d1940b64311f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aab01495f3bea0d37490e130450bf8f532de09d869739591f975396b495a9675.yml +openapi_spec_hash: 85921630e617f5b2a31c386e95dfb365 config_hash: eda5b3d9487ce675d1fadf88153b457d From 32c379d516f4971accb93d44e3b4c1381b757e5f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:00:48 +0000 Subject: [PATCH 236/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1efc15bb5f..00f71739f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aab01495f3bea0d37490e130450bf8f532de09d869739591f975396b495a9675.yml -openapi_spec_hash: 85921630e617f5b2a31c386e95dfb365 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-70a39a6cd37779dbed9ce0f377c83b4eee53dcb3fa5282f3d6c7fcdf4fc7a2ff.yml +openapi_spec_hash: 336f569765a5fdda10f8c04654335ba3 config_hash: eda5b3d9487ce675d1fadf88153b457d From 7c69fe4318620ab757e2b8a3b47633285698ea0c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:12:46 +0000 Subject: [PATCH 237/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 00f71739f1..2e23482aea 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-70a39a6cd37779dbed9ce0f377c83b4eee53dcb3fa5282f3d6c7fcdf4fc7a2ff.yml -openapi_spec_hash: 336f569765a5fdda10f8c04654335ba3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bb8fc9bb71a4e7e3e6011912397651a82ea4d31c511d1c3d866f3203519e4c0.yml +openapi_spec_hash: 564270bb7d332d44dc92d1940b64311f config_hash: eda5b3d9487ce675d1fadf88153b457d From 4299a6a7861511754fdd03baa32dae54af2391ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:24:41 +0000 Subject: [PATCH 238/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2e23482aea..f99d85e9dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3bb8fc9bb71a4e7e3e6011912397651a82ea4d31c511d1c3d866f3203519e4c0.yml -openapi_spec_hash: 564270bb7d332d44dc92d1940b64311f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7d3fe3c9e49d8a00958ea65f8a7bf9c621c42c6f20b5e8e945855ff71200f367.yml +openapi_spec_hash: 84549dae2de0cfcd9462f3ed17a83b8a config_hash: eda5b3d9487ce675d1fadf88153b457d From cc4aa0ef6929680d37d581e5335d9d38d63331f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 17:36:04 +0000 Subject: [PATCH 239/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f99d85e9dd..d4d632f870 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7d3fe3c9e49d8a00958ea65f8a7bf9c621c42c6f20b5e8e945855ff71200f367.yml -openapi_spec_hash: 84549dae2de0cfcd9462f3ed17a83b8a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5864c300ed198f637f640aea96ef38772645bc62291ae31c05c17b82306a01d.yml +openapi_spec_hash: 4721196ccfcb015295bf0c9c60ce380b config_hash: eda5b3d9487ce675d1fadf88153b457d From 7fe560d96e7f29a32036a3f30298a1207c443d84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 18:08:07 +0000 Subject: [PATCH 240/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d4d632f870..d5208f66dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f5864c300ed198f637f640aea96ef38772645bc62291ae31c05c17b82306a01d.yml -openapi_spec_hash: 4721196ccfcb015295bf0c9c60ce380b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-32a2b6025ea9edf6613b1ea43e67fda40ecb0604b152016e12a002851f38d725.yml +openapi_spec_hash: afa86d55e9c7e72e86189054d1c63f48 config_hash: eda5b3d9487ce675d1fadf88153b457d From 2af2e4b1db73fcfd4f0a00e85ca922b3777b7ecd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 18:28:14 +0000 Subject: [PATCH 241/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d5208f66dd..2c30c098bf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-32a2b6025ea9edf6613b1ea43e67fda40ecb0604b152016e12a002851f38d725.yml -openapi_spec_hash: afa86d55e9c7e72e86189054d1c63f48 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2cb8ad4f72caa41bb4569da2a2d04f7a8214e0c6bae30d3d2956e9034df07724.yml +openapi_spec_hash: 02d4a63192ab25423529329b30b6b0ad config_hash: eda5b3d9487ce675d1fadf88153b457d From 3c5b8bd27e6da910ca6c2b921e64f2b7d375f25a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 18:39:53 +0000 Subject: [PATCH 242/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2c30c098bf..2073b67615 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2cb8ad4f72caa41bb4569da2a2d04f7a8214e0c6bae30d3d2956e9034df07724.yml -openapi_spec_hash: 02d4a63192ab25423529329b30b6b0ad +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e9bfa953671e48e1ca33c1b418b25adb923554df737870e5fd4fe11917402ad1.yml +openapi_spec_hash: 6150d811db3257d0e74e0c9d0f9575a7 config_hash: eda5b3d9487ce675d1fadf88153b457d From 20742491dde46967ec3ca72fb096955912aad08e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 19:10:46 +0000 Subject: [PATCH 243/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2073b67615..27be673748 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e9bfa953671e48e1ca33c1b418b25adb923554df737870e5fd4fe11917402ad1.yml -openapi_spec_hash: 6150d811db3257d0e74e0c9d0f9575a7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb90b7fb6b9b4fdf8aa58c6f60980875a8dc855114fb2f84a4998024d7087f69.yml +openapi_spec_hash: 7eabd8352835bf80892dbb494fdf3ef4 config_hash: eda5b3d9487ce675d1fadf88153b457d From f30e927cf6d89e3580bdd77e0a8e2ae91bd9da56 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 10:39:04 +0000 Subject: [PATCH 244/423] chore(api): upload OpenAPI schema from api-schemas --- .stats.yml | 6 +- api.md | 126 +- scripts/detect-breaking-changes | 15 - src/resources/ai-gateway/ai-gateway.ts | 15 + src/resources/ai-gateway/logs.ts | 14 +- src/resources/browser-rendering/json.ts | 20 + src/resources/custom-nameservers.ts | 2 +- .../durable-objects/durable-objects.ts | 11 +- src/resources/durable-objects/index.ts | 2 +- .../durable-objects/namespaces/index.ts | 7 +- .../durable-objects/namespaces/namespaces.ts | 20 +- src/resources/kv/index.ts | 3 +- src/resources/kv/kv.ts | 6 +- src/resources/kv/namespaces/index.ts | 5 +- src/resources/kv/namespaces/keys.ts | 132 +- src/resources/kv/namespaces/metadata.ts | 7 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 31 +- src/resources/logs/control/cmb/cmb.ts | 18 +- src/resources/logs/control/cmb/config.ts | 120 +- src/resources/logs/control/cmb/index.ts | 9 +- src/resources/logs/control/control.ts | 16 +- src/resources/logs/control/index.ts | 8 +- src/resources/logs/control/retention.ts | 91 +- src/resources/logs/index.ts | 4 +- src/resources/logs/logs.ts | 12 +- src/resources/logs/rayid.ts | 61 +- src/resources/logs/received/fields.ts | 34 +- src/resources/logs/received/index.ts | 4 +- src/resources/logs/received/received.ts | 104 +- src/resources/magic-transit/pcaps/download.ts | 2 +- .../magic-transit/pcaps/ownership.ts | 8 +- src/resources/magic-transit/pcaps/pcaps.ts | 12 +- src/resources/queues/index.ts | 5 +- src/resources/queues/messages.ts | 217 +-- src/resources/queues/queues.ts | 11 +- src/resources/r2/buckets/domains/custom.ts | 36 + src/resources/request-tracers/traces.ts | 2 +- .../certificate-packs/certificate-packs.ts | 130 +- src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 +---------------- src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 405 +---- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 +-- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zones/custom-nameservers.ts | 51 +- .../ai-gateway/ai-gateway.test.ts | 1 + .../browser-rendering/json.test.ts | 1 + .../namespaces/namespaces.test.ts | 2 + .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 31 +- .../kv/namespaces/values.test.ts | 3 +- .../logs/control/cmb/config.test.ts | 71 - .../logs/control/retention.test.ts | 49 - tests/api-resources/logs/rayid.test.ts | 33 - .../logs/received/fields.test.ts | 27 - .../logs/received/received.test.ts | 38 - tests/api-resources/queues/messages.test.ts | 43 - .../r2/buckets/domains/custom.test.ts | 2 + .../workers/observability/telemetry.test.ts | 110 -- .../workflows/instances/events.test.ts | 32 - .../workflows/instances/instances.test.ts | 87 - .../workflows/instances/status.test.ts | 33 - .../api-resources/workflows/versions.test.ts | 50 - .../api-resources/workflows/workflows.test.ts | 85 - 70 files changed, 492 insertions(+), 4272 deletions(-) delete mode 100644 tests/api-resources/logs/control/cmb/config.test.ts delete mode 100644 tests/api-resources/logs/control/retention.test.ts delete mode 100644 tests/api-resources/logs/rayid.test.ts delete mode 100644 tests/api-resources/logs/received/fields.test.ts delete mode 100644 tests/api-resources/logs/received/received.test.ts delete mode 100644 tests/api-resources/workers/observability/telemetry.test.ts delete mode 100644 tests/api-resources/workflows/instances/events.test.ts delete mode 100644 tests/api-resources/workflows/instances/instances.test.ts delete mode 100644 tests/api-resources/workflows/instances/status.test.ts delete mode 100644 tests/api-resources/workflows/versions.test.ts delete mode 100644 tests/api-resources/workflows/workflows.test.ts diff --git a/.stats.yml b/.stats.yml index 27be673748..3471ec286f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb90b7fb6b9b4fdf8aa58c6f60980875a8dc855114fb2f84a4998024d7087f69.yml -openapi_spec_hash: 7eabd8352835bf80892dbb494fdf3ef4 +configured_endpoints: 1756 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b079f080cace87a18243c586559e7307e55499171d5cbf440932ad6ee8a0d65e.yml +openapi_spec_hash: 64b0ff31c81d75b8ecb141a233dad48e config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index 510ffa267f..27854a1887 100644 --- a/api.md +++ b/api.md @@ -1702,61 +1702,16 @@ Methods: ### Retention -Types: - -- RetentionCreateResponse -- RetentionGetResponse - -Methods: - -- client.logs.control.retention.create({ ...params }) -> RetentionCreateResponse | null -- client.logs.control.retention.get({ ...params }) -> RetentionGetResponse | null - ### Cmb #### Config -Types: - -- CmbConfig -- ConfigDeleteResponse - -Methods: - -- client.logs.control.cmb.config.create({ ...params }) -> CmbConfig | null -- client.logs.control.cmb.config.delete({ ...params }) -> ConfigDeleteResponse | null -- client.logs.control.cmb.config.get({ ...params }) -> CmbConfig | null - ## RayID -Types: - -- RayIDGetResponse - -Methods: - -- client.logs.RayID.get(RayID, { ...params }) -> RayIDGetResponse - ## Received -Types: - -- ReceivedGetResponse - -Methods: - -- client.logs.received.get({ ...params }) -> ReceivedGetResponse - ### Fields -Types: - -- FieldGetResponse - -Methods: - -- client.logs.received.fields.get({ ...params }) -> FieldGetResponse - # OriginTLSClientAuth Types: @@ -2213,18 +2168,6 @@ Methods: ### 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 @@ -2232,19 +2175,18 @@ Methods: Types: - Namespace +- NamespaceUpdateResponse - NamespaceDeleteResponse - NamespaceBulkDeleteResponse -- NamespaceBulkGetResponse - NamespaceBulkUpdateResponse Methods: - client.kv.namespaces.create({ ...params }) -> Namespace -- client.kv.namespaces.update(namespaceId, { ...params }) -> Namespace +- client.kv.namespaces.update(namespaceId, { ...params }) -> NamespaceUpdateResponse | null - client.kv.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray - client.kv.namespaces.delete(namespaceId, { ...params }) -> NamespaceDeleteResponse | null - client.kv.namespaces.bulkDelete(namespaceId, [ ...body ]) -> NamespaceBulkDeleteResponse | null -- client.kv.namespaces.bulkGet(namespaceId, { ...params }) -> NamespaceBulkGetResponse | null - client.kv.namespaces.bulkUpdate(namespaceId, [ ...body ]) -> NamespaceBulkUpdateResponse | null - client.kv.namespaces.get(namespaceId, { ...params }) -> Namespace @@ -2254,14 +2196,12 @@ 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 @@ -2297,7 +2237,7 @@ Types: Methods: -- client.durableObjects.namespaces.list({ ...params }) -> NamespacesSinglePage +- client.durableObjects.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray ### Objects @@ -2344,16 +2284,12 @@ 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 }) -> MessagePullResponse -- client.queues.messages.push(queueId, { ...params }) -> MessagePushResponse +- client.queues.messages.pull(queueId, { ...params }) -> MessagePullResponsesSinglePage ## Purge @@ -8252,68 +8188,14 @@ Methods: # Workflows -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 -Types: - -- InstanceCreateResponse -- InstanceListResponse -- InstanceBulkResponse -- InstanceGetResponse - -Methods: - -- client.workflows.instances.create(workflowName, { ...params }) -> InstanceCreateResponse -- client.workflows.instances.list(workflowName, { ...params }) -> InstanceListResponsesV4PagePaginationArray -- client.workflows.instances.bulk(workflowName, [ ...body ]) -> InstanceBulkResponsesSinglePage -- client.workflows.instances.get(workflowName, instanceId, { ...params }) -> InstanceGetResponse - ### Status -Types: - -- StatusEditResponse - -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: - -- VersionListResponse -- VersionGetResponse - -Methods: - -- client.workflows.versions.list(workflowName, { ...params }) -> VersionListResponsesV4PagePaginationArray -- client.workflows.versions.get(workflowName, versionId, { ...params }) -> VersionGetResponse - # ResourceSharing Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index b039f24cfa..944ada5878 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -142,14 +142,6 @@ TEST_PATHS=( tests/api-resources/logpush/jobs.test.ts tests/api-resources/logpush/ownership.test.ts tests/api-resources/logpush/validate.test.ts - tests/api-resources/logs/logs.test.ts - tests/api-resources/logs/control/control.test.ts - tests/api-resources/logs/control/retention.test.ts - tests/api-resources/logs/control/cmb/cmb.test.ts - tests/api-resources/logs/control/cmb/config.test.ts - tests/api-resources/logs/rayid.test.ts - tests/api-resources/logs/received/received.test.ts - tests/api-resources/logs/received/fields.test.ts tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts @@ -187,8 +179,6 @@ TEST_PATHS=( tests/api-resources/workers/account-settings.test.ts tests/api-resources/workers/domains.test.ts tests/api-resources/workers/subdomains.test.ts - tests/api-resources/workers/observability/observability.test.ts - tests/api-resources/workers/observability/telemetry.test.ts tests/api-resources/kv/kv.test.ts tests/api-resources/kv/namespaces/namespaces.test.ts tests/api-resources/kv/namespaces/keys.test.ts @@ -702,11 +692,6 @@ TEST_PATHS=( tests/api-resources/botnet-feed/configs/configs.test.ts tests/api-resources/botnet-feed/configs/asn.test.ts tests/api-resources/security-txt.test.ts - tests/api-resources/workflows/workflows.test.ts - tests/api-resources/workflows/instances/instances.test.ts - tests/api-resources/workflows/instances/status.test.ts - tests/api-resources/workflows/instances/events.test.ts - tests/api-resources/workflows/versions.test.ts tests/api-resources/resource-sharing/resource-sharing.test.ts tests/api-resources/resource-sharing/recipients.test.ts tests/api-resources/resource-sharing/resources.test.ts diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index ca019da35e..c619ead6b7 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -240,6 +240,8 @@ export interface AIGatewayCreateResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayUpdateResponse { @@ -279,6 +281,8 @@ export interface AIGatewayUpdateResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayListResponse { @@ -318,6 +322,8 @@ export interface AIGatewayListResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayDeleteResponse { @@ -357,6 +363,8 @@ export interface AIGatewayDeleteResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayGetResponse { @@ -396,6 +404,8 @@ export interface AIGatewayGetResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayCreateParams { @@ -525,6 +535,11 @@ export interface AIGatewayUpdateParams { * Body param: */ logpush_public_key?: string | null; + + /** + * Body param: + */ + store_id?: string | null; } export interface AIGatewayListParams extends V4PagePaginationArrayParams { diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index 4142a8ce6e..f2df3ca255 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -408,6 +408,7 @@ export namespace LogListParams { | 'created_at' | 'request_content_type' | 'response_content_type' + | 'request_type' | 'success' | 'cached' | 'provider' @@ -420,11 +421,13 @@ export namespace LogListParams { | 'duration' | 'feedback' | 'event_id' - | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id'; + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; @@ -477,6 +480,7 @@ export namespace LogDeleteParams { | 'created_at' | 'request_content_type' | 'response_content_type' + | 'request_type' | 'success' | 'cached' | 'provider' @@ -489,11 +493,13 @@ export namespace LogDeleteParams { | 'duration' | 'feedback' | 'event_id' - | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id'; + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index f236ed4200..5afa5cc125 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -98,6 +98,13 @@ export interface JsonCreateParams { */ cookies?: Array; + /** + * Body param: Optional list of custom AI models to use for the request. The models + * will be tried in the order provided, and in case a model returns an error, the + * next one will be used as fallback. + */ + custom_ai?: Array; + /** * Body param: */ @@ -248,6 +255,19 @@ export namespace JsonCreateParams { url?: string; } + export interface CustomAI { + /** + * Authorization token for the AI model: `Bearer `. + */ + authorization: string; + + /** + * AI model to use for the request. Must be formed as `/`, + * e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` + */ + model: string; + } + /** * Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/custom-nameservers.ts b/src/resources/custom-nameservers.ts index 9e8ba96e78..8542a87c22 100644 --- a/src/resources/custom-nameservers.ts +++ b/src/resources/custom-nameservers.ts @@ -102,7 +102,7 @@ export interface CustomNameserver { status: 'moved' | 'pending' | 'verified'; /** - * Identifier + * Identifier. */ zone_tag: string; diff --git a/src/resources/durable-objects/durable-objects.ts b/src/resources/durable-objects/durable-objects.ts index 0fb700ec65..c2a022bafa 100644 --- a/src/resources/durable-objects/durable-objects.ts +++ b/src/resources/durable-objects/durable-objects.ts @@ -2,20 +2,25 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; -import { Namespace, NamespaceListParams, Namespaces, NamespacesSinglePage } from './namespaces/namespaces'; +import { + Namespace, + NamespaceListParams, + Namespaces, + NamespacesV4PagePaginationArray, +} from './namespaces/namespaces'; export class DurableObjects extends APIResource { namespaces: NamespacesAPI.Namespaces = new NamespacesAPI.Namespaces(this._client); } DurableObjects.Namespaces = Namespaces; -DurableObjects.NamespacesSinglePage = NamespacesSinglePage; +DurableObjects.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace DurableObjects { export { Namespaces as Namespaces, type Namespace as Namespace, - NamespacesSinglePage as NamespacesSinglePage, + NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceListParams as NamespaceListParams, }; } diff --git a/src/resources/durable-objects/index.ts b/src/resources/durable-objects/index.ts index 9ad42425bf..5b1a5df711 100644 --- a/src/resources/durable-objects/index.ts +++ b/src/resources/durable-objects/index.ts @@ -2,7 +2,7 @@ export { DurableObjects } from './durable-objects'; export { - NamespacesSinglePage, + NamespacesV4PagePaginationArray, Namespaces, type Namespace, type NamespaceListParams, diff --git a/src/resources/durable-objects/namespaces/index.ts b/src/resources/durable-objects/namespaces/index.ts index eb373cf46d..caae6d139b 100644 --- a/src/resources/durable-objects/namespaces/index.ts +++ b/src/resources/durable-objects/namespaces/index.ts @@ -6,4 +6,9 @@ export { type DurableObject, type ObjectListParams, } from './objects'; -export { NamespacesSinglePage, Namespaces, type Namespace, type NamespaceListParams } from './namespaces'; +export { + NamespacesV4PagePaginationArray, + Namespaces, + type Namespace, + type NamespaceListParams, +} from './namespaces'; diff --git a/src/resources/durable-objects/namespaces/namespaces.ts b/src/resources/durable-objects/namespaces/namespaces.ts index 5547b0e963..8124a972ac 100644 --- a/src/resources/durable-objects/namespaces/namespaces.ts +++ b/src/resources/durable-objects/namespaces/namespaces.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ObjectsAPI from './objects'; import { DurableObject, DurableObjectsCursorLimitPagination, ObjectListParams, Objects } from './objects'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Namespaces extends APIResource { objects: ObjectsAPI.Objects = new ObjectsAPI.Objects(this._client); @@ -15,17 +15,17 @@ export class Namespaces extends APIResource { list( params: NamespaceListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; + ): Core.PagePromise { + const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/workers/durable_objects/namespaces`, - NamespacesSinglePage, - options, + NamespacesV4PagePaginationArray, + { query, ...options }, ); } } -export class NamespacesSinglePage extends SinglePage {} +export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} export interface Namespace { id?: string; @@ -39,21 +39,21 @@ export interface Namespace { use_sqlite?: boolean; } -export interface NamespaceListParams { +export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; } -Namespaces.NamespacesSinglePage = NamespacesSinglePage; +Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Objects = Objects; Namespaces.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; export declare namespace Namespaces { export { type Namespace as Namespace, - NamespacesSinglePage as NamespacesSinglePage, + NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceListParams as NamespaceListParams, }; diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index 6b8512b78a..a8c5f15acb 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -5,16 +5,15 @@ export { NamespacesV4PagePaginationArray, Namespaces, type Namespace, + type NamespaceUpdateResponse, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, - type NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse, type NamespaceCreateParams, type NamespaceUpdateParams, type NamespaceListParams, type NamespaceDeleteParams, type NamespaceBulkDeleteParams, - type NamespaceBulkGetParams, type NamespaceBulkUpdateParams, type NamespaceGetParams, } from './namespaces/index'; diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 6edb9e18af..15034b22f4 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -6,8 +6,6 @@ import { Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, - NamespaceBulkGetParams, - NamespaceBulkGetResponse, NamespaceBulkUpdateParams, NamespaceBulkUpdateResponse, NamespaceCreateParams, @@ -16,6 +14,7 @@ import { NamespaceGetParams, NamespaceListParams, NamespaceUpdateParams, + NamespaceUpdateResponse, Namespaces, NamespacesV4PagePaginationArray, } from './namespaces/namespaces'; @@ -31,9 +30,9 @@ export declare namespace KV { export { Namespaces as Namespaces, type Namespace as Namespace, + type NamespaceUpdateResponse as NamespaceUpdateResponse, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, - type NamespaceBulkGetResponse as NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse as NamespaceBulkUpdateResponse, NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceCreateParams as NamespaceCreateParams, @@ -41,7 +40,6 @@ export declare namespace KV { type NamespaceListParams as NamespaceListParams, type NamespaceDeleteParams as NamespaceDeleteParams, type NamespaceBulkDeleteParams as NamespaceBulkDeleteParams, - type NamespaceBulkGetParams as NamespaceBulkGetParams, type NamespaceBulkUpdateParams as NamespaceBulkUpdateParams, type NamespaceGetParams as NamespaceGetParams, }; diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..c275ce10ef 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -5,11 +5,9 @@ export { Keys, type Key, type KeyBulkDeleteResponse, - type KeyBulkGetResponse, type KeyBulkUpdateResponse, type KeyListParams, type KeyBulkDeleteParams, - type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; @@ -17,16 +15,15 @@ export { NamespacesV4PagePaginationArray, Namespaces, type Namespace, + type NamespaceUpdateResponse, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, - type NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse, type NamespaceCreateParams, type NamespaceUpdateParams, type NamespaceListParams, type NamespaceDeleteParams, type NamespaceBulkDeleteParams, - type NamespaceBulkGetParams, type NamespaceBulkUpdateParams, type NamespaceGetParams, } from './namespaces'; diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..3637aaf8bb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -52,27 +52,6 @@ export class Keys extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based - * values. JSON values can optionally be parsed instead of being returned as a - * string value. Metadata can be included if `withMetadata` is true. - * - * @deprecated Please use kv.namespaces.bulk_get instead - */ - bulkGet( - namespaceId: string, - params: KeyBulkGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, { - body, - ...options, - }) as Core.APIPromise<{ result: KeyBulkGetResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Write multiple keys and values at once. Body should be an array of up to 10,000 * key-value pairs to be stored, along with optional expiration information. @@ -117,12 +96,15 @@ export interface Key { */ expiration?: number; - metadata?: unknown; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: { [key: string]: unknown }; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -132,43 +114,9 @@ export interface KeyBulkDeleteResponse { unsuccessful_keys?: Array; } -export type KeyBulkGetResponse = - | KeyBulkGetResponse.WorkersKVBulkGetResult - | KeyBulkGetResponse.WorkersKVBulkGetResultWithMetadata; - -export namespace KeyBulkGetResponse { - export interface WorkersKVBulkGetResult { - /** - * Requested keys are paired with their values in an object. - */ - values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; - } - - export interface WorkersKVBulkGetResultWithMetadata { - /** - * Requested keys are paired with their values and metadata in an object. - */ - values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; - } - - export namespace WorkersKVBulkGetResultWithMetadata { - export interface Values { - metadata: unknown; - - value: unknown; - - /** - * Expires the key at a certain time, measured in number of seconds since the UNIX - * epoch. - */ - expiration?: number; - } - } -} - export interface KeyBulkUpdateResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -180,20 +128,20 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorLimitPaginationParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; /** - * Query param: Filters returned keys by a name prefix. Exact matches and any key - * names that begin with the prefix will be returned. + * Query param: A string prefix used to filter down which keys will be returned. + * Exact matches and any key names that begin with the prefix will be returned. */ prefix?: string; } export interface KeyBulkDeleteParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -203,31 +151,9 @@ export interface KeyBulkDeleteParams { body: Array; } -export interface KeyBulkGetParams { - /** - * Path param: Identifier. - */ - account_id: string; - - /** - * Body param: Array of keys to retrieve (maximum of 100). - */ - keys: Array; - - /** - * Body param: Whether to parse JSON values in the response. - */ - type?: 'text' | 'json'; - - /** - * Body param: Whether to include metadata in the response. - */ - withMetadata?: boolean; -} - export interface KeyBulkUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -240,35 +166,39 @@ export interface KeyBulkUpdateParams { export namespace KeyBulkUpdateParams { export interface Body { /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Whether or not the server should base64 decode the value before storing it. + * Useful for writing values that wouldn't otherwise be valid JSON strings, such as + * images. */ - key: string; + base64?: boolean; /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. + * The time, measured in number of seconds since the UNIX epoch, at which the key + * should expire. */ - value: string; + expiration?: number; /** - * Indicates whether or not the server should base64 decode the value before - * storing it. Useful for writing values that wouldn't otherwise be valid JSON - * strings, such as images. + * The number of seconds for which the key should be visible before it expires. At + * least 60. */ - base64?: boolean; + expiration_ttl?: number; /** - * Expires the key at a certain time, measured in number of seconds since the UNIX - * epoch. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - expiration?: number; + key?: string; /** - * Expires the key after a number of seconds. Must be at least 60. + * Arbitrary JSON that is associated with a key. */ - expiration_ttl?: number; + metadata?: { [key: string]: unknown }; - metadata?: unknown; + /** + * A UTF-8 encoded string to be stored, up to 25 MiB in length. + */ + value?: string; } } @@ -278,12 +208,10 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 53db763063..5e16f872e9 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,11 +34,14 @@ export class Metadata extends APIResource { } } -export type MetadataGetResponse = unknown; +/** + * Arbitrary JSON that is associated with a key. + */ +export type MetadataGetResponse = { [key: string]: unknown }; export interface MetadataGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..93777b6e79 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -7,8 +7,6 @@ import { Key, KeyBulkDeleteParams, KeyBulkDeleteResponse, - KeyBulkGetParams, - KeyBulkGetResponse, KeyBulkUpdateParams, KeyBulkUpdateResponse, KeyListParams, @@ -24,7 +22,7 @@ import { ValueGetParams, ValueUpdateParams, ValueUpdateResponse, - Values as ValuesAPIValues, + Values, } from './values'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; @@ -74,13 +72,13 @@ export class Namespaces extends APIResource { namespaceId: string, params: NamespaceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}`, { body, ...options, - }) as Core.APIPromise<{ result: Namespace }> + }) as Core.APIPromise<{ result: NamespaceUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -163,36 +161,6 @@ export class Namespaces extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based - * values. JSON values can optionally be parsed instead of being returned as a - * string value. Metadata can be included if `withMetadata` is true. - * - * @example - * ```ts - * const response = await client.kv.namespaces.bulkGet( - * '0f2ac74b498b48028cb68387c421e279', - * { - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * keys: ['My-Key'], - * }, - * ); - * ``` - */ - bulkGet( - namespaceId: string, - params: NamespaceBulkGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, { - body, - ...options, - }) as Core.APIPromise<{ result: NamespaceBulkGetResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - /** * Write multiple keys and values at once. Body should be an array of up to 10,000 * key-value pairs to be stored, along with optional expiration information. @@ -207,7 +175,7 @@ export class Namespaces extends APIResource { * '0f2ac74b498b48028cb68387c421e279', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: [{ key: 'My-Key', value: 'Some string' }], + * body: [{}], * }, * ); * ``` @@ -265,11 +233,6 @@ export interface Namespace { */ title: string; - /** - * True if new beta namespace, with additional preview features. - */ - beta?: boolean; - /** * True if keys written on the URL will be URL-decoded before storing. For example, * if set to "true", a key written on the URL as "%3F" will be stored as "?". @@ -277,11 +240,13 @@ export interface Namespace { supports_url_encoding?: boolean; } +export interface NamespaceUpdateResponse {} + export interface NamespaceDeleteResponse {} export interface NamespaceBulkDeleteResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -291,43 +256,9 @@ export interface NamespaceBulkDeleteResponse { unsuccessful_keys?: Array; } -export type NamespaceBulkGetResponse = - | NamespaceBulkGetResponse.WorkersKVBulkGetResult - | NamespaceBulkGetResponse.WorkersKVBulkGetResultWithMetadata; - -export namespace NamespaceBulkGetResponse { - export interface WorkersKVBulkGetResult { - /** - * Requested keys are paired with their values in an object. - */ - values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; - } - - export interface WorkersKVBulkGetResultWithMetadata { - /** - * Requested keys are paired with their values and metadata in an object. - */ - values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; - } - - export namespace WorkersKVBulkGetResultWithMetadata { - export interface Values { - metadata: unknown; - - value: unknown; - - /** - * Expires the key at a certain time, measured in number of seconds since the UNIX - * epoch. - */ - expiration?: number; - } - } -} - export interface NamespaceBulkUpdateResponse { /** - * Number of keys successfully updated. + * Number of keys successfully updated */ successful_key_count?: number; @@ -339,7 +270,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -351,7 +282,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -363,7 +294,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -380,14 +311,14 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { export interface NamespaceDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface NamespaceBulkDeleteParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -397,31 +328,9 @@ export interface NamespaceBulkDeleteParams { body: Array; } -export interface NamespaceBulkGetParams { - /** - * Path param: Identifier. - */ - account_id: string; - - /** - * Body param: Array of keys to retrieve (maximum of 100). - */ - keys: Array; - - /** - * Body param: Whether to parse JSON values in the response. - */ - type?: 'text' | 'json'; - - /** - * Body param: Whether to include metadata in the response. - */ - withMetadata?: boolean; -} - export interface NamespaceBulkUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -434,41 +343,45 @@ export interface NamespaceBulkUpdateParams { export namespace NamespaceBulkUpdateParams { export interface Body { /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Whether or not the server should base64 decode the value before storing it. + * Useful for writing values that wouldn't otherwise be valid JSON strings, such as + * images. */ - key: string; + base64?: boolean; /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. + * The time, measured in number of seconds since the UNIX epoch, at which the key + * should expire. */ - value: string; + expiration?: number; /** - * Indicates whether or not the server should base64 decode the value before - * storing it. Useful for writing values that wouldn't otherwise be valid JSON - * strings, such as images. + * The number of seconds for which the key should be visible before it expires. At + * least 60. */ - base64?: boolean; + expiration_ttl?: number; /** - * Expires the key at a certain time, measured in number of seconds since the UNIX - * epoch. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - expiration?: number; + key?: string; /** - * Expires the key after a number of seconds. Must be at least 60. + * Arbitrary JSON that is associated with a key. */ - expiration_ttl?: number; + metadata?: { [key: string]: unknown }; - metadata?: unknown; + /** + * A UTF-8 encoded string to be stored, up to 25 MiB in length. + */ + value?: string; } } export interface NamespaceGetParams { /** - * Identifier. + * Identifier */ account_id: string; } @@ -477,14 +390,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorLimitPagination = KeysCursorLimitPagination; Namespaces.Metadata = Metadata; -Namespaces.Values = ValuesAPIValues; +Namespaces.Values = Values; export declare namespace Namespaces { export { type Namespace as Namespace, + type NamespaceUpdateResponse as NamespaceUpdateResponse, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, - type NamespaceBulkGetResponse as NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse as NamespaceBulkUpdateResponse, NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceCreateParams as NamespaceCreateParams, @@ -492,7 +405,6 @@ export declare namespace Namespaces { type NamespaceListParams as NamespaceListParams, type NamespaceDeleteParams as NamespaceDeleteParams, type NamespaceBulkDeleteParams as NamespaceBulkDeleteParams, - type NamespaceBulkGetParams as NamespaceBulkGetParams, type NamespaceBulkUpdateParams as NamespaceBulkUpdateParams, type NamespaceGetParams as NamespaceGetParams, }; @@ -501,12 +413,10 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, - type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, - type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -517,7 +427,7 @@ export declare namespace Namespaces { }; export { - ValuesAPIValues as Values, + Values as Values, type ValueUpdateResponse as ValueUpdateResponse, type ValueDeleteResponse as ValueDeleteResponse, type ValueUpdateParams as ValueUpdateParams, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 03752a92d4..a240802fea 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -22,6 +22,7 @@ export class Values extends APIResource { * 'My-Key', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * metadata: '{"someMetadataKey": "someMetadataValue"}', * value: 'Some Value', * }, * ); @@ -37,7 +38,12 @@ export class Values extends APIResource { return ( this._client.put( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, ...options }), + Core.maybeMultipartFormRequestOptions({ + query: { expiration, expiration_ttl }, + body, + ...options, + headers: { 'Content-Type': '*/*', ...options?.headers }, + }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -113,42 +119,43 @@ export interface ValueDeleteResponse {} export interface ValueUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; + /** + * Body param: Arbitrary JSON to be associated with a key/value pair. + */ + metadata: string; + /** * Body param: A byte sequence to be stored, up to 25 MiB in length. */ value: string; /** - * Query param: Expires the key at a certain time, measured in number of seconds - * since the UNIX epoch. + * Query param: The time, measured in number of seconds since the UNIX epoch, at + * which the key should expire. */ expiration?: number; /** - * Query param: Expires the key after a number of seconds. Must be at least 60. + * Query param: The number of seconds for which the key should be visible before it + * expires. At least 60. */ expiration_ttl?: number; - - /** - * Body param: - */ - metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface ValueGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/logs/control/cmb/cmb.ts b/src/resources/logs/control/cmb/cmb.ts index 281cbbf509..d272ff9745 100644 --- a/src/resources/logs/control/cmb/cmb.ts +++ b/src/resources/logs/control/cmb/cmb.ts @@ -2,14 +2,7 @@ import { APIResource } from '../../../../resource'; import * as ConfigAPI from './config'; -import { - CmbConfig, - Config, - ConfigCreateParams, - ConfigDeleteParams, - ConfigDeleteResponse, - ConfigGetParams, -} from './config'; +import { Config } from './config'; export class Cmb extends APIResource { config: ConfigAPI.Config = new ConfigAPI.Config(this._client); @@ -18,12 +11,5 @@ export class Cmb extends APIResource { Cmb.Config = Config; export declare namespace Cmb { - export { - Config as Config, - type CmbConfig as CmbConfig, - type ConfigDeleteResponse as ConfigDeleteResponse, - type ConfigCreateParams as ConfigCreateParams, - type ConfigDeleteParams as ConfigDeleteParams, - type ConfigGetParams as ConfigGetParams, - }; + export { Config as Config }; } diff --git a/src/resources/logs/control/cmb/config.ts b/src/resources/logs/control/cmb/config.ts index 63af7fdb83..98c038ce8c 100644 --- a/src/resources/logs/control/cmb/config.ts +++ b/src/resources/logs/control/cmb/config.ts @@ -1,123 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import * as Core from '../../../../core'; -export class Config extends APIResource { - /** - * Updates CMB config. - * - * @example - * ```ts - * const cmbConfig = - * await client.logs.control.cmb.config.create({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/logs/control/cmb/config`, { - body, - ...options, - }) as Core.APIPromise<{ result: CmbConfig | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Deletes CMB config. - * - * @example - * ```ts - * const config = await client.logs.control.cmb.config.delete({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - delete( - params: ConfigDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete(`/accounts/${account_id}/logs/control/cmb/config`, options) as Core.APIPromise<{ - result: ConfigDeleteResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Gets CMB config. - * - * @example - * ```ts - * const cmbConfig = await client.logs.control.cmb.config.get({ - * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/logs/control/cmb/config`, options) as Core.APIPromise<{ - result: CmbConfig | null; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CmbConfig { - /** - * Allow out of region access - */ - allow_out_of_region_access?: boolean; - - /** - * Name of the region. - */ - regions?: string; -} - -export type ConfigDeleteResponse = unknown; - -export interface ConfigCreateParams { - /** - * Path param: Identifier. - */ - account_id: string; - - /** - * Body param: Allow out of region access - */ - allow_out_of_region_access?: boolean; - - /** - * Body param: Name of the region. - */ - regions?: string; -} - -export interface ConfigDeleteParams { - /** - * Identifier. - */ - account_id: string; -} - -export interface ConfigGetParams { - /** - * Identifier. - */ - account_id: string; -} - -export declare namespace Config { - export { - type CmbConfig as CmbConfig, - type ConfigDeleteResponse as ConfigDeleteResponse, - type ConfigCreateParams as ConfigCreateParams, - type ConfigDeleteParams as ConfigDeleteParams, - type ConfigGetParams as ConfigGetParams, - }; -} +export class Config extends APIResource {} diff --git a/src/resources/logs/control/cmb/index.ts b/src/resources/logs/control/cmb/index.ts index 0d9ca574cc..c65febf631 100644 --- a/src/resources/logs/control/cmb/index.ts +++ b/src/resources/logs/control/cmb/index.ts @@ -1,11 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Cmb } from './cmb'; -export { - Config, - type CmbConfig, - type ConfigDeleteResponse, - type ConfigCreateParams, - type ConfigDeleteParams, - type ConfigGetParams, -} from './config'; +export { Config } from './config'; diff --git a/src/resources/logs/control/control.ts b/src/resources/logs/control/control.ts index 8c4fdeea5c..da86c60aed 100644 --- a/src/resources/logs/control/control.ts +++ b/src/resources/logs/control/control.ts @@ -2,13 +2,7 @@ import { APIResource } from '../../../resource'; import * as RetentionAPI from './retention'; -import { - Retention, - RetentionCreateParams, - RetentionCreateResponse, - RetentionGetParams, - RetentionGetResponse, -} from './retention'; +import { Retention } from './retention'; import * as CmbAPI from './cmb/cmb'; import { Cmb } from './cmb/cmb'; @@ -21,13 +15,7 @@ Control.Retention = Retention; Control.Cmb = Cmb; export declare namespace Control { - export { - Retention as Retention, - type RetentionCreateResponse as RetentionCreateResponse, - type RetentionGetResponse as RetentionGetResponse, - type RetentionCreateParams as RetentionCreateParams, - type RetentionGetParams as RetentionGetParams, - }; + export { Retention as Retention }; export { Cmb as Cmb }; } diff --git a/src/resources/logs/control/index.ts b/src/resources/logs/control/index.ts index 700f3ebeda..7b4f398e46 100644 --- a/src/resources/logs/control/index.ts +++ b/src/resources/logs/control/index.ts @@ -2,10 +2,4 @@ export { Cmb } from './cmb/index'; export { Control } from './control'; -export { - Retention, - type RetentionCreateResponse, - type RetentionGetResponse, - type RetentionCreateParams, - type RetentionGetParams, -} from './retention'; +export { Retention } from './retention'; diff --git a/src/resources/logs/control/retention.ts b/src/resources/logs/control/retention.ts index c25faf78af..9e00c15d66 100644 --- a/src/resources/logs/control/retention.ts +++ b/src/resources/logs/control/retention.ts @@ -1,94 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Retention extends APIResource { - /** - * Updates log retention flag for Logpull API. - * - * @example - * ```ts - * const retention = - * await client.logs.control.retention.create({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - create( - params: RetentionCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...body } = params; - return ( - this._client.post(`/zones/${zone_id}/logs/control/retention/flag`, { - body, - ...options, - }) as Core.APIPromise<{ result: RetentionCreateResponse | null }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Gets log retention flag for Logpull API. - * - * @example - * ```ts - * const retention = await client.logs.control.retention.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get( - params: RetentionGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id } = params; - return ( - this._client.get(`/zones/${zone_id}/logs/control/retention/flag`, options) as Core.APIPromise<{ - result: RetentionGetResponse | null; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface RetentionCreateResponse { - /** - * The log retention flag for Logpull API. - */ - flag?: boolean; -} - -export interface RetentionGetResponse { - /** - * The log retention flag for Logpull API. - */ - flag?: boolean; -} - -export interface RetentionCreateParams { - /** - * Path param: Identifier. - */ - zone_id: string; - - /** - * Body param: The log retention flag for Logpull API. - */ - flag?: boolean; -} - -export interface RetentionGetParams { - /** - * Identifier. - */ - zone_id: string; -} - -export declare namespace Retention { - export { - type RetentionCreateResponse as RetentionCreateResponse, - type RetentionGetResponse as RetentionGetResponse, - type RetentionCreateParams as RetentionCreateParams, - type RetentionGetParams as RetentionGetParams, - }; -} +export class Retention extends APIResource {} diff --git a/src/resources/logs/index.ts b/src/resources/logs/index.ts index edef47a1eb..75ecc8c68f 100644 --- a/src/resources/logs/index.ts +++ b/src/resources/logs/index.ts @@ -2,5 +2,5 @@ export { Control } from './control/index'; export { Logs } from './logs'; -export { RayID, type RayIDGetResponse, type RayIDGetParams } from './rayid'; -export { Received, type ReceivedGetResponse, type ReceivedGetParams } from './received/index'; +export { RayID } from './rayid'; +export { Received } from './received/index'; diff --git a/src/resources/logs/logs.ts b/src/resources/logs/logs.ts index 8bc3fd5875..f1245aa7aa 100644 --- a/src/resources/logs/logs.ts +++ b/src/resources/logs/logs.ts @@ -2,11 +2,11 @@ import { APIResource } from '../../resource'; import * as RayIDAPI from './rayid'; -import { RayID, RayIDGetParams, RayIDGetResponse } from './rayid'; +import { RayID } from './rayid'; import * as ControlAPI from './control/control'; import { Control } from './control/control'; import * as ReceivedAPI from './received/received'; -import { Received, ReceivedGetParams, ReceivedGetResponse } from './received/received'; +import { Received } from './received/received'; export class Logs extends APIResource { control: ControlAPI.Control = new ControlAPI.Control(this._client); @@ -21,11 +21,7 @@ Logs.Received = Received; export declare namespace Logs { export { Control as Control }; - export { RayID as RayID, type RayIDGetResponse as RayIDGetResponse, type RayIDGetParams as RayIDGetParams }; + export { RayID as RayID }; - export { - Received as Received, - type ReceivedGetResponse as ReceivedGetResponse, - type ReceivedGetParams as ReceivedGetParams, - }; + export { Received as Received }; } diff --git a/src/resources/logs/rayid.ts b/src/resources/logs/rayid.ts index d93b9baf8c..11b29ce4b0 100644 --- a/src/resources/logs/rayid.ts +++ b/src/resources/logs/rayid.ts @@ -1,64 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as Core from '../../core'; -export class RayID extends APIResource { - /** - * The `/rayids` api route allows lookups by specific rayid. The rayids route will - * return zero, one, or more records (ray ids are not unique). - * - * @example - * ```ts - * const RayID = await client.logs.RayID.get( - * '41ddf1740f67442d', - * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - get( - RayID: string, - params: RayIDGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { zone_id, ...query } = params; - return this._client.get(`/zones/${zone_id}/logs/rayids/${RayID}`, { query, ...options }); - } -} - -export type RayIDGetResponse = string | unknown; - -export interface RayIDGetParams { - /** - * Path param: Identifier - */ - zone_id: string; - - /** - * Query param: The `/received` route by default returns a limited set of fields, - * and allows customers to override the default field set by specifying individual - * fields. The reasons for this are: 1. Most customers require only a small subset - * of fields, but that subset varies from customer to customer; 2. Flat schema is - * much easier to work with downstream (importing into BigTable etc); 3. - * Performance (time to process, file size). If `?fields=` is not specified, - * default field set is returned. This default field set may change at any time. - * When `?fields=` is provided, each record is returned with the specified fields. - * `fields` must be specified as a comma separated list without any whitespaces, - * and all fields must exist. The order in which fields are specified does not - * matter, and the order of fields in the response is not specified. - */ - fields?: string; - - /** - * Query param: By default, timestamps in responses are returned as Unix nanosecond - * integers. The `?timestamps=` argument can be set to change the format in which - * response timestamps are returned. Possible values are: `unix`, `unixnano`, - * `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; - * `rfc3339` returns timestamps as strings. - */ - timestamps?: 'unix' | 'unixnano' | 'rfc3339'; -} - -export declare namespace RayID { - export { type RayIDGetResponse as RayIDGetResponse, type RayIDGetParams as RayIDGetParams }; -} +export class RayID extends APIResource {} diff --git a/src/resources/logs/received/fields.ts b/src/resources/logs/received/fields.ts index d84198e6ee..9bd4c53066 100644 --- a/src/resources/logs/received/fields.ts +++ b/src/resources/logs/received/fields.ts @@ -1,37 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Fields extends APIResource { - /** - * Lists all fields available. The response is json object with key-value pairs, - * where keys are field names, and values are descriptions. - * - * @example - * ```ts - * const field = await client.logs.received.fields.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * }); - * ``` - */ - get(params: FieldGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id } = params; - return this._client.get(`/zones/${zone_id}/logs/received/fields`, options); - } -} - -export interface FieldGetResponse { - key?: string; -} - -export interface FieldGetParams { - /** - * Identifier - */ - zone_id: string; -} - -export declare namespace Fields { - export { type FieldGetResponse as FieldGetResponse, type FieldGetParams as FieldGetParams }; -} +export class Fields extends APIResource {} diff --git a/src/resources/logs/received/index.ts b/src/resources/logs/received/index.ts index 872f107c23..b39faedbf8 100644 --- a/src/resources/logs/received/index.ts +++ b/src/resources/logs/received/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Fields, type FieldGetResponse, type FieldGetParams } from './fields'; -export { Received, type ReceivedGetResponse, type ReceivedGetParams } from './received'; +export { Fields } from './fields'; +export { Received } from './received'; diff --git a/src/resources/logs/received/received.ts b/src/resources/logs/received/received.ts index fffcbe7c04..2d2550f8c9 100644 --- a/src/resources/logs/received/received.ts +++ b/src/resources/logs/received/received.ts @@ -1,115 +1,15 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; import * as FieldsAPI from './fields'; -import { FieldGetParams, FieldGetResponse, Fields } from './fields'; +import { Fields } from './fields'; export class Received extends APIResource { fields: FieldsAPI.Fields = new FieldsAPI.Fields(this._client); - - /** - * The `/received` api route allows customers to retrieve their edge HTTP logs. The - * basic access pattern is "give me all the logs for zone Z for minute M", where - * the minute M refers to the time records were received at Cloudflare's central - * data center. `start` is inclusive, and `end` is exclusive. Because of that, to - * get all data, at minutely cadence, starting at 10AM, the proper values are: - * `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then - * `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap - * will be handled properly. - * - * @example - * ```ts - * const received = await client.logs.received.get({ - * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - * end: '2018-05-20T10:01:00Z', - * }); - * ``` - */ - get(params: ReceivedGetParams, options?: Core.RequestOptions): Core.APIPromise { - const { zone_id, ...query } = params; - return this._client.get(`/zones/${zone_id}/logs/received`, { query, ...options }); - } -} - -export type ReceivedGetResponse = string | unknown; - -export interface ReceivedGetParams { - /** - * Path param: Identifier - */ - zone_id: string; - - /** - * Query param: Sets the (exclusive) end of the requested time frame. This can be a - * unix timestamp (in seconds or nanoseconds), or an absolute timestamp that - * conforms to RFC 3339. `end` must be at least five minutes earlier than now and - * must be later than `start`. Difference between `start` and `end` must be not - * greater than one hour. - */ - end: string | number; - - /** - * Query param: When `?count=` is provided, the response will contain up to `count` - * results. Since results are not sorted, you are likely to get different data for - * repeated requests. `count` must be an integer > 0. - */ - count?: number; - - /** - * Query param: The `/received` route by default returns a limited set of fields, - * and allows customers to override the default field set by specifying individual - * fields. The reasons for this are: 1. Most customers require only a small subset - * of fields, but that subset varies from customer to customer; 2. Flat schema is - * much easier to work with downstream (importing into BigTable etc); 3. - * Performance (time to process, file size). If `?fields=` is not specified, - * default field set is returned. This default field set may change at any time. - * When `?fields=` is provided, each record is returned with the specified fields. - * `fields` must be specified as a comma separated list without any whitespaces, - * and all fields must exist. The order in which fields are specified does not - * matter, and the order of fields in the response is not specified. - */ - fields?: string; - - /** - * Query param: When `?sample=` is provided, a sample of matching records is - * returned. If `sample=0.1` then 10% of records will be returned. Sampling is - * random: repeated calls will not only return different records, but likely will - * also vary slightly in number of returned records. When `?count=` is also - * specified, `count` is applied to the number of returned records, not the sampled - * records. So, with `sample=0.05` and `count=7`, when there is a total of 100 - * records available, approximately five will be returned. When there are 1000 - * records, seven will be returned. When there are 10,000 records, seven will be - * returned. - */ - sample?: number; - - /** - * Query param: Sets the (inclusive) beginning of the requested time frame. This - * can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp - * that conforms to RFC 3339. At this point in time, it cannot exceed a time in the - * past greater than seven days. - */ - start?: string | number; - - /** - * Query param: By default, timestamps in responses are returned as Unix nanosecond - * integers. The `?timestamps=` argument can be set to change the format in which - * response timestamps are returned. Possible values are: `unix`, `unixnano`, - * `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; - * `rfc3339` returns timestamps as strings. - */ - timestamps?: 'unix' | 'unixnano' | 'rfc3339'; } Received.Fields = Fields; export declare namespace Received { - export { type ReceivedGetResponse as ReceivedGetResponse, type ReceivedGetParams as ReceivedGetParams }; - - export { - Fields as Fields, - type FieldGetResponse as FieldGetResponse, - type FieldGetParams as FieldGetParams, - }; + export { Fields as Fields }; } diff --git a/src/resources/magic-transit/pcaps/download.ts b/src/resources/magic-transit/pcaps/download.ts index 9413fdcad8..46a0a7ee84 100644 --- a/src/resources/magic-transit/pcaps/download.ts +++ b/src/resources/magic-transit/pcaps/download.ts @@ -32,7 +32,7 @@ export class Download extends APIResource { export interface DownloadGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/magic-transit/pcaps/ownership.ts b/src/resources/magic-transit/pcaps/ownership.ts index b9daa44fee..93602154ba 100644 --- a/src/resources/magic-transit/pcaps/ownership.ts +++ b/src/resources/magic-transit/pcaps/ownership.ts @@ -131,7 +131,7 @@ export interface Ownership { export interface OwnershipCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -144,21 +144,21 @@ export interface OwnershipCreateParams { export interface OwnershipDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface OwnershipGetParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface OwnershipValidateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/magic-transit/pcaps/pcaps.ts b/src/resources/magic-transit/pcaps/pcaps.ts index b1ec94cd7d..fca2bf5d2c 100644 --- a/src/resources/magic-transit/pcaps/pcaps.ts +++ b/src/resources/magic-transit/pcaps/pcaps.ts @@ -90,7 +90,7 @@ export class PCAPs extends APIResource { } /** - * Stop full PCAP + * Stop full PCAP. * * @example * ```ts @@ -485,7 +485,7 @@ export type PCAPCreateParams = export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestSimple { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -526,7 +526,7 @@ export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestFull { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -580,21 +580,21 @@ export declare namespace PCAPCreateParams { export interface PCAPListParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface PCAPGetParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface PCAPStopParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index 4606015396..29bbe25988 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -11,15 +11,12 @@ export { type ConsumerGetParams, } from './consumers'; export { + MessagePullResponsesSinglePage, Messages, type MessageAckResponse, - type MessageBulkPushResponse, type MessagePullResponse, - type MessagePushResponse, type MessageAckParams, - type MessageBulkPushParams, type MessagePullParams, - type MessagePushParams, } from './messages'; export { Purge, type PurgeStatusResponse, type PurgeStartParams, type PurgeStatusParams } from './purge'; export { Queues } from './queues'; diff --git a/src/resources/queues/messages.ts b/src/resources/queues/messages.ts index 3557b14318..eb406d134e 100644 --- a/src/resources/queues/messages.ts +++ b/src/resources/queues/messages.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; +import { SinglePage } from '../../pagination'; export class Messages extends APIResource { /** @@ -30,75 +30,36 @@ export class Messages extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Push a batch of message to a Queue - * - * @example - * ```ts - * const response = await client.queues.messages.bulkPush( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - bulkPush( - queueId: string, - params: MessageBulkPushParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/batch`, { - body, - ...options, - }); - } - /** * Pull a batch of messages from a Queue * * @example * ```ts - * const response = await client.queues.messages.pull( + * // Automatically fetches more pages as needed. + * for await (const messagePullResponse of client.queues.messages.pull( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ pull( queueId: string, params: MessagePullParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/pull`, { - body, - ...options, - }) as Core.APIPromise<{ result: MessagePullResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Push a message to a Queue - * - * @example - * ```ts - * const response = await client.queues.messages.push( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); - * ``` - */ - push( - queueId: string, - params: MessagePushParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages`, { body, ...options }); + return this._client.getAPIList( + `/accounts/${account_id}/queues/${queueId}/messages/pull`, + MessagePullResponsesSinglePage, + { body, method: 'post', ...options }, + ); } } +export class MessagePullResponsesSinglePage extends SinglePage {} + export interface MessageAckResponse { /** * The number of messages that were succesfully acknowledged. @@ -113,55 +74,22 @@ export interface MessageAckResponse { warnings?: Array; } -export interface MessageBulkPushResponse { - errors?: Array; +export interface MessagePullResponse { + id?: string; - messages?: Array; + attempts?: number; - /** - * Indicates if the API call was successful or not. - */ - success?: true; -} + body?: string; -export interface MessagePullResponse { /** - * The number of unacknowledged messages in the queue + * An ID that represents an "in-flight" message that has been pulled from a Queue. + * You must hold on to this ID and use it to acknowledge this message. */ - message_backlog_count?: number; - - messages?: Array; -} - -export namespace MessagePullResponse { - export interface Message { - id?: string; - - attempts?: number; + lease_id?: string; - body?: string; + metadata?: unknown; - /** - * An ID that represents an "in-flight" message that has been pulled from a Queue. - * You must hold on to this ID and use it to acknowledge this message. - */ - lease_id?: string; - - metadata?: unknown; - - timestamp_ms?: number; - } -} - -export interface MessagePushResponse { - errors?: Array; - - messages?: Array; - - /** - * Indicates if the API call was successful or not. - */ - success?: true; + timestamp_ms?: number; } export interface MessageAckParams { @@ -205,50 +133,6 @@ export namespace MessageAckParams { } } -export interface MessageBulkPushParams { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: The number of seconds to wait for attempting to deliver this batch - * to consumers - */ - delay_seconds?: number; - - /** - * Body param: - */ - messages?: Array; -} - -export namespace MessageBulkPushParams { - export interface MqQueueMessageText { - body?: string; - - content_type?: 'text'; - - /** - * The number of seconds to wait for attempting to deliver this message to - * consumers - */ - delay_seconds?: number; - } - - export interface MqQueueMessageJson { - body?: unknown; - - content_type?: 'json'; - - /** - * The number of seconds to wait for attempting to deliver this message to - * consumers - */ - delay_seconds?: number; - } -} - export interface MessagePullParams { /** * Path param: A Resource identifier. @@ -267,65 +151,14 @@ export interface MessagePullParams { visibility_timeout_ms?: number; } -export type MessagePushParams = MessagePushParams.MqQueueMessageText | MessagePushParams.MqQueueMessageJson; - -export declare namespace MessagePushParams { - export interface MqQueueMessageText { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: - */ - body?: string; - - /** - * Body param: - */ - content_type?: 'text'; - - /** - * Body param: The number of seconds to wait for attempting to deliver this message - * to consumers - */ - delay_seconds?: number; - } - - export interface MqQueueMessageJson { - /** - * Path param: A Resource identifier. - */ - account_id: string; - - /** - * Body param: - */ - body?: unknown; - - /** - * Body param: - */ - content_type?: 'json'; - - /** - * Body param: The number of seconds to wait for attempting to deliver this message - * to consumers - */ - delay_seconds?: number; - } -} +Messages.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; export declare namespace Messages { export { type MessageAckResponse as MessageAckResponse, - type MessageBulkPushResponse as MessageBulkPushResponse, type MessagePullResponse as MessagePullResponse, - type MessagePushResponse as MessagePushResponse, + MessagePullResponsesSinglePage as MessagePullResponsesSinglePage, type MessageAckParams as MessageAckParams, - type MessageBulkPushParams as MessageBulkPushParams, type MessagePullParams as MessagePullParams, - type MessagePushParams as MessagePushParams, }; } diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index 240e61d273..b81ab51ef8 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -18,12 +18,9 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, - MessageBulkPushParams, - MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePushParams, - MessagePushResponse, + MessagePullResponsesSinglePage, Messages, } from './messages'; import * as PurgeAPI from './purge'; @@ -330,6 +327,7 @@ Queues.QueuesSinglePage = QueuesSinglePage; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Messages = Messages; +Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; export declare namespace Queues { @@ -359,13 +357,10 @@ export declare namespace Queues { export { Messages as Messages, type MessageAckResponse as MessageAckResponse, - type MessageBulkPushResponse as MessageBulkPushResponse, type MessagePullResponse as MessagePullResponse, - type MessagePushResponse as MessagePushResponse, + MessagePullResponsesSinglePage as MessagePullResponsesSinglePage, type MessageAckParams as MessageAckParams, - type MessageBulkPushParams as MessageBulkPushParams, type MessagePullParams as MessagePullParams, - type MessagePushParams as MessagePushParams, }; export { diff --git a/src/resources/r2/buckets/domains/custom.ts b/src/resources/r2/buckets/domains/custom.ts index 76dbcea299..791c3fe9d4 100644 --- a/src/resources/r2/buckets/domains/custom.ts +++ b/src/resources/r2/buckets/domains/custom.ts @@ -182,6 +182,12 @@ export interface CustomCreateResponse { */ enabled: boolean; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -195,6 +201,12 @@ export interface CustomUpdateResponse { */ domain: string; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Whether this bucket is publicly accessible at the specified custom domain. */ @@ -225,6 +237,12 @@ export namespace CustomListResponse { status: Domain.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -277,6 +295,12 @@ export interface CustomGetResponse { status: CustomGetResponse.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -330,6 +354,12 @@ export interface CustomCreateParams { */ zoneId: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Minimum TLS Version the custom domain will accept for incoming * connections. If not set, defaults to 1.0. @@ -349,6 +379,12 @@ export interface CustomUpdateParams { */ account_id: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Whether to enable public bucket access at the specified custom * domain. diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 375d8ee6e9..3f5b99c978 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -109,7 +109,7 @@ export interface TraceCreateResponse { export interface TraceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/ssl/certificate-packs/certificate-packs.ts b/src/resources/ssl/certificate-packs/certificate-packs.ts index 8ce7a97e6b..9ec84ff8a9 100644 --- a/src/resources/ssl/certificate-packs/certificate-packs.ts +++ b/src/resources/ssl/certificate-packs/certificate-packs.ts @@ -227,19 +227,82 @@ export interface CertificatePackCreateResponse { /** * Type of certificate pack. */ - type?: 'advanced'; + type?: + | 'mh_custom' + | 'managed_hostname' + | 'sni_custom' + | 'universal' + | 'advanced' + | 'total_tls' + | 'keyless' + | 'legacy_custom'; + + /** + * Domain validation errors that have been received by the certificate authority + * (CA). + */ + validation_errors?: Array; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; + /** + * Certificates' validation records. Only present when certificate pack is in + * "pending_validation" status + */ + validation_records?: Array; + /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } +export namespace CertificatePackCreateResponse { + export interface ValidationError { + /** + * A domain validation error. + */ + message?: string; + } + + /** + * Certificate's required validation record. + */ + export interface ValidationRecord { + /** + * The set of email addresses that the certificate authority (CA) will use to + * complete domain validation. + */ + emails?: Array; + + /** + * The content that the certificate authority (CA) will expect to find at the + * http_url during the domain validation. + */ + http_body?: string; + + /** + * The url that will be checked during domain validation. + */ + http_url?: string; + + /** + * The hostname that the certificate authority (CA) will check for a TXT record + * during domain validation . + */ + txt_name?: string; + + /** + * The TXT record that the certificate authority (CA) will check during domain + * validation. + */ + txt_value?: string; + } +} + export type CertificatePackListResponse = unknown; export interface CertificatePackDeleteResponse { @@ -282,19 +345,82 @@ export interface CertificatePackEditResponse { /** * Type of certificate pack. */ - type?: 'advanced'; + type?: + | 'mh_custom' + | 'managed_hostname' + | 'sni_custom' + | 'universal' + | 'advanced' + | 'total_tls' + | 'keyless' + | 'legacy_custom'; + + /** + * Domain validation errors that have been received by the certificate authority + * (CA). + */ + validation_errors?: Array; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; + /** + * Certificates' validation records. Only present when certificate pack is in + * "pending_validation" status + */ + validation_records?: Array; + /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } +export namespace CertificatePackEditResponse { + export interface ValidationError { + /** + * A domain validation error. + */ + message?: string; + } + + /** + * Certificate's required validation record. + */ + export interface ValidationRecord { + /** + * The set of email addresses that the certificate authority (CA) will use to + * complete domain validation. + */ + emails?: Array; + + /** + * The content that the certificate authority (CA) will expect to find at the + * http_url during the domain validation. + */ + http_body?: string; + + /** + * The url that will be checked during domain validation. + */ + http_url?: string; + + /** + * The hostname that the certificate authority (CA) will check for a TXT record + * during domain validation . + */ + txt_name?: string; + + /** + * The TXT record that the certificate authority (CA) will check during domain + * validation. + */ + txt_value?: string; + } +} + export type CertificatePackGetResponse = unknown; export interface CertificatePackCreateParams { diff --git a/src/resources/workers/observability/index.ts b/src/resources/workers/observability/index.ts index 0caddd5ae3..f79888ffc4 100644 --- a/src/resources/workers/observability/index.ts +++ b/src/resources/workers/observability/index.ts @@ -1,14 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Observability } from './observability'; -export { - TelemetryKeysResponsesSinglePage, - TelemetryValuesResponsesSinglePage, - Telemetry, - type TelemetryKeysResponse, - type TelemetryQueryResponse, - type TelemetryValuesResponse, - type TelemetryKeysParams, - type TelemetryQueryParams, - type TelemetryValuesParams, -} from './telemetry'; +export { Telemetry } from './telemetry'; diff --git a/src/resources/workers/observability/observability.ts b/src/resources/workers/observability/observability.ts index 67d35532a5..275786dba8 100644 --- a/src/resources/workers/observability/observability.ts +++ b/src/resources/workers/observability/observability.ts @@ -2,36 +2,14 @@ import { APIResource } from '../../../resource'; import * as TelemetryAPI from './telemetry'; -import { - Telemetry, - TelemetryKeysParams, - TelemetryKeysResponse, - TelemetryKeysResponsesSinglePage, - TelemetryQueryParams, - TelemetryQueryResponse, - TelemetryValuesParams, - TelemetryValuesResponse, - TelemetryValuesResponsesSinglePage, -} from './telemetry'; +import { Telemetry } from './telemetry'; export class Observability extends APIResource { telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client); } Observability.Telemetry = Telemetry; -Observability.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage; -Observability.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage; export declare namespace Observability { - export { - Telemetry as Telemetry, - type TelemetryKeysResponse as TelemetryKeysResponse, - type TelemetryQueryResponse as TelemetryQueryResponse, - type TelemetryValuesResponse as TelemetryValuesResponse, - TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, - TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, - type TelemetryKeysParams as TelemetryKeysParams, - type TelemetryQueryParams as TelemetryQueryParams, - type TelemetryValuesParams as TelemetryValuesParams, - }; + export { Telemetry as Telemetry }; } diff --git a/src/resources/workers/observability/telemetry.ts b/src/resources/workers/observability/telemetry.ts index 9467608603..1a79e6da8e 100644 --- a/src/resources/workers/observability/telemetry.ts +++ b/src/resources/workers/observability/telemetry.ts @@ -1,1541 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -import { SinglePage } from '../../../pagination'; -export class Telemetry extends APIResource { - /** - * List all the keys in your telemetry events. - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const telemetryKeysResponse of client.workers.observability.telemetry.keys( - * { account_id: 'account_id' }, - * )) { - * // ... - * } - * ``` - */ - keys( - params: TelemetryKeysParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...body } = params; - return this._client.getAPIList( - `/accounts/${account_id}/workers/observability/telemetry/keys`, - TelemetryKeysResponsesSinglePage, - { body, method: 'post', ...options }, - ); - } - - /** - * Runs a temporary or saved query - * - * @example - * ```ts - * const response = - * await client.workers.observability.telemetry.query({ - * account_id: 'account_id', - * queryId: 'queryId', - * timeframe: { from: 0, to: 0 }, - * }); - * ``` - */ - query( - params: TelemetryQueryParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/workers/observability/telemetry/query`, { - body, - ...options, - }) as Core.APIPromise<{ result: TelemetryQueryResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List unique values found in your events - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const telemetryValuesResponse of client.workers.observability.telemetry.values( - * { - * account_id: 'account_id', - * datasets: ['string'], - * key: 'key', - * timeframe: { from: 0, to: 0 }, - * type: 'string', - * }, - * )) { - * // ... - * } - * ``` - */ - values( - params: TelemetryValuesParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...body } = params; - return this._client.getAPIList( - `/accounts/${account_id}/workers/observability/telemetry/values`, - TelemetryValuesResponsesSinglePage, - { body, method: 'post', ...options }, - ); - } -} - -export class TelemetryKeysResponsesSinglePage extends SinglePage {} - -export class TelemetryValuesResponsesSinglePage extends SinglePage {} - -export interface TelemetryKeysResponse { - key: string; - - lastSeenAt: number; - - type: 'string' | 'boolean' | 'number'; -} - -export interface TelemetryQueryResponse { - /** - * A Workers Observability Query Object - */ - run: TelemetryQueryResponse.Run; - - /** - * The statistics object contains information about query performance from the - * database, it does not include any network latency - */ - statistics: TelemetryQueryResponse.Statistics; - - calculations?: Array; - - compare?: Array; - - events?: TelemetryQueryResponse.Events; - - invocations?: { [key: string]: Array }; - - patterns?: Array; -} - -export namespace TelemetryQueryResponse { - /** - * A Workers Observability Query Object - */ - export interface Run { - id: string; - - accountId: string; - - dry: boolean; - - /** - * @deprecated - */ - environmentId: string; - - granularity: number; - - query: Run.Query; - - status: 'STARTED' | 'COMPLETED'; - - timeframe: Run.Timeframe; - - userId: string; - - /** - * @deprecated - */ - workspaceId: string; - - created?: string; - - statistics?: Run.Statistics; - - updated?: string; - } - - export namespace Run { - export interface Query { - /** - * ID of the query - */ - id: string; - - created: string; - - description: string | null; - - /** - * ID of your environment - */ - environmentId: string; - - /** - * Flag for alerts automatically created - */ - generated: boolean | null; - - /** - * Query name - */ - name: string | null; - - parameters: Query.Parameters; - - updated: string; - - userId: string; - - /** - * ID of your workspace - */ - workspaceId: string; - } - - export namespace Query { - export interface Parameters { - /** - * Create Calculations to compute as part of the query. - */ - calculations?: Array; - - /** - * Set the Datasets to query. Leave it empty to query all the datasets. - */ - datasets?: Array; - - /** - * Set a Flag to describe how to combine the filters on the query. - */ - filterCombination?: 'and' | 'or' | 'AND' | 'OR'; - - /** - * Configure the Filters to apply to the query. - */ - filters?: Array; - - /** - * Define how to group the results of the query. - */ - groupBys?: Array; - - /** - * Configure the Having clauses that filter on calculations in the query result. - */ - havings?: Array; - - /** - * Set a limit on the number of results / records returned by the query - */ - limit?: number; - - /** - * Define an expression to search using full-text search. - */ - needle?: Parameters.Needle; - - /** - * Configure the order of the results returned by the query. - */ - orderBy?: Parameters.OrderBy; - } - - export namespace Parameters { - export interface Calculation { - operator: - | 'uniq' - | 'count' - | 'max' - | 'min' - | 'sum' - | 'avg' - | 'median' - | 'p001' - | 'p01' - | 'p05' - | 'p10' - | 'p25' - | 'p75' - | 'p90' - | 'p95' - | 'p99' - | 'p999' - | 'stddev' - | 'variance' - | 'COUNT_DISTINCT' - | 'COUNT' - | 'MAX' - | 'MIN' - | 'SUM' - | 'AVG' - | 'MEDIAN' - | 'P001' - | 'P01' - | 'P05' - | 'P10' - | 'P25' - | 'P75' - | 'P90' - | 'P95' - | 'P99' - | 'P999' - | 'STDDEV' - | 'VARIANCE'; - - alias?: string; - - key?: string; - - keyType?: 'string' | 'number' | 'boolean'; - } - - export interface Filter { - key: string; - - operation: - | 'includes' - | 'not_includes' - | 'starts_with' - | 'regex' - | 'exists' - | 'is_null' - | 'in' - | 'not_in' - | 'eq' - | 'neq' - | 'gt' - | 'gte' - | 'lt' - | 'lte' - | '=' - | '!=' - | '>' - | '>=' - | '<' - | '<=' - | 'INCLUDES' - | 'DOES_NOT_INCLUDE' - | 'MATCH_REGEX' - | 'EXISTS' - | 'DOES_NOT_EXIST' - | 'IN' - | 'NOT_IN' - | 'STARTS_WITH'; - - type: 'string' | 'number' | 'boolean'; - - value?: string | number | boolean; - } - - export interface GroupBy { - type: 'string' | 'number' | 'boolean'; - - value: string; - } - - export interface Having { - key: string; - - operation: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; - - value: number; - } - - /** - * Define an expression to search using full-text search. - */ - export interface Needle { - value: string | number | boolean; - - isRegex?: boolean; - - matchCase?: boolean; - } - - /** - * Configure the order of the results returned by the query. - */ - export interface OrderBy { - /** - * Configure which Calculation to order the results by. - */ - value: string; - - /** - * Set the order of the results - */ - order?: 'asc' | 'desc'; - } - } - } - - export interface Timeframe { - /** - * Set the start time for your query using UNIX time in milliseconds. - */ - from: number; - - /** - * Set the end time for your query using UNIX time in milliseconds. - */ - to: number; - } - - export interface Statistics { - /** - * Number of uncompressed bytes read from the table. - */ - bytes_read: number; - - /** - * Time in seconds for the query to run. - */ - elapsed: number; - - /** - * Number of rows scanned from the table. - */ - rows_read: number; - } - } - - /** - * The statistics object contains information about query performance from the - * database, it does not include any network latency - */ - export interface Statistics { - /** - * Number of uncompressed bytes read from the table. - */ - bytes_read: number; - - /** - * Time in seconds for the query to run. - */ - elapsed: number; - - /** - * Number of rows scanned from the table. - */ - rows_read: number; - } - - export interface Calculation { - aggregates: Array; - - calculation: string; - - series: Array; - - alias?: string; - } - - export namespace Calculation { - export interface Aggregate { - count: number; - - interval: number; - - sampleInterval: number; - - value: number; - - groups?: Array; - } - - export namespace Aggregate { - export interface Group { - key: string; - - value: string | number | boolean; - } - } - - export interface Series { - data: Array; - - time: string; - } - - export namespace Series { - export interface Data { - count: number; - - firstSeen: string; - - interval: number; - - lastSeen: string; - - sampleInterval: number; - - value: number; - - groups?: Array; - } - - export namespace Data { - export interface Group { - key: string; - - value: string | number | boolean; - } - } - } - } - - export interface Compare { - aggregates: Array; - - calculation: string; - - series: Array; - - alias?: string; - } - - export namespace Compare { - export interface Aggregate { - count: number; - - interval: number; - - sampleInterval: number; - - value: number; - - groups?: Array; - } - - export namespace Aggregate { - export interface Group { - key: string; - - value: string | number | boolean; - } - } - - export interface Series { - data: Array; - - time: string; - } - - export namespace Series { - export interface Data { - count: number; - - firstSeen: string; - - interval: number; - - lastSeen: string; - - sampleInterval: number; - - value: number; - - groups?: Array; - } - - export namespace Data { - export interface Group { - key: string; - - value: string | number | boolean; - } - } - } - } - - export interface Events { - count?: number; - - events?: Array; - - fields?: Array; - - series?: Array; - } - - export namespace Events { - /** - * The data structure of a telemetry event - */ - export interface Event { - $metadata: Event.Metadata; - - dataset: string; - - source: string | unknown; - - timestamp: number; - - /** - * Cloudflare Workers event information enriches your logs so you can easily - * identify and debug issues. - */ - $workers?: Event.UnionMember0 | Event.UnionMember1; - } - - export namespace Event { - export interface Metadata { - id: string; - - account?: string; - - cloudService?: string; - - coldStart?: number; - - cost?: number; - - duration?: number; - - endTime?: number; - - error?: string; - - errorTemplate?: string; - - fingerprint?: string; - - level?: string; - - message?: string; - - messageTemplate?: string; - - metricName?: string; - - origin?: string; - - parentSpanId?: string; - - provider?: string; - - region?: string; - - requestId?: string; - - service?: string; - - spanId?: string; - - spanName?: string; - - stackId?: string; - - startTime?: number; - - statusCode?: number; - - traceDuration?: number; - - traceId?: string; - - trigger?: string; - - type?: string; - - url?: string; - } - - export interface UnionMember0 { - eventType: - | 'fetch' - | 'scheduled' - | 'alarm' - | 'cron' - | 'queue' - | 'email' - | 'tail' - | 'rpc' - | 'websocket' - | 'unknown'; - - outcome: string; - - requestId: string; - - scriptName: string; - - entrypoint?: string; - - event?: { - [key: string]: - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | { [key: string]: Array | string | number | boolean }; - }; - }; - - executionModel?: 'durableObject' | 'stateless'; - - scriptVersion?: UnionMember0.ScriptVersion; - - truncated?: boolean; - } - - export namespace UnionMember0 { - export interface ScriptVersion { - id?: string; - - message?: string; - - tag?: string; - } - } - - export interface UnionMember1 { - cpuTimeMs: number; - - eventType: - | 'fetch' - | 'scheduled' - | 'alarm' - | 'cron' - | 'queue' - | 'email' - | 'tail' - | 'rpc' - | 'websocket' - | 'unknown'; - - outcome: string; - - requestId: string; - - scriptName: string; - - wallTimeMs: number; - - diagnosticsChannelEvents?: Array; - - dispatchNamespace?: string; - - entrypoint?: string; - - event?: { [key: string]: string | number | boolean }; - - executionModel?: 'durableObject' | 'stateless'; - - scriptVersion?: UnionMember1.ScriptVersion; - - truncated?: boolean; - } - - export namespace UnionMember1 { - export interface DiagnosticsChannelEvent { - channel: string; - - message: string; - - timestamp: number; - } - - export interface ScriptVersion { - id?: string; - - message?: string; - - tag?: string; - } - } - } - - export interface Field { - key: string; - - type: string; - } - - export interface Series { - data: Array; - - time: string; - } - - export namespace Series { - export interface Data { - aggregates: Data.Aggregates; - - count: number; - - interval: number; - - sampleInterval: number; - - errors?: number; - - /** - * Groups in the query results. - */ - groups?: { [key: string]: string | number | boolean }; - } - - export namespace Data { - export interface Aggregates { - /** - * @deprecated - */ - _count: number; - - /** - * @deprecated - */ - _firstSeen: string; - - /** - * @deprecated - */ - _interval: number; - - /** - * @deprecated - */ - _lastSeen: string; - - /** - * @deprecated - */ - bin?: unknown; - } - } - } - } - - /** - * The data structure of a telemetry event - */ - export interface Invocation { - $metadata: Invocation.Metadata; - - dataset: string; - - source: string | unknown; - - timestamp: number; - - /** - * Cloudflare Workers event information enriches your logs so you can easily - * identify and debug issues. - */ - $workers?: Invocation.UnionMember0 | Invocation.UnionMember1; - } - - export namespace Invocation { - export interface Metadata { - id: string; - - account?: string; - - cloudService?: string; - - coldStart?: number; - - cost?: number; - - duration?: number; - - endTime?: number; - - error?: string; - - errorTemplate?: string; - - fingerprint?: string; - - level?: string; - - message?: string; - - messageTemplate?: string; - - metricName?: string; - - origin?: string; - - parentSpanId?: string; - - provider?: string; - - region?: string; - - requestId?: string; - - service?: string; - - spanId?: string; - - spanName?: string; - - stackId?: string; - - startTime?: number; - - statusCode?: number; - - traceDuration?: number; - - traceId?: string; - - trigger?: string; - - type?: string; - - url?: string; - } - - export interface UnionMember0 { - eventType: - | 'fetch' - | 'scheduled' - | 'alarm' - | 'cron' - | 'queue' - | 'email' - | 'tail' - | 'rpc' - | 'websocket' - | 'unknown'; - - outcome: string; - - requestId: string; - - scriptName: string; - - entrypoint?: string; - - event?: { - [key: string]: - | string - | number - | boolean - | { - [key: string]: - | string - | number - | boolean - | { [key: string]: Array | string | number | boolean }; - }; - }; - - executionModel?: 'durableObject' | 'stateless'; - - scriptVersion?: UnionMember0.ScriptVersion; - - truncated?: boolean; - } - - export namespace UnionMember0 { - export interface ScriptVersion { - id?: string; - - message?: string; - - tag?: string; - } - } - - export interface UnionMember1 { - cpuTimeMs: number; - - eventType: - | 'fetch' - | 'scheduled' - | 'alarm' - | 'cron' - | 'queue' - | 'email' - | 'tail' - | 'rpc' - | 'websocket' - | 'unknown'; - - outcome: string; - - requestId: string; - - scriptName: string; - - wallTimeMs: number; - - diagnosticsChannelEvents?: Array; - - dispatchNamespace?: string; - - entrypoint?: string; - - event?: { [key: string]: string | number | boolean }; - - executionModel?: 'durableObject' | 'stateless'; - - scriptVersion?: UnionMember1.ScriptVersion; - - truncated?: boolean; - } - - export namespace UnionMember1 { - export interface DiagnosticsChannelEvent { - channel: string; - - message: string; - - timestamp: number; - } - - export interface ScriptVersion { - id?: string; - - message?: string; - - tag?: string; - } - } - } - - export interface Pattern { - count: number; - - pattern: string; - - series: Array; - - service: string; - } - - export namespace Pattern { - export interface Series { - data: Series.Data; - - time: string; - } - - export namespace Series { - export interface Data { - count: number; - - interval: number; - - sampleInterval: number; - - value: number; - - groups?: Array; - } - - export namespace Data { - export interface Group { - key: string; - - value: string | number | boolean; - } - } - } - } -} - -export interface TelemetryValuesResponse { - dataset: string; - - key: string; - - type: 'string' | 'boolean' | 'number'; - - value: string | number | boolean; -} - -export interface TelemetryKeysParams { - /** - * Path param: Your Cloudflare account ID. - */ - account_id: string; - - /** - * Body param: - */ - datasets?: Array; - - /** - * Body param: - */ - filters?: Array; - - /** - * Body param: Search for a specific substring in the keys. - */ - keyNeedle?: TelemetryKeysParams.KeyNeedle; - - /** - * Body param: - */ - limit?: number; - - /** - * Body param: Search for a specific substring in the event. - */ - needle?: TelemetryKeysParams.Needle; - - /** - * Body param: - */ - timeframe?: TelemetryKeysParams.Timeframe; -} - -export namespace TelemetryKeysParams { - export interface Filter { - key: string; - - operation: - | 'includes' - | 'not_includes' - | 'starts_with' - | 'regex' - | 'exists' - | 'is_null' - | 'in' - | 'not_in' - | 'eq' - | 'neq' - | 'gt' - | 'gte' - | 'lt' - | 'lte' - | '=' - | '!=' - | '>' - | '>=' - | '<' - | '<=' - | 'INCLUDES' - | 'DOES_NOT_INCLUDE' - | 'MATCH_REGEX' - | 'EXISTS' - | 'DOES_NOT_EXIST' - | 'IN' - | 'NOT_IN' - | 'STARTS_WITH'; - - type: 'string' | 'number' | 'boolean'; - - value?: string | number | boolean; - } - - /** - * Search for a specific substring in the keys. - */ - export interface KeyNeedle { - value: string | number | boolean; - - isRegex?: boolean; - - matchCase?: boolean; - } - - /** - * Search for a specific substring in the event. - */ - export interface Needle { - value: string | number | boolean; - - isRegex?: boolean; - - matchCase?: boolean; - } - - export interface Timeframe { - from: number; - - to: number; - } -} - -export interface TelemetryQueryParams { - /** - * Path param: Your Cloudflare account ID. - */ - account_id: string; - - /** - * Body param: - */ - queryId: string; - - /** - * Body param: - */ - timeframe: TelemetryQueryParams.Timeframe; - - /** - * Body param: - */ - chart?: boolean; - - /** - * Body param: - */ - compare?: boolean; - - /** - * Body param: - */ - dry?: boolean; - - /** - * Body param: - */ - granularity?: number; - - /** - * Body param: - */ - ignoreSeries?: boolean; - - /** - * Body param: - */ - limit?: number; - - /** - * Body param: - */ - offset?: string; - - /** - * Body param: - */ - offsetBy?: number; - - /** - * Body param: - */ - offsetDirection?: string; - - /** - * Body param: - */ - parameters?: TelemetryQueryParams.Parameters; - - /** - * Body param: - */ - patternType?: 'message' | 'error'; - - /** - * Body param: - */ - view?: 'traces' | 'events' | 'calculations' | 'invocations' | 'requests' | 'patterns'; -} - -export namespace TelemetryQueryParams { - export interface Timeframe { - from: number; - - to: number; - } - - export interface Parameters { - /** - * Create Calculations to compute as part of the query. - */ - calculations?: Array; - - /** - * Set the Datasets to query. Leave it empty to query all the datasets. - */ - datasets?: Array; - - /** - * Set a Flag to describe how to combine the filters on the query. - */ - filterCombination?: 'and' | 'or' | 'AND' | 'OR'; - - /** - * Configure the Filters to apply to the query. - */ - filters?: Array; - - /** - * Define how to group the results of the query. - */ - groupBys?: Array; - - /** - * Configure the Having clauses that filter on calculations in the query result. - */ - havings?: Array; - - /** - * Set a limit on the number of results / records returned by the query - */ - limit?: number; - - /** - * Define an expression to search using full-text search. - */ - needle?: Parameters.Needle; - - /** - * Configure the order of the results returned by the query. - */ - orderBy?: Parameters.OrderBy; - } - - export namespace Parameters { - export interface Calculation { - operator: - | 'uniq' - | 'count' - | 'max' - | 'min' - | 'sum' - | 'avg' - | 'median' - | 'p001' - | 'p01' - | 'p05' - | 'p10' - | 'p25' - | 'p75' - | 'p90' - | 'p95' - | 'p99' - | 'p999' - | 'stddev' - | 'variance' - | 'COUNT_DISTINCT' - | 'COUNT' - | 'MAX' - | 'MIN' - | 'SUM' - | 'AVG' - | 'MEDIAN' - | 'P001' - | 'P01' - | 'P05' - | 'P10' - | 'P25' - | 'P75' - | 'P90' - | 'P95' - | 'P99' - | 'P999' - | 'STDDEV' - | 'VARIANCE'; - - alias?: string; - - key?: string; - - keyType?: 'string' | 'number' | 'boolean'; - } - - export interface Filter { - key: string; - - operation: - | 'includes' - | 'not_includes' - | 'starts_with' - | 'regex' - | 'exists' - | 'is_null' - | 'in' - | 'not_in' - | 'eq' - | 'neq' - | 'gt' - | 'gte' - | 'lt' - | 'lte' - | '=' - | '!=' - | '>' - | '>=' - | '<' - | '<=' - | 'INCLUDES' - | 'DOES_NOT_INCLUDE' - | 'MATCH_REGEX' - | 'EXISTS' - | 'DOES_NOT_EXIST' - | 'IN' - | 'NOT_IN' - | 'STARTS_WITH'; - - type: 'string' | 'number' | 'boolean'; - - value?: string | number | boolean; - } - - export interface GroupBy { - type: 'string' | 'number' | 'boolean'; - - value: string; - } - - export interface Having { - key: string; - - operation: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; - - value: number; - } - - /** - * Define an expression to search using full-text search. - */ - export interface Needle { - value: string | number | boolean; - - isRegex?: boolean; - - matchCase?: boolean; - } - - /** - * Configure the order of the results returned by the query. - */ - export interface OrderBy { - /** - * Configure which Calculation to order the results by. - */ - value: string; - - /** - * Set the order of the results - */ - order?: 'asc' | 'desc'; - } - } -} - -export interface TelemetryValuesParams { - /** - * Path param: Your Cloudflare account ID. - */ - account_id: string; - - /** - * Body param: - */ - datasets: Array; - - /** - * Body param: - */ - key: string; - - /** - * Body param: - */ - timeframe: TelemetryValuesParams.Timeframe; - - /** - * Body param: - */ - type: 'string' | 'boolean' | 'number'; - - /** - * Body param: - */ - filters?: Array; - - /** - * Body param: - */ - limit?: number; - - /** - * Body param: Search for a specific substring in the event. - */ - needle?: TelemetryValuesParams.Needle; -} - -export namespace TelemetryValuesParams { - export interface Timeframe { - from: number; - - to: number; - } - - export interface Filter { - key: string; - - operation: - | 'includes' - | 'not_includes' - | 'starts_with' - | 'regex' - | 'exists' - | 'is_null' - | 'in' - | 'not_in' - | 'eq' - | 'neq' - | 'gt' - | 'gte' - | 'lt' - | 'lte' - | '=' - | '!=' - | '>' - | '>=' - | '<' - | '<=' - | 'INCLUDES' - | 'DOES_NOT_INCLUDE' - | 'MATCH_REGEX' - | 'EXISTS' - | 'DOES_NOT_EXIST' - | 'IN' - | 'NOT_IN' - | 'STARTS_WITH'; - - type: 'string' | 'number' | 'boolean'; - - value?: string | number | boolean; - } - - /** - * Search for a specific substring in the event. - */ - export interface Needle { - value: string | number | boolean; - - isRegex?: boolean; - - matchCase?: boolean; - } -} - -Telemetry.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage; -Telemetry.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage; - -export declare namespace Telemetry { - export { - type TelemetryKeysResponse as TelemetryKeysResponse, - type TelemetryQueryResponse as TelemetryQueryResponse, - type TelemetryValuesResponse as TelemetryValuesResponse, - TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, - TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, - type TelemetryKeysParams as TelemetryKeysParams, - type TelemetryQueryParams as TelemetryQueryParams, - type TelemetryValuesParams as TelemetryValuesParams, - }; -} +export class Telemetry extends APIResource {} diff --git a/src/resources/workflows/index.ts b/src/resources/workflows/index.ts index f9356eadf4..ff9d0d44ac 100644 --- a/src/resources/workflows/index.ts +++ b/src/resources/workflows/index.ts @@ -1,24 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { - InstanceListResponsesV4PagePaginationArray, - InstanceBulkResponsesSinglePage, - Instances, - type InstanceCreateResponse, - type InstanceListResponse, - type InstanceBulkResponse, - type InstanceGetResponse, - type InstanceCreateParams, - type InstanceListParams, - type InstanceBulkParams, - type InstanceGetParams, -} from './instances/index'; -export { - VersionListResponsesV4PagePaginationArray, - Versions, - type VersionListResponse, - type VersionGetResponse, - type VersionListParams, - type VersionGetParams, -} from './versions'; +export { Instances } from './instances/index'; +export { Versions } from './versions'; export { Workflows } from './workflows'; diff --git a/src/resources/workflows/instances/events.ts b/src/resources/workflows/instances/events.ts index 20f3a15ba5..6e87ef6fb4 100644 --- a/src/resources/workflows/instances/events.ts +++ b/src/resources/workflows/instances/events.ts @@ -1,43 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Events extends APIResource { - /** - * Send event to instance - */ - create( - workflowName: string, - instanceId: string, - eventType: string, - params: EventCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, body } = params ?? {}; - return ( - this._client.post( - `/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/events/${eventType}`, - { body: body, ...options }, - ) as Core.APIPromise<{ result: EventCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export type EventCreateResponse = unknown; - -export interface EventCreateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - body?: unknown; -} - -export declare namespace Events { - export { type EventCreateResponse as EventCreateResponse, type EventCreateParams as EventCreateParams }; -} +export class Events extends APIResource {} diff --git a/src/resources/workflows/instances/index.ts b/src/resources/workflows/instances/index.ts index 9c96da29fb..1c63a64a9d 100644 --- a/src/resources/workflows/instances/index.ts +++ b/src/resources/workflows/instances/index.ts @@ -1,17 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Events, type EventCreateResponse, type EventCreateParams } from './events'; -export { - InstanceListResponsesV4PagePaginationArray, - InstanceBulkResponsesSinglePage, - Instances, - type InstanceCreateResponse, - type InstanceListResponse, - type InstanceBulkResponse, - type InstanceGetResponse, - type InstanceCreateParams, - type InstanceListParams, - type InstanceBulkParams, - type InstanceGetParams, -} from './instances'; -export { Status, type StatusEditResponse, type StatusEditParams } from './status'; +export { Events } from './events'; +export { Instances } from './instances'; +export { Status } from './status'; diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts index 117054a689..8ab49d5567 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,418 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; import * as EventsAPI from './events'; -import { EventCreateParams, EventCreateResponse, Events } from './events'; +import { Events } from './events'; import * as StatusAPI from './status'; -import { Status, StatusEditParams, StatusEditResponse } from './status'; -import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { Status } from './status'; export class Instances extends APIResource { status: StatusAPI.Status = new StatusAPI.Status(this._client); events: EventsAPI.Events = new EventsAPI.Events(this._client); - - /** - * Create a new workflow instance - */ - create( - workflowName: string, - params: InstanceCreateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.post(`/accounts/${account_id}/workflows/${workflowName}/instances`, { - body, - ...options, - }) as Core.APIPromise<{ result: InstanceCreateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List of workflow instances - */ - list( - workflowName: string, - params: InstanceListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/workflows/${workflowName}/instances`, - InstanceListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Batch create new Workflow instances - */ - bulk( - workflowName: string, - params: InstanceBulkParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, body } = params ?? {}; - return this._client.getAPIList( - `/accounts/${account_id}/workflows/${workflowName}/instances/batch`, - InstanceBulkResponsesSinglePage, - { body: body, method: 'post', ...options }, - ); - } - - /** - * Get logs and status from instance - */ - get( - workflowName: string, - instanceId: string, - params: InstanceGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}`, - options, - ) as Core.APIPromise<{ result: InstanceGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class InstanceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export class InstanceBulkResponsesSinglePage extends SinglePage {} - -export interface InstanceCreateResponse { - id: string; - - status: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; - - version_id: string; - - workflow_id: string; -} - -export interface InstanceListResponse { - id: string; - - created_on: string; - - ended_on: string | null; - - modified_on: string; - - started_on: string | null; - - status: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; - - version_id: string; - - workflow_id: string; -} - -export interface InstanceBulkResponse { - id: string; - - status: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; - - version_id: string; - - workflow_id: string; -} - -export interface InstanceGetResponse { - end: string | null; - - error: InstanceGetResponse.Error | null; - - output: string | number; - - params: unknown; - - queued: string; - - start: string | null; - - status: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; - - steps: Array< - | InstanceGetResponse.UnionMember0 - | InstanceGetResponse.UnionMember1 - | InstanceGetResponse.UnionMember2 - | InstanceGetResponse.UnionMember3 - >; - - success: boolean | null; - - trigger: InstanceGetResponse.Trigger; - - versionId: string; -} - -export namespace InstanceGetResponse { - export interface Error { - message: string; - - name: string; - } - - export interface UnionMember0 { - attempts: Array; - - config: UnionMember0.Config; - - end: string | null; - - name: string; - - output: unknown; - - start: string; - - success: boolean | null; - - type: 'step'; - } - - export namespace UnionMember0 { - export interface Attempt { - end: string | null; - - error: Attempt.Error | null; - - start: string; - - success: boolean | null; - } - - export namespace Attempt { - export interface Error { - message: string; - - name: string; - } - } - - export interface Config { - retries: Config.Retries; - - timeout: unknown | number; - } - - export namespace Config { - export interface Retries { - delay: unknown | number; - - limit: number; - - backoff?: 'constant' | 'linear' | 'exponential'; - } - } - } - - export interface UnionMember1 { - end: string; - - error: UnionMember1.Error | null; - - finished: boolean; - - name: string; - - start: string; - - type: 'sleep'; - } - - export namespace UnionMember1 { - export interface Error { - message: string; - - name: string; - } - } - - export interface UnionMember2 { - trigger: UnionMember2.Trigger; - - type: 'termination'; - } - - export namespace UnionMember2 { - export interface Trigger { - source: string; - } - } - - export interface UnionMember3 { - end: string; - - error: UnionMember3.Error | null; - - finished: boolean; - - name: string; - - output: unknown | string | number | boolean; - - start: string; - - type: 'waitForEvent'; - } - - export namespace UnionMember3 { - export interface Error { - message: string; - - name: string; - } - } - - export interface Trigger { - source: 'unknown' | 'api' | 'binding' | 'event' | 'cron'; - } } -export interface InstanceCreateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - instance_id?: string; - - /** - * Body param: - */ - instance_retention?: unknown; - - /** - * Body param: - */ - params?: unknown; -} - -export interface InstanceListParams extends V4PagePaginationArrayParams { - /** - * Path param: - */ - account_id: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_end?: string; - - /** - * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. - */ - date_start?: string; - - /** - * Query param: - */ - status?: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; -} - -export interface InstanceBulkParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - body?: Array; -} - -export namespace InstanceBulkParams { - export interface Body { - instance_id?: string; - - instance_retention?: unknown; - - params?: unknown; - } -} - -export interface InstanceGetParams { - account_id: string; -} - -Instances.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; -Instances.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage; Instances.Status = Status; Instances.Events = Events; export declare namespace Instances { - export { - type InstanceCreateResponse as InstanceCreateResponse, - type InstanceListResponse as InstanceListResponse, - type InstanceBulkResponse as InstanceBulkResponse, - type InstanceGetResponse as InstanceGetResponse, - InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, - InstanceBulkResponsesSinglePage as InstanceBulkResponsesSinglePage, - type InstanceCreateParams as InstanceCreateParams, - type InstanceListParams as InstanceListParams, - type InstanceBulkParams as InstanceBulkParams, - type InstanceGetParams as InstanceGetParams, - }; - - export { - Status as Status, - type StatusEditResponse as StatusEditResponse, - type StatusEditParams as StatusEditParams, - }; + export { Status as Status }; - export { - Events as Events, - type EventCreateResponse as EventCreateResponse, - type EventCreateParams as EventCreateParams, - }; + export { Events as Events }; } diff --git a/src/resources/workflows/instances/status.ts b/src/resources/workflows/instances/status.ts index 54b3ce3cc9..e8d042f21b 100644 --- a/src/resources/workflows/instances/status.ts +++ b/src/resources/workflows/instances/status.ts @@ -1,57 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -export class Status extends APIResource { - /** - * Change status of instance - */ - edit( - workflowName: string, - instanceId: string, - params: StatusEditParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.patch(`/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/status`, { - body, - ...options, - }) as Core.APIPromise<{ result: StatusEditResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface StatusEditResponse { - status: - | 'queued' - | 'running' - | 'paused' - | 'errored' - | 'terminated' - | 'complete' - | 'waitingForPause' - | 'waiting'; - - /** - * Accepts ISO 8601 with no timezone offsets and in UTC. - */ - timestamp: string; -} - -export interface StatusEditParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: Apply action to instance. - */ - status: 'resume' | 'pause' | 'terminate'; -} - -export declare namespace Status { - export { type StatusEditResponse as StatusEditResponse, type StatusEditParams as StatusEditParams }; -} +export class Status extends APIResource {} diff --git a/src/resources/workflows/versions.ts b/src/resources/workflows/versions.ts index dab04a8662..c0875b7239 100644 --- a/src/resources/workflows/versions.ts +++ b/src/resources/workflows/versions.ts @@ -1,90 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as Core from '../../core'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; -export class Versions extends APIResource { - /** - * List deployed Workflow versions - */ - list( - workflowName: string, - params: VersionListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/workflows/${workflowName}/versions`, - VersionListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Get Workflow version details - */ - get( - workflowName: string, - versionId: string, - params: VersionGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/workflows/${workflowName}/versions/${versionId}`, - options, - ) as Core.APIPromise<{ result: VersionGetResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class VersionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface VersionListResponse { - id: string; - - class_name: string; - - created_on: string; - - modified_on: string; - - workflow_id: string; -} - -export interface VersionGetResponse { - id: string; - - class_name: string; - - created_on: string; - - modified_on: string; - - workflow_id: string; -} - -export interface VersionListParams extends V4PagePaginationArrayParams { - /** - * Path param: - */ - account_id: string; -} - -export interface VersionGetParams { - account_id: string; -} - -Versions.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray; - -export declare namespace Versions { - export { - type VersionListResponse as VersionListResponse, - type VersionGetResponse as VersionGetResponse, - VersionListResponsesV4PagePaginationArray as VersionListResponsesV4PagePaginationArray, - type VersionListParams as VersionListParams, - type VersionGetParams as VersionGetParams, - }; -} +export class Versions extends APIResource {} diff --git a/src/resources/workflows/workflows.ts b/src/resources/workflows/workflows.ts index d7f69588d8..e86558cce9 100644 --- a/src/resources/workflows/workflows.ts +++ b/src/resources/workflows/workflows.ts @@ -1,285 +1,21 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; -import * as Core from '../../core'; import * as VersionsAPI from './versions'; -import { - VersionGetParams, - VersionGetResponse, - VersionListParams, - VersionListResponse, - VersionListResponsesV4PagePaginationArray, - Versions, -} from './versions'; +import { Versions } from './versions'; import * as InstancesAPI from './instances/instances'; -import { - InstanceBulkParams, - InstanceBulkResponse, - InstanceBulkResponsesSinglePage, - InstanceCreateParams, - InstanceCreateResponse, - InstanceGetParams, - InstanceGetResponse, - InstanceListParams, - InstanceListResponse, - InstanceListResponsesV4PagePaginationArray, - Instances as InstancesAPIInstances, -} from './instances/instances'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; +import { Instances } from './instances/instances'; export class Workflows extends APIResource { instances: InstancesAPI.Instances = new InstancesAPI.Instances(this._client); versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client); - - /** - * Create/modify Workflow - */ - update( - workflowName: string, - params: WorkflowUpdateParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id, ...body } = params; - return ( - this._client.put(`/accounts/${account_id}/workflows/${workflowName}`, { - body, - ...options, - }) as Core.APIPromise<{ result: WorkflowUpdateResponse }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * List all Workflows - */ - list( - params: WorkflowListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; - return this._client.getAPIList( - `/accounts/${account_id}/workflows`, - WorkflowListResponsesV4PagePaginationArray, - { query, ...options }, - ); - } - - /** - * Deletes a Workflow. This only deletes the Workflow and does not delete or modify - * any Worker associated to this Workflow or bounded to it. - */ - delete( - workflowName: string, - params: WorkflowDeleteParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.delete(`/accounts/${account_id}/workflows/${workflowName}`, options) as Core.APIPromise<{ - result: WorkflowDeleteResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Get Workflow details - */ - get( - workflowName: string, - params: WorkflowGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise { - const { account_id } = params; - return ( - this._client.get(`/accounts/${account_id}/workflows/${workflowName}`, options) as Core.APIPromise<{ - result: WorkflowGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export class WorkflowListResponsesV4PagePaginationArray extends V4PagePaginationArray {} - -export interface WorkflowUpdateResponse { - id: string; - - class_name: string; - - created_on: string; - - is_deleted: number; - - modified_on: string; - - name: string; - - script_name: string; - - terminator_running: number; - - triggered_on: string | null; - - version_id: string; -} - -export interface WorkflowListResponse { - id: string; - - class_name: string; - - created_on: string; - - instances: WorkflowListResponse.Instances; - - modified_on: string; - - name: string; - - script_name: string; - - triggered_on: string | null; -} - -export namespace WorkflowListResponse { - export interface Instances { - complete?: number; - - errored?: number; - - paused?: number; - - queued?: number; - - running?: number; - - terminated?: number; - - waiting?: number; - - waitingForPause?: number; - } } -export interface WorkflowDeleteResponse { - status: 'ok'; - - success: boolean | null; -} - -export interface WorkflowGetResponse { - id: string; - - class_name: string; - - created_on: string; - - instances: WorkflowGetResponse.Instances; - - modified_on: string; - - name: string; - - script_name: string; - - triggered_on: string | null; -} - -export namespace WorkflowGetResponse { - export interface Instances { - complete?: number; - - errored?: number; - - paused?: number; - - queued?: number; - - running?: number; - - terminated?: number; - - waiting?: number; - - waitingForPause?: number; - } -} - -export interface WorkflowUpdateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - class_name: string; - - /** - * Body param: - */ - script_name: string; -} - -export interface WorkflowListParams extends V4PagePaginationArrayParams { - /** - * Path param: - */ - account_id: string; - - /** - * Query param: Allows filtering workflows` name. - */ - search?: string; -} - -export interface WorkflowDeleteParams { - account_id: string; -} - -export interface WorkflowGetParams { - account_id: string; -} - -Workflows.WorkflowListResponsesV4PagePaginationArray = WorkflowListResponsesV4PagePaginationArray; -Workflows.Instances = InstancesAPIInstances; -Workflows.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; -Workflows.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage; +Workflows.Instances = Instances; Workflows.Versions = Versions; -Workflows.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray; export declare namespace Workflows { - export { - type WorkflowUpdateResponse as WorkflowUpdateResponse, - type WorkflowListResponse as WorkflowListResponse, - type WorkflowDeleteResponse as WorkflowDeleteResponse, - type WorkflowGetResponse as WorkflowGetResponse, - WorkflowListResponsesV4PagePaginationArray as WorkflowListResponsesV4PagePaginationArray, - type WorkflowUpdateParams as WorkflowUpdateParams, - type WorkflowListParams as WorkflowListParams, - type WorkflowDeleteParams as WorkflowDeleteParams, - type WorkflowGetParams as WorkflowGetParams, - }; - - export { - InstancesAPIInstances as Instances, - type InstanceCreateResponse as InstanceCreateResponse, - type InstanceListResponse as InstanceListResponse, - type InstanceBulkResponse as InstanceBulkResponse, - type InstanceGetResponse as InstanceGetResponse, - InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, - InstanceBulkResponsesSinglePage as InstanceBulkResponsesSinglePage, - type InstanceCreateParams as InstanceCreateParams, - type InstanceListParams as InstanceListParams, - type InstanceBulkParams as InstanceBulkParams, - type InstanceGetParams as InstanceGetParams, - }; + export { Instances as Instances }; - export { - Versions as Versions, - type VersionListResponse as VersionListResponse, - type VersionGetResponse as VersionGetResponse, - VersionListResponsesV4PagePaginationArray as VersionListResponsesV4PagePaginationArray, - type VersionListParams as VersionListParams, - type VersionGetParams as VersionGetParams, - }; + export { Versions as Versions }; } diff --git a/src/resources/zero-trust/dex/colos.ts b/src/resources/zero-trust/dex/colos.ts index 6b045b5012..5f53995ed5 100644 --- a/src/resources/zero-trust/dex/colos.ts +++ b/src/resources/zero-trust/dex/colos.ts @@ -38,7 +38,22 @@ export class Colos extends APIResource { export class ColoListResponsesSinglePage extends SinglePage {} -export type ColoListResponse = unknown; +export interface ColoListResponse { + /** + * Airport code + */ + airportCode: string; + + /** + * City + */ + city: string; + + /** + * Country code + */ + countryCode: string; +} export interface ColoListParams { /** diff --git a/src/resources/zones/custom-nameservers.ts b/src/resources/zones/custom-nameservers.ts index a24f5a3e4a..d5374a1553 100644 --- a/src/resources/zones/custom-nameservers.ts +++ b/src/resources/zones/custom-nameservers.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; import { SinglePage } from '../../pagination'; /** @@ -58,12 +57,12 @@ export class CustomNameserverUpdateResponsesSinglePage extends SinglePage; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -81,24 +80,56 @@ export interface CustomNameserverGetResponse { } export namespace CustomNameserverGetResponse { + 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; } @@ -106,7 +137,7 @@ export namespace CustomNameserverGetResponse { export interface CustomNameserverUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -123,7 +154,7 @@ export interface CustomNameserverUpdateParams { export interface CustomNameserverGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } diff --git a/tests/api-resources/ai-gateway/ai-gateway.test.ts b/tests/api-resources/ai-gateway/ai-gateway.test.ts index fdb863542c..2b8f9cbe5c 100644 --- a/tests/api-resources/ai-gateway/ai-gateway.test.ts +++ b/tests/api-resources/ai-gateway/ai-gateway.test.ts @@ -81,6 +81,7 @@ describe('resource aiGateway', () => { log_management_strategy: 'STOP_INSERTING', logpush: true, logpush_public_key: 'xxxxxxxxxxxxxxxx', + store_id: 'store_id', }); }); diff --git a/tests/api-resources/browser-rendering/json.test.ts b/tests/api-resources/browser-rendering/json.test.ts index 9443f79ae3..d7317f73a1 100644 --- a/tests/api-resources/browser-rendering/json.test.ts +++ b/tests/api-resources/browser-rendering/json.test.ts @@ -50,6 +50,7 @@ describe('resource json', () => { url: 'url', }, ], + custom_ai: [{ authorization: 'authorization', model: 'model' }], emulateMediaType: 'emulateMediaType', gotoOptions: { referer: 'referer', diff --git a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts index 42e52d5807..ebb748d3f9 100644 --- a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts +++ b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts @@ -26,6 +26,8 @@ describe('resource namespaces', () => { test('list: required and optional params', async () => { const response = await client.durableObjects.namespaces.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 1, }); }); }); diff --git a/tests/api-resources/kv/namespaces/keys.test.ts b/tests/api-resources/kv/namespaces/keys.test.ts index 1d9985944b..4e16a3b3c0 100644 --- a/tests/api-resources/kv/namespaces/keys.test.ts +++ b/tests/api-resources/kv/namespaces/keys.test.ts @@ -54,33 +54,10 @@ describe('resource keys', () => { }); }); - test('bulkGet: only required params', async () => { - const responsePromise = client.kv.namespaces.keys.bulkGet('0f2ac74b498b48028cb68387c421e279', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - keys: ['My-Key'], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('bulkGet: required and optional params', async () => { - const response = await client.kv.namespaces.keys.bulkGet('0f2ac74b498b48028cb68387c421e279', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - keys: ['My-Key'], - type: 'text', - withMetadata: true, - }); - }); - test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.keys.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{ key: 'My-Key', value: 'Some string' }], + body: [{}], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -96,12 +73,12 @@ describe('resource keys', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { - key: 'My-Key', - value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + key: 'My-Key', + metadata: { someMetadataKey: 'bar' }, + value: 'Some string', }, ], }); diff --git a/tests/api-resources/kv/namespaces/namespaces.test.ts b/tests/api-resources/kv/namespaces/namespaces.test.ts index 83aa204719..d69492f799 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -113,33 +113,10 @@ describe('resource namespaces', () => { }); }); - test('bulkGet: only required params', async () => { - const responsePromise = client.kv.namespaces.bulkGet('0f2ac74b498b48028cb68387c421e279', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - keys: ['My-Key'], - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('bulkGet: required and optional params', async () => { - const response = await client.kv.namespaces.bulkGet('0f2ac74b498b48028cb68387c421e279', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - keys: ['My-Key'], - type: 'text', - withMetadata: true, - }); - }); - test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{ key: 'My-Key', value: 'Some string' }], + body: [{}], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -155,12 +132,12 @@ describe('resource namespaces', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { - key: 'My-Key', - value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + key: 'My-Key', + metadata: { someMetadataKey: 'bar' }, + value: 'Some string', }, ], }); diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..2d1cc3ddf6 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -14,6 +14,7 @@ describe('resource values', () => { test.skip('update: only required params', async () => { const responsePromise = client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', }); const rawResponse = await responsePromise.asResponse(); @@ -29,10 +30,10 @@ describe('resource values', () => { test.skip('update: required and optional params', async () => { const response = await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, }); }); diff --git a/tests/api-resources/logs/control/cmb/config.test.ts b/tests/api-resources/logs/control/cmb/config.test.ts deleted file mode 100644 index f90f8827a0..0000000000 --- a/tests/api-resources/logs/control/cmb/config.test.ts +++ /dev/null @@ -1,71 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource config', () => { - test('create: only required params', async () => { - const responsePromise = client.logs.control.cmb.config.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.logs.control.cmb.config.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - allow_out_of_region_access: false, - regions: 'eu', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.logs.control.cmb.config.delete({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('delete: required and optional params', async () => { - const response = await client.logs.control.cmb.config.delete({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.logs.control.cmb.config.get({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.logs.control.cmb.config.get({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); -}); diff --git a/tests/api-resources/logs/control/retention.test.ts b/tests/api-resources/logs/control/retention.test.ts deleted file mode 100644 index 12d00d074b..0000000000 --- a/tests/api-resources/logs/control/retention.test.ts +++ /dev/null @@ -1,49 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource retention', () => { - test('create: only required params', async () => { - const responsePromise = client.logs.control.retention.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.logs.control.retention.create({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - flag: true, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.logs.control.retention.get({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.logs.control.retention.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); diff --git a/tests/api-resources/logs/rayid.test.ts b/tests/api-resources/logs/rayid.test.ts deleted file mode 100644 index 4e5aeb35e0..0000000000 --- a/tests/api-resources/logs/rayid.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource RayID', () => { - test('get: only required params', async () => { - const responsePromise = client.logs.RayID.get('41ddf1740f67442d', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.logs.RayID.get('41ddf1740f67442d', { - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - fields: 'ClientIP,RayID,EdgeStartTimestamp', - timestamps: 'unixnano', - }); - }); -}); diff --git a/tests/api-resources/logs/received/fields.test.ts b/tests/api-resources/logs/received/fields.test.ts deleted file mode 100644 index 1d1882bd46..0000000000 --- a/tests/api-resources/logs/received/fields.test.ts +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource fields', () => { - test('get: only required params', async () => { - const responsePromise = client.logs.received.fields.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.logs.received.fields.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); - }); -}); diff --git a/tests/api-resources/logs/received/received.test.ts b/tests/api-resources/logs/received/received.test.ts deleted file mode 100644 index 9cbc7e0830..0000000000 --- a/tests/api-resources/logs/received/received.test.ts +++ /dev/null @@ -1,38 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource received', () => { - test('get: only required params', async () => { - const responsePromise = client.logs.received.get({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - end: '2018-05-20T10:01:00Z', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.logs.received.get({ - zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - end: '2018-05-20T10:01:00Z', - count: 1, - fields: 'ClientIP,RayID,EdgeStartTimestamp', - sample: 0.1, - start: '2018-05-20T10:00:00Z', - timestamps: 'unixnano', - }); - }); -}); diff --git a/tests/api-resources/queues/messages.test.ts b/tests/api-resources/queues/messages.test.ts index 1e4b58a9d3..681ca31693 100644 --- a/tests/api-resources/queues/messages.test.ts +++ b/tests/api-resources/queues/messages.test.ts @@ -42,27 +42,6 @@ describe('resource messages', () => { }); }); - test('bulkPush: only required params', async () => { - const responsePromise = client.queues.messages.bulkPush('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('bulkPush: required and optional params', async () => { - const response = await client.queues.messages.bulkPush('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - delay_seconds: 0, - messages: [{ body: 'body', content_type: 'text', delay_seconds: 0 }], - }); - }); - test('pull: only required params', async () => { const responsePromise = client.queues.messages.pull('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -83,26 +62,4 @@ describe('resource messages', () => { visibility_timeout_ms: 6000, }); }); - - test('push: only required params', async () => { - const responsePromise = client.queues.messages.push('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('push: required and optional params', async () => { - const response = await client.queues.messages.push('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: 'body', - content_type: 'text', - delay_seconds: 0, - }); - }); }); diff --git a/tests/api-resources/r2/buckets/domains/custom.test.ts b/tests/api-resources/r2/buckets/domains/custom.test.ts index 414dbbd1dc..0912f1f272 100644 --- a/tests/api-resources/r2/buckets/domains/custom.test.ts +++ b/tests/api-resources/r2/buckets/domains/custom.test.ts @@ -34,6 +34,7 @@ describe('resource custom', () => { domain: 'prefix.example-domain.com', enabled: true, zoneId: '36ca64a6d92827b8a6b90be344bb1bfd', + ciphers: ['string'], minTLS: '1.0', jurisdiction: 'default', }); @@ -62,6 +63,7 @@ describe('resource custom', () => { 'example-domain/custom-domain.com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + ciphers: ['string'], enabled: true, minTLS: '1.2', jurisdiction: 'default', diff --git a/tests/api-resources/workers/observability/telemetry.test.ts b/tests/api-resources/workers/observability/telemetry.test.ts deleted file mode 100644 index fe09f5d99a..0000000000 --- a/tests/api-resources/workers/observability/telemetry.test.ts +++ /dev/null @@ -1,110 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource telemetry', () => { - test('keys: only required params', async () => { - const responsePromise = client.workers.observability.telemetry.keys({ account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('keys: required and optional params', async () => { - const response = await client.workers.observability.telemetry.keys({ - account_id: 'account_id', - datasets: ['string'], - filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], - keyNeedle: { value: 'string', isRegex: true, matchCase: true }, - limit: 0, - needle: { value: 'string', isRegex: true, matchCase: true }, - timeframe: { from: 0, to: 0 }, - }); - }); - - test('query: only required params', async () => { - const responsePromise = client.workers.observability.telemetry.query({ - account_id: 'account_id', - queryId: 'queryId', - timeframe: { from: 0, to: 0 }, - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('query: required and optional params', async () => { - const response = await client.workers.observability.telemetry.query({ - account_id: 'account_id', - queryId: 'queryId', - timeframe: { from: 0, to: 0 }, - chart: true, - compare: true, - dry: true, - granularity: 0, - ignoreSeries: true, - limit: 100, - offset: 'offset', - offsetBy: 0, - offsetDirection: 'offsetDirection', - parameters: { - calculations: [{ operator: 'uniq', alias: 'alias', key: 'key', keyType: 'string' }], - datasets: ['string'], - filterCombination: 'and', - filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], - groupBys: [{ type: 'string', value: 'value' }], - havings: [{ key: 'key', operation: 'eq', value: 0 }], - limit: 0, - needle: { value: 'string', isRegex: true, matchCase: true }, - orderBy: { value: 'value', order: 'asc' }, - }, - patternType: 'message', - view: 'traces', - }); - }); - - test('values: only required params', async () => { - const responsePromise = client.workers.observability.telemetry.values({ - account_id: 'account_id', - datasets: ['string'], - key: 'key', - timeframe: { from: 0, to: 0 }, - type: 'string', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('values: required and optional params', async () => { - const response = await client.workers.observability.telemetry.values({ - account_id: 'account_id', - datasets: ['string'], - key: 'key', - timeframe: { from: 0, to: 0 }, - type: 'string', - filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], - limit: 0, - needle: { value: 'string', isRegex: true, matchCase: true }, - }); - }); -}); diff --git a/tests/api-resources/workflows/instances/events.test.ts b/tests/api-resources/workflows/instances/events.test.ts deleted file mode 100644 index a929a7e0d3..0000000000 --- a/tests/api-resources/workflows/instances/events.test.ts +++ /dev/null @@ -1,32 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource events', () => { - test('create: only required params', async () => { - const responsePromise = client.workflows.instances.events.create('x', 'x', 'x', { - account_id: 'account_id', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.workflows.instances.events.create('x', 'x', 'x', { - account_id: 'account_id', - body: {}, - }); - }); -}); diff --git a/tests/api-resources/workflows/instances/instances.test.ts b/tests/api-resources/workflows/instances/instances.test.ts deleted file mode 100644 index a33eac54ad..0000000000 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ /dev/null @@ -1,87 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource instances', () => { - test('create: only required params', async () => { - const responsePromise = client.workflows.instances.create('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('create: required and optional params', async () => { - const response = await client.workflows.instances.create('x', { - account_id: 'account_id', - instance_id: 'instance_id', - instance_retention: {}, - params: {}, - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.workflows.instances.list('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: required and optional params', async () => { - const response = await client.workflows.instances.list('x', { - account_id: 'account_id', - date_end: '2019-12-27T18:11:19.117Z', - date_start: '2019-12-27T18:11:19.117Z', - page: 1, - per_page: 1, - status: 'queued', - }); - }); - - test('bulk: only required params', async () => { - const responsePromise = client.workflows.instances.bulk('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('bulk: required and optional params', async () => { - const response = await client.workflows.instances.bulk('x', { - account_id: 'account_id', - body: [{ instance_id: 'instance_id', instance_retention: {}, params: {} }], - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.workflows.instances.get('x', 'x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.workflows.instances.get('x', 'x', { account_id: 'account_id' }); - }); -}); diff --git a/tests/api-resources/workflows/instances/status.test.ts b/tests/api-resources/workflows/instances/status.test.ts deleted file mode 100644 index 238df1e9a5..0000000000 --- a/tests/api-resources/workflows/instances/status.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource status', () => { - test('edit: only required params', async () => { - const responsePromise = client.workflows.instances.status.edit('x', 'x', { - account_id: 'account_id', - status: 'resume', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('edit: required and optional params', async () => { - const response = await client.workflows.instances.status.edit('x', 'x', { - account_id: 'account_id', - status: 'resume', - }); - }); -}); diff --git a/tests/api-resources/workflows/versions.test.ts b/tests/api-resources/workflows/versions.test.ts deleted file mode 100644 index ee27857662..0000000000 --- a/tests/api-resources/workflows/versions.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource versions', () => { - test('list: only required params', async () => { - const responsePromise = client.workflows.versions.list('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: required and optional params', async () => { - const response = await client.workflows.versions.list('x', { - account_id: 'account_id', - page: 1, - per_page: 1, - }); - }); - - test('get: only required params', async () => { - const responsePromise = client.workflows.versions.get('x', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { - account_id: 'account_id', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.workflows.versions.get('x', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { - account_id: 'account_id', - }); - }); -}); diff --git a/tests/api-resources/workflows/workflows.test.ts b/tests/api-resources/workflows/workflows.test.ts deleted file mode 100644 index c58e0da536..0000000000 --- a/tests/api-resources/workflows/workflows.test.ts +++ /dev/null @@ -1,85 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource workflows', () => { - test('update: only required params', async () => { - const responsePromise = client.workflows.update('x', { - account_id: 'account_id', - class_name: 'x', - script_name: 'x', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('update: required and optional params', async () => { - const response = await client.workflows.update('x', { - account_id: 'account_id', - class_name: 'x', - script_name: 'x', - }); - }); - - test('list: only required params', async () => { - const responsePromise = client.workflows.list({ account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: required and optional params', async () => { - const response = await client.workflows.list({ - account_id: 'account_id', - page: 1, - per_page: 1, - search: 'x', - }); - }); - - test('delete: only required params', async () => { - const responsePromise = client.workflows.delete('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('delete: required and optional params', async () => { - const response = await client.workflows.delete('x', { account_id: 'account_id' }); - }); - - test('get: only required params', async () => { - const responsePromise = client.workflows.get('x', { account_id: 'account_id' }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: required and optional params', async () => { - const response = await client.workflows.get('x', { account_id: 'account_id' }); - }); -}); From 0a4e4049bcf2d6ea77fd3e3776f297e95f8bd555 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:10:45 +0000 Subject: [PATCH 245/423] feat(client): support file upload requests --- api.md | 6 ++-- src/resources/radar/ai/to-markdown.ts | 20 ++++--------- .../zero-trust/dlp/datasets/datasets.ts | 3 +- .../zero-trust/dlp/datasets/index.ts | 2 +- .../zero-trust/dlp/datasets/upload.ts | 28 ++++--------------- .../dlp/datasets/versions/entries.ts | 24 ++++------------ .../zero-trust/dlp/datasets/versions/index.ts | 2 +- .../dlp/datasets/versions/versions.ts | 8 ++---- .../radar/ai/to-markdown.test.ts | 15 +++++----- .../zero-trust/dlp/datasets/upload.test.ts | 5 ++-- .../dlp/datasets/versions/entries.test.ts | 5 ++-- 11 files changed, 38 insertions(+), 80 deletions(-) diff --git a/api.md b/api.md index 27854a1887..b80ca94725 100644 --- a/api.md +++ b/api.md @@ -5592,7 +5592,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset #### Versions @@ -5612,7 +5612,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse ### Patterns @@ -6276,7 +6276,7 @@ Types: Methods: -- client.radar.ai.toMarkdown.create({ ...params }) -> ToMarkdownCreateResponsesSinglePage +- client.radar.ai.toMarkdown.create(body, { ...params }) -> ToMarkdownCreateResponsesSinglePage ### Inference diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts index 045a3212b9..1da4decd3e 100644 --- a/src/resources/radar/ai/to-markdown.ts +++ b/src/resources/radar/ai/to-markdown.ts @@ -13,22 +13,24 @@ export class ToMarkdown extends APIResource { * ```ts * // Automatically fetches more pages as needed. * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * fs.createReadStream('path/to/file'), + * fs.createReadStream('path/to/file'), * )) { * // ... * } * ``` */ create( + body: string | ArrayBufferView | ArrayBuffer | BlobLike, params: ToMarkdownCreateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { account_id, body } = params ?? {}; + const { account_id } = params ?? {}; return this._client.getAPIList( `/accounts/${account_id}/ai/tomarkdown`, ToMarkdownCreateResponsesSinglePage, { - body: body, + body, method: 'post', ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, @@ -52,17 +54,7 @@ export interface ToMarkdownCreateResponse { tokens: string; } -export interface ToMarkdownCreateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - body?: string | ArrayBufferView | ArrayBuffer | BlobLike; -} +export type ToMarkdownCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; ToMarkdown.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; diff --git a/src/resources/zero-trust/dlp/datasets/datasets.ts b/src/resources/zero-trust/dlp/datasets/datasets.ts index ef7b0cb2cc..06d9063140 100644 --- a/src/resources/zero-trust/dlp/datasets/datasets.ts +++ b/src/resources/zero-trust/dlp/datasets/datasets.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as UploadAPI from './upload'; -import { NewVersion, Upload as UploadAPIUpload, UploadCreateParams, UploadEditParams } from './upload'; +import { NewVersion, Upload as UploadAPIUpload, UploadCreateParams } from './upload'; import * as VersionsAPI from './versions/versions'; import { VersionCreateParams, @@ -309,7 +309,6 @@ export declare namespace Datasets { UploadAPIUpload as Upload, type NewVersion as NewVersion, type UploadCreateParams as UploadCreateParams, - type UploadEditParams as UploadEditParams, }; export { diff --git a/src/resources/zero-trust/dlp/datasets/index.ts b/src/resources/zero-trust/dlp/datasets/index.ts index 1b8e055782..33b9a6ce27 100644 --- a/src/resources/zero-trust/dlp/datasets/index.ts +++ b/src/resources/zero-trust/dlp/datasets/index.ts @@ -12,7 +12,7 @@ export { type DatasetDeleteParams, type DatasetGetParams, } from './datasets'; -export { Upload, type NewVersion, type UploadCreateParams, type UploadEditParams } from './upload'; +export { Upload, type NewVersion, type UploadCreateParams } from './upload'; export { VersionCreateResponsesSinglePage, Versions, diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index 32b2097543..789b43d6f7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -44,20 +44,18 @@ export class Upload extends APIResource { * await client.zeroTrust.dlp.datasets.upload.edit( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * 0, - * { - * account_id: 'account_id', - * body: fs.createReadStream('path/to/file'), - * }, + * fs.createReadStream('path/to/file'), + * fs.createReadStream('path/to/file'), * ); * ``` */ edit( datasetId: string, version: number, - params: UploadEditParams, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id, body } = params; + const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { body: body, @@ -99,22 +97,6 @@ export interface UploadCreateParams { account_id: string; } -export interface UploadEditParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - body: string | ArrayBufferView | ArrayBuffer | BlobLike; -} - export declare namespace Upload { - export { - type NewVersion as NewVersion, - type UploadCreateParams as UploadCreateParams, - type UploadEditParams as UploadEditParams, - }; + export { type NewVersion as NewVersion, type UploadCreateParams as UploadCreateParams }; } diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index 4cbeffadc1..a43975f5cc 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -16,10 +16,8 @@ export class Entries extends APIResource { * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * 0, * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - * { - * account_id: 'account_id', - * body: fs.createReadStream('path/to/file'), - * }, + * fs.createReadStream('path/to/file'), + * fs.createReadStream('path/to/file'), * ); * ``` */ @@ -27,10 +25,10 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - params: EntryCreateParams, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { - const { account_id, body } = params; + const { account_id } = params; return ( this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, @@ -55,18 +53,6 @@ export interface EntryCreateResponse { upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } -export interface EntryCreateParams { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: - */ - body: string | ArrayBufferView | ArrayBuffer | BlobLike; -} - export declare namespace Entries { - export { type EntryCreateResponse as EntryCreateResponse, type EntryCreateParams as EntryCreateParams }; + export { type EntryCreateResponse as EntryCreateResponse }; } diff --git a/src/resources/zero-trust/dlp/datasets/versions/index.ts b/src/resources/zero-trust/dlp/datasets/versions/index.ts index fa61430711..40458e879c 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/index.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Entries, type EntryCreateResponse, type EntryCreateParams } from './entries'; +export { Entries, type EntryCreateResponse } from './entries'; export { VersionCreateResponsesSinglePage, Versions, diff --git a/src/resources/zero-trust/dlp/datasets/versions/versions.ts b/src/resources/zero-trust/dlp/datasets/versions/versions.ts index a97887e4a8..254bc0b4da 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/versions.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/versions.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../../resource'; import * as Core from '../../../../../core'; import * as EntriesAPI from './entries'; -import { Entries, EntryCreateParams, EntryCreateResponse } from './entries'; +import { Entries, EntryCreateResponse } from './entries'; import { SinglePage } from '../../../../../pagination'; export class Versions extends APIResource { @@ -98,9 +98,5 @@ export declare namespace Versions { type VersionCreateParams as VersionCreateParams, }; - export { - Entries as Entries, - type EntryCreateResponse as EntryCreateResponse, - type EntryCreateParams as EntryCreateParams, - }; + export { Entries as Entries, type EntryCreateResponse as EntryCreateResponse }; } diff --git a/tests/api-resources/radar/ai/to-markdown.test.ts b/tests/api-resources/radar/ai/to-markdown.test.ts index 8bfd2374c3..d7636b03fb 100644 --- a/tests/api-resources/radar/ai/to-markdown.test.ts +++ b/tests/api-resources/radar/ai/to-markdown.test.ts @@ -12,9 +12,10 @@ const client = new Cloudflare({ describe('resource toMarkdown', () => { // TODO: investigate prism error for invalid security scheme used test.skip('create: only required params', async () => { - const responsePromise = client.radar.ai.toMarkdown.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -26,9 +27,9 @@ describe('resource toMarkdown', () => { // TODO: investigate prism error for invalid security scheme used test.skip('create: required and optional params', async () => { - const response = await client.radar.ai.toMarkdown.create({ - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: await toFile(Buffer.from('# my file contents'), 'README.md'), - }); + const response = await client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); }); }); diff --git a/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts b/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts index 33efd7cd26..889b4773eb 100644 --- a/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts +++ b/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts @@ -36,7 +36,7 @@ describe('resource upload', () => { const responsePromise = client.zeroTrust.dlp.datasets.upload.edit( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, - { account_id: 'account_id', body: await toFile(Buffer.from('# my file contents'), 'README.md') }, + await toFile(Buffer.from('# my file contents'), 'README.md'), ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -52,7 +52,8 @@ describe('resource upload', () => { const response = await client.zeroTrust.dlp.datasets.upload.edit( '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, - { account_id: 'account_id', body: await toFile(Buffer.from('# my file contents'), 'README.md') }, + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), ); }); }); diff --git a/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts b/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts index d261d8fa56..5be46fba56 100755 --- a/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts @@ -16,7 +16,7 @@ describe('resource entries', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { account_id: 'account_id', body: await toFile(Buffer.from('# my file contents'), 'README.md') }, + await toFile(Buffer.from('# my file contents'), 'README.md'), ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -33,7 +33,8 @@ describe('resource entries', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', - { account_id: 'account_id', body: await toFile(Buffer.from('# my file contents'), 'README.md') }, + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), ); }); }); From a1301f033bec4e53d382744bc2ef5c22c2139595 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:22:29 +0000 Subject: [PATCH 246/423] chore(api): update composite API spec --- .stats.yml | 6 +- api.md | 18 +- scripts/detect-breaking-changes | 3 - src/resources/ai/ai.ts | 29 ++- .../threat-events/threat-events.ts | 6 +- src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 194 +--------------- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 215 +----------------- src/resources/radar/bots/bots.ts | 2 + src/resources/snippets/rules.ts | 8 +- .../radar/ai/bots/summary.test.ts | 50 ---- .../radar/ai/timeseries-groups.test.ts | 51 ----- tests/api-resources/snippets/rules.test.ts | 6 +- 16 files changed, 51 insertions(+), 565 deletions(-) delete mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts diff --git a/.stats.yml b/.stats.yml index 3471ec286f..f1502f57d0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1756 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b079f080cace87a18243c586559e7307e55499171d5cbf440932ad6ee8a0d65e.yml -openapi_spec_hash: 64b0ff31c81d75b8ecb141a233dad48e +configured_endpoints: 1754 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10b3e60b93764f161c5b7a9f250787e96cce6b64f7362ac7b11010230dc94afb.yml +openapi_spec_hash: 66e1a1e665b68d9f52d9a58a7b554ec6 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index b80ca94725..752d00ffec 100644 --- a/api.md +++ b/api.md @@ -6310,24 +6310,8 @@ Methods: #### Summary -Types: - -- SummaryUserAgentResponse - -Methods: - -- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse - ### TimeseriesGroups -Types: - -- TimeseriesGroupUserAgentResponse - -Methods: - -- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse - ## Annotations Types: @@ -7654,7 +7638,7 @@ Types: Methods: -- client.snippets.rules.update([ ...body ]) -> RuleUpdateResponsesSinglePage +- client.snippets.rules.update({ ...params }) -> RuleUpdateResponsesSinglePage - client.snippets.rules.list({ ...params }) -> RuleListResponsesSinglePage - client.snippets.rules.delete({ ...params }) -> RuleDeleteResponsesSinglePage diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 944ada5878..63fd3e8a1e 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -532,9 +532,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots/bots.test.ts - tests/api-resources/radar/ai/bots/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index f2c856be09..a728fa6bf6 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -65,7 +65,8 @@ export type AIRunResponse = | AIRunResponse.Translation | AIRunResponse.Summarization | AIRunResponse.ImageToText - | AIRunResponse.ImageTextToText; + | AIRunResponse.ImageTextToText + | AIRunResponse.MultimodalEmbeddings; export namespace AIRunResponse { export interface TextClassification { @@ -255,6 +256,12 @@ export namespace AIRunResponse { export interface ImageTextToText { description?: string; } + + export interface MultimodalEmbeddings { + data?: Array>; + + shape?: Array; + } } export type AIRunParams = @@ -271,7 +278,8 @@ export type AIRunParams = | AIRunParams.Summarization | AIRunParams.ImageToText | AIRunParams.Variant12 - | AIRunParams.Variant13; + | AIRunParams.Variant13 + | AIRunParams.MultimodalEmbeddings; export declare namespace AIRunParams { export interface TextClassification { @@ -1020,6 +1028,23 @@ export declare namespace AIRunParams { role: string; } } + + export interface MultimodalEmbeddings { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image?: string; + + /** + * Body param: + */ + text?: Array; + } } AI.Finetunes = Finetunes; diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index e939bc9ed1..34a9196da9 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -502,7 +502,7 @@ export interface ThreatEventCreateParams { /** * Body param: */ - attacker?: string; + attacker?: string | null; /** * Body param: @@ -649,7 +649,7 @@ export namespace ThreatEventBulkCreateParams { accountId?: number; - attacker?: string; + attacker?: string | null; attackerCountry?: string; @@ -684,7 +684,7 @@ export interface ThreatEventEditParams { /** * Body param: */ - attacker?: string; + attacker?: string | null; /** * Body param: diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 6ba8476430..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,11 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupUserAgentParams, - TimeseriesGroupUserAgentResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -46,9 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 865665cba6..0b5807ee07 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; +import { Summary } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,9 +11,5 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { - Summary as Summary, - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; + export { Summary as Summary }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index c94177cbcd..6f7091f3a3 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 298d84ab48..5abd36afe8 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,197 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import { isRequestOptions } from '../../../../core'; -import * as Core from '../../../../core'; -export class Summary extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.userAgent(); - * ``` - */ - userAgent( - query?: SummaryUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: SummaryUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ - result: SummaryUserAgentResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - meta: SummaryUserAgentResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface SummaryUserAgentParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace Summary { - export { - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; -} +export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index a6a9f99c81..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,11 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 938c8980f2..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,218 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.userAgent(); - * ``` - */ - userAgent( - query?: TimeseriesGroupUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupUserAgentResponse.Meta; - - serie_0: TimeseriesGroupUserAgentResponse.Serie0; -} - -export namespace TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupUserAgentParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index c75011e6a0..e57861cb13 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -189,6 +189,8 @@ export namespace BotListResponse { * A kebab-case identifier derived from the bot name. */ slug: string; + + userAgentPatterns: Array; } } diff --git a/src/resources/snippets/rules.ts b/src/resources/snippets/rules.ts index 407f9e5612..fa1b544710 100644 --- a/src/resources/snippets/rules.ts +++ b/src/resources/snippets/rules.ts @@ -12,11 +12,11 @@ export class Rules extends APIResource { params: RuleUpdateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, body } = params; + const { zone_id, ...body } = params; return this._client.getAPIList( `/zones/${zone_id}/snippets/snippet_rules`, RuleUpdateResponsesSinglePage, - { body: body, method: 'put', ...options }, + { body, method: 'put', ...options }, ); } @@ -171,14 +171,14 @@ export interface RuleUpdateParams { /** * Body param: A list of snippet rules. */ - body: Array; + rules: Array; } export namespace RuleUpdateParams { /** * A snippet rule. */ - export interface Body { + export interface Rule { /** * The expression defining which traffic will match the rule. */ diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts deleted file mode 100644 index e45f8279d7..0000000000 --- a/tests/api-resources/radar/ai/bots/summary.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.bots.summary.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent( - { - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 386515626c..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/snippets/rules.test.ts b/tests/api-resources/snippets/rules.test.ts index 3552adbd0c..5f329ac748 100644 --- a/tests/api-resources/snippets/rules.test.ts +++ b/tests/api-resources/snippets/rules.test.ts @@ -13,7 +13,7 @@ describe('resource rules', () => { test('update: only required params', async () => { const responsePromise = client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - body: [{ expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet' }], + rules: [{ expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -27,9 +27,9 @@ describe('resource rules', () => { test('update: required and optional params', async () => { const response = await client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - body: [ + rules: [ { - expression: 'ip.src ne 1.1.1.1', + expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet', description: 'Execute my_snippet when IP address is 1.1.1.1.', enabled: true, From 298d367ca7b84e8e647554ee6143e7fd87aba4ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:57:03 +0000 Subject: [PATCH 247/423] feat(api): api update --- .stats.yml | 6 +- api.md | 144 +- scripts/detect-breaking-changes | 18 + src/resources/ai-gateway/ai-gateway.ts | 15 - src/resources/ai-gateway/logs.ts | 14 +- src/resources/ai/ai.ts | 29 +- src/resources/browser-rendering/json.ts | 20 - .../threat-events/threat-events.ts | 6 +- src/resources/custom-nameservers.ts | 2 +- .../durable-objects/durable-objects.ts | 11 +- src/resources/durable-objects/index.ts | 2 +- .../durable-objects/namespaces/index.ts | 7 +- .../durable-objects/namespaces/namespaces.ts | 20 +- src/resources/kv/index.ts | 3 +- src/resources/kv/kv.ts | 6 +- src/resources/kv/namespaces/index.ts | 5 +- src/resources/kv/namespaces/keys.ts | 132 +- src/resources/kv/namespaces/metadata.ts | 7 +- src/resources/kv/namespaces/namespaces.ts | 164 +- src/resources/kv/namespaces/values.ts | 31 +- src/resources/logs/control/cmb/cmb.ts | 18 +- src/resources/logs/control/cmb/config.ts | 120 +- src/resources/logs/control/cmb/index.ts | 9 +- src/resources/logs/control/control.ts | 16 +- src/resources/logs/control/index.ts | 8 +- src/resources/logs/control/retention.ts | 91 +- src/resources/logs/index.ts | 4 +- src/resources/logs/logs.ts | 12 +- src/resources/logs/rayid.ts | 61 +- src/resources/logs/received/fields.ts | 34 +- src/resources/logs/received/index.ts | 4 +- src/resources/logs/received/received.ts | 104 +- src/resources/magic-transit/pcaps/download.ts | 2 +- .../magic-transit/pcaps/ownership.ts | 8 +- src/resources/magic-transit/pcaps/pcaps.ts | 12 +- src/resources/queues/index.ts | 5 +- src/resources/queues/messages.ts | 217 ++- src/resources/queues/queues.ts | 11 +- src/resources/r2/buckets/domains/custom.ts | 36 - src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 194 ++- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 215 ++- src/resources/radar/bots/bots.ts | 2 - src/resources/request-tracers/traces.ts | 2 +- src/resources/snippets/rules.ts | 8 +- .../certificate-packs/certificate-packs.ts | 130 +- src/resources/workers/observability/index.ts | 12 +- .../workers/observability/observability.ts | 26 +- .../workers/observability/telemetry.ts | 1538 ++++++++++++++++- src/resources/workflows/index.ts | 23 +- src/resources/workflows/instances/events.ts | 40 +- src/resources/workflows/instances/index.ts | 18 +- .../workflows/instances/instances.ts | 405 ++++- src/resources/workflows/instances/status.ts | 54 +- src/resources/workflows/versions.ts | 87 +- src/resources/workflows/workflows.ts | 274 ++- src/resources/zero-trust/dex/colos.ts | 17 +- src/resources/zones/custom-nameservers.ts | 51 +- .../ai-gateway/ai-gateway.test.ts | 1 - .../browser-rendering/json.test.ts | 1 - .../namespaces/namespaces.test.ts | 2 - .../api-resources/kv/namespaces/keys.test.ts | 31 +- .../kv/namespaces/namespaces.test.ts | 31 +- .../kv/namespaces/values.test.ts | 3 +- .../logs/control/cmb/config.test.ts | 71 + .../logs/control/retention.test.ts | 49 + tests/api-resources/logs/rayid.test.ts | 33 + .../logs/received/fields.test.ts | 27 + .../logs/received/received.test.ts | 38 + tests/api-resources/queues/messages.test.ts | 43 + .../r2/buckets/domains/custom.test.ts | 2 - .../radar/ai/bots/summary.test.ts | 50 + .../radar/ai/timeseries-groups.test.ts | 51 + tests/api-resources/snippets/rules.test.ts | 6 +- .../workers/observability/telemetry.test.ts | 110 ++ .../workflows/instances/events.test.ts | 32 + .../workflows/instances/instances.test.ts | 87 + .../workflows/instances/status.test.ts | 33 + .../api-resources/workflows/versions.test.ts | 50 + .../api-resources/workflows/workflows.test.ts | 85 + 83 files changed, 4834 insertions(+), 540 deletions(-) create mode 100644 tests/api-resources/logs/control/cmb/config.test.ts create mode 100644 tests/api-resources/logs/control/retention.test.ts create mode 100644 tests/api-resources/logs/rayid.test.ts create mode 100644 tests/api-resources/logs/received/fields.test.ts create mode 100644 tests/api-resources/logs/received/received.test.ts create mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts create mode 100644 tests/api-resources/workers/observability/telemetry.test.ts create mode 100644 tests/api-resources/workflows/instances/events.test.ts create mode 100644 tests/api-resources/workflows/instances/instances.test.ts create mode 100644 tests/api-resources/workflows/instances/status.test.ts create mode 100644 tests/api-resources/workflows/versions.test.ts create mode 100644 tests/api-resources/workflows/workflows.test.ts diff --git a/.stats.yml b/.stats.yml index f1502f57d0..27be673748 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1754 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-10b3e60b93764f161c5b7a9f250787e96cce6b64f7362ac7b11010230dc94afb.yml -openapi_spec_hash: 66e1a1e665b68d9f52d9a58a7b554ec6 +configured_endpoints: 1782 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb90b7fb6b9b4fdf8aa58c6f60980875a8dc855114fb2f84a4998024d7087f69.yml +openapi_spec_hash: 7eabd8352835bf80892dbb494fdf3ef4 config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index 752d00ffec..de3c2f95de 100644 --- a/api.md +++ b/api.md @@ -1702,16 +1702,61 @@ Methods: ### Retention +Types: + +- RetentionCreateResponse +- RetentionGetResponse + +Methods: + +- client.logs.control.retention.create({ ...params }) -> RetentionCreateResponse | null +- client.logs.control.retention.get({ ...params }) -> RetentionGetResponse | null + ### Cmb #### Config +Types: + +- CmbConfig +- ConfigDeleteResponse + +Methods: + +- client.logs.control.cmb.config.create({ ...params }) -> CmbConfig | null +- client.logs.control.cmb.config.delete({ ...params }) -> ConfigDeleteResponse | null +- client.logs.control.cmb.config.get({ ...params }) -> CmbConfig | null + ## RayID +Types: + +- RayIDGetResponse + +Methods: + +- client.logs.RayID.get(RayID, { ...params }) -> RayIDGetResponse + ## Received +Types: + +- ReceivedGetResponse + +Methods: + +- client.logs.received.get({ ...params }) -> ReceivedGetResponse + ### Fields +Types: + +- FieldGetResponse + +Methods: + +- client.logs.received.fields.get({ ...params }) -> FieldGetResponse + # OriginTLSClientAuth Types: @@ -2168,6 +2213,18 @@ Methods: ### 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 @@ -2175,18 +2232,19 @@ Methods: Types: - Namespace -- NamespaceUpdateResponse - NamespaceDeleteResponse - NamespaceBulkDeleteResponse +- NamespaceBulkGetResponse - 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.bulkGet(namespaceId, { ...params }) -> NamespaceBulkGetResponse | null - client.kv.namespaces.bulkUpdate(namespaceId, [ ...body ]) -> NamespaceBulkUpdateResponse | null - client.kv.namespaces.get(namespaceId, { ...params }) -> Namespace @@ -2196,12 +2254,14 @@ 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 @@ -2237,7 +2297,7 @@ Types: Methods: -- client.durableObjects.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray +- client.durableObjects.namespaces.list({ ...params }) -> NamespacesSinglePage ### Objects @@ -2284,12 +2344,16 @@ Methods: Types: - MessageAckResponse +- MessageBulkPushResponse - MessagePullResponse +- MessagePushResponse Methods: - client.queues.messages.ack(queueId, { ...params }) -> MessageAckResponse -- client.queues.messages.pull(queueId, { ...params }) -> MessagePullResponsesSinglePage +- client.queues.messages.bulkPush(queueId, { ...params }) -> MessageBulkPushResponse +- client.queues.messages.pull(queueId, { ...params }) -> MessagePullResponse +- client.queues.messages.push(queueId, { ...params }) -> MessagePushResponse ## Purge @@ -6310,8 +6374,24 @@ Methods: #### Summary +Types: + +- SummaryUserAgentResponse + +Methods: + +- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse + ### TimeseriesGroups +Types: + +- TimeseriesGroupUserAgentResponse + +Methods: + +- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse + ## Annotations Types: @@ -7638,7 +7718,7 @@ Types: Methods: -- client.snippets.rules.update({ ...params }) -> RuleUpdateResponsesSinglePage +- client.snippets.rules.update([ ...body ]) -> RuleUpdateResponsesSinglePage - client.snippets.rules.list({ ...params }) -> RuleListResponsesSinglePage - client.snippets.rules.delete({ ...params }) -> RuleDeleteResponsesSinglePage @@ -8172,14 +8252,68 @@ Methods: # Workflows +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 +Types: + +- InstanceCreateResponse +- InstanceListResponse +- InstanceBulkResponse +- InstanceGetResponse + +Methods: + +- client.workflows.instances.create(workflowName, { ...params }) -> InstanceCreateResponse +- client.workflows.instances.list(workflowName, { ...params }) -> InstanceListResponsesV4PagePaginationArray +- client.workflows.instances.bulk(workflowName, [ ...body ]) -> InstanceBulkResponsesSinglePage +- client.workflows.instances.get(workflowName, instanceId, { ...params }) -> InstanceGetResponse + ### Status +Types: + +- StatusEditResponse + +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: + +- VersionListResponse +- VersionGetResponse + +Methods: + +- client.workflows.versions.list(workflowName, { ...params }) -> VersionListResponsesV4PagePaginationArray +- client.workflows.versions.get(workflowName, versionId, { ...params }) -> VersionGetResponse + # ResourceSharing Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 63fd3e8a1e..b039f24cfa 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -142,6 +142,14 @@ TEST_PATHS=( tests/api-resources/logpush/jobs.test.ts tests/api-resources/logpush/ownership.test.ts tests/api-resources/logpush/validate.test.ts + tests/api-resources/logs/logs.test.ts + tests/api-resources/logs/control/control.test.ts + tests/api-resources/logs/control/retention.test.ts + tests/api-resources/logs/control/cmb/cmb.test.ts + tests/api-resources/logs/control/cmb/config.test.ts + tests/api-resources/logs/rayid.test.ts + tests/api-resources/logs/received/received.test.ts + tests/api-resources/logs/received/fields.test.ts tests/api-resources/origin-tls-client-auth/origin-tls-client-auth.test.ts tests/api-resources/origin-tls-client-auth/hostnames/hostnames.test.ts tests/api-resources/origin-tls-client-auth/hostnames/certificates.test.ts @@ -179,6 +187,8 @@ TEST_PATHS=( tests/api-resources/workers/account-settings.test.ts tests/api-resources/workers/domains.test.ts tests/api-resources/workers/subdomains.test.ts + tests/api-resources/workers/observability/observability.test.ts + tests/api-resources/workers/observability/telemetry.test.ts tests/api-resources/kv/kv.test.ts tests/api-resources/kv/namespaces/namespaces.test.ts tests/api-resources/kv/namespaces/keys.test.ts @@ -532,6 +542,9 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts @@ -689,6 +702,11 @@ TEST_PATHS=( tests/api-resources/botnet-feed/configs/configs.test.ts tests/api-resources/botnet-feed/configs/asn.test.ts tests/api-resources/security-txt.test.ts + tests/api-resources/workflows/workflows.test.ts + tests/api-resources/workflows/instances/instances.test.ts + tests/api-resources/workflows/instances/status.test.ts + tests/api-resources/workflows/instances/events.test.ts + tests/api-resources/workflows/versions.test.ts tests/api-resources/resource-sharing/resource-sharing.test.ts tests/api-resources/resource-sharing/recipients.test.ts tests/api-resources/resource-sharing/resources.test.ts diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index c619ead6b7..ca019da35e 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -240,8 +240,6 @@ export interface AIGatewayCreateResponse { logpush?: boolean; logpush_public_key?: string | null; - - store_id?: string | null; } export interface AIGatewayUpdateResponse { @@ -281,8 +279,6 @@ export interface AIGatewayUpdateResponse { logpush?: boolean; logpush_public_key?: string | null; - - store_id?: string | null; } export interface AIGatewayListResponse { @@ -322,8 +318,6 @@ export interface AIGatewayListResponse { logpush?: boolean; logpush_public_key?: string | null; - - store_id?: string | null; } export interface AIGatewayDeleteResponse { @@ -363,8 +357,6 @@ export interface AIGatewayDeleteResponse { logpush?: boolean; logpush_public_key?: string | null; - - store_id?: string | null; } export interface AIGatewayGetResponse { @@ -404,8 +396,6 @@ export interface AIGatewayGetResponse { logpush?: boolean; logpush_public_key?: string | null; - - store_id?: string | null; } export interface AIGatewayCreateParams { @@ -535,11 +525,6 @@ export interface AIGatewayUpdateParams { * Body param: */ logpush_public_key?: string | null; - - /** - * Body param: - */ - store_id?: string | null; } export interface AIGatewayListParams extends V4PagePaginationArrayParams { diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index f2df3ca255..4142a8ce6e 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -408,7 +408,6 @@ export namespace LogListParams { | 'created_at' | 'request_content_type' | 'response_content_type' - | 'request_type' | 'success' | 'cached' | 'provider' @@ -421,13 +420,11 @@ export namespace LogListParams { | 'duration' | 'feedback' | 'event_id' + | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id' - | 'authentication' - | 'wholesale' - | 'compatibilityMode'; + | 'prompts.version_id'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; @@ -480,7 +477,6 @@ export namespace LogDeleteParams { | 'created_at' | 'request_content_type' | 'response_content_type' - | 'request_type' | 'success' | 'cached' | 'provider' @@ -493,13 +489,11 @@ export namespace LogDeleteParams { | 'duration' | 'feedback' | 'event_id' + | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id' - | 'authentication' - | 'wholesale' - | 'compatibilityMode'; + | 'prompts.version_id'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index a728fa6bf6..f2c856be09 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -65,8 +65,7 @@ export type AIRunResponse = | AIRunResponse.Translation | AIRunResponse.Summarization | AIRunResponse.ImageToText - | AIRunResponse.ImageTextToText - | AIRunResponse.MultimodalEmbeddings; + | AIRunResponse.ImageTextToText; export namespace AIRunResponse { export interface TextClassification { @@ -256,12 +255,6 @@ export namespace AIRunResponse { export interface ImageTextToText { description?: string; } - - export interface MultimodalEmbeddings { - data?: Array>; - - shape?: Array; - } } export type AIRunParams = @@ -278,8 +271,7 @@ export type AIRunParams = | AIRunParams.Summarization | AIRunParams.ImageToText | AIRunParams.Variant12 - | AIRunParams.Variant13 - | AIRunParams.MultimodalEmbeddings; + | AIRunParams.Variant13; export declare namespace AIRunParams { export interface TextClassification { @@ -1028,23 +1020,6 @@ export declare namespace AIRunParams { role: string; } } - - export interface MultimodalEmbeddings { - /** - * Path param: - */ - account_id: string; - - /** - * Body param: Image in base64 encoded format. - */ - image?: string; - - /** - * Body param: - */ - text?: Array; - } } AI.Finetunes = Finetunes; diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index 5afa5cc125..f236ed4200 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -98,13 +98,6 @@ export interface JsonCreateParams { */ cookies?: Array; - /** - * Body param: Optional list of custom AI models to use for the request. The models - * will be tried in the order provided, and in case a model returns an error, the - * next one will be used as fallback. - */ - custom_ai?: Array; - /** * Body param: */ @@ -255,19 +248,6 @@ export namespace JsonCreateParams { url?: string; } - export interface CustomAI { - /** - * Authorization token for the AI model: `Bearer `. - */ - authorization: string; - - /** - * AI model to use for the request. Must be formed as `/`, - * e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` - */ - model: string; - } - /** * Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index 34a9196da9..e939bc9ed1 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -502,7 +502,7 @@ export interface ThreatEventCreateParams { /** * Body param: */ - attacker?: string | null; + attacker?: string; /** * Body param: @@ -649,7 +649,7 @@ export namespace ThreatEventBulkCreateParams { accountId?: number; - attacker?: string | null; + attacker?: string; attackerCountry?: string; @@ -684,7 +684,7 @@ export interface ThreatEventEditParams { /** * Body param: */ - attacker?: string | null; + attacker?: string; /** * Body param: diff --git a/src/resources/custom-nameservers.ts b/src/resources/custom-nameservers.ts index 8542a87c22..9e8ba96e78 100644 --- a/src/resources/custom-nameservers.ts +++ b/src/resources/custom-nameservers.ts @@ -102,7 +102,7 @@ export interface CustomNameserver { status: 'moved' | 'pending' | 'verified'; /** - * Identifier. + * Identifier */ zone_tag: string; diff --git a/src/resources/durable-objects/durable-objects.ts b/src/resources/durable-objects/durable-objects.ts index c2a022bafa..0fb700ec65 100644 --- a/src/resources/durable-objects/durable-objects.ts +++ b/src/resources/durable-objects/durable-objects.ts @@ -2,25 +2,20 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; -import { - Namespace, - NamespaceListParams, - Namespaces, - NamespacesV4PagePaginationArray, -} from './namespaces/namespaces'; +import { Namespace, NamespaceListParams, Namespaces, NamespacesSinglePage } from './namespaces/namespaces'; export class DurableObjects extends APIResource { namespaces: NamespacesAPI.Namespaces = new NamespacesAPI.Namespaces(this._client); } DurableObjects.Namespaces = Namespaces; -DurableObjects.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; +DurableObjects.NamespacesSinglePage = NamespacesSinglePage; export declare namespace DurableObjects { export { Namespaces as Namespaces, type Namespace as Namespace, - NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, + NamespacesSinglePage as NamespacesSinglePage, type NamespaceListParams as NamespaceListParams, }; } diff --git a/src/resources/durable-objects/index.ts b/src/resources/durable-objects/index.ts index 5b1a5df711..9ad42425bf 100644 --- a/src/resources/durable-objects/index.ts +++ b/src/resources/durable-objects/index.ts @@ -2,7 +2,7 @@ export { DurableObjects } from './durable-objects'; export { - NamespacesV4PagePaginationArray, + NamespacesSinglePage, Namespaces, type Namespace, type NamespaceListParams, diff --git a/src/resources/durable-objects/namespaces/index.ts b/src/resources/durable-objects/namespaces/index.ts index caae6d139b..eb373cf46d 100644 --- a/src/resources/durable-objects/namespaces/index.ts +++ b/src/resources/durable-objects/namespaces/index.ts @@ -6,9 +6,4 @@ export { type DurableObject, type ObjectListParams, } from './objects'; -export { - NamespacesV4PagePaginationArray, - Namespaces, - type Namespace, - type NamespaceListParams, -} from './namespaces'; +export { NamespacesSinglePage, Namespaces, type Namespace, type NamespaceListParams } from './namespaces'; diff --git a/src/resources/durable-objects/namespaces/namespaces.ts b/src/resources/durable-objects/namespaces/namespaces.ts index 8124a972ac..5547b0e963 100644 --- a/src/resources/durable-objects/namespaces/namespaces.ts +++ b/src/resources/durable-objects/namespaces/namespaces.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ObjectsAPI from './objects'; import { DurableObject, DurableObjectsCursorLimitPagination, ObjectListParams, Objects } from './objects'; -import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; +import { SinglePage } from '../../../pagination'; export class Namespaces extends APIResource { objects: ObjectsAPI.Objects = new ObjectsAPI.Objects(this._client); @@ -15,17 +15,17 @@ export class Namespaces extends APIResource { list( params: NamespaceListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id, ...query } = params; + ): Core.PagePromise { + const { account_id } = params; return this._client.getAPIList( `/accounts/${account_id}/workers/durable_objects/namespaces`, - NamespacesV4PagePaginationArray, - { query, ...options }, + NamespacesSinglePage, + options, ); } } -export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} +export class NamespacesSinglePage extends SinglePage {} export interface Namespace { id?: string; @@ -39,21 +39,21 @@ export interface Namespace { use_sqlite?: boolean; } -export interface NamespaceListParams extends V4PagePaginationArrayParams { +export interface NamespaceListParams { /** - * Path param: Identifier. + * Identifier. */ account_id: string; } -Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; +Namespaces.NamespacesSinglePage = NamespacesSinglePage; Namespaces.Objects = Objects; Namespaces.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; export declare namespace Namespaces { export { type Namespace as Namespace, - NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, + NamespacesSinglePage as NamespacesSinglePage, type NamespaceListParams as NamespaceListParams, }; diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index a8c5f15acb..6b8512b78a 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -5,15 +5,16 @@ export { NamespacesV4PagePaginationArray, Namespaces, type Namespace, - type NamespaceUpdateResponse, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, + type NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse, type NamespaceCreateParams, type NamespaceUpdateParams, type NamespaceListParams, type NamespaceDeleteParams, type NamespaceBulkDeleteParams, + type NamespaceBulkGetParams, type NamespaceBulkUpdateParams, type NamespaceGetParams, } from './namespaces/index'; diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 15034b22f4..6edb9e18af 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -6,6 +6,8 @@ import { Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, + NamespaceBulkGetParams, + NamespaceBulkGetResponse, NamespaceBulkUpdateParams, NamespaceBulkUpdateResponse, NamespaceCreateParams, @@ -14,7 +16,6 @@ import { NamespaceGetParams, NamespaceListParams, NamespaceUpdateParams, - NamespaceUpdateResponse, Namespaces, NamespacesV4PagePaginationArray, } from './namespaces/namespaces'; @@ -30,9 +31,9 @@ export declare namespace KV { export { Namespaces as Namespaces, type Namespace as Namespace, - type NamespaceUpdateResponse as NamespaceUpdateResponse, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, + type NamespaceBulkGetResponse as NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse as NamespaceBulkUpdateResponse, NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceCreateParams as NamespaceCreateParams, @@ -40,6 +41,7 @@ export declare namespace KV { type NamespaceListParams as NamespaceListParams, type NamespaceDeleteParams as NamespaceDeleteParams, type NamespaceBulkDeleteParams as NamespaceBulkDeleteParams, + type NamespaceBulkGetParams as NamespaceBulkGetParams, type NamespaceBulkUpdateParams as NamespaceBulkUpdateParams, type NamespaceGetParams as NamespaceGetParams, }; diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index c275ce10ef..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -5,9 +5,11 @@ export { Keys, type Key, type KeyBulkDeleteResponse, + type KeyBulkGetResponse, type KeyBulkUpdateResponse, type KeyListParams, type KeyBulkDeleteParams, + type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; @@ -15,15 +17,16 @@ export { NamespacesV4PagePaginationArray, Namespaces, type Namespace, - type NamespaceUpdateResponse, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, + type NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse, type NamespaceCreateParams, type NamespaceUpdateParams, type NamespaceListParams, type NamespaceDeleteParams, type NamespaceBulkDeleteParams, + type NamespaceBulkGetParams, type NamespaceBulkUpdateParams, type NamespaceGetParams, } from './namespaces'; diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 3637aaf8bb..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -52,6 +52,27 @@ export class Keys extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based + * values. JSON values can optionally be parsed instead of being returned as a + * string value. Metadata can be included if `withMetadata` is true. + * + * @deprecated Please use kv.namespaces.bulk_get instead + */ + bulkGet( + namespaceId: string, + params: KeyBulkGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, { + body, + ...options, + }) as Core.APIPromise<{ result: KeyBulkGetResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Write multiple keys and values at once. Body should be an array of up to 10,000 * key-value pairs to be stored, along with optional expiration information. @@ -96,15 +117,12 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: { [key: string]: unknown }; + metadata?: unknown; } export interface KeyBulkDeleteResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -114,9 +132,43 @@ export interface KeyBulkDeleteResponse { unsuccessful_keys?: Array; } +export type KeyBulkGetResponse = + | KeyBulkGetResponse.WorkersKVBulkGetResult + | KeyBulkGetResponse.WorkersKVBulkGetResultWithMetadata; + +export namespace KeyBulkGetResponse { + export interface WorkersKVBulkGetResult { + /** + * Requested keys are paired with their values in an object. + */ + values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; + } + + export interface WorkersKVBulkGetResultWithMetadata { + /** + * Requested keys are paired with their values and metadata in an object. + */ + values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; + } + + export namespace WorkersKVBulkGetResultWithMetadata { + export interface Values { + metadata: unknown; + + value: unknown; + + /** + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. + */ + expiration?: number; + } + } +} + export interface KeyBulkUpdateResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -128,20 +180,20 @@ export interface KeyBulkUpdateResponse { export interface KeyListParams extends CursorLimitPaginationParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; /** - * Query param: A string prefix used to filter down which keys will be returned. - * Exact matches and any key names that begin with the prefix will be returned. + * Query param: Filters returned keys by a name prefix. Exact matches and any key + * names that begin with the prefix will be returned. */ prefix?: string; } export interface KeyBulkDeleteParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -151,9 +203,31 @@ export interface KeyBulkDeleteParams { body: Array; } +export interface KeyBulkGetParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Array of keys to retrieve (maximum of 100). + */ + keys: Array; + + /** + * Body param: Whether to parse JSON values in the response. + */ + type?: 'text' | 'json'; + + /** + * Body param: Whether to include metadata in the response. + */ + withMetadata?: boolean; +} + export interface KeyBulkUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -166,39 +240,35 @@ export interface KeyBulkUpdateParams { export namespace KeyBulkUpdateParams { export interface Body { /** - * Whether or not the server should base64 decode the value before storing it. - * Useful for writing values that wouldn't otherwise be valid JSON strings, such as - * images. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - base64?: boolean; + key: string; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - expiration?: number; + value: string; /** - * The number of seconds for which the key should be visible before it expires. At - * least 60. + * Indicates whether or not the server should base64 decode the value before + * storing it. Useful for writing values that wouldn't otherwise be valid JSON + * strings, such as images. */ - expiration_ttl?: number; + base64?: boolean; /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ - key?: string; + expiration?: number; /** - * Arbitrary JSON that is associated with a key. + * Expires the key after a number of seconds. Must be at least 60. */ - metadata?: { [key: string]: unknown }; + expiration_ttl?: number; - /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. - */ - value?: string; + metadata?: unknown; } } @@ -208,10 +278,12 @@ export declare namespace Keys { export { type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 5e16f872e9..53db763063 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,14 +34,11 @@ export class Metadata extends APIResource { } } -/** - * Arbitrary JSON that is associated with a key. - */ -export type MetadataGetResponse = { [key: string]: unknown }; +export type MetadataGetResponse = unknown; export interface MetadataGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 93777b6e79..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -7,6 +7,8 @@ import { Key, KeyBulkDeleteParams, KeyBulkDeleteResponse, + KeyBulkGetParams, + KeyBulkGetResponse, KeyBulkUpdateParams, KeyBulkUpdateResponse, KeyListParams, @@ -22,7 +24,7 @@ import { ValueGetParams, ValueUpdateParams, ValueUpdateResponse, - Values, + Values as ValuesAPIValues, } from './values'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; @@ -72,13 +74,13 @@ export class Namespaces extends APIResource { namespaceId: string, params: NamespaceUpdateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, ...body } = params; return ( this._client.put(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}`, { body, ...options, - }) as Core.APIPromise<{ result: NamespaceUpdateResponse | null }> + }) as Core.APIPromise<{ result: Namespace }> )._thenUnwrap((obj) => obj.result); } @@ -161,6 +163,36 @@ export class Namespaces extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Retrieve up to 100 KV pairs from the namespace. Keys must contain text-based + * values. JSON values can optionally be parsed instead of being returned as a + * string value. Metadata can be included if `withMetadata` is true. + * + * @example + * ```ts + * const response = await client.kv.namespaces.bulkGet( + * '0f2ac74b498b48028cb68387c421e279', + * { + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * keys: ['My-Key'], + * }, + * ); + * ``` + */ + bulkGet( + namespaceId: string, + params: NamespaceBulkGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/bulk/get`, { + body, + ...options, + }) as Core.APIPromise<{ result: NamespaceBulkGetResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + /** * Write multiple keys and values at once. Body should be an array of up to 10,000 * key-value pairs to be stored, along with optional expiration information. @@ -175,7 +207,7 @@ export class Namespaces extends APIResource { * '0f2ac74b498b48028cb68387c421e279', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * body: [{}], + * body: [{ key: 'My-Key', value: 'Some string' }], * }, * ); * ``` @@ -233,6 +265,11 @@ export interface Namespace { */ title: string; + /** + * True if new beta namespace, with additional preview features. + */ + beta?: boolean; + /** * True if keys written on the URL will be URL-decoded before storing. For example, * if set to "true", a key written on the URL as "%3F" will be stored as "?". @@ -240,13 +277,11 @@ export interface Namespace { supports_url_encoding?: boolean; } -export interface NamespaceUpdateResponse {} - export interface NamespaceDeleteResponse {} export interface NamespaceBulkDeleteResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -256,9 +291,43 @@ export interface NamespaceBulkDeleteResponse { unsuccessful_keys?: Array; } +export type NamespaceBulkGetResponse = + | NamespaceBulkGetResponse.WorkersKVBulkGetResult + | NamespaceBulkGetResponse.WorkersKVBulkGetResultWithMetadata; + +export namespace NamespaceBulkGetResponse { + export interface WorkersKVBulkGetResult { + /** + * Requested keys are paired with their values in an object. + */ + values?: { [key: string]: string | number | boolean | { [key: string]: unknown } }; + } + + export interface WorkersKVBulkGetResultWithMetadata { + /** + * Requested keys are paired with their values and metadata in an object. + */ + values?: { [key: string]: WorkersKVBulkGetResultWithMetadata.Values | null }; + } + + export namespace WorkersKVBulkGetResultWithMetadata { + export interface Values { + metadata: unknown; + + value: unknown; + + /** + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. + */ + expiration?: number; + } + } +} + export interface NamespaceBulkUpdateResponse { /** - * Number of keys successfully updated + * Number of keys successfully updated. */ successful_key_count?: number; @@ -270,7 +339,7 @@ export interface NamespaceBulkUpdateResponse { export interface NamespaceCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -282,7 +351,7 @@ export interface NamespaceCreateParams { export interface NamespaceUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -294,7 +363,7 @@ export interface NamespaceUpdateParams { export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -311,14 +380,14 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { export interface NamespaceDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface NamespaceBulkDeleteParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -328,9 +397,31 @@ export interface NamespaceBulkDeleteParams { body: Array; } +export interface NamespaceBulkGetParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Array of keys to retrieve (maximum of 100). + */ + keys: Array; + + /** + * Body param: Whether to parse JSON values in the response. + */ + type?: 'text' | 'json'; + + /** + * Body param: Whether to include metadata in the response. + */ + withMetadata?: boolean; +} + export interface NamespaceBulkUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -343,45 +434,41 @@ export interface NamespaceBulkUpdateParams { export namespace NamespaceBulkUpdateParams { export interface Body { /** - * Whether or not the server should base64 decode the value before storing it. - * Useful for writing values that wouldn't otherwise be valid JSON strings, such as - * images. + * A key's name. The name may be at most 512 bytes. All printable, non-whitespace + * characters are valid. */ - base64?: boolean; + key: string; /** - * The time, measured in number of seconds since the UNIX epoch, at which the key - * should expire. + * A UTF-8 encoded string to be stored, up to 25 MiB in length. */ - expiration?: number; + value: string; /** - * The number of seconds for which the key should be visible before it expires. At - * least 60. + * Indicates whether or not the server should base64 decode the value before + * storing it. Useful for writing values that wouldn't otherwise be valid JSON + * strings, such as images. */ - expiration_ttl?: number; + base64?: boolean; /** - * A key's name. The name may be at most 512 bytes. All printable, non-whitespace - * characters are valid. + * Expires the key at a certain time, measured in number of seconds since the UNIX + * epoch. */ - key?: string; + expiration?: number; /** - * Arbitrary JSON that is associated with a key. + * Expires the key after a number of seconds. Must be at least 60. */ - metadata?: { [key: string]: unknown }; + expiration_ttl?: number; - /** - * A UTF-8 encoded string to be stored, up to 25 MiB in length. - */ - value?: string; + metadata?: unknown; } } export interface NamespaceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } @@ -390,14 +477,14 @@ Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; Namespaces.KeysCursorLimitPagination = KeysCursorLimitPagination; Namespaces.Metadata = Metadata; -Namespaces.Values = Values; +Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { type Namespace as Namespace, - type NamespaceUpdateResponse as NamespaceUpdateResponse, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, + type NamespaceBulkGetResponse as NamespaceBulkGetResponse, type NamespaceBulkUpdateResponse as NamespaceBulkUpdateResponse, NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceCreateParams as NamespaceCreateParams, @@ -405,6 +492,7 @@ export declare namespace Namespaces { type NamespaceListParams as NamespaceListParams, type NamespaceDeleteParams as NamespaceDeleteParams, type NamespaceBulkDeleteParams as NamespaceBulkDeleteParams, + type NamespaceBulkGetParams as NamespaceBulkGetParams, type NamespaceBulkUpdateParams as NamespaceBulkUpdateParams, type NamespaceGetParams as NamespaceGetParams, }; @@ -413,10 +501,12 @@ export declare namespace Namespaces { Keys as Keys, type Key as Key, type KeyBulkDeleteResponse as KeyBulkDeleteResponse, + type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, + type KeyBulkGetParams as KeyBulkGetParams, type KeyBulkUpdateParams as KeyBulkUpdateParams, }; @@ -427,7 +517,7 @@ export declare namespace Namespaces { }; export { - Values as Values, + ValuesAPIValues as Values, type ValueUpdateResponse as ValueUpdateResponse, type ValueDeleteResponse as ValueDeleteResponse, type ValueUpdateParams as ValueUpdateParams, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index a240802fea..03752a92d4 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -22,7 +22,6 @@ export class Values extends APIResource { * 'My-Key', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', - * metadata: '{"someMetadataKey": "someMetadataValue"}', * value: 'Some Value', * }, * ); @@ -38,12 +37,7 @@ export class Values extends APIResource { return ( this._client.put( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/values/${keyName}`, - Core.maybeMultipartFormRequestOptions({ - query: { expiration, expiration_ttl }, - body, - ...options, - headers: { 'Content-Type': '*/*', ...options?.headers }, - }), + Core.multipartFormRequestOptions({ query: { expiration, expiration_ttl }, body, ...options }), ) as Core.APIPromise<{ result: ValueUpdateResponse | null }> )._thenUnwrap((obj) => obj.result); } @@ -119,43 +113,42 @@ export interface ValueDeleteResponse {} export interface ValueUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; - /** - * Body param: Arbitrary JSON to be associated with a key/value pair. - */ - metadata: string; - /** * Body param: A byte sequence to be stored, up to 25 MiB in length. */ value: string; /** - * Query param: The time, measured in number of seconds since the UNIX epoch, at - * which the key should expire. + * Query param: Expires the key at a certain time, measured in number of seconds + * since the UNIX epoch. */ expiration?: number; /** - * Query param: The number of seconds for which the key should be visible before it - * expires. At least 60. + * Query param: Expires the key after a number of seconds. Must be at least 60. */ expiration_ttl?: number; + + /** + * Body param: + */ + metadata?: unknown; } export interface ValueDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface ValueGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/logs/control/cmb/cmb.ts b/src/resources/logs/control/cmb/cmb.ts index d272ff9745..281cbbf509 100644 --- a/src/resources/logs/control/cmb/cmb.ts +++ b/src/resources/logs/control/cmb/cmb.ts @@ -2,7 +2,14 @@ import { APIResource } from '../../../../resource'; import * as ConfigAPI from './config'; -import { Config } from './config'; +import { + CmbConfig, + Config, + ConfigCreateParams, + ConfigDeleteParams, + ConfigDeleteResponse, + ConfigGetParams, +} from './config'; export class Cmb extends APIResource { config: ConfigAPI.Config = new ConfigAPI.Config(this._client); @@ -11,5 +18,12 @@ export class Cmb extends APIResource { Cmb.Config = Config; export declare namespace Cmb { - export { Config as Config }; + export { + Config as Config, + type CmbConfig as CmbConfig, + type ConfigDeleteResponse as ConfigDeleteResponse, + type ConfigCreateParams as ConfigCreateParams, + type ConfigDeleteParams as ConfigDeleteParams, + type ConfigGetParams as ConfigGetParams, + }; } diff --git a/src/resources/logs/control/cmb/config.ts b/src/resources/logs/control/cmb/config.ts index 98c038ce8c..63af7fdb83 100644 --- a/src/resources/logs/control/cmb/config.ts +++ b/src/resources/logs/control/cmb/config.ts @@ -1,5 +1,123 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import * as Core from '../../../../core'; -export class Config extends APIResource {} +export class Config extends APIResource { + /** + * Updates CMB config. + * + * @example + * ```ts + * const cmbConfig = + * await client.logs.control.cmb.config.create({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create(params: ConfigCreateParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/logs/control/cmb/config`, { + body, + ...options, + }) as Core.APIPromise<{ result: CmbConfig | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Deletes CMB config. + * + * @example + * ```ts + * const config = await client.logs.control.cmb.config.delete({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + delete( + params: ConfigDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/logs/control/cmb/config`, options) as Core.APIPromise<{ + result: ConfigDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets CMB config. + * + * @example + * ```ts + * const cmbConfig = await client.logs.control.cmb.config.get({ + * account_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get(params: ConfigGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/logs/control/cmb/config`, options) as Core.APIPromise<{ + result: CmbConfig | null; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CmbConfig { + /** + * Allow out of region access + */ + allow_out_of_region_access?: boolean; + + /** + * Name of the region. + */ + regions?: string; +} + +export type ConfigDeleteResponse = unknown; + +export interface ConfigCreateParams { + /** + * Path param: Identifier. + */ + account_id: string; + + /** + * Body param: Allow out of region access + */ + allow_out_of_region_access?: boolean; + + /** + * Body param: Name of the region. + */ + regions?: string; +} + +export interface ConfigDeleteParams { + /** + * Identifier. + */ + account_id: string; +} + +export interface ConfigGetParams { + /** + * Identifier. + */ + account_id: string; +} + +export declare namespace Config { + export { + type CmbConfig as CmbConfig, + type ConfigDeleteResponse as ConfigDeleteResponse, + type ConfigCreateParams as ConfigCreateParams, + type ConfigDeleteParams as ConfigDeleteParams, + type ConfigGetParams as ConfigGetParams, + }; +} diff --git a/src/resources/logs/control/cmb/index.ts b/src/resources/logs/control/cmb/index.ts index c65febf631..0d9ca574cc 100644 --- a/src/resources/logs/control/cmb/index.ts +++ b/src/resources/logs/control/cmb/index.ts @@ -1,4 +1,11 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Cmb } from './cmb'; -export { Config } from './config'; +export { + Config, + type CmbConfig, + type ConfigDeleteResponse, + type ConfigCreateParams, + type ConfigDeleteParams, + type ConfigGetParams, +} from './config'; diff --git a/src/resources/logs/control/control.ts b/src/resources/logs/control/control.ts index da86c60aed..8c4fdeea5c 100644 --- a/src/resources/logs/control/control.ts +++ b/src/resources/logs/control/control.ts @@ -2,7 +2,13 @@ import { APIResource } from '../../../resource'; import * as RetentionAPI from './retention'; -import { Retention } from './retention'; +import { + Retention, + RetentionCreateParams, + RetentionCreateResponse, + RetentionGetParams, + RetentionGetResponse, +} from './retention'; import * as CmbAPI from './cmb/cmb'; import { Cmb } from './cmb/cmb'; @@ -15,7 +21,13 @@ Control.Retention = Retention; Control.Cmb = Cmb; export declare namespace Control { - export { Retention as Retention }; + export { + Retention as Retention, + type RetentionCreateResponse as RetentionCreateResponse, + type RetentionGetResponse as RetentionGetResponse, + type RetentionCreateParams as RetentionCreateParams, + type RetentionGetParams as RetentionGetParams, + }; export { Cmb as Cmb }; } diff --git a/src/resources/logs/control/index.ts b/src/resources/logs/control/index.ts index 7b4f398e46..700f3ebeda 100644 --- a/src/resources/logs/control/index.ts +++ b/src/resources/logs/control/index.ts @@ -2,4 +2,10 @@ export { Cmb } from './cmb/index'; export { Control } from './control'; -export { Retention } from './retention'; +export { + Retention, + type RetentionCreateResponse, + type RetentionGetResponse, + type RetentionCreateParams, + type RetentionGetParams, +} from './retention'; diff --git a/src/resources/logs/control/retention.ts b/src/resources/logs/control/retention.ts index 9e00c15d66..c25faf78af 100644 --- a/src/resources/logs/control/retention.ts +++ b/src/resources/logs/control/retention.ts @@ -1,5 +1,94 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class Retention extends APIResource {} +export class Retention extends APIResource { + /** + * Updates log retention flag for Logpull API. + * + * @example + * ```ts + * const retention = + * await client.logs.control.retention.create({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + create( + params: RetentionCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...body } = params; + return ( + this._client.post(`/zones/${zone_id}/logs/control/retention/flag`, { + body, + ...options, + }) as Core.APIPromise<{ result: RetentionCreateResponse | null }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Gets log retention flag for Logpull API. + * + * @example + * ```ts + * const retention = await client.logs.control.retention.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get( + params: RetentionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id } = params; + return ( + this._client.get(`/zones/${zone_id}/logs/control/retention/flag`, options) as Core.APIPromise<{ + result: RetentionGetResponse | null; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface RetentionCreateResponse { + /** + * The log retention flag for Logpull API. + */ + flag?: boolean; +} + +export interface RetentionGetResponse { + /** + * The log retention flag for Logpull API. + */ + flag?: boolean; +} + +export interface RetentionCreateParams { + /** + * Path param: Identifier. + */ + zone_id: string; + + /** + * Body param: The log retention flag for Logpull API. + */ + flag?: boolean; +} + +export interface RetentionGetParams { + /** + * Identifier. + */ + zone_id: string; +} + +export declare namespace Retention { + export { + type RetentionCreateResponse as RetentionCreateResponse, + type RetentionGetResponse as RetentionGetResponse, + type RetentionCreateParams as RetentionCreateParams, + type RetentionGetParams as RetentionGetParams, + }; +} diff --git a/src/resources/logs/index.ts b/src/resources/logs/index.ts index 75ecc8c68f..edef47a1eb 100644 --- a/src/resources/logs/index.ts +++ b/src/resources/logs/index.ts @@ -2,5 +2,5 @@ export { Control } from './control/index'; export { Logs } from './logs'; -export { RayID } from './rayid'; -export { Received } from './received/index'; +export { RayID, type RayIDGetResponse, type RayIDGetParams } from './rayid'; +export { Received, type ReceivedGetResponse, type ReceivedGetParams } from './received/index'; diff --git a/src/resources/logs/logs.ts b/src/resources/logs/logs.ts index f1245aa7aa..8bc3fd5875 100644 --- a/src/resources/logs/logs.ts +++ b/src/resources/logs/logs.ts @@ -2,11 +2,11 @@ import { APIResource } from '../../resource'; import * as RayIDAPI from './rayid'; -import { RayID } from './rayid'; +import { RayID, RayIDGetParams, RayIDGetResponse } from './rayid'; import * as ControlAPI from './control/control'; import { Control } from './control/control'; import * as ReceivedAPI from './received/received'; -import { Received } from './received/received'; +import { Received, ReceivedGetParams, ReceivedGetResponse } from './received/received'; export class Logs extends APIResource { control: ControlAPI.Control = new ControlAPI.Control(this._client); @@ -21,7 +21,11 @@ Logs.Received = Received; export declare namespace Logs { export { Control as Control }; - export { RayID as RayID }; + export { RayID as RayID, type RayIDGetResponse as RayIDGetResponse, type RayIDGetParams as RayIDGetParams }; - export { Received as Received }; + export { + Received as Received, + type ReceivedGetResponse as ReceivedGetResponse, + type ReceivedGetParams as ReceivedGetParams, + }; } diff --git a/src/resources/logs/rayid.ts b/src/resources/logs/rayid.ts index 11b29ce4b0..d93b9baf8c 100644 --- a/src/resources/logs/rayid.ts +++ b/src/resources/logs/rayid.ts @@ -1,5 +1,64 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; -export class RayID extends APIResource {} +export class RayID extends APIResource { + /** + * The `/rayids` api route allows lookups by specific rayid. The rayids route will + * return zero, one, or more records (ray ids are not unique). + * + * @example + * ```ts + * const RayID = await client.logs.RayID.get( + * '41ddf1740f67442d', + * { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + get( + RayID: string, + params: RayIDGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { zone_id, ...query } = params; + return this._client.get(`/zones/${zone_id}/logs/rayids/${RayID}`, { query, ...options }); + } +} + +export type RayIDGetResponse = string | unknown; + +export interface RayIDGetParams { + /** + * Path param: Identifier + */ + zone_id: string; + + /** + * Query param: The `/received` route by default returns a limited set of fields, + * and allows customers to override the default field set by specifying individual + * fields. The reasons for this are: 1. Most customers require only a small subset + * of fields, but that subset varies from customer to customer; 2. Flat schema is + * much easier to work with downstream (importing into BigTable etc); 3. + * Performance (time to process, file size). If `?fields=` is not specified, + * default field set is returned. This default field set may change at any time. + * When `?fields=` is provided, each record is returned with the specified fields. + * `fields` must be specified as a comma separated list without any whitespaces, + * and all fields must exist. The order in which fields are specified does not + * matter, and the order of fields in the response is not specified. + */ + fields?: string; + + /** + * Query param: By default, timestamps in responses are returned as Unix nanosecond + * integers. The `?timestamps=` argument can be set to change the format in which + * response timestamps are returned. Possible values are: `unix`, `unixnano`, + * `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; + * `rfc3339` returns timestamps as strings. + */ + timestamps?: 'unix' | 'unixnano' | 'rfc3339'; +} + +export declare namespace RayID { + export { type RayIDGetResponse as RayIDGetResponse, type RayIDGetParams as RayIDGetParams }; +} diff --git a/src/resources/logs/received/fields.ts b/src/resources/logs/received/fields.ts index 9bd4c53066..d84198e6ee 100644 --- a/src/resources/logs/received/fields.ts +++ b/src/resources/logs/received/fields.ts @@ -1,5 +1,37 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class Fields extends APIResource {} +export class Fields extends APIResource { + /** + * Lists all fields available. The response is json object with key-value pairs, + * where keys are field names, and values are descriptions. + * + * @example + * ```ts + * const field = await client.logs.received.fields.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * }); + * ``` + */ + get(params: FieldGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id } = params; + return this._client.get(`/zones/${zone_id}/logs/received/fields`, options); + } +} + +export interface FieldGetResponse { + key?: string; +} + +export interface FieldGetParams { + /** + * Identifier + */ + zone_id: string; +} + +export declare namespace Fields { + export { type FieldGetResponse as FieldGetResponse, type FieldGetParams as FieldGetParams }; +} diff --git a/src/resources/logs/received/index.ts b/src/resources/logs/received/index.ts index b39faedbf8..872f107c23 100644 --- a/src/resources/logs/received/index.ts +++ b/src/resources/logs/received/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Fields } from './fields'; -export { Received } from './received'; +export { Fields, type FieldGetResponse, type FieldGetParams } from './fields'; +export { Received, type ReceivedGetResponse, type ReceivedGetParams } from './received'; diff --git a/src/resources/logs/received/received.ts b/src/resources/logs/received/received.ts index 2d2550f8c9..fffcbe7c04 100644 --- a/src/resources/logs/received/received.ts +++ b/src/resources/logs/received/received.ts @@ -1,15 +1,115 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; import * as FieldsAPI from './fields'; -import { Fields } from './fields'; +import { FieldGetParams, FieldGetResponse, Fields } from './fields'; export class Received extends APIResource { fields: FieldsAPI.Fields = new FieldsAPI.Fields(this._client); + + /** + * The `/received` api route allows customers to retrieve their edge HTTP logs. The + * basic access pattern is "give me all the logs for zone Z for minute M", where + * the minute M refers to the time records were received at Cloudflare's central + * data center. `start` is inclusive, and `end` is exclusive. Because of that, to + * get all data, at minutely cadence, starting at 10AM, the proper values are: + * `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then + * `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap + * will be handled properly. + * + * @example + * ```ts + * const received = await client.logs.received.get({ + * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + * end: '2018-05-20T10:01:00Z', + * }); + * ``` + */ + get(params: ReceivedGetParams, options?: Core.RequestOptions): Core.APIPromise { + const { zone_id, ...query } = params; + return this._client.get(`/zones/${zone_id}/logs/received`, { query, ...options }); + } +} + +export type ReceivedGetResponse = string | unknown; + +export interface ReceivedGetParams { + /** + * Path param: Identifier + */ + zone_id: string; + + /** + * Query param: Sets the (exclusive) end of the requested time frame. This can be a + * unix timestamp (in seconds or nanoseconds), or an absolute timestamp that + * conforms to RFC 3339. `end` must be at least five minutes earlier than now and + * must be later than `start`. Difference between `start` and `end` must be not + * greater than one hour. + */ + end: string | number; + + /** + * Query param: When `?count=` is provided, the response will contain up to `count` + * results. Since results are not sorted, you are likely to get different data for + * repeated requests. `count` must be an integer > 0. + */ + count?: number; + + /** + * Query param: The `/received` route by default returns a limited set of fields, + * and allows customers to override the default field set by specifying individual + * fields. The reasons for this are: 1. Most customers require only a small subset + * of fields, but that subset varies from customer to customer; 2. Flat schema is + * much easier to work with downstream (importing into BigTable etc); 3. + * Performance (time to process, file size). If `?fields=` is not specified, + * default field set is returned. This default field set may change at any time. + * When `?fields=` is provided, each record is returned with the specified fields. + * `fields` must be specified as a comma separated list without any whitespaces, + * and all fields must exist. The order in which fields are specified does not + * matter, and the order of fields in the response is not specified. + */ + fields?: string; + + /** + * Query param: When `?sample=` is provided, a sample of matching records is + * returned. If `sample=0.1` then 10% of records will be returned. Sampling is + * random: repeated calls will not only return different records, but likely will + * also vary slightly in number of returned records. When `?count=` is also + * specified, `count` is applied to the number of returned records, not the sampled + * records. So, with `sample=0.05` and `count=7`, when there is a total of 100 + * records available, approximately five will be returned. When there are 1000 + * records, seven will be returned. When there are 10,000 records, seven will be + * returned. + */ + sample?: number; + + /** + * Query param: Sets the (inclusive) beginning of the requested time frame. This + * can be a unix timestamp (in seconds or nanoseconds), or an absolute timestamp + * that conforms to RFC 3339. At this point in time, it cannot exceed a time in the + * past greater than seven days. + */ + start?: string | number; + + /** + * Query param: By default, timestamps in responses are returned as Unix nanosecond + * integers. The `?timestamps=` argument can be set to change the format in which + * response timestamps are returned. Possible values are: `unix`, `unixnano`, + * `rfc3339`. Note that `unix` and `unixnano` return timestamps as integers; + * `rfc3339` returns timestamps as strings. + */ + timestamps?: 'unix' | 'unixnano' | 'rfc3339'; } Received.Fields = Fields; export declare namespace Received { - export { Fields as Fields }; + export { type ReceivedGetResponse as ReceivedGetResponse, type ReceivedGetParams as ReceivedGetParams }; + + export { + Fields as Fields, + type FieldGetResponse as FieldGetResponse, + type FieldGetParams as FieldGetParams, + }; } diff --git a/src/resources/magic-transit/pcaps/download.ts b/src/resources/magic-transit/pcaps/download.ts index 46a0a7ee84..9413fdcad8 100644 --- a/src/resources/magic-transit/pcaps/download.ts +++ b/src/resources/magic-transit/pcaps/download.ts @@ -32,7 +32,7 @@ export class Download extends APIResource { export interface DownloadGetParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/magic-transit/pcaps/ownership.ts b/src/resources/magic-transit/pcaps/ownership.ts index 93602154ba..b9daa44fee 100644 --- a/src/resources/magic-transit/pcaps/ownership.ts +++ b/src/resources/magic-transit/pcaps/ownership.ts @@ -131,7 +131,7 @@ export interface Ownership { export interface OwnershipCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -144,21 +144,21 @@ export interface OwnershipCreateParams { export interface OwnershipDeleteParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface OwnershipGetParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface OwnershipValidateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; diff --git a/src/resources/magic-transit/pcaps/pcaps.ts b/src/resources/magic-transit/pcaps/pcaps.ts index fca2bf5d2c..b1ec94cd7d 100644 --- a/src/resources/magic-transit/pcaps/pcaps.ts +++ b/src/resources/magic-transit/pcaps/pcaps.ts @@ -90,7 +90,7 @@ export class PCAPs extends APIResource { } /** - * Stop full PCAP. + * Stop full PCAP * * @example * ```ts @@ -485,7 +485,7 @@ export type PCAPCreateParams = export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestSimple { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -526,7 +526,7 @@ export declare namespace PCAPCreateParams { export interface MagicVisibilityPCAPsPCAPsRequestFull { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; @@ -580,21 +580,21 @@ export declare namespace PCAPCreateParams { export interface PCAPListParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface PCAPGetParams { /** - * Identifier. + * Identifier */ account_id: string; } export interface PCAPStopParams { /** - * Identifier. + * Identifier */ account_id: string; } diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index 29bbe25988..4606015396 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -11,12 +11,15 @@ export { type ConsumerGetParams, } from './consumers'; export { - MessagePullResponsesSinglePage, Messages, type MessageAckResponse, + type MessageBulkPushResponse, type MessagePullResponse, + type MessagePushResponse, type MessageAckParams, + type MessageBulkPushParams, type MessagePullParams, + type MessagePushParams, } from './messages'; export { Purge, type PurgeStatusResponse, type PurgeStartParams, type PurgeStatusParams } from './purge'; export { Queues } from './queues'; diff --git a/src/resources/queues/messages.ts b/src/resources/queues/messages.ts index eb406d134e..3557b14318 100644 --- a/src/resources/queues/messages.ts +++ b/src/resources/queues/messages.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import { SinglePage } from '../../pagination'; +import * as Shared from '../shared'; export class Messages extends APIResource { /** @@ -30,35 +30,74 @@ export class Messages extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Push a batch of message to a Queue + * + * @example + * ```ts + * const response = await client.queues.messages.bulkPush( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + bulkPush( + queueId: string, + params: MessageBulkPushParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/batch`, { + body, + ...options, + }); + } + /** * Pull a batch of messages from a Queue * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const messagePullResponse of client.queues.messages.pull( + * const response = await client.queues.messages.pull( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * ); * ``` */ pull( queueId: string, params: MessagePullParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.APIPromise { const { account_id, ...body } = params; - return this._client.getAPIList( - `/accounts/${account_id}/queues/${queueId}/messages/pull`, - MessagePullResponsesSinglePage, - { body, method: 'post', ...options }, - ); + return ( + this._client.post(`/accounts/${account_id}/queues/${queueId}/messages/pull`, { + body, + ...options, + }) as Core.APIPromise<{ result: MessagePullResponse }> + )._thenUnwrap((obj) => obj.result); } -} -export class MessagePullResponsesSinglePage extends SinglePage {} + /** + * Push a message to a Queue + * + * @example + * ```ts + * const response = await client.queues.messages.push( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * ); + * ``` + */ + push( + queueId: string, + params: MessagePushParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return this._client.post(`/accounts/${account_id}/queues/${queueId}/messages`, { body, ...options }); + } +} export interface MessageAckResponse { /** @@ -74,22 +113,55 @@ export interface MessageAckResponse { warnings?: Array; } -export interface MessagePullResponse { - id?: string; +export interface MessageBulkPushResponse { + errors?: Array; - attempts?: number; + messages?: Array; - body?: string; + /** + * Indicates if the API call was successful or not. + */ + success?: true; +} +export interface MessagePullResponse { /** - * An ID that represents an "in-flight" message that has been pulled from a Queue. - * You must hold on to this ID and use it to acknowledge this message. + * The number of unacknowledged messages in the queue */ - lease_id?: string; + message_backlog_count?: number; + + messages?: Array; +} + +export namespace MessagePullResponse { + export interface Message { + id?: string; + + attempts?: number; - metadata?: unknown; + body?: string; - timestamp_ms?: number; + /** + * An ID that represents an "in-flight" message that has been pulled from a Queue. + * You must hold on to this ID and use it to acknowledge this message. + */ + lease_id?: string; + + metadata?: unknown; + + timestamp_ms?: number; + } +} + +export interface MessagePushResponse { + errors?: Array; + + messages?: Array; + + /** + * Indicates if the API call was successful or not. + */ + success?: true; } export interface MessageAckParams { @@ -133,6 +205,50 @@ export namespace MessageAckParams { } } +export interface MessageBulkPushParams { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: The number of seconds to wait for attempting to deliver this batch + * to consumers + */ + delay_seconds?: number; + + /** + * Body param: + */ + messages?: Array; +} + +export namespace MessageBulkPushParams { + export interface MqQueueMessageText { + body?: string; + + content_type?: 'text'; + + /** + * The number of seconds to wait for attempting to deliver this message to + * consumers + */ + delay_seconds?: number; + } + + export interface MqQueueMessageJson { + body?: unknown; + + content_type?: 'json'; + + /** + * The number of seconds to wait for attempting to deliver this message to + * consumers + */ + delay_seconds?: number; + } +} + export interface MessagePullParams { /** * Path param: A Resource identifier. @@ -151,14 +267,65 @@ export interface MessagePullParams { visibility_timeout_ms?: number; } -Messages.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; +export type MessagePushParams = MessagePushParams.MqQueueMessageText | MessagePushParams.MqQueueMessageJson; + +export declare namespace MessagePushParams { + export interface MqQueueMessageText { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: + */ + body?: string; + + /** + * Body param: + */ + content_type?: 'text'; + + /** + * Body param: The number of seconds to wait for attempting to deliver this message + * to consumers + */ + delay_seconds?: number; + } + + export interface MqQueueMessageJson { + /** + * Path param: A Resource identifier. + */ + account_id: string; + + /** + * Body param: + */ + body?: unknown; + + /** + * Body param: + */ + content_type?: 'json'; + + /** + * Body param: The number of seconds to wait for attempting to deliver this message + * to consumers + */ + delay_seconds?: number; + } +} export declare namespace Messages { export { type MessageAckResponse as MessageAckResponse, + type MessageBulkPushResponse as MessageBulkPushResponse, type MessagePullResponse as MessagePullResponse, - MessagePullResponsesSinglePage as MessagePullResponsesSinglePage, + type MessagePushResponse as MessagePushResponse, type MessageAckParams as MessageAckParams, + type MessageBulkPushParams as MessageBulkPushParams, type MessagePullParams as MessagePullParams, + type MessagePushParams as MessagePushParams, }; } diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index b81ab51ef8..240e61d273 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -18,9 +18,12 @@ import * as MessagesAPI from './messages'; import { MessageAckParams, MessageAckResponse, + MessageBulkPushParams, + MessageBulkPushResponse, MessagePullParams, MessagePullResponse, - MessagePullResponsesSinglePage, + MessagePushParams, + MessagePushResponse, Messages, } from './messages'; import * as PurgeAPI from './purge'; @@ -327,7 +330,6 @@ Queues.QueuesSinglePage = QueuesSinglePage; Queues.Consumers = Consumers; Queues.ConsumersSinglePage = ConsumersSinglePage; Queues.Messages = Messages; -Queues.MessagePullResponsesSinglePage = MessagePullResponsesSinglePage; Queues.Purge = Purge; export declare namespace Queues { @@ -357,10 +359,13 @@ export declare namespace Queues { export { Messages as Messages, type MessageAckResponse as MessageAckResponse, + type MessageBulkPushResponse as MessageBulkPushResponse, type MessagePullResponse as MessagePullResponse, - MessagePullResponsesSinglePage as MessagePullResponsesSinglePage, + type MessagePushResponse as MessagePushResponse, type MessageAckParams as MessageAckParams, + type MessageBulkPushParams as MessageBulkPushParams, type MessagePullParams as MessagePullParams, + type MessagePushParams as MessagePushParams, }; export { diff --git a/src/resources/r2/buckets/domains/custom.ts b/src/resources/r2/buckets/domains/custom.ts index 791c3fe9d4..76dbcea299 100644 --- a/src/resources/r2/buckets/domains/custom.ts +++ b/src/resources/r2/buckets/domains/custom.ts @@ -182,12 +182,6 @@ export interface CustomCreateResponse { */ enabled: boolean; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -201,12 +195,6 @@ export interface CustomUpdateResponse { */ domain: string; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Whether this bucket is publicly accessible at the specified custom domain. */ @@ -237,12 +225,6 @@ export namespace CustomListResponse { status: Domain.Status; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -295,12 +277,6 @@ export interface CustomGetResponse { status: CustomGetResponse.Status; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -354,12 +330,6 @@ export interface CustomCreateParams { */ zoneId: string; - /** - * Body param: An allowlist of ciphers for TLS termination. These ciphers must be - * in the BoringSSL format. - */ - ciphers?: Array; - /** * Body param: Minimum TLS Version the custom domain will accept for incoming * connections. If not set, defaults to 1.0. @@ -379,12 +349,6 @@ export interface CustomUpdateParams { */ account_id: string; - /** - * Body param: An allowlist of ciphers for TLS termination. These ciphers must be - * in the BoringSSL format. - */ - ciphers?: Array; - /** * Body param: Whether to enable public bucket access at the specified custom * domain. diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..6ba8476430 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,11 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupUserAgentParams, + TimeseriesGroupUserAgentResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +46,9 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 0b5807ee07..865665cba6 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary } from './summary'; +import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,5 +11,9 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { Summary as Summary }; + export { + Summary as Summary, + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 6f7091f3a3..c94177cbcd 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary } from './summary'; +export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 5abd36afe8..298d84ab48 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,5 +1,197 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; -export class Summary extends APIResource {} +export class Summary extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.userAgent(); + * ``` + */ + userAgent( + query?: SummaryUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: SummaryUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ + result: SummaryUserAgentResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + meta: SummaryUserAgentResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SummaryUserAgentParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace Summary { + export { + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; +} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..a6a9f99c81 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,11 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..938c8980f2 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,218 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.userAgent(); + * ``` + */ + userAgent( + query?: TimeseriesGroupUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupUserAgentResponse.Meta; + + serie_0: TimeseriesGroupUserAgentResponse.Serie0; +} + +export namespace TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupUserAgentParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; +} diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index e57861cb13..c75011e6a0 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -189,8 +189,6 @@ export namespace BotListResponse { * A kebab-case identifier derived from the bot name. */ slug: string; - - userAgentPatterns: Array; } } diff --git a/src/resources/request-tracers/traces.ts b/src/resources/request-tracers/traces.ts index 3f5b99c978..375d8ee6e9 100644 --- a/src/resources/request-tracers/traces.ts +++ b/src/resources/request-tracers/traces.ts @@ -109,7 +109,7 @@ export interface TraceCreateResponse { export interface TraceCreateParams { /** - * Path param: Identifier. + * Path param: Identifier */ account_id: string; diff --git a/src/resources/snippets/rules.ts b/src/resources/snippets/rules.ts index fa1b544710..407f9e5612 100644 --- a/src/resources/snippets/rules.ts +++ b/src/resources/snippets/rules.ts @@ -12,11 +12,11 @@ export class Rules extends APIResource { params: RuleUpdateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, ...body } = params; + const { zone_id, body } = params; return this._client.getAPIList( `/zones/${zone_id}/snippets/snippet_rules`, RuleUpdateResponsesSinglePage, - { body, method: 'put', ...options }, + { body: body, method: 'put', ...options }, ); } @@ -171,14 +171,14 @@ export interface RuleUpdateParams { /** * Body param: A list of snippet rules. */ - rules: Array; + body: Array; } export namespace RuleUpdateParams { /** * A snippet rule. */ - export interface Rule { + export interface Body { /** * The expression defining which traffic will match the rule. */ diff --git a/src/resources/ssl/certificate-packs/certificate-packs.ts b/src/resources/ssl/certificate-packs/certificate-packs.ts index 9ec84ff8a9..8ce7a97e6b 100644 --- a/src/resources/ssl/certificate-packs/certificate-packs.ts +++ b/src/resources/ssl/certificate-packs/certificate-packs.ts @@ -227,82 +227,19 @@ export interface CertificatePackCreateResponse { /** * Type of certificate pack. */ - type?: - | 'mh_custom' - | 'managed_hostname' - | 'sni_custom' - | 'universal' - | 'advanced' - | 'total_tls' - | 'keyless' - | 'legacy_custom'; - - /** - * Domain validation errors that have been received by the certificate authority - * (CA). - */ - validation_errors?: Array; + type?: 'advanced'; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; - /** - * Certificates' validation records. Only present when certificate pack is in - * "pending_validation" status - */ - validation_records?: Array; - /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } -export namespace CertificatePackCreateResponse { - export interface ValidationError { - /** - * A domain validation error. - */ - message?: string; - } - - /** - * Certificate's required validation record. - */ - export interface ValidationRecord { - /** - * The set of email addresses that the certificate authority (CA) will use to - * complete domain validation. - */ - emails?: Array; - - /** - * The content that the certificate authority (CA) will expect to find at the - * http_url during the domain validation. - */ - http_body?: string; - - /** - * The url that will be checked during domain validation. - */ - http_url?: string; - - /** - * The hostname that the certificate authority (CA) will check for a TXT record - * during domain validation . - */ - txt_name?: string; - - /** - * The TXT record that the certificate authority (CA) will check during domain - * validation. - */ - txt_value?: string; - } -} - export type CertificatePackListResponse = unknown; export interface CertificatePackDeleteResponse { @@ -345,82 +282,19 @@ export interface CertificatePackEditResponse { /** * Type of certificate pack. */ - type?: - | 'mh_custom' - | 'managed_hostname' - | 'sni_custom' - | 'universal' - | 'advanced' - | 'total_tls' - | 'keyless' - | 'legacy_custom'; - - /** - * Domain validation errors that have been received by the certificate authority - * (CA). - */ - validation_errors?: Array; + type?: 'advanced'; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; - /** - * Certificates' validation records. Only present when certificate pack is in - * "pending_validation" status - */ - validation_records?: Array; - /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } -export namespace CertificatePackEditResponse { - export interface ValidationError { - /** - * A domain validation error. - */ - message?: string; - } - - /** - * Certificate's required validation record. - */ - export interface ValidationRecord { - /** - * The set of email addresses that the certificate authority (CA) will use to - * complete domain validation. - */ - emails?: Array; - - /** - * The content that the certificate authority (CA) will expect to find at the - * http_url during the domain validation. - */ - http_body?: string; - - /** - * The url that will be checked during domain validation. - */ - http_url?: string; - - /** - * The hostname that the certificate authority (CA) will check for a TXT record - * during domain validation . - */ - txt_name?: string; - - /** - * The TXT record that the certificate authority (CA) will check during domain - * validation. - */ - txt_value?: string; - } -} - export type CertificatePackGetResponse = unknown; export interface CertificatePackCreateParams { diff --git a/src/resources/workers/observability/index.ts b/src/resources/workers/observability/index.ts index f79888ffc4..0caddd5ae3 100644 --- a/src/resources/workers/observability/index.ts +++ b/src/resources/workers/observability/index.ts @@ -1,4 +1,14 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Observability } from './observability'; -export { Telemetry } from './telemetry'; +export { + TelemetryKeysResponsesSinglePage, + TelemetryValuesResponsesSinglePage, + Telemetry, + type TelemetryKeysResponse, + type TelemetryQueryResponse, + type TelemetryValuesResponse, + type TelemetryKeysParams, + type TelemetryQueryParams, + type TelemetryValuesParams, +} from './telemetry'; diff --git a/src/resources/workers/observability/observability.ts b/src/resources/workers/observability/observability.ts index 275786dba8..67d35532a5 100644 --- a/src/resources/workers/observability/observability.ts +++ b/src/resources/workers/observability/observability.ts @@ -2,14 +2,36 @@ import { APIResource } from '../../../resource'; import * as TelemetryAPI from './telemetry'; -import { Telemetry } from './telemetry'; +import { + Telemetry, + TelemetryKeysParams, + TelemetryKeysResponse, + TelemetryKeysResponsesSinglePage, + TelemetryQueryParams, + TelemetryQueryResponse, + TelemetryValuesParams, + TelemetryValuesResponse, + TelemetryValuesResponsesSinglePage, +} from './telemetry'; export class Observability extends APIResource { telemetry: TelemetryAPI.Telemetry = new TelemetryAPI.Telemetry(this._client); } Observability.Telemetry = Telemetry; +Observability.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage; +Observability.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage; export declare namespace Observability { - export { Telemetry as Telemetry }; + export { + Telemetry as Telemetry, + type TelemetryKeysResponse as TelemetryKeysResponse, + type TelemetryQueryResponse as TelemetryQueryResponse, + type TelemetryValuesResponse as TelemetryValuesResponse, + TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, + TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, + type TelemetryKeysParams as TelemetryKeysParams, + type TelemetryQueryParams as TelemetryQueryParams, + type TelemetryValuesParams as TelemetryValuesParams, + }; } diff --git a/src/resources/workers/observability/telemetry.ts b/src/resources/workers/observability/telemetry.ts index 1a79e6da8e..9467608603 100644 --- a/src/resources/workers/observability/telemetry.ts +++ b/src/resources/workers/observability/telemetry.ts @@ -1,5 +1,1541 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; -export class Telemetry extends APIResource {} +export class Telemetry extends APIResource { + /** + * List all the keys in your telemetry events. + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const telemetryKeysResponse of client.workers.observability.telemetry.keys( + * { account_id: 'account_id' }, + * )) { + * // ... + * } + * ``` + */ + keys( + params: TelemetryKeysParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...body } = params; + return this._client.getAPIList( + `/accounts/${account_id}/workers/observability/telemetry/keys`, + TelemetryKeysResponsesSinglePage, + { body, method: 'post', ...options }, + ); + } + + /** + * Runs a temporary or saved query + * + * @example + * ```ts + * const response = + * await client.workers.observability.telemetry.query({ + * account_id: 'account_id', + * queryId: 'queryId', + * timeframe: { from: 0, to: 0 }, + * }); + * ``` + */ + query( + params: TelemetryQueryParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/workers/observability/telemetry/query`, { + body, + ...options, + }) as Core.APIPromise<{ result: TelemetryQueryResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List unique values found in your events + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const telemetryValuesResponse of client.workers.observability.telemetry.values( + * { + * account_id: 'account_id', + * datasets: ['string'], + * key: 'key', + * timeframe: { from: 0, to: 0 }, + * type: 'string', + * }, + * )) { + * // ... + * } + * ``` + */ + values( + params: TelemetryValuesParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...body } = params; + return this._client.getAPIList( + `/accounts/${account_id}/workers/observability/telemetry/values`, + TelemetryValuesResponsesSinglePage, + { body, method: 'post', ...options }, + ); + } +} + +export class TelemetryKeysResponsesSinglePage extends SinglePage {} + +export class TelemetryValuesResponsesSinglePage extends SinglePage {} + +export interface TelemetryKeysResponse { + key: string; + + lastSeenAt: number; + + type: 'string' | 'boolean' | 'number'; +} + +export interface TelemetryQueryResponse { + /** + * A Workers Observability Query Object + */ + run: TelemetryQueryResponse.Run; + + /** + * The statistics object contains information about query performance from the + * database, it does not include any network latency + */ + statistics: TelemetryQueryResponse.Statistics; + + calculations?: Array; + + compare?: Array; + + events?: TelemetryQueryResponse.Events; + + invocations?: { [key: string]: Array }; + + patterns?: Array; +} + +export namespace TelemetryQueryResponse { + /** + * A Workers Observability Query Object + */ + export interface Run { + id: string; + + accountId: string; + + dry: boolean; + + /** + * @deprecated + */ + environmentId: string; + + granularity: number; + + query: Run.Query; + + status: 'STARTED' | 'COMPLETED'; + + timeframe: Run.Timeframe; + + userId: string; + + /** + * @deprecated + */ + workspaceId: string; + + created?: string; + + statistics?: Run.Statistics; + + updated?: string; + } + + export namespace Run { + export interface Query { + /** + * ID of the query + */ + id: string; + + created: string; + + description: string | null; + + /** + * ID of your environment + */ + environmentId: string; + + /** + * Flag for alerts automatically created + */ + generated: boolean | null; + + /** + * Query name + */ + name: string | null; + + parameters: Query.Parameters; + + updated: string; + + userId: string; + + /** + * ID of your workspace + */ + workspaceId: string; + } + + export namespace Query { + export interface Parameters { + /** + * Create Calculations to compute as part of the query. + */ + calculations?: Array; + + /** + * Set the Datasets to query. Leave it empty to query all the datasets. + */ + datasets?: Array; + + /** + * Set a Flag to describe how to combine the filters on the query. + */ + filterCombination?: 'and' | 'or' | 'AND' | 'OR'; + + /** + * Configure the Filters to apply to the query. + */ + filters?: Array; + + /** + * Define how to group the results of the query. + */ + groupBys?: Array; + + /** + * Configure the Having clauses that filter on calculations in the query result. + */ + havings?: Array; + + /** + * Set a limit on the number of results / records returned by the query + */ + limit?: number; + + /** + * Define an expression to search using full-text search. + */ + needle?: Parameters.Needle; + + /** + * Configure the order of the results returned by the query. + */ + orderBy?: Parameters.OrderBy; + } + + export namespace Parameters { + export interface Calculation { + operator: + | 'uniq' + | 'count' + | 'max' + | 'min' + | 'sum' + | 'avg' + | 'median' + | 'p001' + | 'p01' + | 'p05' + | 'p10' + | 'p25' + | 'p75' + | 'p90' + | 'p95' + | 'p99' + | 'p999' + | 'stddev' + | 'variance' + | 'COUNT_DISTINCT' + | 'COUNT' + | 'MAX' + | 'MIN' + | 'SUM' + | 'AVG' + | 'MEDIAN' + | 'P001' + | 'P01' + | 'P05' + | 'P10' + | 'P25' + | 'P75' + | 'P90' + | 'P95' + | 'P99' + | 'P999' + | 'STDDEV' + | 'VARIANCE'; + + alias?: string; + + key?: string; + + keyType?: 'string' | 'number' | 'boolean'; + } + + export interface Filter { + key: string; + + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'regex' + | 'exists' + | 'is_null' + | 'in' + | 'not_in' + | 'eq' + | 'neq' + | 'gt' + | 'gte' + | 'lt' + | 'lte' + | '=' + | '!=' + | '>' + | '>=' + | '<' + | '<=' + | 'INCLUDES' + | 'DOES_NOT_INCLUDE' + | 'MATCH_REGEX' + | 'EXISTS' + | 'DOES_NOT_EXIST' + | 'IN' + | 'NOT_IN' + | 'STARTS_WITH'; + + type: 'string' | 'number' | 'boolean'; + + value?: string | number | boolean; + } + + export interface GroupBy { + type: 'string' | 'number' | 'boolean'; + + value: string; + } + + export interface Having { + key: string; + + operation: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; + + value: number; + } + + /** + * Define an expression to search using full-text search. + */ + export interface Needle { + value: string | number | boolean; + + isRegex?: boolean; + + matchCase?: boolean; + } + + /** + * Configure the order of the results returned by the query. + */ + export interface OrderBy { + /** + * Configure which Calculation to order the results by. + */ + value: string; + + /** + * Set the order of the results + */ + order?: 'asc' | 'desc'; + } + } + } + + export interface Timeframe { + /** + * Set the start time for your query using UNIX time in milliseconds. + */ + from: number; + + /** + * Set the end time for your query using UNIX time in milliseconds. + */ + to: number; + } + + export interface Statistics { + /** + * Number of uncompressed bytes read from the table. + */ + bytes_read: number; + + /** + * Time in seconds for the query to run. + */ + elapsed: number; + + /** + * Number of rows scanned from the table. + */ + rows_read: number; + } + } + + /** + * The statistics object contains information about query performance from the + * database, it does not include any network latency + */ + export interface Statistics { + /** + * Number of uncompressed bytes read from the table. + */ + bytes_read: number; + + /** + * Time in seconds for the query to run. + */ + elapsed: number; + + /** + * Number of rows scanned from the table. + */ + rows_read: number; + } + + export interface Calculation { + aggregates: Array; + + calculation: string; + + series: Array; + + alias?: string; + } + + export namespace Calculation { + export interface Aggregate { + count: number; + + interval: number; + + sampleInterval: number; + + value: number; + + groups?: Array; + } + + export namespace Aggregate { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + + export interface Series { + data: Array; + + time: string; + } + + export namespace Series { + export interface Data { + count: number; + + firstSeen: string; + + interval: number; + + lastSeen: string; + + sampleInterval: number; + + value: number; + + groups?: Array; + } + + export namespace Data { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + } + } + + export interface Compare { + aggregates: Array; + + calculation: string; + + series: Array; + + alias?: string; + } + + export namespace Compare { + export interface Aggregate { + count: number; + + interval: number; + + sampleInterval: number; + + value: number; + + groups?: Array; + } + + export namespace Aggregate { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + + export interface Series { + data: Array; + + time: string; + } + + export namespace Series { + export interface Data { + count: number; + + firstSeen: string; + + interval: number; + + lastSeen: string; + + sampleInterval: number; + + value: number; + + groups?: Array; + } + + export namespace Data { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + } + } + + export interface Events { + count?: number; + + events?: Array; + + fields?: Array; + + series?: Array; + } + + export namespace Events { + /** + * The data structure of a telemetry event + */ + export interface Event { + $metadata: Event.Metadata; + + dataset: string; + + source: string | unknown; + + timestamp: number; + + /** + * Cloudflare Workers event information enriches your logs so you can easily + * identify and debug issues. + */ + $workers?: Event.UnionMember0 | Event.UnionMember1; + } + + export namespace Event { + export interface Metadata { + id: string; + + account?: string; + + cloudService?: string; + + coldStart?: number; + + cost?: number; + + duration?: number; + + endTime?: number; + + error?: string; + + errorTemplate?: string; + + fingerprint?: string; + + level?: string; + + message?: string; + + messageTemplate?: string; + + metricName?: string; + + origin?: string; + + parentSpanId?: string; + + provider?: string; + + region?: string; + + requestId?: string; + + service?: string; + + spanId?: string; + + spanName?: string; + + stackId?: string; + + startTime?: number; + + statusCode?: number; + + traceDuration?: number; + + traceId?: string; + + trigger?: string; + + type?: string; + + url?: string; + } + + export interface UnionMember0 { + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + entrypoint?: string; + + event?: { + [key: string]: + | string + | number + | boolean + | { + [key: string]: + | string + | number + | boolean + | { [key: string]: Array | string | number | boolean }; + }; + }; + + executionModel?: 'durableObject' | 'stateless'; + + scriptVersion?: UnionMember0.ScriptVersion; + + truncated?: boolean; + } + + export namespace UnionMember0 { + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + + export interface UnionMember1 { + cpuTimeMs: number; + + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + wallTimeMs: number; + + diagnosticsChannelEvents?: Array; + + dispatchNamespace?: string; + + entrypoint?: string; + + event?: { [key: string]: string | number | boolean }; + + executionModel?: 'durableObject' | 'stateless'; + + scriptVersion?: UnionMember1.ScriptVersion; + + truncated?: boolean; + } + + export namespace UnionMember1 { + export interface DiagnosticsChannelEvent { + channel: string; + + message: string; + + timestamp: number; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + } + + export interface Field { + key: string; + + type: string; + } + + export interface Series { + data: Array; + + time: string; + } + + export namespace Series { + export interface Data { + aggregates: Data.Aggregates; + + count: number; + + interval: number; + + sampleInterval: number; + + errors?: number; + + /** + * Groups in the query results. + */ + groups?: { [key: string]: string | number | boolean }; + } + + export namespace Data { + export interface Aggregates { + /** + * @deprecated + */ + _count: number; + + /** + * @deprecated + */ + _firstSeen: string; + + /** + * @deprecated + */ + _interval: number; + + /** + * @deprecated + */ + _lastSeen: string; + + /** + * @deprecated + */ + bin?: unknown; + } + } + } + } + + /** + * The data structure of a telemetry event + */ + export interface Invocation { + $metadata: Invocation.Metadata; + + dataset: string; + + source: string | unknown; + + timestamp: number; + + /** + * Cloudflare Workers event information enriches your logs so you can easily + * identify and debug issues. + */ + $workers?: Invocation.UnionMember0 | Invocation.UnionMember1; + } + + export namespace Invocation { + export interface Metadata { + id: string; + + account?: string; + + cloudService?: string; + + coldStart?: number; + + cost?: number; + + duration?: number; + + endTime?: number; + + error?: string; + + errorTemplate?: string; + + fingerprint?: string; + + level?: string; + + message?: string; + + messageTemplate?: string; + + metricName?: string; + + origin?: string; + + parentSpanId?: string; + + provider?: string; + + region?: string; + + requestId?: string; + + service?: string; + + spanId?: string; + + spanName?: string; + + stackId?: string; + + startTime?: number; + + statusCode?: number; + + traceDuration?: number; + + traceId?: string; + + trigger?: string; + + type?: string; + + url?: string; + } + + export interface UnionMember0 { + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + entrypoint?: string; + + event?: { + [key: string]: + | string + | number + | boolean + | { + [key: string]: + | string + | number + | boolean + | { [key: string]: Array | string | number | boolean }; + }; + }; + + executionModel?: 'durableObject' | 'stateless'; + + scriptVersion?: UnionMember0.ScriptVersion; + + truncated?: boolean; + } + + export namespace UnionMember0 { + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + + export interface UnionMember1 { + cpuTimeMs: number; + + eventType: + | 'fetch' + | 'scheduled' + | 'alarm' + | 'cron' + | 'queue' + | 'email' + | 'tail' + | 'rpc' + | 'websocket' + | 'unknown'; + + outcome: string; + + requestId: string; + + scriptName: string; + + wallTimeMs: number; + + diagnosticsChannelEvents?: Array; + + dispatchNamespace?: string; + + entrypoint?: string; + + event?: { [key: string]: string | number | boolean }; + + executionModel?: 'durableObject' | 'stateless'; + + scriptVersion?: UnionMember1.ScriptVersion; + + truncated?: boolean; + } + + export namespace UnionMember1 { + export interface DiagnosticsChannelEvent { + channel: string; + + message: string; + + timestamp: number; + } + + export interface ScriptVersion { + id?: string; + + message?: string; + + tag?: string; + } + } + } + + export interface Pattern { + count: number; + + pattern: string; + + series: Array; + + service: string; + } + + export namespace Pattern { + export interface Series { + data: Series.Data; + + time: string; + } + + export namespace Series { + export interface Data { + count: number; + + interval: number; + + sampleInterval: number; + + value: number; + + groups?: Array; + } + + export namespace Data { + export interface Group { + key: string; + + value: string | number | boolean; + } + } + } + } +} + +export interface TelemetryValuesResponse { + dataset: string; + + key: string; + + type: 'string' | 'boolean' | 'number'; + + value: string | number | boolean; +} + +export interface TelemetryKeysParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param: + */ + datasets?: Array; + + /** + * Body param: + */ + filters?: Array; + + /** + * Body param: Search for a specific substring in the keys. + */ + keyNeedle?: TelemetryKeysParams.KeyNeedle; + + /** + * Body param: + */ + limit?: number; + + /** + * Body param: Search for a specific substring in the event. + */ + needle?: TelemetryKeysParams.Needle; + + /** + * Body param: + */ + timeframe?: TelemetryKeysParams.Timeframe; +} + +export namespace TelemetryKeysParams { + export interface Filter { + key: string; + + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'regex' + | 'exists' + | 'is_null' + | 'in' + | 'not_in' + | 'eq' + | 'neq' + | 'gt' + | 'gte' + | 'lt' + | 'lte' + | '=' + | '!=' + | '>' + | '>=' + | '<' + | '<=' + | 'INCLUDES' + | 'DOES_NOT_INCLUDE' + | 'MATCH_REGEX' + | 'EXISTS' + | 'DOES_NOT_EXIST' + | 'IN' + | 'NOT_IN' + | 'STARTS_WITH'; + + type: 'string' | 'number' | 'boolean'; + + value?: string | number | boolean; + } + + /** + * Search for a specific substring in the keys. + */ + export interface KeyNeedle { + value: string | number | boolean; + + isRegex?: boolean; + + matchCase?: boolean; + } + + /** + * Search for a specific substring in the event. + */ + export interface Needle { + value: string | number | boolean; + + isRegex?: boolean; + + matchCase?: boolean; + } + + export interface Timeframe { + from: number; + + to: number; + } +} + +export interface TelemetryQueryParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param: + */ + queryId: string; + + /** + * Body param: + */ + timeframe: TelemetryQueryParams.Timeframe; + + /** + * Body param: + */ + chart?: boolean; + + /** + * Body param: + */ + compare?: boolean; + + /** + * Body param: + */ + dry?: boolean; + + /** + * Body param: + */ + granularity?: number; + + /** + * Body param: + */ + ignoreSeries?: boolean; + + /** + * Body param: + */ + limit?: number; + + /** + * Body param: + */ + offset?: string; + + /** + * Body param: + */ + offsetBy?: number; + + /** + * Body param: + */ + offsetDirection?: string; + + /** + * Body param: + */ + parameters?: TelemetryQueryParams.Parameters; + + /** + * Body param: + */ + patternType?: 'message' | 'error'; + + /** + * Body param: + */ + view?: 'traces' | 'events' | 'calculations' | 'invocations' | 'requests' | 'patterns'; +} + +export namespace TelemetryQueryParams { + export interface Timeframe { + from: number; + + to: number; + } + + export interface Parameters { + /** + * Create Calculations to compute as part of the query. + */ + calculations?: Array; + + /** + * Set the Datasets to query. Leave it empty to query all the datasets. + */ + datasets?: Array; + + /** + * Set a Flag to describe how to combine the filters on the query. + */ + filterCombination?: 'and' | 'or' | 'AND' | 'OR'; + + /** + * Configure the Filters to apply to the query. + */ + filters?: Array; + + /** + * Define how to group the results of the query. + */ + groupBys?: Array; + + /** + * Configure the Having clauses that filter on calculations in the query result. + */ + havings?: Array; + + /** + * Set a limit on the number of results / records returned by the query + */ + limit?: number; + + /** + * Define an expression to search using full-text search. + */ + needle?: Parameters.Needle; + + /** + * Configure the order of the results returned by the query. + */ + orderBy?: Parameters.OrderBy; + } + + export namespace Parameters { + export interface Calculation { + operator: + | 'uniq' + | 'count' + | 'max' + | 'min' + | 'sum' + | 'avg' + | 'median' + | 'p001' + | 'p01' + | 'p05' + | 'p10' + | 'p25' + | 'p75' + | 'p90' + | 'p95' + | 'p99' + | 'p999' + | 'stddev' + | 'variance' + | 'COUNT_DISTINCT' + | 'COUNT' + | 'MAX' + | 'MIN' + | 'SUM' + | 'AVG' + | 'MEDIAN' + | 'P001' + | 'P01' + | 'P05' + | 'P10' + | 'P25' + | 'P75' + | 'P90' + | 'P95' + | 'P99' + | 'P999' + | 'STDDEV' + | 'VARIANCE'; + + alias?: string; + + key?: string; + + keyType?: 'string' | 'number' | 'boolean'; + } + + export interface Filter { + key: string; + + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'regex' + | 'exists' + | 'is_null' + | 'in' + | 'not_in' + | 'eq' + | 'neq' + | 'gt' + | 'gte' + | 'lt' + | 'lte' + | '=' + | '!=' + | '>' + | '>=' + | '<' + | '<=' + | 'INCLUDES' + | 'DOES_NOT_INCLUDE' + | 'MATCH_REGEX' + | 'EXISTS' + | 'DOES_NOT_EXIST' + | 'IN' + | 'NOT_IN' + | 'STARTS_WITH'; + + type: 'string' | 'number' | 'boolean'; + + value?: string | number | boolean; + } + + export interface GroupBy { + type: 'string' | 'number' | 'boolean'; + + value: string; + } + + export interface Having { + key: string; + + operation: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte'; + + value: number; + } + + /** + * Define an expression to search using full-text search. + */ + export interface Needle { + value: string | number | boolean; + + isRegex?: boolean; + + matchCase?: boolean; + } + + /** + * Configure the order of the results returned by the query. + */ + export interface OrderBy { + /** + * Configure which Calculation to order the results by. + */ + value: string; + + /** + * Set the order of the results + */ + order?: 'asc' | 'desc'; + } + } +} + +export interface TelemetryValuesParams { + /** + * Path param: Your Cloudflare account ID. + */ + account_id: string; + + /** + * Body param: + */ + datasets: Array; + + /** + * Body param: + */ + key: string; + + /** + * Body param: + */ + timeframe: TelemetryValuesParams.Timeframe; + + /** + * Body param: + */ + type: 'string' | 'boolean' | 'number'; + + /** + * Body param: + */ + filters?: Array; + + /** + * Body param: + */ + limit?: number; + + /** + * Body param: Search for a specific substring in the event. + */ + needle?: TelemetryValuesParams.Needle; +} + +export namespace TelemetryValuesParams { + export interface Timeframe { + from: number; + + to: number; + } + + export interface Filter { + key: string; + + operation: + | 'includes' + | 'not_includes' + | 'starts_with' + | 'regex' + | 'exists' + | 'is_null' + | 'in' + | 'not_in' + | 'eq' + | 'neq' + | 'gt' + | 'gte' + | 'lt' + | 'lte' + | '=' + | '!=' + | '>' + | '>=' + | '<' + | '<=' + | 'INCLUDES' + | 'DOES_NOT_INCLUDE' + | 'MATCH_REGEX' + | 'EXISTS' + | 'DOES_NOT_EXIST' + | 'IN' + | 'NOT_IN' + | 'STARTS_WITH'; + + type: 'string' | 'number' | 'boolean'; + + value?: string | number | boolean; + } + + /** + * Search for a specific substring in the event. + */ + export interface Needle { + value: string | number | boolean; + + isRegex?: boolean; + + matchCase?: boolean; + } +} + +Telemetry.TelemetryKeysResponsesSinglePage = TelemetryKeysResponsesSinglePage; +Telemetry.TelemetryValuesResponsesSinglePage = TelemetryValuesResponsesSinglePage; + +export declare namespace Telemetry { + export { + type TelemetryKeysResponse as TelemetryKeysResponse, + type TelemetryQueryResponse as TelemetryQueryResponse, + type TelemetryValuesResponse as TelemetryValuesResponse, + TelemetryKeysResponsesSinglePage as TelemetryKeysResponsesSinglePage, + TelemetryValuesResponsesSinglePage as TelemetryValuesResponsesSinglePage, + type TelemetryKeysParams as TelemetryKeysParams, + type TelemetryQueryParams as TelemetryQueryParams, + type TelemetryValuesParams as TelemetryValuesParams, + }; +} diff --git a/src/resources/workflows/index.ts b/src/resources/workflows/index.ts index ff9d0d44ac..f9356eadf4 100644 --- a/src/resources/workflows/index.ts +++ b/src/resources/workflows/index.ts @@ -1,5 +1,24 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Instances } from './instances/index'; -export { Versions } from './versions'; +export { + InstanceListResponsesV4PagePaginationArray, + InstanceBulkResponsesSinglePage, + Instances, + type InstanceCreateResponse, + type InstanceListResponse, + type InstanceBulkResponse, + type InstanceGetResponse, + type InstanceCreateParams, + type InstanceListParams, + type InstanceBulkParams, + type InstanceGetParams, +} from './instances/index'; +export { + VersionListResponsesV4PagePaginationArray, + Versions, + type VersionListResponse, + type VersionGetResponse, + type VersionListParams, + type VersionGetParams, +} from './versions'; export { Workflows } from './workflows'; diff --git a/src/resources/workflows/instances/events.ts b/src/resources/workflows/instances/events.ts index 6e87ef6fb4..20f3a15ba5 100644 --- a/src/resources/workflows/instances/events.ts +++ b/src/resources/workflows/instances/events.ts @@ -1,5 +1,43 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class Events extends APIResource {} +export class Events extends APIResource { + /** + * Send event to instance + */ + create( + workflowName: string, + instanceId: string, + eventType: string, + params: EventCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, body } = params ?? {}; + return ( + this._client.post( + `/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/events/${eventType}`, + { body: body, ...options }, + ) as Core.APIPromise<{ result: EventCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export type EventCreateResponse = unknown; + +export interface EventCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + body?: unknown; +} + +export declare namespace Events { + export { type EventCreateResponse as EventCreateResponse, type EventCreateParams as EventCreateParams }; +} diff --git a/src/resources/workflows/instances/index.ts b/src/resources/workflows/instances/index.ts index 1c63a64a9d..9c96da29fb 100644 --- a/src/resources/workflows/instances/index.ts +++ b/src/resources/workflows/instances/index.ts @@ -1,5 +1,17 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Events } from './events'; -export { Instances } from './instances'; -export { Status } from './status'; +export { Events, type EventCreateResponse, type EventCreateParams } from './events'; +export { + InstanceListResponsesV4PagePaginationArray, + InstanceBulkResponsesSinglePage, + Instances, + type InstanceCreateResponse, + type InstanceListResponse, + type InstanceBulkResponse, + type InstanceGetResponse, + type InstanceCreateParams, + type InstanceListParams, + type InstanceBulkParams, + type InstanceGetParams, +} from './instances'; +export { Status, type StatusEditResponse, type StatusEditParams } from './status'; diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts index 8ab49d5567..117054a689 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -1,21 +1,418 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; import * as EventsAPI from './events'; -import { Events } from './events'; +import { EventCreateParams, EventCreateResponse, Events } from './events'; import * as StatusAPI from './status'; -import { Status } from './status'; +import { Status, StatusEditParams, StatusEditResponse } from './status'; +import { SinglePage, V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Instances extends APIResource { status: StatusAPI.Status = new StatusAPI.Status(this._client); events: EventsAPI.Events = new EventsAPI.Events(this._client); + + /** + * Create a new workflow instance + */ + create( + workflowName: string, + params: InstanceCreateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.post(`/accounts/${account_id}/workflows/${workflowName}/instances`, { + body, + ...options, + }) as Core.APIPromise<{ result: InstanceCreateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List of workflow instances + */ + list( + workflowName: string, + params: InstanceListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/workflows/${workflowName}/instances`, + InstanceListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Batch create new Workflow instances + */ + bulk( + workflowName: string, + params: InstanceBulkParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, body } = params ?? {}; + return this._client.getAPIList( + `/accounts/${account_id}/workflows/${workflowName}/instances/batch`, + InstanceBulkResponsesSinglePage, + { body: body, method: 'post', ...options }, + ); + } + + /** + * Get logs and status from instance + */ + get( + workflowName: string, + instanceId: string, + params: InstanceGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}`, + options, + ) as Core.APIPromise<{ result: InstanceGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class InstanceListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export class InstanceBulkResponsesSinglePage extends SinglePage {} + +export interface InstanceCreateResponse { + id: string; + + status: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; + + version_id: string; + + workflow_id: string; +} + +export interface InstanceListResponse { + id: string; + + created_on: string; + + ended_on: string | null; + + modified_on: string; + + started_on: string | null; + + status: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; + + version_id: string; + + workflow_id: string; +} + +export interface InstanceBulkResponse { + id: string; + + status: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; + + version_id: string; + + workflow_id: string; +} + +export interface InstanceGetResponse { + end: string | null; + + error: InstanceGetResponse.Error | null; + + output: string | number; + + params: unknown; + + queued: string; + + start: string | null; + + status: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; + + steps: Array< + | InstanceGetResponse.UnionMember0 + | InstanceGetResponse.UnionMember1 + | InstanceGetResponse.UnionMember2 + | InstanceGetResponse.UnionMember3 + >; + + success: boolean | null; + + trigger: InstanceGetResponse.Trigger; + + versionId: string; +} + +export namespace InstanceGetResponse { + export interface Error { + message: string; + + name: string; + } + + export interface UnionMember0 { + attempts: Array; + + config: UnionMember0.Config; + + end: string | null; + + name: string; + + output: unknown; + + start: string; + + success: boolean | null; + + type: 'step'; + } + + export namespace UnionMember0 { + export interface Attempt { + end: string | null; + + error: Attempt.Error | null; + + start: string; + + success: boolean | null; + } + + export namespace Attempt { + export interface Error { + message: string; + + name: string; + } + } + + export interface Config { + retries: Config.Retries; + + timeout: unknown | number; + } + + export namespace Config { + export interface Retries { + delay: unknown | number; + + limit: number; + + backoff?: 'constant' | 'linear' | 'exponential'; + } + } + } + + export interface UnionMember1 { + end: string; + + error: UnionMember1.Error | null; + + finished: boolean; + + name: string; + + start: string; + + type: 'sleep'; + } + + export namespace UnionMember1 { + export interface Error { + message: string; + + name: string; + } + } + + export interface UnionMember2 { + trigger: UnionMember2.Trigger; + + type: 'termination'; + } + + export namespace UnionMember2 { + export interface Trigger { + source: string; + } + } + + export interface UnionMember3 { + end: string; + + error: UnionMember3.Error | null; + + finished: boolean; + + name: string; + + output: unknown | string | number | boolean; + + start: string; + + type: 'waitForEvent'; + } + + export namespace UnionMember3 { + export interface Error { + message: string; + + name: string; + } + } + + export interface Trigger { + source: 'unknown' | 'api' | 'binding' | 'event' | 'cron'; + } } +export interface InstanceCreateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + instance_id?: string; + + /** + * Body param: + */ + instance_retention?: unknown; + + /** + * Body param: + */ + params?: unknown; +} + +export interface InstanceListParams extends V4PagePaginationArrayParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_end?: string; + + /** + * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. + */ + date_start?: string; + + /** + * Query param: + */ + status?: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; +} + +export interface InstanceBulkParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + body?: Array; +} + +export namespace InstanceBulkParams { + export interface Body { + instance_id?: string; + + instance_retention?: unknown; + + params?: unknown; + } +} + +export interface InstanceGetParams { + account_id: string; +} + +Instances.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; +Instances.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage; Instances.Status = Status; Instances.Events = Events; export declare namespace Instances { - export { Status as Status }; + export { + type InstanceCreateResponse as InstanceCreateResponse, + type InstanceListResponse as InstanceListResponse, + type InstanceBulkResponse as InstanceBulkResponse, + type InstanceGetResponse as InstanceGetResponse, + InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, + InstanceBulkResponsesSinglePage as InstanceBulkResponsesSinglePage, + type InstanceCreateParams as InstanceCreateParams, + type InstanceListParams as InstanceListParams, + type InstanceBulkParams as InstanceBulkParams, + type InstanceGetParams as InstanceGetParams, + }; + + export { + Status as Status, + type StatusEditResponse as StatusEditResponse, + type StatusEditParams as StatusEditParams, + }; - export { Events as Events }; + export { + Events as Events, + type EventCreateResponse as EventCreateResponse, + type EventCreateParams as EventCreateParams, + }; } diff --git a/src/resources/workflows/instances/status.ts b/src/resources/workflows/instances/status.ts index e8d042f21b..54b3ce3cc9 100644 --- a/src/resources/workflows/instances/status.ts +++ b/src/resources/workflows/instances/status.ts @@ -1,5 +1,57 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; -export class Status extends APIResource {} +export class Status extends APIResource { + /** + * Change status of instance + */ + edit( + workflowName: string, + instanceId: string, + params: StatusEditParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.patch(`/accounts/${account_id}/workflows/${workflowName}/instances/${instanceId}/status`, { + body, + ...options, + }) as Core.APIPromise<{ result: StatusEditResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface StatusEditResponse { + status: + | 'queued' + | 'running' + | 'paused' + | 'errored' + | 'terminated' + | 'complete' + | 'waitingForPause' + | 'waiting'; + + /** + * Accepts ISO 8601 with no timezone offsets and in UTC. + */ + timestamp: string; +} + +export interface StatusEditParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: Apply action to instance. + */ + status: 'resume' | 'pause' | 'terminate'; +} + +export declare namespace Status { + export { type StatusEditResponse as StatusEditResponse, type StatusEditParams as StatusEditParams }; +} diff --git a/src/resources/workflows/versions.ts b/src/resources/workflows/versions.ts index c0875b7239..dab04a8662 100644 --- a/src/resources/workflows/versions.ts +++ b/src/resources/workflows/versions.ts @@ -1,5 +1,90 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; -export class Versions extends APIResource {} +export class Versions extends APIResource { + /** + * List deployed Workflow versions + */ + list( + workflowName: string, + params: VersionListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/workflows/${workflowName}/versions`, + VersionListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Get Workflow version details + */ + get( + workflowName: string, + versionId: string, + params: VersionGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get( + `/accounts/${account_id}/workflows/${workflowName}/versions/${versionId}`, + options, + ) as Core.APIPromise<{ result: VersionGetResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class VersionListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface VersionListResponse { + id: string; + + class_name: string; + + created_on: string; + + modified_on: string; + + workflow_id: string; +} + +export interface VersionGetResponse { + id: string; + + class_name: string; + + created_on: string; + + modified_on: string; + + workflow_id: string; +} + +export interface VersionListParams extends V4PagePaginationArrayParams { + /** + * Path param: + */ + account_id: string; +} + +export interface VersionGetParams { + account_id: string; +} + +Versions.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray; + +export declare namespace Versions { + export { + type VersionListResponse as VersionListResponse, + type VersionGetResponse as VersionGetResponse, + VersionListResponsesV4PagePaginationArray as VersionListResponsesV4PagePaginationArray, + type VersionListParams as VersionListParams, + type VersionGetParams as VersionGetParams, + }; +} diff --git a/src/resources/workflows/workflows.ts b/src/resources/workflows/workflows.ts index e86558cce9..d7f69588d8 100644 --- a/src/resources/workflows/workflows.ts +++ b/src/resources/workflows/workflows.ts @@ -1,21 +1,285 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; +import * as Core from '../../core'; import * as VersionsAPI from './versions'; -import { Versions } from './versions'; +import { + VersionGetParams, + VersionGetResponse, + VersionListParams, + VersionListResponse, + VersionListResponsesV4PagePaginationArray, + Versions, +} from './versions'; import * as InstancesAPI from './instances/instances'; -import { Instances } from './instances/instances'; +import { + InstanceBulkParams, + InstanceBulkResponse, + InstanceBulkResponsesSinglePage, + InstanceCreateParams, + InstanceCreateResponse, + InstanceGetParams, + InstanceGetResponse, + InstanceListParams, + InstanceListResponse, + InstanceListResponsesV4PagePaginationArray, + Instances as InstancesAPIInstances, +} from './instances/instances'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination'; export class Workflows extends APIResource { instances: InstancesAPI.Instances = new InstancesAPI.Instances(this._client); versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client); + + /** + * Create/modify Workflow + */ + update( + workflowName: string, + params: WorkflowUpdateParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id, ...body } = params; + return ( + this._client.put(`/accounts/${account_id}/workflows/${workflowName}`, { + body, + ...options, + }) as Core.APIPromise<{ result: WorkflowUpdateResponse }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * List all Workflows + */ + list( + params: WorkflowListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList( + `/accounts/${account_id}/workflows`, + WorkflowListResponsesV4PagePaginationArray, + { query, ...options }, + ); + } + + /** + * Deletes a Workflow. This only deletes the Workflow and does not delete or modify + * any Worker associated to this Workflow or bounded to it. + */ + delete( + workflowName: string, + params: WorkflowDeleteParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.delete(`/accounts/${account_id}/workflows/${workflowName}`, options) as Core.APIPromise<{ + result: WorkflowDeleteResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Get Workflow details + */ + get( + workflowName: string, + params: WorkflowGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise { + const { account_id } = params; + return ( + this._client.get(`/accounts/${account_id}/workflows/${workflowName}`, options) as Core.APIPromise<{ + result: WorkflowGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export class WorkflowListResponsesV4PagePaginationArray extends V4PagePaginationArray {} + +export interface WorkflowUpdateResponse { + id: string; + + class_name: string; + + created_on: string; + + is_deleted: number; + + modified_on: string; + + name: string; + + script_name: string; + + terminator_running: number; + + triggered_on: string | null; + + version_id: string; +} + +export interface WorkflowListResponse { + id: string; + + class_name: string; + + created_on: string; + + instances: WorkflowListResponse.Instances; + + modified_on: string; + + name: string; + + script_name: string; + + triggered_on: string | null; +} + +export namespace WorkflowListResponse { + export interface Instances { + complete?: number; + + errored?: number; + + paused?: number; + + queued?: number; + + running?: number; + + terminated?: number; + + waiting?: number; + + waitingForPause?: number; + } } -Workflows.Instances = Instances; +export interface WorkflowDeleteResponse { + status: 'ok'; + + success: boolean | null; +} + +export interface WorkflowGetResponse { + id: string; + + class_name: string; + + created_on: string; + + instances: WorkflowGetResponse.Instances; + + modified_on: string; + + name: string; + + script_name: string; + + triggered_on: string | null; +} + +export namespace WorkflowGetResponse { + export interface Instances { + complete?: number; + + errored?: number; + + paused?: number; + + queued?: number; + + running?: number; + + terminated?: number; + + waiting?: number; + + waitingForPause?: number; + } +} + +export interface WorkflowUpdateParams { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: + */ + class_name: string; + + /** + * Body param: + */ + script_name: string; +} + +export interface WorkflowListParams extends V4PagePaginationArrayParams { + /** + * Path param: + */ + account_id: string; + + /** + * Query param: Allows filtering workflows` name. + */ + search?: string; +} + +export interface WorkflowDeleteParams { + account_id: string; +} + +export interface WorkflowGetParams { + account_id: string; +} + +Workflows.WorkflowListResponsesV4PagePaginationArray = WorkflowListResponsesV4PagePaginationArray; +Workflows.Instances = InstancesAPIInstances; +Workflows.InstanceListResponsesV4PagePaginationArray = InstanceListResponsesV4PagePaginationArray; +Workflows.InstanceBulkResponsesSinglePage = InstanceBulkResponsesSinglePage; Workflows.Versions = Versions; +Workflows.VersionListResponsesV4PagePaginationArray = VersionListResponsesV4PagePaginationArray; export declare namespace Workflows { - export { Instances as Instances }; + export { + type WorkflowUpdateResponse as WorkflowUpdateResponse, + type WorkflowListResponse as WorkflowListResponse, + type WorkflowDeleteResponse as WorkflowDeleteResponse, + type WorkflowGetResponse as WorkflowGetResponse, + WorkflowListResponsesV4PagePaginationArray as WorkflowListResponsesV4PagePaginationArray, + type WorkflowUpdateParams as WorkflowUpdateParams, + type WorkflowListParams as WorkflowListParams, + type WorkflowDeleteParams as WorkflowDeleteParams, + type WorkflowGetParams as WorkflowGetParams, + }; + + export { + InstancesAPIInstances as Instances, + type InstanceCreateResponse as InstanceCreateResponse, + type InstanceListResponse as InstanceListResponse, + type InstanceBulkResponse as InstanceBulkResponse, + type InstanceGetResponse as InstanceGetResponse, + InstanceListResponsesV4PagePaginationArray as InstanceListResponsesV4PagePaginationArray, + InstanceBulkResponsesSinglePage as InstanceBulkResponsesSinglePage, + type InstanceCreateParams as InstanceCreateParams, + type InstanceListParams as InstanceListParams, + type InstanceBulkParams as InstanceBulkParams, + type InstanceGetParams as InstanceGetParams, + }; - export { Versions as Versions }; + export { + Versions as Versions, + type VersionListResponse as VersionListResponse, + type VersionGetResponse as VersionGetResponse, + VersionListResponsesV4PagePaginationArray as VersionListResponsesV4PagePaginationArray, + type VersionListParams as VersionListParams, + type VersionGetParams as VersionGetParams, + }; } diff --git a/src/resources/zero-trust/dex/colos.ts b/src/resources/zero-trust/dex/colos.ts index 5f53995ed5..6b045b5012 100644 --- a/src/resources/zero-trust/dex/colos.ts +++ b/src/resources/zero-trust/dex/colos.ts @@ -38,22 +38,7 @@ export class Colos extends APIResource { export class ColoListResponsesSinglePage extends SinglePage {} -export interface ColoListResponse { - /** - * Airport code - */ - airportCode: string; - - /** - * City - */ - city: string; - - /** - * Country code - */ - countryCode: string; -} +export type ColoListResponse = unknown; export interface ColoListParams { /** diff --git a/src/resources/zones/custom-nameservers.ts b/src/resources/zones/custom-nameservers.ts index d5374a1553..a24f5a3e4a 100644 --- a/src/resources/zones/custom-nameservers.ts +++ b/src/resources/zones/custom-nameservers.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; +import * as Shared from '../shared'; import { SinglePage } from '../../pagination'; /** @@ -57,12 +58,12 @@ export class CustomNameserverUpdateResponsesSinglePage extends SinglePage; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful. + * Whether the API call was successful */ success: true; @@ -80,56 +81,24 @@ export interface CustomNameserverGetResponse { } export namespace CustomNameserverGetResponse { - 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; } @@ -137,7 +106,7 @@ export namespace CustomNameserverGetResponse { export interface CustomNameserverUpdateParams { /** - * Path param: Identifier. + * Path param: Identifier */ zone_id: string; @@ -154,7 +123,7 @@ export interface CustomNameserverUpdateParams { export interface CustomNameserverGetParams { /** - * Identifier. + * Identifier */ zone_id: string; } diff --git a/tests/api-resources/ai-gateway/ai-gateway.test.ts b/tests/api-resources/ai-gateway/ai-gateway.test.ts index 2b8f9cbe5c..fdb863542c 100644 --- a/tests/api-resources/ai-gateway/ai-gateway.test.ts +++ b/tests/api-resources/ai-gateway/ai-gateway.test.ts @@ -81,7 +81,6 @@ describe('resource aiGateway', () => { log_management_strategy: 'STOP_INSERTING', logpush: true, logpush_public_key: 'xxxxxxxxxxxxxxxx', - store_id: 'store_id', }); }); diff --git a/tests/api-resources/browser-rendering/json.test.ts b/tests/api-resources/browser-rendering/json.test.ts index d7317f73a1..9443f79ae3 100644 --- a/tests/api-resources/browser-rendering/json.test.ts +++ b/tests/api-resources/browser-rendering/json.test.ts @@ -50,7 +50,6 @@ describe('resource json', () => { url: 'url', }, ], - custom_ai: [{ authorization: 'authorization', model: 'model' }], emulateMediaType: 'emulateMediaType', gotoOptions: { referer: 'referer', diff --git a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts index ebb748d3f9..42e52d5807 100644 --- a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts +++ b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts @@ -26,8 +26,6 @@ describe('resource namespaces', () => { test('list: required and optional params', async () => { const response = await client.durableObjects.namespaces.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', - page: 1, - per_page: 1, }); }); }); diff --git a/tests/api-resources/kv/namespaces/keys.test.ts b/tests/api-resources/kv/namespaces/keys.test.ts index 4e16a3b3c0..1d9985944b 100644 --- a/tests/api-resources/kv/namespaces/keys.test.ts +++ b/tests/api-resources/kv/namespaces/keys.test.ts @@ -54,10 +54,33 @@ describe('resource keys', () => { }); }); + test('bulkGet: only required params', async () => { + const responsePromise = client.kv.namespaces.keys.bulkGet('0f2ac74b498b48028cb68387c421e279', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + keys: ['My-Key'], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('bulkGet: required and optional params', async () => { + const response = await client.kv.namespaces.keys.bulkGet('0f2ac74b498b48028cb68387c421e279', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + keys: ['My-Key'], + type: 'text', + withMetadata: true, + }); + }); + test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.keys.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ key: 'My-Key', value: 'Some string' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -73,12 +96,12 @@ describe('resource keys', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { + key: 'My-Key', + value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - key: 'My-Key', - metadata: { someMetadataKey: 'bar' }, - value: 'Some string', + metadata: {}, }, ], }); diff --git a/tests/api-resources/kv/namespaces/namespaces.test.ts b/tests/api-resources/kv/namespaces/namespaces.test.ts index d69492f799..83aa204719 100644 --- a/tests/api-resources/kv/namespaces/namespaces.test.ts +++ b/tests/api-resources/kv/namespaces/namespaces.test.ts @@ -113,10 +113,33 @@ describe('resource namespaces', () => { }); }); + test('bulkGet: only required params', async () => { + const responsePromise = client.kv.namespaces.bulkGet('0f2ac74b498b48028cb68387c421e279', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + keys: ['My-Key'], + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('bulkGet: required and optional params', async () => { + const response = await client.kv.namespaces.bulkGet('0f2ac74b498b48028cb68387c421e279', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + keys: ['My-Key'], + type: 'text', + withMetadata: true, + }); + }); + test('bulkUpdate: only required params', async () => { const responsePromise = client.kv.namespaces.bulkUpdate('0f2ac74b498b48028cb68387c421e279', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: [{}], + body: [{ key: 'My-Key', value: 'Some string' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -132,12 +155,12 @@ describe('resource namespaces', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', body: [ { + key: 'My-Key', + value: 'Some string', base64: true, expiration: 1578435000, expiration_ttl: 300, - key: 'My-Key', - metadata: { someMetadataKey: 'bar' }, - value: 'Some string', + metadata: {}, }, ], }); diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 2d1cc3ddf6..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -14,7 +14,6 @@ describe('resource values', () => { test.skip('update: only required params', async () => { const responsePromise = client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', }); const rawResponse = await responsePromise.asResponse(); @@ -30,10 +29,10 @@ describe('resource values', () => { test.skip('update: required and optional params', async () => { const response = await client.kv.namespaces.values.update('0f2ac74b498b48028cb68387c421e279', 'My-Key', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - metadata: '{"someMetadataKey": "someMetadataValue"}', value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); diff --git a/tests/api-resources/logs/control/cmb/config.test.ts b/tests/api-resources/logs/control/cmb/config.test.ts new file mode 100644 index 0000000000..f90f8827a0 --- /dev/null +++ b/tests/api-resources/logs/control/cmb/config.test.ts @@ -0,0 +1,71 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource config', () => { + test('create: only required params', async () => { + const responsePromise = client.logs.control.cmb.config.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.logs.control.cmb.config.create({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + allow_out_of_region_access: false, + regions: 'eu', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.logs.control.cmb.config.delete({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.logs.control.cmb.config.delete({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.logs.control.cmb.config.get({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.logs.control.cmb.config.get({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); +}); diff --git a/tests/api-resources/logs/control/retention.test.ts b/tests/api-resources/logs/control/retention.test.ts new file mode 100644 index 0000000000..12d00d074b --- /dev/null +++ b/tests/api-resources/logs/control/retention.test.ts @@ -0,0 +1,49 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource retention', () => { + test('create: only required params', async () => { + const responsePromise = client.logs.control.retention.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.logs.control.retention.create({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + flag: true, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.logs.control.retention.get({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.logs.control.retention.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); diff --git a/tests/api-resources/logs/rayid.test.ts b/tests/api-resources/logs/rayid.test.ts new file mode 100644 index 0000000000..4e5aeb35e0 --- /dev/null +++ b/tests/api-resources/logs/rayid.test.ts @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource RayID', () => { + test('get: only required params', async () => { + const responsePromise = client.logs.RayID.get('41ddf1740f67442d', { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.logs.RayID.get('41ddf1740f67442d', { + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + fields: 'ClientIP,RayID,EdgeStartTimestamp', + timestamps: 'unixnano', + }); + }); +}); diff --git a/tests/api-resources/logs/received/fields.test.ts b/tests/api-resources/logs/received/fields.test.ts new file mode 100644 index 0000000000..1d1882bd46 --- /dev/null +++ b/tests/api-resources/logs/received/fields.test.ts @@ -0,0 +1,27 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource fields', () => { + test('get: only required params', async () => { + const responsePromise = client.logs.received.fields.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.logs.received.fields.get({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + }); +}); diff --git a/tests/api-resources/logs/received/received.test.ts b/tests/api-resources/logs/received/received.test.ts new file mode 100644 index 0000000000..9cbc7e0830 --- /dev/null +++ b/tests/api-resources/logs/received/received.test.ts @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource received', () => { + test('get: only required params', async () => { + const responsePromise = client.logs.received.get({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + end: '2018-05-20T10:01:00Z', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.logs.received.get({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + end: '2018-05-20T10:01:00Z', + count: 1, + fields: 'ClientIP,RayID,EdgeStartTimestamp', + sample: 0.1, + start: '2018-05-20T10:00:00Z', + timestamps: 'unixnano', + }); + }); +}); diff --git a/tests/api-resources/queues/messages.test.ts b/tests/api-resources/queues/messages.test.ts index 681ca31693..1e4b58a9d3 100644 --- a/tests/api-resources/queues/messages.test.ts +++ b/tests/api-resources/queues/messages.test.ts @@ -42,6 +42,27 @@ describe('resource messages', () => { }); }); + test('bulkPush: only required params', async () => { + const responsePromise = client.queues.messages.bulkPush('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('bulkPush: required and optional params', async () => { + const response = await client.queues.messages.bulkPush('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + delay_seconds: 0, + messages: [{ body: 'body', content_type: 'text', delay_seconds: 0 }], + }); + }); + test('pull: only required params', async () => { const responsePromise = client.queues.messages.pull('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', @@ -62,4 +83,26 @@ describe('resource messages', () => { visibility_timeout_ms: 6000, }); }); + + test('push: only required params', async () => { + const responsePromise = client.queues.messages.push('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('push: required and optional params', async () => { + const response = await client.queues.messages.push('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + body: 'body', + content_type: 'text', + delay_seconds: 0, + }); + }); }); diff --git a/tests/api-resources/r2/buckets/domains/custom.test.ts b/tests/api-resources/r2/buckets/domains/custom.test.ts index 0912f1f272..414dbbd1dc 100644 --- a/tests/api-resources/r2/buckets/domains/custom.test.ts +++ b/tests/api-resources/r2/buckets/domains/custom.test.ts @@ -34,7 +34,6 @@ describe('resource custom', () => { domain: 'prefix.example-domain.com', enabled: true, zoneId: '36ca64a6d92827b8a6b90be344bb1bfd', - ciphers: ['string'], minTLS: '1.0', jurisdiction: 'default', }); @@ -63,7 +62,6 @@ describe('resource custom', () => { 'example-domain/custom-domain.com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - ciphers: ['string'], enabled: true, minTLS: '1.2', jurisdiction: 'default', diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts new file mode 100644 index 0000000000..e45f8279d7 --- /dev/null +++ b/tests/api-resources/radar/ai/bots/summary.test.ts @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.bots.summary.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent( + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..386515626c --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/snippets/rules.test.ts b/tests/api-resources/snippets/rules.test.ts index 5f329ac748..3552adbd0c 100644 --- a/tests/api-resources/snippets/rules.test.ts +++ b/tests/api-resources/snippets/rules.test.ts @@ -13,7 +13,7 @@ describe('resource rules', () => { test('update: only required params', async () => { const responsePromise = client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - rules: [{ expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet' }], + body: [{ expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -27,9 +27,9 @@ describe('resource rules', () => { test('update: required and optional params', async () => { const response = await client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - rules: [ + body: [ { - expression: 'ip.src eq 1.1.1.1', + expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet', description: 'Execute my_snippet when IP address is 1.1.1.1.', enabled: true, diff --git a/tests/api-resources/workers/observability/telemetry.test.ts b/tests/api-resources/workers/observability/telemetry.test.ts new file mode 100644 index 0000000000..fe09f5d99a --- /dev/null +++ b/tests/api-resources/workers/observability/telemetry.test.ts @@ -0,0 +1,110 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource telemetry', () => { + test('keys: only required params', async () => { + const responsePromise = client.workers.observability.telemetry.keys({ account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('keys: required and optional params', async () => { + const response = await client.workers.observability.telemetry.keys({ + account_id: 'account_id', + datasets: ['string'], + filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], + keyNeedle: { value: 'string', isRegex: true, matchCase: true }, + limit: 0, + needle: { value: 'string', isRegex: true, matchCase: true }, + timeframe: { from: 0, to: 0 }, + }); + }); + + test('query: only required params', async () => { + const responsePromise = client.workers.observability.telemetry.query({ + account_id: 'account_id', + queryId: 'queryId', + timeframe: { from: 0, to: 0 }, + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('query: required and optional params', async () => { + const response = await client.workers.observability.telemetry.query({ + account_id: 'account_id', + queryId: 'queryId', + timeframe: { from: 0, to: 0 }, + chart: true, + compare: true, + dry: true, + granularity: 0, + ignoreSeries: true, + limit: 100, + offset: 'offset', + offsetBy: 0, + offsetDirection: 'offsetDirection', + parameters: { + calculations: [{ operator: 'uniq', alias: 'alias', key: 'key', keyType: 'string' }], + datasets: ['string'], + filterCombination: 'and', + filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], + groupBys: [{ type: 'string', value: 'value' }], + havings: [{ key: 'key', operation: 'eq', value: 0 }], + limit: 0, + needle: { value: 'string', isRegex: true, matchCase: true }, + orderBy: { value: 'value', order: 'asc' }, + }, + patternType: 'message', + view: 'traces', + }); + }); + + test('values: only required params', async () => { + const responsePromise = client.workers.observability.telemetry.values({ + account_id: 'account_id', + datasets: ['string'], + key: 'key', + timeframe: { from: 0, to: 0 }, + type: 'string', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('values: required and optional params', async () => { + const response = await client.workers.observability.telemetry.values({ + account_id: 'account_id', + datasets: ['string'], + key: 'key', + timeframe: { from: 0, to: 0 }, + type: 'string', + filters: [{ key: 'key', operation: 'includes', type: 'string', value: 'string' }], + limit: 0, + needle: { value: 'string', isRegex: true, matchCase: true }, + }); + }); +}); diff --git a/tests/api-resources/workflows/instances/events.test.ts b/tests/api-resources/workflows/instances/events.test.ts new file mode 100644 index 0000000000..a929a7e0d3 --- /dev/null +++ b/tests/api-resources/workflows/instances/events.test.ts @@ -0,0 +1,32 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource events', () => { + test('create: only required params', async () => { + const responsePromise = client.workflows.instances.events.create('x', 'x', 'x', { + account_id: 'account_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.workflows.instances.events.create('x', 'x', 'x', { + account_id: 'account_id', + body: {}, + }); + }); +}); diff --git a/tests/api-resources/workflows/instances/instances.test.ts b/tests/api-resources/workflows/instances/instances.test.ts new file mode 100644 index 0000000000..a33eac54ad --- /dev/null +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource instances', () => { + test('create: only required params', async () => { + const responsePromise = client.workflows.instances.create('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('create: required and optional params', async () => { + const response = await client.workflows.instances.create('x', { + account_id: 'account_id', + instance_id: 'instance_id', + instance_retention: {}, + params: {}, + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.workflows.instances.list('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.workflows.instances.list('x', { + account_id: 'account_id', + date_end: '2019-12-27T18:11:19.117Z', + date_start: '2019-12-27T18:11:19.117Z', + page: 1, + per_page: 1, + status: 'queued', + }); + }); + + test('bulk: only required params', async () => { + const responsePromise = client.workflows.instances.bulk('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('bulk: required and optional params', async () => { + const response = await client.workflows.instances.bulk('x', { + account_id: 'account_id', + body: [{ instance_id: 'instance_id', instance_retention: {}, params: {} }], + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.workflows.instances.get('x', 'x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.workflows.instances.get('x', 'x', { account_id: 'account_id' }); + }); +}); diff --git a/tests/api-resources/workflows/instances/status.test.ts b/tests/api-resources/workflows/instances/status.test.ts new file mode 100644 index 0000000000..238df1e9a5 --- /dev/null +++ b/tests/api-resources/workflows/instances/status.test.ts @@ -0,0 +1,33 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource status', () => { + test('edit: only required params', async () => { + const responsePromise = client.workflows.instances.status.edit('x', 'x', { + account_id: 'account_id', + status: 'resume', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('edit: required and optional params', async () => { + const response = await client.workflows.instances.status.edit('x', 'x', { + account_id: 'account_id', + status: 'resume', + }); + }); +}); diff --git a/tests/api-resources/workflows/versions.test.ts b/tests/api-resources/workflows/versions.test.ts new file mode 100644 index 0000000000..ee27857662 --- /dev/null +++ b/tests/api-resources/workflows/versions.test.ts @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource versions', () => { + test('list: only required params', async () => { + const responsePromise = client.workflows.versions.list('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.workflows.versions.list('x', { + account_id: 'account_id', + page: 1, + per_page: 1, + }); + }); + + test('get: only required params', async () => { + const responsePromise = client.workflows.versions.get('x', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + account_id: 'account_id', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.workflows.versions.get('x', '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', { + account_id: 'account_id', + }); + }); +}); diff --git a/tests/api-resources/workflows/workflows.test.ts b/tests/api-resources/workflows/workflows.test.ts new file mode 100644 index 0000000000..c58e0da536 --- /dev/null +++ b/tests/api-resources/workflows/workflows.test.ts @@ -0,0 +1,85 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource workflows', () => { + test('update: only required params', async () => { + const responsePromise = client.workflows.update('x', { + account_id: 'account_id', + class_name: 'x', + script_name: 'x', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('update: required and optional params', async () => { + const response = await client.workflows.update('x', { + account_id: 'account_id', + class_name: 'x', + script_name: 'x', + }); + }); + + test('list: only required params', async () => { + const responsePromise = client.workflows.list({ account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.workflows.list({ + account_id: 'account_id', + page: 1, + per_page: 1, + search: 'x', + }); + }); + + test('delete: only required params', async () => { + const responsePromise = client.workflows.delete('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('delete: required and optional params', async () => { + const response = await client.workflows.delete('x', { account_id: 'account_id' }); + }); + + test('get: only required params', async () => { + const responsePromise = client.workflows.get('x', { account_id: 'account_id' }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: required and optional params', async () => { + const response = await client.workflows.get('x', { account_id: 'account_id' }); + }); +}); From 1efe99b7cc816478cfe2bcf8b8b029ee3cf0a8e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 18:09:28 +0000 Subject: [PATCH 248/423] feat(api): api update --- .stats.yml | 4 ++-- api.md | 2 +- src/resources/snippets/rules.ts | 8 ++++---- src/resources/workflows/instances/instances.ts | 5 +++++ tests/api-resources/snippets/rules.test.ts | 6 +++--- tests/api-resources/workflows/instances/instances.test.ts | 1 + 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27be673748..fa1277fdc3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb90b7fb6b9b4fdf8aa58c6f60980875a8dc855114fb2f84a4998024d7087f69.yml -openapi_spec_hash: 7eabd8352835bf80892dbb494fdf3ef4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d2a66f62f007704db30b02dc6072a9c9a3363f229521fd5c8d1db94cdaddf682.yml +openapi_spec_hash: 5439122fed13eb566c770576999e67fb config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index de3c2f95de..0e74cc2102 100644 --- a/api.md +++ b/api.md @@ -7718,7 +7718,7 @@ Types: Methods: -- client.snippets.rules.update([ ...body ]) -> RuleUpdateResponsesSinglePage +- client.snippets.rules.update({ ...params }) -> RuleUpdateResponsesSinglePage - client.snippets.rules.list({ ...params }) -> RuleListResponsesSinglePage - client.snippets.rules.delete({ ...params }) -> RuleDeleteResponsesSinglePage diff --git a/src/resources/snippets/rules.ts b/src/resources/snippets/rules.ts index 407f9e5612..fa1b544710 100644 --- a/src/resources/snippets/rules.ts +++ b/src/resources/snippets/rules.ts @@ -12,11 +12,11 @@ export class Rules extends APIResource { params: RuleUpdateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, body } = params; + const { zone_id, ...body } = params; return this._client.getAPIList( `/zones/${zone_id}/snippets/snippet_rules`, RuleUpdateResponsesSinglePage, - { body: body, method: 'put', ...options }, + { body, method: 'put', ...options }, ); } @@ -171,14 +171,14 @@ export interface RuleUpdateParams { /** * Body param: A list of snippet rules. */ - body: Array; + rules: Array; } export namespace RuleUpdateParams { /** * A snippet rule. */ - export interface Body { + export interface Rule { /** * The expression defining which traffic will match the rule. */ diff --git a/src/resources/workflows/instances/instances.ts b/src/resources/workflows/instances/instances.ts index 117054a689..6fdee7d5a9 100644 --- a/src/resources/workflows/instances/instances.ts +++ b/src/resources/workflows/instances/instances.ts @@ -335,6 +335,11 @@ export interface InstanceListParams extends V4PagePaginationArrayParams { */ account_id: string; + /** + * Query param: `page` and `cursor` are mutually exclusive, use one or the other. + */ + cursor?: string; + /** * Query param: Accepts ISO 8601 with no timezone offsets and in UTC. */ diff --git a/tests/api-resources/snippets/rules.test.ts b/tests/api-resources/snippets/rules.test.ts index 3552adbd0c..5f329ac748 100644 --- a/tests/api-resources/snippets/rules.test.ts +++ b/tests/api-resources/snippets/rules.test.ts @@ -13,7 +13,7 @@ describe('resource rules', () => { test('update: only required params', async () => { const responsePromise = client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - body: [{ expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet' }], + rules: [{ expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet' }], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -27,9 +27,9 @@ describe('resource rules', () => { test('update: required and optional params', async () => { const response = await client.snippets.rules.update({ zone_id: '9f1839b6152d298aca64c4e906b6d074', - body: [ + rules: [ { - expression: 'ip.src ne 1.1.1.1', + expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet', description: 'Execute my_snippet when IP address is 1.1.1.1.', enabled: true, diff --git a/tests/api-resources/workflows/instances/instances.test.ts b/tests/api-resources/workflows/instances/instances.test.ts index a33eac54ad..17d0fa0426 100644 --- a/tests/api-resources/workflows/instances/instances.test.ts +++ b/tests/api-resources/workflows/instances/instances.test.ts @@ -44,6 +44,7 @@ describe('resource instances', () => { test('list: required and optional params', async () => { const response = await client.workflows.instances.list('x', { account_id: 'account_id', + cursor: 'cursor', date_end: '2019-12-27T18:11:19.117Z', date_start: '2019-12-27T18:11:19.117Z', page: 1, From db79b6eff163e6d45de81ea5b6a7a74f5879db96 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 00:25:57 +0000 Subject: [PATCH 249/423] feat(api): api update --- .stats.yml | 8 +-- api.md | 5 +- .../durable-objects/durable-objects.ts | 11 +++- src/resources/durable-objects/index.ts | 2 +- .../durable-objects/namespaces/index.ts | 7 ++- .../durable-objects/namespaces/namespaces.ts | 20 +++---- src/resources/queues/consumers.ts | 59 +++++++++++++++---- src/resources/queues/index.ts | 1 + src/resources/queues/queues.ts | 2 + src/resources/workers/scripts/deployments.ts | 15 +++++ .../regional-hostnames.test.ts | 2 +- .../namespaces/namespaces.test.ts | 2 + tests/api-resources/queues/consumers.test.ts | 35 +++++++++-- 13 files changed, 129 insertions(+), 40 deletions(-) diff --git a/.stats.yml b/.stats.yml index fa1277fdc3..534bd7f197 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1782 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d2a66f62f007704db30b02dc6072a9c9a3363f229521fd5c8d1db94cdaddf682.yml -openapi_spec_hash: 5439122fed13eb566c770576999e67fb -config_hash: eda5b3d9487ce675d1fadf88153b457d +configured_endpoints: 1783 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml +openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 +config_hash: 9ecbb4ede8ef69ecffaf8e504d2cb25d diff --git a/api.md b/api.md index 0e74cc2102..d67c737ead 100644 --- a/api.md +++ b/api.md @@ -2297,7 +2297,7 @@ Types: Methods: -- client.durableObjects.namespaces.list({ ...params }) -> NamespacesSinglePage +- client.durableObjects.namespaces.list({ ...params }) -> NamespacesV4PagePaginationArray ### Objects @@ -2336,8 +2336,9 @@ Methods: - client.queues.consumers.create(queueId, { ...params }) -> Consumer - client.queues.consumers.update(queueId, consumerId, { ...params }) -> Consumer +- client.queues.consumers.list(queueId, { ...params }) -> ConsumersSinglePage - client.queues.consumers.delete(queueId, consumerId, { ...params }) -> ConsumerDeleteResponse -- client.queues.consumers.get(queueId, { ...params }) -> ConsumersSinglePage +- client.queues.consumers.get(queueId, consumerId, { ...params }) -> Consumer ## Messages diff --git a/src/resources/durable-objects/durable-objects.ts b/src/resources/durable-objects/durable-objects.ts index 0fb700ec65..c2a022bafa 100644 --- a/src/resources/durable-objects/durable-objects.ts +++ b/src/resources/durable-objects/durable-objects.ts @@ -2,20 +2,25 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; -import { Namespace, NamespaceListParams, Namespaces, NamespacesSinglePage } from './namespaces/namespaces'; +import { + Namespace, + NamespaceListParams, + Namespaces, + NamespacesV4PagePaginationArray, +} from './namespaces/namespaces'; export class DurableObjects extends APIResource { namespaces: NamespacesAPI.Namespaces = new NamespacesAPI.Namespaces(this._client); } DurableObjects.Namespaces = Namespaces; -DurableObjects.NamespacesSinglePage = NamespacesSinglePage; +DurableObjects.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace DurableObjects { export { Namespaces as Namespaces, type Namespace as Namespace, - NamespacesSinglePage as NamespacesSinglePage, + NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceListParams as NamespaceListParams, }; } diff --git a/src/resources/durable-objects/index.ts b/src/resources/durable-objects/index.ts index 9ad42425bf..5b1a5df711 100644 --- a/src/resources/durable-objects/index.ts +++ b/src/resources/durable-objects/index.ts @@ -2,7 +2,7 @@ export { DurableObjects } from './durable-objects'; export { - NamespacesSinglePage, + NamespacesV4PagePaginationArray, Namespaces, type Namespace, type NamespaceListParams, diff --git a/src/resources/durable-objects/namespaces/index.ts b/src/resources/durable-objects/namespaces/index.ts index eb373cf46d..caae6d139b 100644 --- a/src/resources/durable-objects/namespaces/index.ts +++ b/src/resources/durable-objects/namespaces/index.ts @@ -6,4 +6,9 @@ export { type DurableObject, type ObjectListParams, } from './objects'; -export { NamespacesSinglePage, Namespaces, type Namespace, type NamespaceListParams } from './namespaces'; +export { + NamespacesV4PagePaginationArray, + Namespaces, + type Namespace, + type NamespaceListParams, +} from './namespaces'; diff --git a/src/resources/durable-objects/namespaces/namespaces.ts b/src/resources/durable-objects/namespaces/namespaces.ts index 5547b0e963..8124a972ac 100644 --- a/src/resources/durable-objects/namespaces/namespaces.ts +++ b/src/resources/durable-objects/namespaces/namespaces.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ObjectsAPI from './objects'; import { DurableObject, DurableObjectsCursorLimitPagination, ObjectListParams, Objects } from './objects'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Namespaces extends APIResource { objects: ObjectsAPI.Objects = new ObjectsAPI.Objects(this._client); @@ -15,17 +15,17 @@ export class Namespaces extends APIResource { list( params: NamespaceListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; + ): Core.PagePromise { + const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/workers/durable_objects/namespaces`, - NamespacesSinglePage, - options, + NamespacesV4PagePaginationArray, + { query, ...options }, ); } } -export class NamespacesSinglePage extends SinglePage {} +export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} export interface Namespace { id?: string; @@ -39,21 +39,21 @@ export interface Namespace { use_sqlite?: boolean; } -export interface NamespaceListParams { +export interface NamespaceListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; } -Namespaces.NamespacesSinglePage = NamespacesSinglePage; +Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Objects = Objects; Namespaces.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; export declare namespace Namespaces { export { type Namespace as Namespace, - NamespacesSinglePage as NamespacesSinglePage, + NamespacesV4PagePaginationArray as NamespacesV4PagePaginationArray, type NamespaceListParams as NamespaceListParams, }; diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 8578505f6b..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -58,6 +58,33 @@ export class Consumers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Returns the consumers for a Queue + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const consumer of client.queues.consumers.list( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + queueId: string, + params: ConsumerListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/queues/${queueId}/consumers`, + ConsumersSinglePage, + options, + ); + } + /** * Deletes the consumer for a queue. * @@ -81,30 +108,30 @@ export class Consumers extends APIResource { } /** - * Returns the consumers for a Queue + * Fetches the consumer for a queue by consumer id * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const consumer of client.queues.consumers.get( + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * ); * ``` */ get( queueId: string, + consumerId: string, params: ConsumerGetParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.APIPromise { const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/queues/${queueId}/consumers`, - ConsumersSinglePage, - options, - ); + return ( + this._client.get( + `/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, + options, + ) as Core.APIPromise<{ result: Consumer }> + )._thenUnwrap((obj) => obj.result); } } @@ -450,6 +477,13 @@ export declare namespace ConsumerUpdateParams { } } +export interface ConsumerListParams { + /** + * A Resource identifier. + */ + account_id: string; +} + export interface ConsumerDeleteParams { /** * A Resource identifier. @@ -473,6 +507,7 @@ export declare namespace Consumers { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, + type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index 4606015396..31ecb56311 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -7,6 +7,7 @@ export { type ConsumerDeleteResponse, type ConsumerCreateParams, type ConsumerUpdateParams, + type ConsumerListParams, type ConsumerDeleteParams, type ConsumerGetParams, } from './consumers'; diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index 240e61d273..ba46cd701d 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -10,6 +10,7 @@ import { ConsumerDeleteParams, ConsumerDeleteResponse, ConsumerGetParams, + ConsumerListParams, ConsumerUpdateParams, Consumers, ConsumersSinglePage, @@ -352,6 +353,7 @@ export declare namespace Queues { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, + type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index e75138f7ed..c23e1d1b09 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -155,6 +155,11 @@ export namespace DeploymentCreateResponse { * Human-readable message about the deployment. Truncated to 100 bytes. */ 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; } } @@ -191,6 +196,11 @@ export namespace DeploymentListResponse { * Human-readable message about the deployment. Truncated to 100 bytes. */ 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; } } } @@ -268,6 +278,11 @@ export namespace DeploymentGetResponse { * Human-readable message about the deployment. Truncated to 100 bytes. */ 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; } } diff --git a/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts b/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts index 02207fae28..0652d2bfad 100644 --- a/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts +++ b/tests/api-resources/addressing/regional-hostnames/regional-hostnames.test.ts @@ -30,7 +30,7 @@ describe('resource regionalHostnames', () => { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', hostname: 'foo.example.com', region_key: 'ca', - routing: 'routing', + routing: 'dns', }); }); diff --git a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts index 42e52d5807..ebb748d3f9 100644 --- a/tests/api-resources/durable-objects/namespaces/namespaces.test.ts +++ b/tests/api-resources/durable-objects/namespaces/namespaces.test.ts @@ -26,6 +26,8 @@ describe('resource namespaces', () => { test('list: required and optional params', async () => { const response = await client.durableObjects.namespaces.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 1, + per_page: 1, }); }); }); diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 8bc8cf6a3a..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -74,6 +74,25 @@ describe('resource consumers', () => { ); }); + test('list: only required params', async () => { + const responsePromise = client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + test('delete: only required params', async () => { const responsePromise = client.queues.consumers.delete( '023e105f4ecef8ad9ca31a8372d0c353', @@ -98,9 +117,11 @@ describe('resource consumers', () => { }); test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -111,8 +132,10 @@ describe('resource consumers', () => { }); test('get: required and optional params', async () => { - const response = await client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); }); From aab4c1fe6ba01d801376bba35279352495210fcb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 04:40:58 +0000 Subject: [PATCH 250/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 4 ++-- src/resources/zero-trust/dlp/datasets/upload.ts | 4 ++-- src/resources/zero-trust/dlp/datasets/versions/entries.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 534bd7f197..78dfa65db7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 9ecbb4ede8ef69ecffaf8e504d2cb25d +config_hash: 6f2399f8a4ad67973817d2ebd2d2fce7 diff --git a/api.md b/api.md index d67c737ead..9b880207de 100644 --- a/api.md +++ b/api.md @@ -5657,7 +5657,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset #### Versions @@ -5677,7 +5677,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index 789b43d6f7..ee68c9f2a7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: body, + body: dataset, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index a43975f5cc..6982ee71da 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: body, + body: datasetVersionEntry, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, From 4da7b68f759ec954c163f8304be01a0253d8095f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 05:22:59 +0000 Subject: [PATCH 251/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 4 ++-- src/resources/zero-trust/dlp/datasets/upload.ts | 4 ++-- src/resources/zero-trust/dlp/datasets/versions/entries.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 78dfa65db7..534bd7f197 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 6f2399f8a4ad67973817d2ebd2d2fce7 +config_hash: 9ecbb4ede8ef69ecffaf8e504d2cb25d diff --git a/api.md b/api.md index 9b880207de..d67c737ead 100644 --- a/api.md +++ b/api.md @@ -5657,7 +5657,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset #### Versions @@ -5677,7 +5677,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index ee68c9f2a7..789b43d6f7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: dataset, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index 6982ee71da..a43975f5cc 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: datasetVersionEntry, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, From 7b381d8d1f15579e860390de3ca13a02f590d539 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 05:32:58 +0000 Subject: [PATCH 252/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 4 ++-- src/resources/zero-trust/dlp/datasets/upload.ts | 4 ++-- src/resources/zero-trust/dlp/datasets/versions/entries.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 534bd7f197..78dfa65db7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 9ecbb4ede8ef69ecffaf8e504d2cb25d +config_hash: 6f2399f8a4ad67973817d2ebd2d2fce7 diff --git a/api.md b/api.md index d67c737ead..9b880207de 100644 --- a/api.md +++ b/api.md @@ -5657,7 +5657,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset #### Versions @@ -5677,7 +5677,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index 789b43d6f7..ee68c9f2a7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: body, + body: dataset, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index a43975f5cc..6982ee71da 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: body, + body: datasetVersionEntry, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, From 5dc4f7124e95ab46f1ca4e00b418bef6e1586f55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 05:43:09 +0000 Subject: [PATCH 253/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 7 +-- src/resources/queues/consumers.ts | 59 ++++--------------- src/resources/queues/index.ts | 1 - src/resources/queues/queues.ts | 2 - .../zero-trust/dlp/datasets/upload.ts | 4 +- .../dlp/datasets/versions/entries.ts | 4 +- tests/api-resources/queues/consumers.test.ts | 35 ++--------- 8 files changed, 27 insertions(+), 89 deletions(-) diff --git a/.stats.yml b/.stats.yml index 78dfa65db7..0a022bae05 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1783 +configured_endpoints: 1782 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 6f2399f8a4ad67973817d2ebd2d2fce7 +config_hash: eda5b3d9487ce675d1fadf88153b457d diff --git a/api.md b/api.md index 9b880207de..1604c6925f 100644 --- a/api.md +++ b/api.md @@ -2336,9 +2336,8 @@ Methods: - client.queues.consumers.create(queueId, { ...params }) -> Consumer - client.queues.consumers.update(queueId, consumerId, { ...params }) -> Consumer -- client.queues.consumers.list(queueId, { ...params }) -> ConsumersSinglePage - client.queues.consumers.delete(queueId, consumerId, { ...params }) -> ConsumerDeleteResponse -- client.queues.consumers.get(queueId, consumerId, { ...params }) -> Consumer +- client.queues.consumers.get(queueId, { ...params }) -> ConsumersSinglePage ## Messages @@ -5657,7 +5656,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset #### Versions @@ -5677,7 +5676,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 43eae71410..8578505f6b 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -58,33 +58,6 @@ export class Consumers extends APIResource { )._thenUnwrap((obj) => obj.result); } - /** - * Returns the consumers for a Queue - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const consumer of client.queues.consumers.list( - * '023e105f4ecef8ad9ca31a8372d0c353', - * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } - * ``` - */ - list( - queueId: string, - params: ConsumerListParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/queues/${queueId}/consumers`, - ConsumersSinglePage, - options, - ); - } - /** * Deletes the consumer for a queue. * @@ -108,30 +81,30 @@ export class Consumers extends APIResource { } /** - * Fetches the consumer for a queue by consumer id + * Returns the consumers for a Queue * * @example * ```ts - * const consumer = await client.queues.consumers.get( - * '023e105f4ecef8ad9ca31a8372d0c353', + * // Automatically fetches more pages as needed. + * for await (const consumer of client.queues.consumers.get( * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * ); + * )) { + * // ... + * } * ``` */ get( queueId: string, - consumerId: string, params: ConsumerGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.PagePromise { const { account_id } = params; - return ( - this._client.get( - `/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, - options, - ) as Core.APIPromise<{ result: Consumer }> - )._thenUnwrap((obj) => obj.result); + return this._client.getAPIList( + `/accounts/${account_id}/queues/${queueId}/consumers`, + ConsumersSinglePage, + options, + ); } } @@ -477,13 +450,6 @@ export declare namespace ConsumerUpdateParams { } } -export interface ConsumerListParams { - /** - * A Resource identifier. - */ - account_id: string; -} - export interface ConsumerDeleteParams { /** * A Resource identifier. @@ -507,7 +473,6 @@ export declare namespace Consumers { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, - type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index 31ecb56311..4606015396 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -7,7 +7,6 @@ export { type ConsumerDeleteResponse, type ConsumerCreateParams, type ConsumerUpdateParams, - type ConsumerListParams, type ConsumerDeleteParams, type ConsumerGetParams, } from './consumers'; diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index ba46cd701d..240e61d273 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -10,7 +10,6 @@ import { ConsumerDeleteParams, ConsumerDeleteResponse, ConsumerGetParams, - ConsumerListParams, ConsumerUpdateParams, Consumers, ConsumersSinglePage, @@ -353,7 +352,6 @@ export declare namespace Queues { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, - type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index ee68c9f2a7..789b43d6f7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: dataset, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index 6982ee71da..a43975f5cc 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: datasetVersionEntry, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index e4275cc8e0..8bc8cf6a3a 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -74,25 +74,6 @@ describe('resource consumers', () => { ); }); - test('list: only required params', async () => { - const responsePromise = client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: required and optional params', async () => { - const response = await client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); - }); - test('delete: only required params', async () => { const responsePromise = client.queues.consumers.delete( '023e105f4ecef8ad9ca31a8372d0c353', @@ -117,11 +98,9 @@ describe('resource consumers', () => { }); test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const responsePromise = client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -132,10 +111,8 @@ describe('resource consumers', () => { }); test('get: required and optional params', async () => { - const response = await client.queues.consumers.get( - '023e105f4ecef8ad9ca31a8372d0c353', - '023e105f4ecef8ad9ca31a8372d0c353', - { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - ); + const response = await client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); }); }); From c2327a1c83aa7deecce08a5eb1a9a966a4d22b5b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:41:06 +0000 Subject: [PATCH 254/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 4 ++-- src/resources/zero-trust/dlp/datasets/upload.ts | 4 ++-- src/resources/zero-trust/dlp/datasets/versions/entries.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0a022bae05..bb5893530c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1782 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: eda5b3d9487ce675d1fadf88153b457d +config_hash: 030d8d88be354a2a4bb74551e840f68e diff --git a/api.md b/api.md index 1604c6925f..53133ff9f7 100644 --- a/api.md +++ b/api.md @@ -5656,7 +5656,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset #### Versions @@ -5676,7 +5676,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index 789b43d6f7..ee68c9f2a7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: body, + body: dataset, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index a43975f5cc..6982ee71da 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: body, + body: datasetVersionEntry, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, From acdb02eda7bf53c05fdda0d636beb2d132e54fec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:47:03 +0000 Subject: [PATCH 255/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 7 ++- src/resources/queues/consumers.ts | 59 +++++++++++++++---- src/resources/queues/index.ts | 1 + src/resources/queues/queues.ts | 2 + .../zero-trust/dlp/datasets/upload.ts | 4 +- .../dlp/datasets/versions/entries.ts | 4 +- tests/api-resources/queues/consumers.test.ts | 35 +++++++++-- 8 files changed, 89 insertions(+), 27 deletions(-) diff --git a/.stats.yml b/.stats.yml index bb5893530c..1d4a60721a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1782 +configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 030d8d88be354a2a4bb74551e840f68e +config_hash: 978af651b5e83254b5ea0afd49908fc4 diff --git a/api.md b/api.md index 53133ff9f7..d67c737ead 100644 --- a/api.md +++ b/api.md @@ -2336,8 +2336,9 @@ Methods: - client.queues.consumers.create(queueId, { ...params }) -> Consumer - client.queues.consumers.update(queueId, consumerId, { ...params }) -> Consumer +- client.queues.consumers.list(queueId, { ...params }) -> ConsumersSinglePage - client.queues.consumers.delete(queueId, consumerId, { ...params }) -> ConsumerDeleteResponse -- client.queues.consumers.get(queueId, { ...params }) -> ConsumersSinglePage +- client.queues.consumers.get(queueId, consumerId, { ...params }) -> Consumer ## Messages @@ -5656,7 +5657,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset #### Versions @@ -5676,7 +5677,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/queues/consumers.ts b/src/resources/queues/consumers.ts index 8578505f6b..43eae71410 100644 --- a/src/resources/queues/consumers.ts +++ b/src/resources/queues/consumers.ts @@ -58,6 +58,33 @@ export class Consumers extends APIResource { )._thenUnwrap((obj) => obj.result); } + /** + * Returns the consumers for a Queue + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const consumer of client.queues.consumers.list( + * '023e105f4ecef8ad9ca31a8372d0c353', + * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + * )) { + * // ... + * } + * ``` + */ + list( + queueId: string, + params: ConsumerListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params; + return this._client.getAPIList( + `/accounts/${account_id}/queues/${queueId}/consumers`, + ConsumersSinglePage, + options, + ); + } + /** * Deletes the consumer for a queue. * @@ -81,30 +108,30 @@ export class Consumers extends APIResource { } /** - * Returns the consumers for a Queue + * Fetches the consumer for a queue by consumer id * * @example * ```ts - * // Automatically fetches more pages as needed. - * for await (const consumer of client.queues.consumers.get( + * const consumer = await client.queues.consumers.get( + * '023e105f4ecef8ad9ca31a8372d0c353', * '023e105f4ecef8ad9ca31a8372d0c353', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, - * )) { - * // ... - * } + * ); * ``` */ get( queueId: string, + consumerId: string, params: ConsumerGetParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.APIPromise { const { account_id } = params; - return this._client.getAPIList( - `/accounts/${account_id}/queues/${queueId}/consumers`, - ConsumersSinglePage, - options, - ); + return ( + this._client.get( + `/accounts/${account_id}/queues/${queueId}/consumers/${consumerId}`, + options, + ) as Core.APIPromise<{ result: Consumer }> + )._thenUnwrap((obj) => obj.result); } } @@ -450,6 +477,13 @@ export declare namespace ConsumerUpdateParams { } } +export interface ConsumerListParams { + /** + * A Resource identifier. + */ + account_id: string; +} + export interface ConsumerDeleteParams { /** * A Resource identifier. @@ -473,6 +507,7 @@ export declare namespace Consumers { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, + type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/queues/index.ts b/src/resources/queues/index.ts index 4606015396..31ecb56311 100644 --- a/src/resources/queues/index.ts +++ b/src/resources/queues/index.ts @@ -7,6 +7,7 @@ export { type ConsumerDeleteResponse, type ConsumerCreateParams, type ConsumerUpdateParams, + type ConsumerListParams, type ConsumerDeleteParams, type ConsumerGetParams, } from './consumers'; diff --git a/src/resources/queues/queues.ts b/src/resources/queues/queues.ts index 240e61d273..ba46cd701d 100644 --- a/src/resources/queues/queues.ts +++ b/src/resources/queues/queues.ts @@ -10,6 +10,7 @@ import { ConsumerDeleteParams, ConsumerDeleteResponse, ConsumerGetParams, + ConsumerListParams, ConsumerUpdateParams, Consumers, ConsumersSinglePage, @@ -352,6 +353,7 @@ export declare namespace Queues { ConsumersSinglePage as ConsumersSinglePage, type ConsumerCreateParams as ConsumerCreateParams, type ConsumerUpdateParams as ConsumerUpdateParams, + type ConsumerListParams as ConsumerListParams, type ConsumerDeleteParams as ConsumerDeleteParams, type ConsumerGetParams as ConsumerGetParams, }; diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index ee68c9f2a7..789b43d6f7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: dataset, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index 6982ee71da..a43975f5cc 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, + body: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: datasetVersionEntry, + body: body, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/tests/api-resources/queues/consumers.test.ts b/tests/api-resources/queues/consumers.test.ts index 8bc8cf6a3a..e4275cc8e0 100644 --- a/tests/api-resources/queues/consumers.test.ts +++ b/tests/api-resources/queues/consumers.test.ts @@ -74,6 +74,25 @@ describe('resource consumers', () => { ); }); + test('list: only required params', async () => { + const responsePromise = client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: required and optional params', async () => { + const response = await client.queues.consumers.list('023e105f4ecef8ad9ca31a8372d0c353', { + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + }); + }); + test('delete: only required params', async () => { const responsePromise = client.queues.consumers.delete( '023e105f4ecef8ad9ca31a8372d0c353', @@ -98,9 +117,11 @@ describe('resource consumers', () => { }); test('get: only required params', async () => { - const responsePromise = client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const responsePromise = client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -111,8 +132,10 @@ describe('resource consumers', () => { }); test('get: required and optional params', async () => { - const response = await client.queues.consumers.get('023e105f4ecef8ad9ca31a8372d0c353', { - account_id: '023e105f4ecef8ad9ca31a8372d0c353', - }); + const response = await client.queues.consumers.get( + '023e105f4ecef8ad9ca31a8372d0c353', + '023e105f4ecef8ad9ca31a8372d0c353', + { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, + ); }); }); From 6f512ce9a09acf86f8d99b11d497e9530d58cbef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 15:49:59 +0000 Subject: [PATCH 256/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 4 ++-- src/resources/zero-trust/dlp/datasets/upload.ts | 4 ++-- src/resources/zero-trust/dlp/datasets/versions/entries.ts | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1d4a60721a..1a3178786d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 978af651b5e83254b5ea0afd49908fc4 +config_hash: 4bc172023c6b7acd8703ab80c8213e03 diff --git a/api.md b/api.md index d67c737ead..9b880207de 100644 --- a/api.md +++ b/api.md @@ -5657,7 +5657,7 @@ Types: Methods: - client.zeroTrust.dlp.datasets.upload.create(datasetId, { ...params }) -> NewVersion -- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, body, { ...params }) -> Dataset +- client.zeroTrust.dlp.datasets.upload.edit(datasetId, version, dataset, { ...params }) -> Dataset #### Versions @@ -5677,7 +5677,7 @@ Types: Methods: -- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, body, { ...params }) -> EntryCreateResponse +- client.zeroTrust.dlp.datasets.versions.entries.create(datasetId, version, entryId, datasetVersionEntry, { ...params }) -> EntryCreateResponse ### Patterns diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index 789b43d6f7..ee68c9f2a7 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -52,13 +52,13 @@ export class Upload extends APIResource { edit( datasetId: string, version: number, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; return ( this._client.post(`/accounts/${account_id}/dlp/datasets/${datasetId}/upload/${version}`, { - body: body, + body: dataset, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index a43975f5cc..6982ee71da 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -25,7 +25,7 @@ export class Entries extends APIResource { datasetId: string, version: number, entryId: string, - body: string | ArrayBufferView | ArrayBuffer | BlobLike, + datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -33,7 +33,7 @@ export class Entries extends APIResource { this._client.post( `/accounts/${account_id}/dlp/datasets/${datasetId}/versions/${version}/entries/${entryId}`, { - body: body, + body: datasetVersionEntry, ...options, headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, __binaryRequest: true, From 4b59fc5c37537eda888f981982cd89bca48bdbb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 18:38:50 +0000 Subject: [PATCH 257/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- .../brand-protection/brand-protection.test.ts | 12 ++++++++---- tests/api-resources/brand-protection/logos.test.ts | 6 ++++-- .../secrets-store/stores/secrets.test.ts | 12 ++++++++---- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a3178786d..de610fa02f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 4bc172023c6b7acd8703ab80c8213e03 +config_hash: 2de5d0640ab26d69bec880a63b912e1f diff --git a/tests/api-resources/brand-protection/brand-protection.test.ts b/tests/api-resources/brand-protection/brand-protection.test.ts index 6591b92297..fe88039f53 100644 --- a/tests/api-resources/brand-protection/brand-protection.test.ts +++ b/tests/api-resources/brand-protection/brand-protection.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource brandProtection', () => { - test('submit: only required params', async () => { + // TODO: investigate broken test + test.skip('submit: only required params', async () => { const responsePromise = client.brandProtection.submit({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -21,11 +22,13 @@ describe('resource brandProtection', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('submit: required and optional params', async () => { + // TODO: investigate broken test + test.skip('submit: required and optional params', async () => { const response = await client.brandProtection.submit({ account_id: 'x' }); }); - test('urlInfo: only required params', async () => { + // TODO: investigate broken test + test.skip('urlInfo: only required params', async () => { const responsePromise = client.brandProtection.urlInfo({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -36,7 +39,8 @@ describe('resource brandProtection', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('urlInfo: required and optional params', async () => { + // TODO: investigate broken test + test.skip('urlInfo: required and optional params', async () => { const response = await client.brandProtection.urlInfo({ account_id: 'x' }); }); }); diff --git a/tests/api-resources/brand-protection/logos.test.ts b/tests/api-resources/brand-protection/logos.test.ts index ed48c6070a..2403224175 100644 --- a/tests/api-resources/brand-protection/logos.test.ts +++ b/tests/api-resources/brand-protection/logos.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource logos', () => { - test('create: only required params', async () => { + // TODO: investigate broken test, 422 Unprocessable Entity + test.skip('create: only required params', async () => { const responsePromise = client.brandProtection.logos.create({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -21,7 +22,8 @@ describe('resource logos', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('create: required and optional params', async () => { + // TODO: investigate broken test, 422 Unprocessable Entity + test.skip('create: required and optional params', async () => { const response = await client.brandProtection.logos.create({ account_id: 'x', match_type: 'match_type', diff --git a/tests/api-resources/secrets-store/stores/secrets.test.ts b/tests/api-resources/secrets-store/stores/secrets.test.ts index 91cd2bb269..afb8337e61 100644 --- a/tests/api-resources/secrets-store/stores/secrets.test.ts +++ b/tests/api-resources/secrets-store/stores/secrets.test.ts @@ -38,7 +38,8 @@ describe('resource secrets', () => { }); }); - test('list: only required params', async () => { + // TODO: investigate prism error for 422 Unprocessable Entity + test.skip('list: only required params', async () => { const responsePromise = client.secretsStore.stores.secrets.list('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '985e105f4ecef8ad9ca31a8372d0c353', }); @@ -51,7 +52,8 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('list: required and optional params', async () => { + // TODO: investigate prism error for 422 Unprocessable Entity + test.skip('list: required and optional params', async () => { const response = await client.secretsStore.stores.secrets.list('023e105f4ecef8ad9ca31a8372d0c353', { account_id: '985e105f4ecef8ad9ca31a8372d0c353', direction: 'asc', @@ -140,7 +142,8 @@ describe('resource secrets', () => { ); }); - test('edit: only required params', async () => { + // TODO: investigate prism error for 422 Unprocessable Entity + test.skip('edit: only required params', async () => { const responsePromise = client.secretsStore.stores.secrets.edit( '023e105f4ecef8ad9ca31a8372d0c353', '3fd85f74b32742f1bff64a85009dda07', @@ -155,7 +158,8 @@ describe('resource secrets', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('edit: required and optional params', async () => { + // TODO: investigate prism error for 422 Unprocessable Entity + test.skip('edit: required and optional params', async () => { const response = await client.secretsStore.stores.secrets.edit( '023e105f4ecef8ad9ca31a8372d0c353', '3fd85f74b32742f1bff64a85009dda07', From de13a49117612eac3601989e4f92d86448666363 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 18:58:29 +0000 Subject: [PATCH 258/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index de610fa02f..7b16f22760 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 2de5d0640ab26d69bec880a63b912e1f +config_hash: 7ac0d4c75c3f166b66a81e21a3d97f15 From e0100f9ca4c50847707f96b8b34d9019592f7b11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 19:36:11 +0000 Subject: [PATCH 259/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- .../brand-protection/logo-matches.test.ts | 12 ++++++++---- tests/api-resources/brand-protection/logos.test.ts | 6 ++++-- tests/api-resources/brand-protection/matches.test.ts | 12 ++++++++---- tests/api-resources/brand-protection/queries.test.ts | 12 ++++++++---- .../cloudforce-one/binary-storage.test.ts | 12 ++++++++---- 6 files changed, 37 insertions(+), 19 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7b16f22760..b37fcd8c03 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 7ac0d4c75c3f166b66a81e21a3d97f15 +config_hash: 43130be32c5ad35813f78ea0d90fb11d diff --git a/tests/api-resources/brand-protection/logo-matches.test.ts b/tests/api-resources/brand-protection/logo-matches.test.ts index 47ffc05601..dde68dc984 100644 --- a/tests/api-resources/brand-protection/logo-matches.test.ts +++ b/tests/api-resources/brand-protection/logo-matches.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource logoMatches', () => { - test('download: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('download: only required params', async () => { const responsePromise = client.brandProtection.logoMatches.download({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -21,7 +22,8 @@ describe('resource logoMatches', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('download: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('download: required and optional params', async () => { const response = await client.brandProtection.logoMatches.download({ account_id: 'x', limit: 'limit', @@ -30,7 +32,8 @@ describe('resource logoMatches', () => { }); }); - test('get: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('get: only required params', async () => { const responsePromise = client.brandProtection.logoMatches.get({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -41,7 +44,8 @@ describe('resource logoMatches', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('get: required and optional params', async () => { const response = await client.brandProtection.logoMatches.get({ account_id: 'x', limit: 'limit', diff --git a/tests/api-resources/brand-protection/logos.test.ts b/tests/api-resources/brand-protection/logos.test.ts index 2403224175..a8c6d50b64 100644 --- a/tests/api-resources/brand-protection/logos.test.ts +++ b/tests/api-resources/brand-protection/logos.test.ts @@ -33,7 +33,8 @@ describe('resource logos', () => { }); }); - test('delete: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('delete: only required params', async () => { const responsePromise = client.brandProtection.logos.delete('x', { account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -44,7 +45,8 @@ describe('resource logos', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('delete: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized error + test.skip('delete: required and optional params', async () => { const response = await client.brandProtection.logos.delete('x', { account_id: 'x' }); }); }); diff --git a/tests/api-resources/brand-protection/matches.test.ts b/tests/api-resources/brand-protection/matches.test.ts index 9b9c651497..d042fed02a 100644 --- a/tests/api-resources/brand-protection/matches.test.ts +++ b/tests/api-resources/brand-protection/matches.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource matches', () => { - test('download: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('download: only required params', async () => { const responsePromise = client.brandProtection.matches.download({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -21,7 +22,8 @@ describe('resource matches', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('download: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('download: required and optional params', async () => { const response = await client.brandProtection.matches.download({ account_id: 'x', id: 'id', @@ -31,7 +33,8 @@ describe('resource matches', () => { }); }); - test('get: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('get: only required params', async () => { const responsePromise = client.brandProtection.matches.get({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -42,7 +45,8 @@ describe('resource matches', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('get: required and optional params', async () => { const response = await client.brandProtection.matches.get({ account_id: 'x', id: 'id', diff --git a/tests/api-resources/brand-protection/queries.test.ts b/tests/api-resources/brand-protection/queries.test.ts index 4972f320d6..eebdec0918 100644 --- a/tests/api-resources/brand-protection/queries.test.ts +++ b/tests/api-resources/brand-protection/queries.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource queries', () => { - test('create: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('create: only required params', async () => { const responsePromise = client.brandProtection.queries.create({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -21,7 +22,8 @@ describe('resource queries', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('create: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('create: required and optional params', async () => { const response = await client.brandProtection.queries.create({ account_id: 'x', id: 'id', @@ -35,7 +37,8 @@ describe('resource queries', () => { }); }); - test('delete: only required params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('delete: only required params', async () => { const responsePromise = client.brandProtection.queries.delete({ account_id: 'x' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -46,7 +49,8 @@ describe('resource queries', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('delete: required and optional params', async () => { + // TODO: investigate broken test, 401 Unauthorized + test.skip('delete: required and optional params', async () => { const response = await client.brandProtection.queries.delete({ account_id: 'x', id: 'id', diff --git a/tests/api-resources/cloudforce-one/binary-storage.test.ts b/tests/api-resources/cloudforce-one/binary-storage.test.ts index 0c50b97af3..4b65a1fe8a 100644 --- a/tests/api-resources/cloudforce-one/binary-storage.test.ts +++ b/tests/api-resources/cloudforce-one/binary-storage.test.ts @@ -10,7 +10,8 @@ const client = new Cloudflare({ }); describe('resource binaryStorage', () => { - test('create: only required params', async () => { + // TODO: HTTP 401 from prism + test.skip('create: only required params', async () => { const responsePromise = client.cloudforceOne.binaryStorage.create({ account_id: 'account_id', file: await toFile(Buffer.from('# my file contents'), 'README.md'), @@ -24,14 +25,16 @@ describe('resource binaryStorage', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('create: required and optional params', async () => { + // TODO: HTTP 401 from prism + test.skip('create: required and optional params', async () => { const response = await client.cloudforceOne.binaryStorage.create({ account_id: 'account_id', file: await toFile(Buffer.from('# my file contents'), 'README.md'), }); }); - test('get: only required params', async () => { + // TODO: HTTP 401 from prism + test.skip('get: only required params', async () => { const responsePromise = client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -42,7 +45,8 @@ describe('resource binaryStorage', () => { expect(dataAndResponse.response).toBe(rawResponse); }); - test('get: required and optional params', async () => { + // TODO: HTTP 401 from prism + test.skip('get: required and optional params', async () => { const response = await client.cloudforceOne.binaryStorage.get('hash', { account_id: 'account_id' }); }); }); From 96d18cefc4fd635e0f9a1aa1d3e3c26c990b7dad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:43:21 +0000 Subject: [PATCH 260/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b37fcd8c03..81de078d57 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 43130be32c5ad35813f78ea0d90fb11d +config_hash: df5e22b1b937c12cccec7d3b8d8cb162 From 7d0a09ca6692d6b68899bbcf6e2f4be66913f55b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 00:15:33 +0000 Subject: [PATCH 261/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 81de078d57..45e88c88aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: df5e22b1b937c12cccec7d3b8d8cb162 +config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From 2cf76458a7900f98a6ff5ebf738a853e77cde10c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 13:51:27 +0000 Subject: [PATCH 262/423] feat(api): api update --- .stats.yml | 6 +- api.md | 16 -- scripts/detect-breaking-changes | 3 - src/resources/browser-rendering/json.ts | 20 ++ src/resources/r2/buckets/domains/custom.ts | 36 +++ src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 194 +--------------- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 215 +----------------- src/resources/radar/bots/bots.ts | 2 + .../gateway/configurations/configurations.ts | 4 +- .../browser-rendering/json.test.ts | 1 + .../r2/buckets/domains/custom.test.ts | 2 + .../radar/ai/bots/summary.test.ts | 50 ---- .../radar/ai/timeseries-groups.test.ts | 51 ----- .../configurations/configurations.test.ts | 4 +- 18 files changed, 76 insertions(+), 556 deletions(-) delete mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts diff --git a/.stats.yml b/.stats.yml index 45e88c88aa..502b1c57ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml -openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 +configured_endpoints: 1781 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7bea25aa2ecf5263456a917858800dceeeb1b026bd91c2a8f634f29f6a82186f.yml +openapi_spec_hash: 932e8170cf032407cc8f0bd756bc61bd config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index 9b880207de..a4731c0470 100644 --- a/api.md +++ b/api.md @@ -6375,24 +6375,8 @@ Methods: #### Summary -Types: - -- SummaryUserAgentResponse - -Methods: - -- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse - ### TimeseriesGroups -Types: - -- TimeseriesGroupUserAgentResponse - -Methods: - -- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index b039f24cfa..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,9 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots/bots.test.ts - tests/api-resources/radar/ai/bots/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index f236ed4200..5afa5cc125 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -98,6 +98,13 @@ export interface JsonCreateParams { */ cookies?: Array; + /** + * Body param: Optional list of custom AI models to use for the request. The models + * will be tried in the order provided, and in case a model returns an error, the + * next one will be used as fallback. + */ + custom_ai?: Array; + /** * Body param: */ @@ -248,6 +255,19 @@ export namespace JsonCreateParams { url?: string; } + export interface CustomAI { + /** + * Authorization token for the AI model: `Bearer `. + */ + authorization: string; + + /** + * AI model to use for the request. Must be formed as `/`, + * e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` + */ + model: string; + } + /** * Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/r2/buckets/domains/custom.ts b/src/resources/r2/buckets/domains/custom.ts index 76dbcea299..791c3fe9d4 100644 --- a/src/resources/r2/buckets/domains/custom.ts +++ b/src/resources/r2/buckets/domains/custom.ts @@ -182,6 +182,12 @@ export interface CustomCreateResponse { */ enabled: boolean; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -195,6 +201,12 @@ export interface CustomUpdateResponse { */ domain: string; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Whether this bucket is publicly accessible at the specified custom domain. */ @@ -225,6 +237,12 @@ export namespace CustomListResponse { status: Domain.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -277,6 +295,12 @@ export interface CustomGetResponse { status: CustomGetResponse.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -330,6 +354,12 @@ export interface CustomCreateParams { */ zoneId: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Minimum TLS Version the custom domain will accept for incoming * connections. If not set, defaults to 1.0. @@ -349,6 +379,12 @@ export interface CustomUpdateParams { */ account_id: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Whether to enable public bucket access at the specified custom * domain. diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 6ba8476430..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,11 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupUserAgentParams, - TimeseriesGroupUserAgentResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -46,9 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 865665cba6..0b5807ee07 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; +import { Summary } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,9 +11,5 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { - Summary as Summary, - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; + export { Summary as Summary }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index c94177cbcd..6f7091f3a3 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 298d84ab48..5abd36afe8 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,197 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import { isRequestOptions } from '../../../../core'; -import * as Core from '../../../../core'; -export class Summary extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.userAgent(); - * ``` - */ - userAgent( - query?: SummaryUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: SummaryUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ - result: SummaryUserAgentResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - meta: SummaryUserAgentResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface SummaryUserAgentParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace Summary { - export { - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; -} +export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index a6a9f99c81..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,11 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 938c8980f2..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,218 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.userAgent(); - * ``` - */ - userAgent( - query?: TimeseriesGroupUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupUserAgentResponse.Meta; - - serie_0: TimeseriesGroupUserAgentResponse.Serie0; -} - -export namespace TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupUserAgentParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index c75011e6a0..e57861cb13 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -189,6 +189,8 @@ export namespace BotListResponse { * A kebab-case identifier derived from the bot name. */ slug: string; + + userAgentPatterns: Array; } } diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 63b0edfdc7..9a3f07a900 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -208,7 +208,7 @@ export interface BlockPageSettings { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: 'customized_block_page' | 'redirect_uri'; + mode?: '' | 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. @@ -293,7 +293,7 @@ export interface BlockPageSettingsParam { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: 'customized_block_page' | 'redirect_uri'; + mode?: '' | 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. diff --git a/tests/api-resources/browser-rendering/json.test.ts b/tests/api-resources/browser-rendering/json.test.ts index 9443f79ae3..d7317f73a1 100644 --- a/tests/api-resources/browser-rendering/json.test.ts +++ b/tests/api-resources/browser-rendering/json.test.ts @@ -50,6 +50,7 @@ describe('resource json', () => { url: 'url', }, ], + custom_ai: [{ authorization: 'authorization', model: 'model' }], emulateMediaType: 'emulateMediaType', gotoOptions: { referer: 'referer', diff --git a/tests/api-resources/r2/buckets/domains/custom.test.ts b/tests/api-resources/r2/buckets/domains/custom.test.ts index 414dbbd1dc..0912f1f272 100644 --- a/tests/api-resources/r2/buckets/domains/custom.test.ts +++ b/tests/api-resources/r2/buckets/domains/custom.test.ts @@ -34,6 +34,7 @@ describe('resource custom', () => { domain: 'prefix.example-domain.com', enabled: true, zoneId: '36ca64a6d92827b8a6b90be344bb1bfd', + ciphers: ['string'], minTLS: '1.0', jurisdiction: 'default', }); @@ -62,6 +63,7 @@ describe('resource custom', () => { 'example-domain/custom-domain.com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + ciphers: ['string'], enabled: true, minTLS: '1.2', jurisdiction: 'default', diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts deleted file mode 100644 index e45f8279d7..0000000000 --- a/tests/api-resources/radar/ai/bots/summary.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.bots.summary.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent( - { - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 386515626c..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index 563c3a8cd6..e1e1b78591 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -48,7 +48,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', + mode: '', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -106,7 +106,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', + mode: '', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', From b071b24a9bb73bbaf81e5fe6b756d009b18f535f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 14:33:54 +0000 Subject: [PATCH 263/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 502b1c57ec..d1e22cae63 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7bea25aa2ecf5263456a917858800dceeeb1b026bd91c2a8f634f29f6a82186f.yml -openapi_spec_hash: 932e8170cf032407cc8f0bd756bc61bd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a8e2f9b43dab071e1560856014f5de528bf67743c5e3f129f42f0a6d08d88c1b.yml +openapi_spec_hash: ff9ad2afc74c6556007cde31b96c0453 config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From cf5423bd6bc4eda20d8be971fe6f91b079759829 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 16:25:24 +0000 Subject: [PATCH 264/423] feat(api): api update --- .stats.yml | 6 +- api.md | 16 ++ scripts/detect-breaking-changes | 3 + src/resources/browser-rendering/json.ts | 20 -- src/resources/r2/buckets/domains/custom.ts | 36 --- src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 194 +++++++++++++++- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 215 +++++++++++++++++- src/resources/radar/bots/bots.ts | 2 - .../gateway/configurations/configurations.ts | 4 +- .../browser-rendering/json.test.ts | 1 - .../r2/buckets/domains/custom.test.ts | 2 - .../radar/ai/bots/summary.test.ts | 50 ++++ .../radar/ai/timeseries-groups.test.ts | 51 +++++ .../configurations/configurations.test.ts | 4 +- 18 files changed, 556 insertions(+), 76 deletions(-) create mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts diff --git a/.stats.yml b/.stats.yml index d1e22cae63..45e88c88aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a8e2f9b43dab071e1560856014f5de528bf67743c5e3f129f42f0a6d08d88c1b.yml -openapi_spec_hash: ff9ad2afc74c6556007cde31b96c0453 +configured_endpoints: 1783 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml +openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index a4731c0470..9b880207de 100644 --- a/api.md +++ b/api.md @@ -6375,8 +6375,24 @@ Methods: #### Summary +Types: + +- SummaryUserAgentResponse + +Methods: + +- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse + ### TimeseriesGroups +Types: + +- TimeseriesGroupUserAgentResponse + +Methods: + +- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..b039f24cfa 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,9 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index 5afa5cc125..f236ed4200 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -98,13 +98,6 @@ export interface JsonCreateParams { */ cookies?: Array; - /** - * Body param: Optional list of custom AI models to use for the request. The models - * will be tried in the order provided, and in case a model returns an error, the - * next one will be used as fallback. - */ - custom_ai?: Array; - /** * Body param: */ @@ -255,19 +248,6 @@ export namespace JsonCreateParams { url?: string; } - export interface CustomAI { - /** - * Authorization token for the AI model: `Bearer `. - */ - authorization: string; - - /** - * AI model to use for the request. Must be formed as `/`, - * e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` - */ - model: string; - } - /** * Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/r2/buckets/domains/custom.ts b/src/resources/r2/buckets/domains/custom.ts index 791c3fe9d4..76dbcea299 100644 --- a/src/resources/r2/buckets/domains/custom.ts +++ b/src/resources/r2/buckets/domains/custom.ts @@ -182,12 +182,6 @@ export interface CustomCreateResponse { */ enabled: boolean; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -201,12 +195,6 @@ export interface CustomUpdateResponse { */ domain: string; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Whether this bucket is publicly accessible at the specified custom domain. */ @@ -237,12 +225,6 @@ export namespace CustomListResponse { status: Domain.Status; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -295,12 +277,6 @@ export interface CustomGetResponse { status: CustomGetResponse.Status; - /** - * An allowlist of ciphers for TLS termination. These ciphers must be in the - * BoringSSL format. - */ - ciphers?: Array; - /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -354,12 +330,6 @@ export interface CustomCreateParams { */ zoneId: string; - /** - * Body param: An allowlist of ciphers for TLS termination. These ciphers must be - * in the BoringSSL format. - */ - ciphers?: Array; - /** * Body param: Minimum TLS Version the custom domain will accept for incoming * connections. If not set, defaults to 1.0. @@ -379,12 +349,6 @@ export interface CustomUpdateParams { */ account_id: string; - /** - * Body param: An allowlist of ciphers for TLS termination. These ciphers must be - * in the BoringSSL format. - */ - ciphers?: Array; - /** * Body param: Whether to enable public bucket access at the specified custom * domain. diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..6ba8476430 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,11 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupUserAgentParams, + TimeseriesGroupUserAgentResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +46,9 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 0b5807ee07..865665cba6 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary } from './summary'; +import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,5 +11,9 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { Summary as Summary }; + export { + Summary as Summary, + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 6f7091f3a3..c94177cbcd 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary } from './summary'; +export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 5abd36afe8..298d84ab48 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,5 +1,197 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; -export class Summary extends APIResource {} +export class Summary extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.userAgent(); + * ``` + */ + userAgent( + query?: SummaryUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: SummaryUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ + result: SummaryUserAgentResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + meta: SummaryUserAgentResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SummaryUserAgentParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace Summary { + export { + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; +} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..a6a9f99c81 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,11 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..938c8980f2 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,218 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.userAgent(); + * ``` + */ + userAgent( + query?: TimeseriesGroupUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupUserAgentResponse.Meta; + + serie_0: TimeseriesGroupUserAgentResponse.Serie0; +} + +export namespace TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupUserAgentParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; +} diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index e57861cb13..c75011e6a0 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -189,8 +189,6 @@ export namespace BotListResponse { * A kebab-case identifier derived from the bot name. */ slug: string; - - userAgentPatterns: Array; } } diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 9a3f07a900..63b0edfdc7 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -208,7 +208,7 @@ export interface BlockPageSettings { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: '' | 'customized_block_page' | 'redirect_uri'; + mode?: 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. @@ -293,7 +293,7 @@ export interface BlockPageSettingsParam { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: '' | 'customized_block_page' | 'redirect_uri'; + mode?: 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. diff --git a/tests/api-resources/browser-rendering/json.test.ts b/tests/api-resources/browser-rendering/json.test.ts index d7317f73a1..9443f79ae3 100644 --- a/tests/api-resources/browser-rendering/json.test.ts +++ b/tests/api-resources/browser-rendering/json.test.ts @@ -50,7 +50,6 @@ describe('resource json', () => { url: 'url', }, ], - custom_ai: [{ authorization: 'authorization', model: 'model' }], emulateMediaType: 'emulateMediaType', gotoOptions: { referer: 'referer', diff --git a/tests/api-resources/r2/buckets/domains/custom.test.ts b/tests/api-resources/r2/buckets/domains/custom.test.ts index 0912f1f272..414dbbd1dc 100644 --- a/tests/api-resources/r2/buckets/domains/custom.test.ts +++ b/tests/api-resources/r2/buckets/domains/custom.test.ts @@ -34,7 +34,6 @@ describe('resource custom', () => { domain: 'prefix.example-domain.com', enabled: true, zoneId: '36ca64a6d92827b8a6b90be344bb1bfd', - ciphers: ['string'], minTLS: '1.0', jurisdiction: 'default', }); @@ -63,7 +62,6 @@ describe('resource custom', () => { 'example-domain/custom-domain.com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', - ciphers: ['string'], enabled: true, minTLS: '1.2', jurisdiction: 'default', diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts new file mode 100644 index 0000000000..e45f8279d7 --- /dev/null +++ b/tests/api-resources/radar/ai/bots/summary.test.ts @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.bots.summary.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent( + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..386515626c --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index e1e1b78591..563c3a8cd6 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -48,7 +48,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: '', + mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -106,7 +106,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: '', + mode: 'customized_block_page', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', From d409ced1739b16275d6a426023c1bf1a6a3f3efd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 21:59:15 +0000 Subject: [PATCH 265/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 6 +- src/index.ts | 8 +++ src/pagination.ts | 71 +++++++++++++++++++ src/resources/accounts/logs/audit.ts | 21 ++++-- src/resources/accounts/logs/index.ts | 2 +- src/resources/accounts/logs/logs.ts | 6 +- .../durable-objects/namespaces/index.ts | 2 +- .../durable-objects/namespaces/namespaces.ts | 6 +- .../durable-objects/namespaces/objects.ts | 20 ++++-- src/resources/kv/namespaces/index.ts | 2 +- src/resources/kv/namespaces/keys.ts | 21 ++++-- src/resources/kv/namespaces/namespaces.ts | 6 +- 13 files changed, 136 insertions(+), 37 deletions(-) diff --git a/.stats.yml b/.stats.yml index 45e88c88aa..4ff289517f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 +config_hash: 2d45ef3f487fb8c17ee578789175de57 diff --git a/api.md b/api.md index 9b880207de..0f60ba16bc 100644 --- a/api.md +++ b/api.md @@ -122,7 +122,7 @@ Types: Methods: -- client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorLimitPagination +- client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorPaginationAfter # OriginCACertificates @@ -2259,7 +2259,7 @@ Types: Methods: -- client.kv.namespaces.keys.list(namespaceId, { ...params }) -> KeysCursorLimitPagination +- client.kv.namespaces.keys.list(namespaceId, { ...params }) -> KeysCursorPaginationAfter - 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 @@ -2307,7 +2307,7 @@ Types: Methods: -- client.durableObjects.namespaces.objects.list(id, { ...params }) -> DurableObjectsCursorLimitPagination +- client.durableObjects.namespaces.objects.list(id, { ...params }) -> DurableObjectsCursorPaginationAfter # Queues diff --git a/src/index.ts b/src/index.ts index 112d9389ca..fd232692e2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,8 @@ import * as Pagination from './pagination'; import { type CursorLimitPaginationParams, CursorLimitPaginationResponse, + type CursorPaginationAfterParams, + CursorPaginationAfterResponse, type CursorPaginationParams, CursorPaginationResponse, SinglePageResponse, @@ -607,6 +609,12 @@ export declare namespace Cloudflare { type CursorPaginationResponse as CursorPaginationResponse, }; + export import CursorPaginationAfter = Pagination.CursorPaginationAfter; + export { + type CursorPaginationAfterParams as CursorPaginationAfterParams, + type CursorPaginationAfterResponse as CursorPaginationAfterResponse, + }; + export import CursorLimitPagination = Pagination.CursorLimitPagination; export { type CursorLimitPaginationParams as CursorLimitPaginationParams, diff --git a/src/pagination.ts b/src/pagination.ts index 8f6f5d7115..6602fa805a 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; +import * as StainlessPageResourceAPI from './resources/stainless-page-resource'; export interface V4PagePaginationResponse { result: V4PagePaginationResponse.Result; @@ -194,6 +195,76 @@ export class CursorPagination extends AbstractPage implements Cursor } } +export interface CursorPaginationAfterResponse { + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; +} + +export namespace CursorPaginationAfterResponse { + export interface ResultInfo { + cursors?: StainlessPageResourceAPI.ResultInfo.Cursors; + } + + export namespace ResultInfo { + export interface Cursors { + after?: string; + } + } +} + +export interface CursorPaginationAfterParams { + cursor?: string; +} + +export class CursorPaginationAfter + extends AbstractPage + implements CursorPaginationAfterResponse +{ + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; + + constructor( + client: APIClient, + response: Response, + body: CursorPaginationAfterResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.result = body.result || []; + this.result_info = body.result_info || {}; + } + + getPaginatedItems(): Item[] { + return this.result ?? []; + } + + // @deprecated Please use `nextPageInfo()` instead + nextPageParams(): Partial | null { + const info = this.nextPageInfo(); + if (!info) return null; + if ('params' in info) return info.params; + const params = Object.fromEntries(info.url.searchParams); + if (!Object.keys(params).length) return null; + return params; + } + + nextPageInfo(): PageInfo | null { + const cursor = this.result_info?.cursors?.after; + if (!cursor) { + return null; + } + + return { + params: { + cursor, + }, + }; + } +} + export interface CursorLimitPaginationResponse { result: Array; diff --git a/src/resources/accounts/logs/audit.ts b/src/resources/accounts/logs/audit.ts index 25db8ce592..63362be091 100644 --- a/src/resources/accounts/logs/audit.ts +++ b/src/resources/accounts/logs/audit.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; +import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; export class Audit extends APIResource { /** @@ -29,17 +29,17 @@ export class Audit extends APIResource { list( params: AuditListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/logs/audit`, - AuditListResponsesCursorLimitPagination, + AuditListResponsesCursorPaginationAfter, { query, ...options }, ); } } -export class AuditListResponsesCursorLimitPagination extends CursorLimitPagination {} +export class AuditListResponsesCursorPaginationAfter extends CursorPaginationAfter {} export interface AuditListResponse { /** @@ -232,7 +232,7 @@ export namespace AuditListResponse { } } -export interface AuditListParams extends CursorLimitPaginationParams { +export interface AuditListParams extends CursorPaginationAfterParams { /** * Path param: The unique id that identifies the account. */ @@ -312,6 +312,13 @@ export interface AuditListParams extends CursorLimitPaginationParams { */ direction?: 'desc' | 'asc'; + /** + * Query param: The number limits the objects to return. The cursor attribute may + * be used to iterate over the next batch of objects if there are more than the + * limit. + */ + limit?: number; + /** * Query param: */ @@ -518,12 +525,12 @@ export namespace AuditListParams { } } -Audit.AuditListResponsesCursorLimitPagination = AuditListResponsesCursorLimitPagination; +Audit.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; export declare namespace Audit { export { type AuditListResponse as AuditListResponse, - AuditListResponsesCursorLimitPagination as AuditListResponsesCursorLimitPagination, + AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, type AuditListParams as AuditListParams, }; } diff --git a/src/resources/accounts/logs/index.ts b/src/resources/accounts/logs/index.ts index 92a21aa38b..4252e744ab 100644 --- a/src/resources/accounts/logs/index.ts +++ b/src/resources/accounts/logs/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AuditListResponsesCursorLimitPagination, + AuditListResponsesCursorPaginationAfter, Audit, type AuditListResponse, type AuditListParams, diff --git a/src/resources/accounts/logs/logs.ts b/src/resources/accounts/logs/logs.ts index 0966ebbb45..ae9cf0f885 100644 --- a/src/resources/accounts/logs/logs.ts +++ b/src/resources/accounts/logs/logs.ts @@ -2,20 +2,20 @@ import { APIResource } from '../../../resource'; import * as AuditAPI from './audit'; -import { Audit, AuditListParams, AuditListResponse, AuditListResponsesCursorLimitPagination } from './audit'; +import { Audit, AuditListParams, AuditListResponse, AuditListResponsesCursorPaginationAfter } from './audit'; export class Logs extends APIResource { audit: AuditAPI.Audit = new AuditAPI.Audit(this._client); } Logs.Audit = Audit; -Logs.AuditListResponsesCursorLimitPagination = AuditListResponsesCursorLimitPagination; +Logs.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; export declare namespace Logs { export { Audit as Audit, type AuditListResponse as AuditListResponse, - AuditListResponsesCursorLimitPagination as AuditListResponsesCursorLimitPagination, + AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, type AuditListParams as AuditListParams, }; } diff --git a/src/resources/durable-objects/namespaces/index.ts b/src/resources/durable-objects/namespaces/index.ts index caae6d139b..e7ad4bae20 100644 --- a/src/resources/durable-objects/namespaces/index.ts +++ b/src/resources/durable-objects/namespaces/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - DurableObjectsCursorLimitPagination, + DurableObjectsCursorPaginationAfter, Objects, type DurableObject, type ObjectListParams, diff --git a/src/resources/durable-objects/namespaces/namespaces.ts b/src/resources/durable-objects/namespaces/namespaces.ts index 8124a972ac..dcfda7f42e 100644 --- a/src/resources/durable-objects/namespaces/namespaces.ts +++ b/src/resources/durable-objects/namespaces/namespaces.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ObjectsAPI from './objects'; -import { DurableObject, DurableObjectsCursorLimitPagination, ObjectListParams, Objects } from './objects'; +import { DurableObject, DurableObjectsCursorPaginationAfter, ObjectListParams, Objects } from './objects'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Namespaces extends APIResource { @@ -48,7 +48,7 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Objects = Objects; -Namespaces.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; +Namespaces.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter; export declare namespace Namespaces { export { @@ -60,7 +60,7 @@ export declare namespace Namespaces { export { Objects as Objects, type DurableObject as DurableObject, - DurableObjectsCursorLimitPagination as DurableObjectsCursorLimitPagination, + DurableObjectsCursorPaginationAfter as DurableObjectsCursorPaginationAfter, type ObjectListParams as ObjectListParams, }; } diff --git a/src/resources/durable-objects/namespaces/objects.ts b/src/resources/durable-objects/namespaces/objects.ts index a6bc00101f..8aaa4c3526 100644 --- a/src/resources/durable-objects/namespaces/objects.ts +++ b/src/resources/durable-objects/namespaces/objects.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; +import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; export class Objects extends APIResource { /** @@ -12,17 +12,17 @@ export class Objects extends APIResource { id: string, params: ObjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/workers/durable_objects/namespaces/${id}/objects`, - DurableObjectsCursorLimitPagination, + DurableObjectsCursorPaginationAfter, { query, ...options }, ); } } -export class DurableObjectsCursorLimitPagination extends CursorLimitPagination {} +export class DurableObjectsCursorPaginationAfter extends CursorPaginationAfter {} export interface DurableObject { /** @@ -36,19 +36,25 @@ export interface DurableObject { hasStoredData?: boolean; } -export interface ObjectListParams extends CursorLimitPaginationParams { +export interface ObjectListParams extends CursorPaginationAfterParams { /** * Path param: Identifier. */ account_id: string; + + /** + * Query param: The number of objects to return. The cursor attribute may be used + * to iterate over the next batch of objects if there are more than the limit. + */ + limit?: number; } -Objects.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; +Objects.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter; export declare namespace Objects { export { type DurableObject as DurableObject, - DurableObjectsCursorLimitPagination as DurableObjectsCursorLimitPagination, + DurableObjectsCursorPaginationAfter as DurableObjectsCursorPaginationAfter, type ObjectListParams as ObjectListParams, }; } diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..c581632a76 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - KeysCursorLimitPagination, + KeysCursorPaginationAfter, Keys, type Key, type KeyBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..8c90e39c42 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; +import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; export class Keys extends APIResource { /** @@ -23,11 +23,11 @@ export class Keys extends APIResource { namespaceId: string, params: KeyListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/keys`, - KeysCursorLimitPagination, + KeysCursorPaginationAfter, { query, ...options }, ); } @@ -98,7 +98,7 @@ export class Keys extends APIResource { } } -export class KeysCursorLimitPagination extends CursorLimitPagination {} +export class KeysCursorPaginationAfter extends CursorPaginationAfter {} /** * A name for a value. A value stored under a given key may be retrieved via the @@ -178,12 +178,19 @@ export interface KeyBulkUpdateResponse { unsuccessful_keys?: Array; } -export interface KeyListParams extends CursorLimitPaginationParams { +export interface KeyListParams extends CursorPaginationAfterParams { /** * Path param: Identifier. */ account_id: string; + /** + * Query param: Limits the number of keys returned in the response. The cursor + * attribute may be used to iterate over the next batch of keys if there are more + * than the limit. + */ + limit?: number; + /** * Query param: Filters returned keys by a name prefix. Exact matches and any key * names that begin with the prefix will be returned. @@ -272,7 +279,7 @@ export namespace KeyBulkUpdateParams { } } -Keys.KeysCursorLimitPagination = KeysCursorLimitPagination; +Keys.KeysCursorPaginationAfter = KeysCursorPaginationAfter; export declare namespace Keys { export { @@ -280,7 +287,7 @@ export declare namespace Keys { type KeyBulkDeleteResponse as KeyBulkDeleteResponse, type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, - KeysCursorLimitPagination as KeysCursorLimitPagination, + KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, type KeyBulkGetParams as KeyBulkGetParams, diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..f50080847c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -13,7 +13,7 @@ import { KeyBulkUpdateResponse, KeyListParams, Keys, - KeysCursorLimitPagination, + KeysCursorPaginationAfter, } from './keys'; import * as MetadataAPI from './metadata'; import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; @@ -475,7 +475,7 @@ export interface NamespaceGetParams { Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; -Namespaces.KeysCursorLimitPagination = KeysCursorLimitPagination; +Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; Namespaces.Metadata = Metadata; Namespaces.Values = ValuesAPIValues; @@ -503,7 +503,7 @@ export declare namespace Namespaces { type KeyBulkDeleteResponse as KeyBulkDeleteResponse, type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, - KeysCursorLimitPagination as KeysCursorLimitPagination, + KeysCursorPaginationAfter as KeysCursorPaginationAfter, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, type KeyBulkGetParams as KeyBulkGetParams, From 579fa30b2ef17be56ce87cf99f6ced0eea6943b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 23:33:57 +0000 Subject: [PATCH 266/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 8 ++- src/index.ts | 8 --- src/pagination.ts | 71 ------------------- src/resources/accounts/logs/audit.ts | 21 ++---- src/resources/accounts/logs/index.ts | 2 +- src/resources/accounts/logs/logs.ts | 6 +- .../durable-objects/namespaces/index.ts | 2 +- .../durable-objects/namespaces/namespaces.ts | 6 +- .../durable-objects/namespaces/objects.ts | 20 ++---- src/resources/kv/namespaces/index.ts | 2 +- src/resources/kv/namespaces/keys.ts | 21 ++---- src/resources/kv/namespaces/namespaces.ts | 6 +- src/resources/workers/index.ts | 1 + src/resources/workers/versions.ts | 5 ++ src/resources/workers/workers.ts | 6 ++ 16 files changed, 51 insertions(+), 136 deletions(-) create mode 100644 src/resources/workers/versions.ts diff --git a/.stats.yml b/.stats.yml index 4ff289517f..90c188b3c2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 2d45ef3f487fb8c17ee578789175de57 +config_hash: 1d1f62e87686c0d8571be460876f347c diff --git a/api.md b/api.md index 0f60ba16bc..a50ee05222 100644 --- a/api.md +++ b/api.md @@ -122,7 +122,7 @@ Types: Methods: -- client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorPaginationAfter +- client.accounts.logs.audit.list({ ...params }) -> AuditListResponsesCursorLimitPagination # OriginCACertificates @@ -2030,6 +2030,8 @@ Methods: - client.workers.assets.upload.create({ ...params }) -> UploadCreateResponse +## Versions + ## Scripts Types: @@ -2259,7 +2261,7 @@ Types: Methods: -- client.kv.namespaces.keys.list(namespaceId, { ...params }) -> KeysCursorPaginationAfter +- 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 @@ -2307,7 +2309,7 @@ Types: Methods: -- client.durableObjects.namespaces.objects.list(id, { ...params }) -> DurableObjectsCursorPaginationAfter +- client.durableObjects.namespaces.objects.list(id, { ...params }) -> DurableObjectsCursorLimitPagination # Queues diff --git a/src/index.ts b/src/index.ts index fd232692e2..112d9389ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,8 +8,6 @@ import * as Pagination from './pagination'; import { type CursorLimitPaginationParams, CursorLimitPaginationResponse, - type CursorPaginationAfterParams, - CursorPaginationAfterResponse, type CursorPaginationParams, CursorPaginationResponse, SinglePageResponse, @@ -609,12 +607,6 @@ export declare namespace Cloudflare { type CursorPaginationResponse as CursorPaginationResponse, }; - export import CursorPaginationAfter = Pagination.CursorPaginationAfter; - export { - type CursorPaginationAfterParams as CursorPaginationAfterParams, - type CursorPaginationAfterResponse as CursorPaginationAfterResponse, - }; - export import CursorLimitPagination = Pagination.CursorLimitPagination; export { type CursorLimitPaginationParams as CursorLimitPaginationParams, diff --git a/src/pagination.ts b/src/pagination.ts index 6602fa805a..8f6f5d7115 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; -import * as StainlessPageResourceAPI from './resources/stainless-page-resource'; export interface V4PagePaginationResponse { result: V4PagePaginationResponse.Result; @@ -195,76 +194,6 @@ export class CursorPagination extends AbstractPage implements Cursor } } -export interface CursorPaginationAfterResponse { - result: Array; - - result_info: CursorPaginationAfterResponse.ResultInfo; -} - -export namespace CursorPaginationAfterResponse { - export interface ResultInfo { - cursors?: StainlessPageResourceAPI.ResultInfo.Cursors; - } - - export namespace ResultInfo { - export interface Cursors { - after?: string; - } - } -} - -export interface CursorPaginationAfterParams { - cursor?: string; -} - -export class CursorPaginationAfter - extends AbstractPage - implements CursorPaginationAfterResponse -{ - result: Array; - - result_info: CursorPaginationAfterResponse.ResultInfo; - - constructor( - client: APIClient, - response: Response, - body: CursorPaginationAfterResponse, - options: FinalRequestOptions, - ) { - super(client, response, body, options); - - this.result = body.result || []; - this.result_info = body.result_info || {}; - } - - getPaginatedItems(): Item[] { - return this.result ?? []; - } - - // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { - const info = this.nextPageInfo(); - if (!info) return null; - if ('params' in info) return info.params; - const params = Object.fromEntries(info.url.searchParams); - if (!Object.keys(params).length) return null; - return params; - } - - nextPageInfo(): PageInfo | null { - const cursor = this.result_info?.cursors?.after; - if (!cursor) { - return null; - } - - return { - params: { - cursor, - }, - }; - } -} - export interface CursorLimitPaginationResponse { result: Array; diff --git a/src/resources/accounts/logs/audit.ts b/src/resources/accounts/logs/audit.ts index 63362be091..25db8ce592 100644 --- a/src/resources/accounts/logs/audit.ts +++ b/src/resources/accounts/logs/audit.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; +import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Audit extends APIResource { /** @@ -29,17 +29,17 @@ export class Audit extends APIResource { list( params: AuditListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/logs/audit`, - AuditListResponsesCursorPaginationAfter, + AuditListResponsesCursorLimitPagination, { query, ...options }, ); } } -export class AuditListResponsesCursorPaginationAfter extends CursorPaginationAfter {} +export class AuditListResponsesCursorLimitPagination extends CursorLimitPagination {} export interface AuditListResponse { /** @@ -232,7 +232,7 @@ export namespace AuditListResponse { } } -export interface AuditListParams extends CursorPaginationAfterParams { +export interface AuditListParams extends CursorLimitPaginationParams { /** * Path param: The unique id that identifies the account. */ @@ -312,13 +312,6 @@ export interface AuditListParams extends CursorPaginationAfterParams { */ direction?: 'desc' | 'asc'; - /** - * Query param: The number limits the objects to return. The cursor attribute may - * be used to iterate over the next batch of objects if there are more than the - * limit. - */ - limit?: number; - /** * Query param: */ @@ -525,12 +518,12 @@ export namespace AuditListParams { } } -Audit.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; +Audit.AuditListResponsesCursorLimitPagination = AuditListResponsesCursorLimitPagination; export declare namespace Audit { export { type AuditListResponse as AuditListResponse, - AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, + AuditListResponsesCursorLimitPagination as AuditListResponsesCursorLimitPagination, type AuditListParams as AuditListParams, }; } diff --git a/src/resources/accounts/logs/index.ts b/src/resources/accounts/logs/index.ts index 4252e744ab..92a21aa38b 100644 --- a/src/resources/accounts/logs/index.ts +++ b/src/resources/accounts/logs/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AuditListResponsesCursorPaginationAfter, + AuditListResponsesCursorLimitPagination, Audit, type AuditListResponse, type AuditListParams, diff --git a/src/resources/accounts/logs/logs.ts b/src/resources/accounts/logs/logs.ts index ae9cf0f885..0966ebbb45 100644 --- a/src/resources/accounts/logs/logs.ts +++ b/src/resources/accounts/logs/logs.ts @@ -2,20 +2,20 @@ import { APIResource } from '../../../resource'; import * as AuditAPI from './audit'; -import { Audit, AuditListParams, AuditListResponse, AuditListResponsesCursorPaginationAfter } from './audit'; +import { Audit, AuditListParams, AuditListResponse, AuditListResponsesCursorLimitPagination } from './audit'; export class Logs extends APIResource { audit: AuditAPI.Audit = new AuditAPI.Audit(this._client); } Logs.Audit = Audit; -Logs.AuditListResponsesCursorPaginationAfter = AuditListResponsesCursorPaginationAfter; +Logs.AuditListResponsesCursorLimitPagination = AuditListResponsesCursorLimitPagination; export declare namespace Logs { export { Audit as Audit, type AuditListResponse as AuditListResponse, - AuditListResponsesCursorPaginationAfter as AuditListResponsesCursorPaginationAfter, + AuditListResponsesCursorLimitPagination as AuditListResponsesCursorLimitPagination, type AuditListParams as AuditListParams, }; } diff --git a/src/resources/durable-objects/namespaces/index.ts b/src/resources/durable-objects/namespaces/index.ts index e7ad4bae20..caae6d139b 100644 --- a/src/resources/durable-objects/namespaces/index.ts +++ b/src/resources/durable-objects/namespaces/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - DurableObjectsCursorPaginationAfter, + DurableObjectsCursorLimitPagination, Objects, type DurableObject, type ObjectListParams, diff --git a/src/resources/durable-objects/namespaces/namespaces.ts b/src/resources/durable-objects/namespaces/namespaces.ts index dcfda7f42e..8124a972ac 100644 --- a/src/resources/durable-objects/namespaces/namespaces.ts +++ b/src/resources/durable-objects/namespaces/namespaces.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ObjectsAPI from './objects'; -import { DurableObject, DurableObjectsCursorPaginationAfter, ObjectListParams, Objects } from './objects'; +import { DurableObject, DurableObjectsCursorLimitPagination, ObjectListParams, Objects } from './objects'; import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Namespaces extends APIResource { @@ -48,7 +48,7 @@ export interface NamespaceListParams extends V4PagePaginationArrayParams { Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Objects = Objects; -Namespaces.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter; +Namespaces.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; export declare namespace Namespaces { export { @@ -60,7 +60,7 @@ export declare namespace Namespaces { export { Objects as Objects, type DurableObject as DurableObject, - DurableObjectsCursorPaginationAfter as DurableObjectsCursorPaginationAfter, + DurableObjectsCursorLimitPagination as DurableObjectsCursorLimitPagination, type ObjectListParams as ObjectListParams, }; } diff --git a/src/resources/durable-objects/namespaces/objects.ts b/src/resources/durable-objects/namespaces/objects.ts index 8aaa4c3526..a6bc00101f 100644 --- a/src/resources/durable-objects/namespaces/objects.ts +++ b/src/resources/durable-objects/namespaces/objects.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; +import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Objects extends APIResource { /** @@ -12,17 +12,17 @@ export class Objects extends APIResource { id: string, params: ObjectListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/workers/durable_objects/namespaces/${id}/objects`, - DurableObjectsCursorPaginationAfter, + DurableObjectsCursorLimitPagination, { query, ...options }, ); } } -export class DurableObjectsCursorPaginationAfter extends CursorPaginationAfter {} +export class DurableObjectsCursorLimitPagination extends CursorLimitPagination {} export interface DurableObject { /** @@ -36,25 +36,19 @@ export interface DurableObject { hasStoredData?: boolean; } -export interface ObjectListParams extends CursorPaginationAfterParams { +export interface ObjectListParams extends CursorLimitPaginationParams { /** * Path param: Identifier. */ account_id: string; - - /** - * Query param: The number of objects to return. The cursor attribute may be used - * to iterate over the next batch of objects if there are more than the limit. - */ - limit?: number; } -Objects.DurableObjectsCursorPaginationAfter = DurableObjectsCursorPaginationAfter; +Objects.DurableObjectsCursorLimitPagination = DurableObjectsCursorLimitPagination; export declare namespace Objects { export { type DurableObject as DurableObject, - DurableObjectsCursorPaginationAfter as DurableObjectsCursorPaginationAfter, + DurableObjectsCursorLimitPagination as DurableObjectsCursorLimitPagination, type ObjectListParams as ObjectListParams, }; } diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index c581632a76..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - KeysCursorPaginationAfter, + KeysCursorLimitPagination, Keys, type Key, type KeyBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 8c90e39c42..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../../pagination'; +import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { /** @@ -23,11 +23,11 @@ export class Keys extends APIResource { namespaceId: string, params: KeyListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/keys`, - KeysCursorPaginationAfter, + KeysCursorLimitPagination, { query, ...options }, ); } @@ -98,7 +98,7 @@ export class Keys extends APIResource { } } -export class KeysCursorPaginationAfter extends CursorPaginationAfter {} +export class KeysCursorLimitPagination extends CursorLimitPagination {} /** * A name for a value. A value stored under a given key may be retrieved via the @@ -178,19 +178,12 @@ export interface KeyBulkUpdateResponse { unsuccessful_keys?: Array; } -export interface KeyListParams extends CursorPaginationAfterParams { +export interface KeyListParams extends CursorLimitPaginationParams { /** * Path param: Identifier. */ account_id: string; - /** - * Query param: Limits the number of keys returned in the response. The cursor - * attribute may be used to iterate over the next batch of keys if there are more - * than the limit. - */ - limit?: number; - /** * Query param: Filters returned keys by a name prefix. Exact matches and any key * names that begin with the prefix will be returned. @@ -279,7 +272,7 @@ export namespace KeyBulkUpdateParams { } } -Keys.KeysCursorPaginationAfter = KeysCursorPaginationAfter; +Keys.KeysCursorLimitPagination = KeysCursorLimitPagination; export declare namespace Keys { export { @@ -287,7 +280,7 @@ export declare namespace Keys { type KeyBulkDeleteResponse as KeyBulkDeleteResponse, type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, - KeysCursorPaginationAfter as KeysCursorPaginationAfter, + KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, type KeyBulkGetParams as KeyBulkGetParams, diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index f50080847c..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -13,7 +13,7 @@ import { KeyBulkUpdateResponse, KeyListParams, Keys, - KeysCursorPaginationAfter, + KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; @@ -475,7 +475,7 @@ export interface NamespaceGetParams { Namespaces.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; Namespaces.Keys = Keys; -Namespaces.KeysCursorPaginationAfter = KeysCursorPaginationAfter; +Namespaces.KeysCursorLimitPagination = KeysCursorLimitPagination; Namespaces.Metadata = Metadata; Namespaces.Values = ValuesAPIValues; @@ -503,7 +503,7 @@ export declare namespace Namespaces { type KeyBulkDeleteResponse as KeyBulkDeleteResponse, type KeyBulkGetResponse as KeyBulkGetResponse, type KeyBulkUpdateResponse as KeyBulkUpdateResponse, - KeysCursorPaginationAfter as KeysCursorPaginationAfter, + KeysCursorLimitPagination as KeysCursorLimitPagination, type KeyListParams as KeyListParams, type KeyBulkDeleteParams as KeyBulkDeleteParams, type KeyBulkGetParams as KeyBulkGetParams, diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index 2bda9755e8..5d649c98ab 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -52,4 +52,5 @@ export { type SubdomainUpdateParams, type SubdomainGetParams, } from './subdomains'; +export { Versions } from './versions'; export { Workers } from './workers'; diff --git a/src/resources/workers/versions.ts b/src/resources/workers/versions.ts new file mode 100644 index 0000000000..c0875b7239 --- /dev/null +++ b/src/resources/workers/versions.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../resource'; + +export class Versions extends APIResource {} diff --git a/src/resources/workers/workers.ts b/src/resources/workers/workers.ts index 62145d430b..ea43460ef5 100644 --- a/src/resources/workers/workers.ts +++ b/src/resources/workers/workers.ts @@ -42,6 +42,8 @@ import { SubdomainUpdateResponse, Subdomains, } from './subdomains'; +import * as VersionsAPI from './versions'; +import { Versions } from './versions'; import * as AssetsAPI from './assets/assets'; import { Assets } from './assets/assets'; import * as ObservabilityAPI from './observability/observability'; @@ -64,6 +66,7 @@ import { export class Workers extends APIResource { routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client); assets: AssetsAPI.Assets = new AssetsAPI.Assets(this._client); + versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client); scripts: ScriptsAPI.Scripts = new ScriptsAPI.Scripts(this._client); accountSettings: AccountSettingsAPI.AccountSettings = new AccountSettingsAPI.AccountSettings(this._client); domains: DomainsAPI.Domains = new DomainsAPI.Domains(this._client); @@ -219,6 +222,7 @@ export interface WorkerMetadataParam { Workers.Routes = Routes; Workers.RouteListResponsesSinglePage = RouteListResponsesSinglePage; Workers.Assets = Assets; +Workers.Versions = Versions; Workers.Scripts = Scripts; Workers.ScriptsSinglePage = ScriptsSinglePage; Workers.AccountSettings = AccountSettings; @@ -251,6 +255,8 @@ export declare namespace Workers { export { Assets as Assets }; + export { Versions as Versions }; + export { Scripts as Scripts, type Script as Script, From 2fa76d8a3dc756f1e8e4a8e7b83cee859dfc5251 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:38:45 +0000 Subject: [PATCH 267/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 2 -- src/resources/workers/index.ts | 1 - src/resources/workers/versions.ts | 5 ----- src/resources/workers/workers.ts | 6 ------ 5 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 src/resources/workers/versions.ts diff --git a/.stats.yml b/.stats.yml index 90c188b3c2..45e88c88aa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 -config_hash: 1d1f62e87686c0d8571be460876f347c +config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index a50ee05222..9b880207de 100644 --- a/api.md +++ b/api.md @@ -2030,8 +2030,6 @@ Methods: - client.workers.assets.upload.create({ ...params }) -> UploadCreateResponse -## Versions - ## Scripts Types: diff --git a/src/resources/workers/index.ts b/src/resources/workers/index.ts index 5d649c98ab..2bda9755e8 100644 --- a/src/resources/workers/index.ts +++ b/src/resources/workers/index.ts @@ -52,5 +52,4 @@ export { type SubdomainUpdateParams, type SubdomainGetParams, } from './subdomains'; -export { Versions } from './versions'; export { Workers } from './workers'; diff --git a/src/resources/workers/versions.ts b/src/resources/workers/versions.ts deleted file mode 100644 index c0875b7239..0000000000 --- a/src/resources/workers/versions.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../resource'; - -export class Versions extends APIResource {} diff --git a/src/resources/workers/workers.ts b/src/resources/workers/workers.ts index ea43460ef5..62145d430b 100644 --- a/src/resources/workers/workers.ts +++ b/src/resources/workers/workers.ts @@ -42,8 +42,6 @@ import { SubdomainUpdateResponse, Subdomains, } from './subdomains'; -import * as VersionsAPI from './versions'; -import { Versions } from './versions'; import * as AssetsAPI from './assets/assets'; import { Assets } from './assets/assets'; import * as ObservabilityAPI from './observability/observability'; @@ -66,7 +64,6 @@ import { export class Workers extends APIResource { routes: RoutesAPI.Routes = new RoutesAPI.Routes(this._client); assets: AssetsAPI.Assets = new AssetsAPI.Assets(this._client); - versions: VersionsAPI.Versions = new VersionsAPI.Versions(this._client); scripts: ScriptsAPI.Scripts = new ScriptsAPI.Scripts(this._client); accountSettings: AccountSettingsAPI.AccountSettings = new AccountSettingsAPI.AccountSettings(this._client); domains: DomainsAPI.Domains = new DomainsAPI.Domains(this._client); @@ -222,7 +219,6 @@ export interface WorkerMetadataParam { Workers.Routes = Routes; Workers.RouteListResponsesSinglePage = RouteListResponsesSinglePage; Workers.Assets = Assets; -Workers.Versions = Versions; Workers.Scripts = Scripts; Workers.ScriptsSinglePage = ScriptsSinglePage; Workers.AccountSettings = AccountSettings; @@ -255,8 +251,6 @@ export declare namespace Workers { export { Assets as Assets }; - export { Versions as Versions }; - export { Scripts as Scripts, type Script as Script, From 4e126f6d036c9f4e581889de924aa48ed40b062d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 17:00:22 +0000 Subject: [PATCH 268/423] feat(api): api update --- .stats.yml | 6 +- api.md | 26 +-- scripts/detect-breaking-changes | 3 - src/resources/ai/ai.ts | 29 ++- src/resources/browser-rendering/json.ts | 20 ++ .../threat-events/threat-events.ts | 6 +- src/resources/filters.ts | 118 ++++++++-- src/resources/r2/buckets/domains/custom.ts | 36 +++ src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 194 +--------------- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 215 +----------------- src/resources/radar/bots/bots.ts | 2 + src/resources/stream/stream.ts | 11 +- .../gateway/configurations/configurations.ts | 4 +- .../browser-rendering/json.test.ts | 1 + tests/api-resources/filters.test.ts | 49 +++- .../r2/buckets/domains/custom.test.ts | 2 + .../radar/ai/bots/summary.test.ts | 50 ---- .../radar/ai/timeseries-groups.test.ts | 51 ----- tests/api-resources/stream/stream.test.ts | 1 + .../configurations/configurations.test.ts | 4 +- 24 files changed, 255 insertions(+), 601 deletions(-) delete mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts diff --git a/.stats.yml b/.stats.yml index 45e88c88aa..35a1cd4fab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e408a7cdec2dae3d1a18842dcc59280c56050fb042569139aec3fe0f12e0d461.yml -openapi_spec_hash: 7e210c76f5dd4c79b3e67204ad279b81 +configured_endpoints: 1781 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c42cf957e3b5a69a156a53aff688afcbefc8b3d47d588ece03224d14a520b99.yml +openapi_spec_hash: 3489d7f7afa926c1b377c245812fd27d config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index 9b880207de..7e5b25ab4d 100644 --- a/api.md +++ b/api.md @@ -1420,15 +1420,17 @@ Methods: Types: - FirewallFilter +- FilterDeleteResponse +- FilterBulkDeleteResponse Methods: -- client.filters.create({ ...params }) -> FirewallFiltersSinglePage +- client.filters.create([ ...body ]) -> FirewallFiltersSinglePage - client.filters.update(filterId, { ...params }) -> FirewallFilter - client.filters.list({ ...params }) -> FirewallFiltersV4PagePaginationArray -- client.filters.delete(filterId, { ...params }) -> FirewallFilter -- client.filters.bulkDelete({ ...params }) -> FirewallFiltersSinglePage -- client.filters.bulkUpdate({ ...params }) -> FirewallFiltersSinglePage +- client.filters.delete(filterId, { ...params }) -> FilterDeleteResponse +- client.filters.bulkDelete({ ...params }) -> FilterBulkDeleteResponse | null +- client.filters.bulkUpdate([ ...body ]) -> FirewallFiltersSinglePage - client.filters.get(filterId, { ...params }) -> FirewallFilter # Firewall @@ -6375,24 +6377,8 @@ Methods: #### Summary -Types: - -- SummaryUserAgentResponse - -Methods: - -- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse - ### TimeseriesGroups -Types: - -- TimeseriesGroupUserAgentResponse - -Methods: - -- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index b039f24cfa..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,9 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots/bots.test.ts - tests/api-resources/radar/ai/bots/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/ai/ai.ts b/src/resources/ai/ai.ts index f2c856be09..a728fa6bf6 100644 --- a/src/resources/ai/ai.ts +++ b/src/resources/ai/ai.ts @@ -65,7 +65,8 @@ export type AIRunResponse = | AIRunResponse.Translation | AIRunResponse.Summarization | AIRunResponse.ImageToText - | AIRunResponse.ImageTextToText; + | AIRunResponse.ImageTextToText + | AIRunResponse.MultimodalEmbeddings; export namespace AIRunResponse { export interface TextClassification { @@ -255,6 +256,12 @@ export namespace AIRunResponse { export interface ImageTextToText { description?: string; } + + export interface MultimodalEmbeddings { + data?: Array>; + + shape?: Array; + } } export type AIRunParams = @@ -271,7 +278,8 @@ export type AIRunParams = | AIRunParams.Summarization | AIRunParams.ImageToText | AIRunParams.Variant12 - | AIRunParams.Variant13; + | AIRunParams.Variant13 + | AIRunParams.MultimodalEmbeddings; export declare namespace AIRunParams { export interface TextClassification { @@ -1020,6 +1028,23 @@ export declare namespace AIRunParams { role: string; } } + + export interface MultimodalEmbeddings { + /** + * Path param: + */ + account_id: string; + + /** + * Body param: Image in base64 encoded format. + */ + image?: string; + + /** + * Body param: + */ + text?: Array; + } } AI.Finetunes = Finetunes; diff --git a/src/resources/browser-rendering/json.ts b/src/resources/browser-rendering/json.ts index f236ed4200..5afa5cc125 100644 --- a/src/resources/browser-rendering/json.ts +++ b/src/resources/browser-rendering/json.ts @@ -98,6 +98,13 @@ export interface JsonCreateParams { */ cookies?: Array; + /** + * Body param: Optional list of custom AI models to use for the request. The models + * will be tried in the order provided, and in case a model returns an error, the + * next one will be used as fallback. + */ + custom_ai?: Array; + /** * Body param: */ @@ -248,6 +255,19 @@ export namespace JsonCreateParams { url?: string; } + export interface CustomAI { + /** + * Authorization token for the AI model: `Bearer `. + */ + authorization: string; + + /** + * AI model to use for the request. Must be formed as `/`, + * e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast` + */ + model: string; + } + /** * Check [options](https://pptr.dev/api/puppeteer.gotooptions). */ diff --git a/src/resources/cloudforce-one/threat-events/threat-events.ts b/src/resources/cloudforce-one/threat-events/threat-events.ts index e939bc9ed1..34a9196da9 100644 --- a/src/resources/cloudforce-one/threat-events/threat-events.ts +++ b/src/resources/cloudforce-one/threat-events/threat-events.ts @@ -502,7 +502,7 @@ export interface ThreatEventCreateParams { /** * Body param: */ - attacker?: string; + attacker?: string | null; /** * Body param: @@ -649,7 +649,7 @@ export namespace ThreatEventBulkCreateParams { accountId?: number; - attacker?: string; + attacker?: string | null; attackerCountry?: string; @@ -684,7 +684,7 @@ export interface ThreatEventEditParams { /** * Body param: */ - attacker?: string; + attacker?: string | null; /** * Body param: diff --git a/src/resources/filters.ts b/src/resources/filters.ts index 041be0687d..ce6af0a7d1 100644 --- a/src/resources/filters.ts +++ b/src/resources/filters.ts @@ -17,9 +17,9 @@ export class Filters extends APIResource { params: FilterCreateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, ...body } = params; + const { zone_id, body } = params; return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersSinglePage, { - body, + body: body, method: 'post', ...options, }); @@ -35,12 +35,11 @@ export class Filters extends APIResource { params: FilterUpdateParams, options?: Core.RequestOptions, ): Core.APIPromise { - const { zone_id, body } = params; + const { zone_id, ...body } = params; return ( - this._client.put(`/zones/${zone_id}/filters/${filterId}`, { - body: body, - ...options, - }) as Core.APIPromise<{ result: FirewallFilter }> + this._client.put(`/zones/${zone_id}/filters/${filterId}`, { body, ...options }) as Core.APIPromise<{ + result: FirewallFilter; + }> )._thenUnwrap((obj) => obj.result); } @@ -70,11 +69,11 @@ export class Filters extends APIResource { filterId: string, params: FilterDeleteParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { zone_id } = params; return ( this._client.delete(`/zones/${zone_id}/filters/${filterId}`, options) as Core.APIPromise<{ - result: FirewallFilter; + result: FilterDeleteResponse; }> )._thenUnwrap((obj) => obj.result); } @@ -87,12 +86,13 @@ export class Filters extends APIResource { bulkDelete( params: FilterBulkDeleteParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { zone_id } = params; - return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersSinglePage, { - method: 'delete', - ...options, - }); + ): Core.APIPromise { + const { zone_id, id } = params; + return ( + this._client.delete(`/zones/${zone_id}/filters`, { query: { id }, ...options }) as Core.APIPromise<{ + result: FilterBulkDeleteResponse | null; + }> + )._thenUnwrap((obj) => obj.result); } /** @@ -104,9 +104,9 @@ export class Filters extends APIResource { params: FilterBulkUpdateParams, options?: Core.RequestOptions, ): Core.PagePromise { - const { zone_id, ...body } = params; + const { zone_id, body } = params; return this._client.getAPIList(`/zones/${zone_id}/filters`, FirewallFiltersSinglePage, { - body, + body: body, method: 'put', ...options, }); @@ -186,6 +186,24 @@ export interface FirewallFilterParam { ref?: string; } +export interface FilterDeleteResponse { + /** + * The unique identifier of the filter. + */ + id: string; +} + +export type FilterBulkDeleteResponse = Array; + +export namespace FilterBulkDeleteResponse { + export interface FilterBulkDeleteResponseItem { + /** + * The unique identifier of the filter. + */ + id?: string; + } +} + export interface FilterCreateParams { /** * Path param: Defines an identifier. @@ -193,10 +211,9 @@ export interface FilterCreateParams { zone_id: string; /** - * Body param: The filter expression. For more information, refer to - * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + * Body param: */ - expression: string; + body: Array; } export interface FilterUpdateParams { @@ -206,9 +223,25 @@ export interface FilterUpdateParams { zone_id: string; /** - * Body param: + * Body param: An informative summary of the filter. + */ + description?: string; + + /** + * Body param: The filter expression. For more information, refer to + * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + */ + expression?: string; + + /** + * Body param: When true, indicates that the filter is currently paused. + */ + paused?: boolean; + + /** + * Body param: A short reference tag. Allows you to select related filters. */ - body: unknown; + ref?: string; } export interface FilterListParams extends V4PagePaginationArrayParams { @@ -253,16 +286,51 @@ export interface FilterDeleteParams { export interface FilterBulkDeleteParams { /** - * Defines an identifier. + * Path param: Defines an identifier. */ zone_id: string; + + /** + * Query param: + */ + id: Array; } export interface FilterBulkUpdateParams { /** - * Defines an identifier. + * Path param: Defines an identifier. */ zone_id: string; + + /** + * Body param: + */ + body: Array; +} + +export namespace FilterBulkUpdateParams { + export interface Body { + /** + * An informative summary of the filter. + */ + description?: string; + + /** + * The filter expression. For more information, refer to + * [Expressions](https://developers.cloudflare.com/ruleset-engine/rules-language/expressions/). + */ + expression?: string; + + /** + * When true, indicates that the filter is currently paused. + */ + paused?: boolean; + + /** + * A short reference tag. Allows you to select related filters. + */ + ref?: string; + } } export interface FilterGetParams { @@ -278,6 +346,8 @@ Filters.FirewallFiltersV4PagePaginationArray = FirewallFiltersV4PagePaginationAr export declare namespace Filters { export { type FirewallFilter as FirewallFilter, + type FilterDeleteResponse as FilterDeleteResponse, + type FilterBulkDeleteResponse as FilterBulkDeleteResponse, FirewallFiltersSinglePage as FirewallFiltersSinglePage, FirewallFiltersV4PagePaginationArray as FirewallFiltersV4PagePaginationArray, type FilterCreateParams as FilterCreateParams, diff --git a/src/resources/r2/buckets/domains/custom.ts b/src/resources/r2/buckets/domains/custom.ts index 76dbcea299..791c3fe9d4 100644 --- a/src/resources/r2/buckets/domains/custom.ts +++ b/src/resources/r2/buckets/domains/custom.ts @@ -182,6 +182,12 @@ export interface CustomCreateResponse { */ enabled: boolean; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -195,6 +201,12 @@ export interface CustomUpdateResponse { */ domain: string; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Whether this bucket is publicly accessible at the specified custom domain. */ @@ -225,6 +237,12 @@ export namespace CustomListResponse { status: Domain.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -277,6 +295,12 @@ export interface CustomGetResponse { status: CustomGetResponse.Status; + /** + * An allowlist of ciphers for TLS termination. These ciphers must be in the + * BoringSSL format. + */ + ciphers?: Array; + /** * Minimum TLS Version the custom domain will accept for incoming connections. If * not set, defaults to 1.0. @@ -330,6 +354,12 @@ export interface CustomCreateParams { */ zoneId: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Minimum TLS Version the custom domain will accept for incoming * connections. If not set, defaults to 1.0. @@ -349,6 +379,12 @@ export interface CustomUpdateParams { */ account_id: string; + /** + * Body param: An allowlist of ciphers for TLS termination. These ciphers must be + * in the BoringSSL format. + */ + ciphers?: Array; + /** * Body param: Whether to enable public bucket access at the specified custom * domain. diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 6ba8476430..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,11 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupUserAgentParams, - TimeseriesGroupUserAgentResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -46,9 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 865665cba6..0b5807ee07 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; +import { Summary } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,9 +11,5 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { - Summary as Summary, - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; + export { Summary as Summary }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index c94177cbcd..6f7091f3a3 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 298d84ab48..5abd36afe8 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,197 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import { isRequestOptions } from '../../../../core'; -import * as Core from '../../../../core'; -export class Summary extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.userAgent(); - * ``` - */ - userAgent( - query?: SummaryUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: SummaryUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ - result: SummaryUserAgentResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - meta: SummaryUserAgentResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SummaryUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface SummaryUserAgentParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace Summary { - export { - type SummaryUserAgentResponse as SummaryUserAgentResponse, - type SummaryUserAgentParams as SummaryUserAgentParams, - }; -} +export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index a6a9f99c81..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,11 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 938c8980f2..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,218 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves the distribution of traffic by AI user agent over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.userAgent(); - * ``` - */ - userAgent( - query?: TimeseriesGroupUserAgentParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - userAgent(options?: Core.RequestOptions): Core.APIPromise; - userAgent( - query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.userAgent({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupUserAgentResponse.Meta; - - serie_0: TimeseriesGroupUserAgentResponse.Serie0; -} - -export namespace TimeseriesGroupUserAgentResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupUserAgentParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, - type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/bots/bots.ts b/src/resources/radar/bots/bots.ts index c75011e6a0..e57861cb13 100644 --- a/src/resources/radar/bots/bots.ts +++ b/src/resources/radar/bots/bots.ts @@ -189,6 +189,8 @@ export namespace BotListResponse { * A kebab-case identifier derived from the bot name. */ slug: string; + + userAgentPatterns: Array; } } diff --git a/src/resources/stream/stream.ts b/src/resources/stream/stream.ts index 4d4953be34..a684d439d8 100644 --- a/src/resources/stream/stream.ts +++ b/src/resources/stream/stream.ts @@ -489,8 +489,9 @@ export interface StreamListParams { include_counts?: boolean; /** - * Query param: Searches over the `name` key in the `meta` field. This field can be - * set with or after the upload request. + * Query param: Provides a partial word match of the `name` key in the `meta` + * field. Slow for medium to large video libraries. May be unavailable for very + * large libraries. */ search?: string; @@ -508,6 +509,12 @@ export interface StreamListParams { * Query param: Specifies whether the video is `vod` or `live`. */ type?: string; + + /** + * Query param: Provides a fast, exact string match on the `name` key in the `meta` + * field. + */ + video_name?: string; } export interface StreamDeleteParams { diff --git a/src/resources/zero-trust/gateway/configurations/configurations.ts b/src/resources/zero-trust/gateway/configurations/configurations.ts index 63b0edfdc7..9a3f07a900 100755 --- a/src/resources/zero-trust/gateway/configurations/configurations.ts +++ b/src/resources/zero-trust/gateway/configurations/configurations.ts @@ -208,7 +208,7 @@ export interface BlockPageSettings { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: 'customized_block_page' | 'redirect_uri'; + mode?: '' | 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. @@ -293,7 +293,7 @@ export interface BlockPageSettingsParam { * Controls whether the user is redirected to a Cloudflare-hosted block page or to * a customer-provided URI. */ - mode?: 'customized_block_page' | 'redirect_uri'; + mode?: '' | 'customized_block_page' | 'redirect_uri'; /** * If mode is customized_block_page: block page title. diff --git a/tests/api-resources/browser-rendering/json.test.ts b/tests/api-resources/browser-rendering/json.test.ts index 9443f79ae3..d7317f73a1 100644 --- a/tests/api-resources/browser-rendering/json.test.ts +++ b/tests/api-resources/browser-rendering/json.test.ts @@ -50,6 +50,7 @@ describe('resource json', () => { url: 'url', }, ], + custom_ai: [{ authorization: 'authorization', model: 'model' }], emulateMediaType: 'emulateMediaType', gotoOptions: { referer: 'referer', diff --git a/tests/api-resources/filters.test.ts b/tests/api-resources/filters.test.ts index 4378b9ee73..7bcf42a6e9 100644 --- a/tests/api-resources/filters.test.ts +++ b/tests/api-resources/filters.test.ts @@ -14,8 +14,7 @@ describe('resource filters', () => { test.skip('create: only required params', async () => { const responsePromise = client.filters.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - expression: - '(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', + body: [{}], }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -30,8 +29,15 @@ describe('resource filters', () => { test.skip('create: required and optional params', async () => { const response = await client.filters.create({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - expression: - '(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', + body: [ + { + description: 'Restrict access from these browsers on this address range.', + expression: + '(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', + paused: false, + ref: 'FIL-100', + }, + ], }); }); @@ -39,7 +45,6 @@ describe('resource filters', () => { test.skip('update: only required params', async () => { const responsePromise = client.filters.update('372e67954025e0ba6aaa6d586b9e0b61', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: {}, }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); @@ -54,7 +59,11 @@ describe('resource filters', () => { test.skip('update: required and optional params', async () => { const response = await client.filters.update('372e67954025e0ba6aaa6d586b9e0b61', { zone_id: '023e105f4ecef8ad9ca31a8372d0c353', - body: {}, + description: 'Restrict access from these browsers on this address range.', + expression: + '(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', + paused: false, + ref: 'FIL-100', }); }); @@ -102,7 +111,10 @@ describe('resource filters', () => { }); test('bulkDelete: only required params', async () => { - const responsePromise = client.filters.bulkDelete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.filters.bulkDelete({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + id: ['372e67954025e0ba6aaa6d586b9e0b61'], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -113,12 +125,18 @@ describe('resource filters', () => { }); test('bulkDelete: required and optional params', async () => { - const response = await client.filters.bulkDelete({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.filters.bulkDelete({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + id: ['372e67954025e0ba6aaa6d586b9e0b61'], + }); }); // TODO: investigate broken test test.skip('bulkUpdate: only required params', async () => { - const responsePromise = client.filters.bulkUpdate({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const responsePromise = client.filters.bulkUpdate({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + body: [{}], + }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -130,7 +148,18 @@ describe('resource filters', () => { // TODO: investigate broken test test.skip('bulkUpdate: required and optional params', async () => { - const response = await client.filters.bulkUpdate({ zone_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.filters.bulkUpdate({ + zone_id: '023e105f4ecef8ad9ca31a8372d0c353', + body: [ + { + description: 'Restrict access from these browsers on this address range.', + expression: + '(http.request.uri.path ~ ".*wp-login.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.addr ne 172.16.22.155', + paused: false, + ref: 'FIL-100', + }, + ], + }); }); test('get: only required params', async () => { diff --git a/tests/api-resources/r2/buckets/domains/custom.test.ts b/tests/api-resources/r2/buckets/domains/custom.test.ts index 414dbbd1dc..0912f1f272 100644 --- a/tests/api-resources/r2/buckets/domains/custom.test.ts +++ b/tests/api-resources/r2/buckets/domains/custom.test.ts @@ -34,6 +34,7 @@ describe('resource custom', () => { domain: 'prefix.example-domain.com', enabled: true, zoneId: '36ca64a6d92827b8a6b90be344bb1bfd', + ciphers: ['string'], minTLS: '1.0', jurisdiction: 'default', }); @@ -62,6 +63,7 @@ describe('resource custom', () => { 'example-domain/custom-domain.com', { account_id: '023e105f4ecef8ad9ca31a8372d0c353', + ciphers: ['string'], enabled: true, minTLS: '1.2', jurisdiction: 'default', diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts deleted file mode 100644 index e45f8279d7..0000000000 --- a/tests/api-resources/radar/ai/bots/summary.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.bots.summary.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.userAgent( - { - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 386515626c..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('userAgent', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('userAgent: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('userAgent: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.userAgent( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/stream/stream.test.ts b/tests/api-resources/stream/stream.test.ts index 1559b01649..7de51c804b 100644 --- a/tests/api-resources/stream/stream.test.ts +++ b/tests/api-resources/stream/stream.test.ts @@ -63,6 +63,7 @@ describe('resource stream', () => { start: '2014-01-02T02:20:00Z', status: 'inprogress', type: 'live', + video_name: 'puppy.mp4', }); }); diff --git a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts index 563c3a8cd6..e1e1b78591 100755 --- a/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts +++ b/tests/api-resources/zero-trust/gateway/configurations/configurations.test.ts @@ -48,7 +48,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', + mode: '', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', @@ -106,7 +106,7 @@ describe('resource configurations', () => { logo_path: 'https://logos.com/a.png', mailto_address: 'admin@example.com', mailto_subject: 'Blocked User Inquiry', - mode: 'customized_block_page', + mode: '', name: 'Cloudflare', suppress_footer: false, target_uri: 'https://example.com', From 721daccec125b999703d32ba9086b1c66deff9de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 17:06:33 +0000 Subject: [PATCH 269/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 35a1cd4fab..ab95ab8e35 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2c42cf957e3b5a69a156a53aff688afcbefc8b3d47d588ece03224d14a520b99.yml -openapi_spec_hash: 3489d7f7afa926c1b377c245812fd27d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f0ad051e40ef01b15273d26b50221cc5cf385f284fd36c6623b22cddaf7afe1.yml +openapi_spec_hash: 43e2f1eb3778fd93c9a3e964dd6d733c config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From e5d616476c467db5b406bc4eb5157363c8466e7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 18:01:16 +0000 Subject: [PATCH 270/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab95ab8e35..9dd5e4a56d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1f0ad051e40ef01b15273d26b50221cc5cf385f284fd36c6623b22cddaf7afe1.yml -openapi_spec_hash: 43e2f1eb3778fd93c9a3e964dd6d733c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2372e4dabb3a817b99e38d42ce82085a8a22be8205cf46258b81df6b532ae9c6.yml +openapi_spec_hash: 503baf033a20647772a293575832a2da config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From 9f7ebe8b9c33297b8598dbe59c89aa8e122725f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 19:00:45 +0000 Subject: [PATCH 271/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9dd5e4a56d..6df46d0e7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2372e4dabb3a817b99e38d42ce82085a8a22be8205cf46258b81df6b532ae9c6.yml -openapi_spec_hash: 503baf033a20647772a293575832a2da +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f281d38c4419f3c721111ccaf872eefa16c55824451128ed75f1ff1f0b335fd5.yml +openapi_spec_hash: eee1a308dd4fa493110742d2dde152a5 config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From 7d98a7452db4f0d49812cf1fe3d9e38747a8ebb8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 19:41:59 +0000 Subject: [PATCH 272/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6df46d0e7a..978aec8925 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f281d38c4419f3c721111ccaf872eefa16c55824451128ed75f1ff1f0b335fd5.yml -openapi_spec_hash: eee1a308dd4fa493110742d2dde152a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2bfb36c626416e47cb758ab9f6f03d7a4ad14f7b7d4ecfc43e204effec027213.yml +openapi_spec_hash: 01656e36e266af66a86deb34e34d1821 config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From b6ae6c868b6a9f73bfed54f68187bf5c1a0a458e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:07:39 +0000 Subject: [PATCH 273/423] feat(api): api update --- .stats.yml | 4 +- api.md | 28 +- src/resources/zero-trust/access/access.ts | 48 +- .../access/applications/applications.ts | 4670 ++--------------- .../zero-trust/access/applications/cas.ts | 28 +- .../zero-trust/access/applications/index.ts | 6 +- .../access/applications/policies.ts | 28 +- .../access/certificates/certificates.ts | 28 +- .../zero-trust/access/certificates/index.ts | 2 +- .../zero-trust/access/custom-pages.ts | 20 +- src/resources/zero-trust/access/groups.ts | 22 +- src/resources/zero-trust/access/index.ts | 20 +- .../zero-trust/access/logs/access-requests.ts | 10 + .../zero-trust/access/logs/scim/index.ts | 2 +- .../zero-trust/access/logs/scim/scim.ts | 11 +- .../zero-trust/access/logs/scim/updates.ts | 14 +- src/resources/zero-trust/access/policies.ts | 20 +- .../zero-trust/access/service-tokens.ts | 18 +- src/resources/zero-trust/access/tags.ts | 24 +- .../zero-trust/access/users/index.ts | 4 +- .../zero-trust/access/users/users.ts | 23 +- .../identity-providers/identity-providers.ts | 19 +- .../zero-trust/identity-providers/index.ts | 2 +- .../identity-providers/scim/groups.ts | 11 +- .../identity-providers/scim/users.ts | 11 +- src/resources/zero-trust/index.ts | 2 +- src/resources/zero-trust/zero-trust.ts | 7 +- .../zero-trust/access/custom-pages.test.ts | 2 + .../access/logs/access-requests.test.ts | 2 + .../access/logs/scim/updates.test.ts | 2 + .../zero-trust/access/policies.test.ts | 2 + .../zero-trust/access/tags.test.ts | 2 + .../zero-trust/access/users/users.test.ts | 2 + .../identity-providers/scim/groups.test.ts | 2 + .../identity-providers/scim/users.test.ts | 2 + 35 files changed, 820 insertions(+), 4278 deletions(-) diff --git a/.stats.yml b/.stats.yml index 978aec8925..d726b10283 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2bfb36c626416e47cb758ab9f6f03d7a4ad14f7b7d4ecfc43e204effec027213.yml -openapi_spec_hash: 01656e36e266af66a86deb34e34d1821 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d12e5f29ee59534bcbd3655ccc82d3f9b721562ce32d6a74905e4f64ea963ff3.yml +openapi_spec_hash: 816ab531b7373d57f9c701d5bb8dcd2a config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index 7e5b25ab4d..89ff9eae57 100644 --- a/api.md +++ b/api.md @@ -4912,7 +4912,7 @@ Methods: - client.zeroTrust.identityProviders.create({ ...params }) -> IdentityProvider - client.zeroTrust.identityProviders.update(identityProviderId, { ...params }) -> IdentityProvider -- client.zeroTrust.identityProviders.list({ ...params }) -> IdentityProviderListResponsesSinglePage +- client.zeroTrust.identityProviders.list({ ...params }) -> IdentityProviderListResponsesV4PagePaginationArray - client.zeroTrust.identityProviders.delete(identityProviderId, { ...params }) -> IdentityProviderDeleteResponse - client.zeroTrust.identityProviders.get(identityProviderId, { ...params }) -> IdentityProvider @@ -4922,13 +4922,13 @@ Methods: Methods: -- client.zeroTrust.identityProviders.scim.groups.list(identityProviderId, { ...params }) -> ZeroTrustGroupsSinglePage +- client.zeroTrust.identityProviders.scim.groups.list(identityProviderId, { ...params }) -> ZeroTrustGroupsV4PagePaginationArray #### Users Methods: -- client.zeroTrust.identityProviders.scim.users.list(identityProviderId, { ...params }) -> AccessUsersSinglePage +- client.zeroTrust.identityProviders.scim.users.list(identityProviderId, { ...params }) -> AccessUsersV4PagePaginationArray ## Organizations @@ -5040,7 +5040,7 @@ Methods: - client.zeroTrust.access.applications.create({ ...params }) -> ApplicationCreateResponse - client.zeroTrust.access.applications.update(appId, { ...params }) -> ApplicationUpdateResponse -- client.zeroTrust.access.applications.list({ ...params }) -> ApplicationListResponsesSinglePage +- client.zeroTrust.access.applications.list({ ...params }) -> ApplicationListResponsesV4PagePaginationArray - client.zeroTrust.access.applications.delete(appId, { ...params }) -> ApplicationDeleteResponse - client.zeroTrust.access.applications.get(appId, { ...params }) -> ApplicationGetResponse - client.zeroTrust.access.applications.revokeTokens(appId, { ...params }) -> ApplicationRevokeTokensResponse | null @@ -5055,7 +5055,7 @@ Types: Methods: - client.zeroTrust.access.applications.cas.create(appId, { ...params }) -> CA -- client.zeroTrust.access.applications.cas.list({ ...params }) -> CAsSinglePage +- client.zeroTrust.access.applications.cas.list({ ...params }) -> CAsV4PagePaginationArray - client.zeroTrust.access.applications.cas.delete(appId, { ...params }) -> CADeleteResponse - client.zeroTrust.access.applications.cas.get(appId, { ...params }) -> CA @@ -5104,7 +5104,7 @@ Methods: - client.zeroTrust.access.applications.policies.create(appId, { ...params }) -> PolicyCreateResponse - client.zeroTrust.access.applications.policies.update(appId, policyId, { ...params }) -> PolicyUpdateResponse -- client.zeroTrust.access.applications.policies.list(appId, { ...params }) -> PolicyListResponsesSinglePage +- client.zeroTrust.access.applications.policies.list(appId, { ...params }) -> PolicyListResponsesV4PagePaginationArray - client.zeroTrust.access.applications.policies.delete(appId, policyId, { ...params }) -> PolicyDeleteResponse - client.zeroTrust.access.applications.policies.get(appId, policyId, { ...params }) -> PolicyGetResponse @@ -5154,7 +5154,7 @@ Methods: - client.zeroTrust.access.certificates.create({ ...params }) -> Certificate - client.zeroTrust.access.certificates.update(certificateId, { ...params }) -> Certificate -- client.zeroTrust.access.certificates.list({ ...params }) -> CertificatesSinglePage +- client.zeroTrust.access.certificates.list({ ...params }) -> CertificatesV4PagePaginationArray - client.zeroTrust.access.certificates.delete(certificateId, { ...params }) -> CertificateDeleteResponse - client.zeroTrust.access.certificates.get(certificateId, { ...params }) -> Certificate @@ -5184,7 +5184,7 @@ Methods: - client.zeroTrust.access.groups.create({ ...params }) -> GroupCreateResponse - client.zeroTrust.access.groups.update(groupId, { ...params }) -> GroupUpdateResponse -- client.zeroTrust.access.groups.list({ ...params }) -> GroupListResponsesSinglePage +- client.zeroTrust.access.groups.list({ ...params }) -> GroupListResponsesV4PagePaginationArray - client.zeroTrust.access.groups.delete(groupId, { ...params }) -> GroupDeleteResponse - client.zeroTrust.access.groups.get(groupId, { ...params }) -> GroupGetResponse @@ -5200,7 +5200,7 @@ Methods: - client.zeroTrust.access.serviceTokens.create({ ...params }) -> ServiceTokenCreateResponse - client.zeroTrust.access.serviceTokens.update(serviceTokenId, { ...params }) -> ServiceToken -- client.zeroTrust.access.serviceTokens.list({ ...params }) -> ServiceTokensSinglePage +- client.zeroTrust.access.serviceTokens.list({ ...params }) -> ServiceTokensV4PagePaginationArray - client.zeroTrust.access.serviceTokens.delete(serviceTokenId, { ...params }) -> ServiceToken - client.zeroTrust.access.serviceTokens.get(serviceTokenId, { ...params }) -> ServiceToken - client.zeroTrust.access.serviceTokens.refresh(serviceTokenId, { ...params }) -> ServiceToken @@ -5261,7 +5261,7 @@ Types: Methods: -- client.zeroTrust.access.logs.scim.updates.list({ ...params }) -> UpdateListResponsesSinglePage +- client.zeroTrust.access.logs.scim.updates.list({ ...params }) -> UpdateListResponsesV4PagePaginationArray ### Users @@ -5272,7 +5272,7 @@ Types: Methods: -- client.zeroTrust.access.users.list({ ...params }) -> UserListResponsesSinglePage +- client.zeroTrust.access.users.list({ ...params }) -> UserListResponsesV4PagePaginationArray #### ActiveSessions @@ -5318,7 +5318,7 @@ Methods: - client.zeroTrust.access.customPages.create({ ...params }) -> CustomPageWithoutHTML - client.zeroTrust.access.customPages.update(customPageId, { ...params }) -> CustomPageWithoutHTML -- client.zeroTrust.access.customPages.list({ ...params }) -> CustomPageWithoutHTMLsSinglePage +- client.zeroTrust.access.customPages.list({ ...params }) -> CustomPageWithoutHTMLsV4PagePaginationArray - client.zeroTrust.access.customPages.delete(customPageId, { ...params }) -> CustomPageDeleteResponse - client.zeroTrust.access.customPages.get(customPageId, { ...params }) -> CustomPage @@ -5333,7 +5333,7 @@ Methods: - client.zeroTrust.access.tags.create({ ...params }) -> Tag - client.zeroTrust.access.tags.update(tagName, { ...params }) -> Tag -- client.zeroTrust.access.tags.list({ ...params }) -> TagsSinglePage +- client.zeroTrust.access.tags.list({ ...params }) -> TagsV4PagePaginationArray - client.zeroTrust.access.tags.delete(tagName, { ...params }) -> TagDeleteResponse - client.zeroTrust.access.tags.get(tagName, { ...params }) -> Tag @@ -5353,7 +5353,7 @@ Methods: - client.zeroTrust.access.policies.create({ ...params }) -> PolicyCreateResponse - client.zeroTrust.access.policies.update(policyId, { ...params }) -> PolicyUpdateResponse -- client.zeroTrust.access.policies.list({ ...params }) -> PolicyListResponsesSinglePage +- client.zeroTrust.access.policies.list({ ...params }) -> PolicyListResponsesV4PagePaginationArray - client.zeroTrust.access.policies.delete(policyId, { ...params }) -> PolicyDeleteResponse - client.zeroTrust.access.policies.get(policyId, { ...params }) -> PolicyGetResponse diff --git a/src/resources/zero-trust/access/access.ts b/src/resources/zero-trust/access/access.ts index c14de3aa26..fea6040f8d 100644 --- a/src/resources/zero-trust/access/access.ts +++ b/src/resources/zero-trust/access/access.ts @@ -23,7 +23,7 @@ import { CustomPageListParams, CustomPageUpdateParams, CustomPageWithoutHTML, - CustomPageWithoutHTMLsSinglePage, + CustomPageWithoutHTMLsV4PagePaginationArray, CustomPages, } from './custom-pages'; import * as GatewayCAAPI from './gateway-ca'; @@ -47,7 +47,7 @@ import { GroupGetResponse, GroupListParams, GroupListResponse, - GroupListResponsesSinglePage, + GroupListResponsesV4PagePaginationArray, GroupUpdateParams, GroupUpdateResponse, Groups, @@ -76,7 +76,7 @@ import { PolicyGetResponse, PolicyListParams, PolicyListResponse, - PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray, PolicyUpdateParams, PolicyUpdateResponse, } from './policies'; @@ -93,7 +93,7 @@ import { ServiceTokenRotateResponse, ServiceTokenUpdateParams, ServiceTokens, - ServiceTokensSinglePage, + ServiceTokensV4PagePaginationArray, } from './service-tokens'; import * as TagsAPI from './tags'; import { @@ -105,7 +105,7 @@ import { TagListParams, TagUpdateParams, Tags, - TagsSinglePage, + TagsV4PagePaginationArray, } from './tags'; import * as ApplicationsAPI from './applications/applications'; import { @@ -123,7 +123,7 @@ import { ApplicationGetResponse, ApplicationListParams, ApplicationListResponse, - ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray, ApplicationPolicy, ApplicationRevokeTokensParams, ApplicationRevokeTokensResponse, @@ -154,7 +154,7 @@ import { CertificateListParams, CertificateUpdateParams, Certificates, - CertificatesSinglePage, + CertificatesV4PagePaginationArray, } from './certificates/certificates'; import * as InfrastructureAPI from './infrastructure/infrastructure'; import { Infrastructure } from './infrastructure/infrastructure'; @@ -165,7 +165,7 @@ import { AccessUser, UserListParams, UserListResponse, - UserListResponsesSinglePage, + UserListResponsesV4PagePaginationArray, Users, } from './users/users'; @@ -189,25 +189,25 @@ Access.GatewayCA = GatewayCA; Access.GatewayCAListResponsesSinglePage = GatewayCAListResponsesSinglePage; Access.Infrastructure = Infrastructure; Access.Applications = Applications; -Access.ApplicationListResponsesSinglePage = ApplicationListResponsesSinglePage; +Access.ApplicationListResponsesV4PagePaginationArray = ApplicationListResponsesV4PagePaginationArray; Access.Certificates = Certificates; -Access.CertificatesSinglePage = CertificatesSinglePage; +Access.CertificatesV4PagePaginationArray = CertificatesV4PagePaginationArray; Access.Groups = Groups; -Access.GroupListResponsesSinglePage = GroupListResponsesSinglePage; +Access.GroupListResponsesV4PagePaginationArray = GroupListResponsesV4PagePaginationArray; Access.ServiceTokens = ServiceTokens; -Access.ServiceTokensSinglePage = ServiceTokensSinglePage; +Access.ServiceTokensV4PagePaginationArray = ServiceTokensV4PagePaginationArray; Access.Bookmarks = Bookmarks; Access.BookmarksSinglePage = BookmarksSinglePage; Access.Keys = Keys; Access.Logs = Logs; Access.Users = Users; -Access.UserListResponsesSinglePage = UserListResponsesSinglePage; +Access.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray; Access.CustomPages = CustomPages; -Access.CustomPageWithoutHTMLsSinglePage = CustomPageWithoutHTMLsSinglePage; +Access.CustomPageWithoutHTMLsV4PagePaginationArray = CustomPageWithoutHTMLsV4PagePaginationArray; Access.Tags = Tags; -Access.TagsSinglePage = TagsSinglePage; +Access.TagsV4PagePaginationArray = TagsV4PagePaginationArray; Access.Policies = Policies; -Access.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage; +Access.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray; export declare namespace Access { export { @@ -250,7 +250,7 @@ export declare namespace Access { type ApplicationDeleteResponse as ApplicationDeleteResponse, type ApplicationGetResponse as ApplicationGetResponse, type ApplicationRevokeTokensResponse as ApplicationRevokeTokensResponse, - ApplicationListResponsesSinglePage as ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray as ApplicationListResponsesV4PagePaginationArray, type ApplicationCreateParams as ApplicationCreateParams, type ApplicationUpdateParams as ApplicationUpdateParams, type ApplicationListParams as ApplicationListParams, @@ -264,7 +264,7 @@ export declare namespace Access { type AssociatedHostnames as AssociatedHostnames, type Certificate as Certificate, type CertificateDeleteResponse as CertificateDeleteResponse, - CertificatesSinglePage as CertificatesSinglePage, + CertificatesV4PagePaginationArray as CertificatesV4PagePaginationArray, type CertificateCreateParams as CertificateCreateParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, @@ -280,7 +280,7 @@ export declare namespace Access { type GroupListResponse as GroupListResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupGetResponse as GroupGetResponse, - GroupListResponsesSinglePage as GroupListResponsesSinglePage, + GroupListResponsesV4PagePaginationArray as GroupListResponsesV4PagePaginationArray, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, @@ -293,7 +293,7 @@ export declare namespace Access { type ServiceToken as ServiceToken, type ServiceTokenCreateResponse as ServiceTokenCreateResponse, type ServiceTokenRotateResponse as ServiceTokenRotateResponse, - ServiceTokensSinglePage as ServiceTokensSinglePage, + ServiceTokensV4PagePaginationArray as ServiceTokensV4PagePaginationArray, type ServiceTokenCreateParams as ServiceTokenCreateParams, type ServiceTokenUpdateParams as ServiceTokenUpdateParams, type ServiceTokenListParams as ServiceTokenListParams, @@ -331,7 +331,7 @@ export declare namespace Access { Users as Users, type AccessUser as AccessUser, type UserListResponse as UserListResponse, - UserListResponsesSinglePage as UserListResponsesSinglePage, + UserListResponsesV4PagePaginationArray as UserListResponsesV4PagePaginationArray, type UserListParams as UserListParams, }; @@ -340,7 +340,7 @@ export declare namespace Access { type CustomPage as CustomPage, type CustomPageWithoutHTML as CustomPageWithoutHTML, type CustomPageDeleteResponse as CustomPageDeleteResponse, - CustomPageWithoutHTMLsSinglePage as CustomPageWithoutHTMLsSinglePage, + CustomPageWithoutHTMLsV4PagePaginationArray as CustomPageWithoutHTMLsV4PagePaginationArray, type CustomPageCreateParams as CustomPageCreateParams, type CustomPageUpdateParams as CustomPageUpdateParams, type CustomPageListParams as CustomPageListParams, @@ -352,7 +352,7 @@ export declare namespace Access { Tags as Tags, type Tag as Tag, type TagDeleteResponse as TagDeleteResponse, - TagsSinglePage as TagsSinglePage, + TagsV4PagePaginationArray as TagsV4PagePaginationArray, type TagCreateParams as TagCreateParams, type TagUpdateParams as TagUpdateParams, type TagListParams as TagListParams, @@ -369,7 +369,7 @@ export declare namespace Access { type PolicyListResponse as PolicyListResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyGetResponse as PolicyGetResponse, - PolicyListResponsesSinglePage as PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray as PolicyListResponsesV4PagePaginationArray, type PolicyCreateParams as PolicyCreateParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyListParams as PolicyListParams, diff --git a/src/resources/zero-trust/access/applications/applications.ts b/src/resources/zero-trust/access/applications/applications.ts index d07d5c870a..67800f8ac2 100644 --- a/src/resources/zero-trust/access/applications/applications.ts +++ b/src/resources/zero-trust/access/applications/applications.ts @@ -14,7 +14,7 @@ import { CAGetParams, CAListParams, CAs, - CAsSinglePage, + CAsV4PagePaginationArray, } from './cas'; import * as ApplicationsPoliciesAPI from './policies'; import { @@ -45,7 +45,7 @@ import { PolicyGetResponse, PolicyListParams, PolicyListResponse, - PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray, PolicyUpdateParams, PolicyUpdateResponse, SAMLGroupRule, @@ -75,7 +75,7 @@ import { PolicyTests, } from './policy-tests/policy-tests'; import { CloudflareError } from '../../../../error'; -import { SinglePage } from '../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Applications extends APIResource { cas: CAsAPI.CAs = new CAsAPI.CAs(this._client); @@ -190,14 +190,14 @@ export class Applications extends APIResource { list( params?: ApplicationListParams, options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( params: ApplicationListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -220,7 +220,7 @@ export class Applications extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/apps`, - ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray, { query, ...options }, ); } @@ -382,7 +382,7 @@ export class Applications extends APIResource { } } -export class ApplicationListResponsesSinglePage extends SinglePage {} +export class ApplicationListResponsesV4PagePaginationArray extends V4PagePaginationArray {} export type AllowedHeaders = string; @@ -4153,6 +4153,23 @@ export namespace ApplicationCreateResponse { created_at?: string; + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * The custom pages that will be displayed when applicable for this application + */ + custom_pages?: Array; + /** * The primary hostname and path secured by Access. This domain will be displayed * if the app is visible in the App Launcher. @@ -4181,12 +4198,6 @@ export namespace ApplicationCreateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -4325,105 +4336,6 @@ export namespace ApplicationCreateResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface DeviceEnrollmentPermissionsApplication { @@ -4443,11 +4355,6 @@ export namespace ApplicationCreateResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -4459,33 +4366,30 @@ export namespace ApplicationCreateResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -4494,12 +4398,6 @@ export namespace ApplicationCreateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -4507,57 +4405,10 @@ export namespace ApplicationCreateResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - export interface Policy { /** * The UUID of the policy @@ -4638,133 +4489,29 @@ export namespace ApplicationCreateResponse { updated_at?: string; } + } + export interface BrowserIsolationPermissionsApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * The application type. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + type: ApplicationsAPI.ApplicationType; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * UUID. + */ + id?: string; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * The identity providers your users can select when connecting to this + * application. Defaults to all IdPs configured in your account. + */ + allowed_idps?: Array; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserIsolationPermissionsApplication { - /** - * The application type. - */ - type: ApplicationsAPI.ApplicationType; - - /** - * UUID. - */ - id?: string; - - /** - * The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - - /** - * Audience tag. - */ - aud?: string; + /** + * Audience tag. + */ + aud?: string; /** * When set to `true`, users skip the identity provider selection step during @@ -4772,33 +4519,30 @@ export namespace ApplicationCreateResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -4807,12 +4551,6 @@ export namespace ApplicationCreateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -4820,57 +4558,10 @@ export namespace ApplicationCreateResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - export interface Policy { /** * The UUID of the policy @@ -4951,261 +4642,55 @@ export namespace ApplicationCreateResponse { updated_at?: string; } + } + export interface BookmarkApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * UUID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + id?: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + /** + * Displays the application in the App Launcher. + */ + app_launcher_visible?: boolean; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * Audience tag. + */ + aud?: string; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + created_at?: string; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; + /** + * The URL or domain of the bookmark. + */ + domain?: string; - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } + /** + * The image URL for the logo shown in the App Launcher dashboard. + */ + logo_url?: string; - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; + /** + * The name of the application. + */ + name?: string; - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; + /** + * The tags you want assigned to an application. Tags are used to filter + * applications in the App Launcher dashboard. + */ + tags?: Array; - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * UUID. - */ - id?: string; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * Audience tag. - */ - aud?: string; - - created_at?: string; - - /** - * The URL or domain of the bookmark. - */ - domain?: string; - - /** - * The image URL for the logo shown in the App Launcher dashboard. - */ - logo_url?: string; - - /** - * The name of the application. - */ - name?: string; - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - - /** - * The tags you want assigned to an application. Tags are used to filter - * applications in the App Launcher dashboard. - */ - tags?: Array; - - /** - * The application type. - */ - type?: ApplicationsAPI.ApplicationType; + /** + * The application type. + */ + type?: ApplicationsAPI.ApplicationType; updated_at?: string; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { target_criteria: Array; @@ -5233,12 +4718,6 @@ export namespace ApplicationCreateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: InfrastructureApplication.SCIMConfig; - updated_at?: string; } @@ -5338,138 +4817,39 @@ export namespace ApplicationCreateResponse { } } } + } + export interface BrowserRdpApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + domain: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + target_criteria: Array; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * The application type. + */ + type: ApplicationsAPI.ApplicationType; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * UUID. + */ + id?: string; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; + /** + * When set to true, users can authenticate to this application using their WARP + * session. When set to false this application will always require direct IdP + * authentication. This setting always overrides the organization setting for WARP + * authentication. + */ + allow_authenticate_via_warp?: boolean; - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserRdpApplication { - /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. - */ - domain: string; - - target_criteria: Array; - - /** - * The application type. - */ - type: ApplicationsAPI.ApplicationType; - - /** - * UUID. - */ - id?: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; - - /** - * Enables loading application content in an iFrame. - */ - allow_iframe?: boolean; + /** + * Enables loading application content in an iFrame. + */ + allow_iframe?: boolean; /** * The identity providers your users can select when connecting to this @@ -7441,6 +6821,23 @@ export namespace ApplicationUpdateResponse { created_at?: string; + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * The custom pages that will be displayed when applicable for this application + */ + custom_pages?: Array; + /** * The primary hostname and path secured by Access. This domain will be displayed * if the app is visible in the App Launcher. @@ -7469,12 +6866,6 @@ export namespace ApplicationUpdateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -7613,105 +7004,6 @@ export namespace ApplicationUpdateResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface DeviceEnrollmentPermissionsApplication { @@ -7731,11 +7023,6 @@ export namespace ApplicationUpdateResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -7747,33 +7034,30 @@ export namespace ApplicationUpdateResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -7782,12 +7066,6 @@ export namespace ApplicationUpdateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -7795,75 +7073,28 @@ export namespace ApplicationUpdateResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { + export interface Policy { /** - * The hypertext in the footer link. + * The UUID of the policy */ - name: string; + id?: string; /** - * the hyperlink in the footer link. + * Administrators who can approve a temporary authentication request. */ - url: string; - } + approval_groups?: Array; - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { /** - * The background color of the log in button on the landing page. + * Requires the user to request access from an administrator at the start of each + * session. */ - button_color?: string; + approval_required?: boolean; - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - - export interface Policy { - /** - * The UUID of the policy - */ - id?: string; - - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; - - /** - * Requires the user to request access from an administrator at the start of each - * session. - */ - approval_required?: boolean; - - created_at?: string; + created_at?: string; /** * The action Access will take if a user matches this policy. Infrastructure @@ -7926,105 +7157,6 @@ export namespace ApplicationUpdateResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface BrowserIsolationPermissionsApplication { @@ -8044,11 +7176,6 @@ export namespace ApplicationUpdateResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -8060,33 +7187,30 @@ export namespace ApplicationUpdateResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -8095,12 +7219,6 @@ export namespace ApplicationUpdateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -8108,57 +7226,10 @@ export namespace ApplicationUpdateResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - export interface Policy { /** * The UUID of the policy @@ -8239,122 +7310,23 @@ export namespace ApplicationUpdateResponse { updated_at?: string; } + } + export interface BookmarkApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * UUID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + id?: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + /** + * Displays the application in the App Launcher. + */ + app_launcher_visible?: boolean; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * UUID. - */ - id?: string; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * Audience tag. - */ - aud?: string; + /** + * Audience tag. + */ + aud?: string; created_at?: string; @@ -8373,12 +7345,6 @@ export namespace ApplicationUpdateResponse { */ name?: string; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - /** * The tags you want assigned to an application. Tags are used to filter * applications in the App Launcher dashboard. @@ -8393,107 +7359,6 @@ export namespace ApplicationUpdateResponse { updated_at?: string; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { target_criteria: Array; @@ -8521,12 +7386,6 @@ export namespace ApplicationUpdateResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: InfrastructureApplication.SCIMConfig; - updated_at?: string; } @@ -8626,133 +7485,34 @@ export namespace ApplicationUpdateResponse { } } } + } + export interface BrowserRdpApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + domain: string; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + target_criteria: Array; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * The application type. + */ + type: ApplicationsAPI.ApplicationType; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; + /** + * UUID. + */ + id?: string; - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserRdpApplication { - /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. - */ - domain: string; - - target_criteria: Array; - - /** - * The application type. - */ - type: ApplicationsAPI.ApplicationType; - - /** - * UUID. - */ - id?: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; + /** + * When set to true, users can authenticate to this application using their WARP + * session. When set to false this application will always require direct IdP + * authentication. This setting always overrides the organization setting for WARP + * authentication. + */ + allow_authenticate_via_warp?: boolean; /** * Enables loading application content in an iFrame. @@ -10729,6 +9489,23 @@ export namespace ApplicationListResponse { created_at?: string; + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * The custom pages that will be displayed when applicable for this application + */ + custom_pages?: Array; + /** * The primary hostname and path secured by Access. This domain will be displayed * if the app is visible in the App Launcher. @@ -10757,12 +9534,6 @@ export namespace ApplicationListResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -10901,105 +9672,6 @@ export namespace ApplicationListResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface DeviceEnrollmentPermissionsApplication { @@ -11019,11 +9691,6 @@ export namespace ApplicationListResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -11035,33 +9702,30 @@ export namespace ApplicationListResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -11070,12 +9734,6 @@ export namespace ApplicationListResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -11083,73 +9741,26 @@ export namespace ApplicationListResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { + export interface Policy { /** - * The hypertext in the footer link. + * The UUID of the policy */ - name: string; + id?: string; /** - * the hyperlink in the footer link. + * Administrators who can approve a temporary authentication request. */ - url: string; - } + approval_groups?: Array; - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { /** - * The background color of the log in button on the landing page. + * Requires the user to request access from an administrator at the start of each + * session. */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - - export interface Policy { - /** - * The UUID of the policy - */ - id?: string; - - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; - - /** - * Requires the user to request access from an administrator at the start of each - * session. - */ - approval_required?: boolean; + approval_required?: boolean; created_at?: string; @@ -11214,105 +9825,6 @@ export namespace ApplicationListResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface BrowserIsolationPermissionsApplication { @@ -11332,11 +9844,6 @@ export namespace ApplicationListResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -11348,33 +9855,30 @@ export namespace ApplicationListResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -11383,12 +9887,6 @@ export namespace ApplicationListResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -11396,57 +9894,10 @@ export namespace ApplicationListResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - export interface Policy { /** * The UUID of the policy @@ -11527,122 +9978,23 @@ export namespace ApplicationListResponse { updated_at?: string; } + } + export interface BookmarkApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * UUID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + id?: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + /** + * Displays the application in the App Launcher. + */ + app_launcher_visible?: boolean; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * UUID. - */ - id?: string; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * Audience tag. - */ - aud?: string; + /** + * Audience tag. + */ + aud?: string; created_at?: string; @@ -11661,12 +10013,6 @@ export namespace ApplicationListResponse { */ name?: string; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - /** * The tags you want assigned to an application. Tags are used to filter * applications in the App Launcher dashboard. @@ -11681,107 +10027,6 @@ export namespace ApplicationListResponse { updated_at?: string; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { target_criteria: Array; @@ -11809,12 +10054,6 @@ export namespace ApplicationListResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: InfrastructureApplication.SCIMConfig; - updated_at?: string; } @@ -11914,133 +10153,34 @@ export namespace ApplicationListResponse { } } } + } + export interface BrowserRdpApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + domain: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + target_criteria: Array; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * The application type. + */ + type: ApplicationsAPI.ApplicationType; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * UUID. + */ + id?: string; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserRdpApplication { - /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. - */ - domain: string; - - target_criteria: Array; - - /** - * The application type. - */ - type: ApplicationsAPI.ApplicationType; - - /** - * UUID. - */ - id?: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; + /** + * When set to true, users can authenticate to this application using their WARP + * session. When set to false this application will always require direct IdP + * authentication. This setting always overrides the organization setting for WARP + * authentication. + */ + allow_authenticate_via_warp?: boolean; /** * Enables loading application content in an iFrame. @@ -14024,6 +12164,23 @@ export namespace ApplicationGetResponse { created_at?: string; + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * The custom pages that will be displayed when applicable for this application + */ + custom_pages?: Array; + /** * The primary hostname and path secured by Access. This domain will be displayed * if the app is visible in the App Launcher. @@ -14052,12 +12209,6 @@ export namespace ApplicationGetResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -14196,105 +12347,6 @@ export namespace ApplicationGetResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface DeviceEnrollmentPermissionsApplication { @@ -14314,11 +12366,6 @@ export namespace ApplicationGetResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -14330,33 +12377,30 @@ export namespace ApplicationGetResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -14365,12 +12409,6 @@ export namespace ApplicationGetResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -14378,71 +12416,24 @@ export namespace ApplicationGetResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { + export interface Policy { /** - * The hypertext in the footer link. + * The UUID of the policy */ - name: string; + id?: string; /** - * the hyperlink in the footer link. + * Administrators who can approve a temporary authentication request. */ - url: string; - } + approval_groups?: Array; - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - - export interface Policy { - /** - * The UUID of the policy - */ - id?: string; - - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; - - /** - * Requires the user to request access from an administrator at the start of each - * session. + * Requires the user to request access from an administrator at the start of each + * session. */ approval_required?: boolean; @@ -14509,105 +12500,6 @@ export namespace ApplicationGetResponse { updated_at?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface BrowserIsolationPermissionsApplication { @@ -14627,11 +12519,6 @@ export namespace ApplicationGetResponse { */ allowed_idps?: Array; - /** - * The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Audience tag. */ @@ -14643,33 +12530,30 @@ export namespace ApplicationGetResponse { */ auto_redirect_to_identity?: boolean; - /** - * The background color of the App Launcher page. - */ - bg_color?: string; - created_at?: string; /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. + * The custom URL a user is redirected to when they are denied access to the + * application when failing identity-based rules. */ - domain?: string; + custom_deny_url?: string; /** - * The links in the App Launcher footer. + * The custom URL a user is redirected to when they are denied access to the + * application when failing non-identity rules. */ - footer_links?: Array; + custom_non_identity_deny_url?: string; /** - * The background color of the App Launcher header. + * The custom pages that will be displayed when applicable for this application */ - header_bg_color?: string; + custom_pages?: Array; /** - * The design of the App Launcher landing page shown to users when they log in. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; + domain?: string; /** * The name of the application. @@ -14678,12 +12562,6 @@ export namespace ApplicationGetResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - /** * The amount of time that tokens issued for this application will be valid. Must * be in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, @@ -14691,57 +12569,10 @@ export namespace ApplicationGetResponse { */ session_duration?: string; - /** - * Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - updated_at?: string; } export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - export interface Policy { /** * The UUID of the policy @@ -14822,122 +12653,23 @@ export namespace ApplicationGetResponse { updated_at?: string; } + } + export interface BookmarkApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * UUID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + id?: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + /** + * Displays the application in the App Launcher. + */ + app_launcher_visible?: boolean; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * UUID. - */ - id?: string; - - /** - * Displays the application in the App Launcher. - */ - app_launcher_visible?: boolean; - - /** - * Audience tag. - */ - aud?: string; + /** + * Audience tag. + */ + aud?: string; created_at?: string; @@ -14956,12 +12688,6 @@ export namespace ApplicationGetResponse { */ name?: string; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - /** * The tags you want assigned to an application. Tags are used to filter * applications in the App Launcher dashboard. @@ -14976,107 +12702,6 @@ export namespace ApplicationGetResponse { updated_at?: string; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { target_criteria: Array; @@ -15104,12 +12729,6 @@ export namespace ApplicationGetResponse { policies?: Array; - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - scim_config?: InfrastructureApplication.SCIMConfig; - updated_at?: string; } @@ -15209,133 +12828,34 @@ export namespace ApplicationGetResponse { } } } + } + export interface BrowserRdpApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * The primary hostname and path secured by Access. This domain will be displayed + * if the app is visible in the App Launcher. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + domain: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + target_criteria: Array; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasic - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerToken - | ApplicationsAPI.SCIMConfigAuthenticationOauth2 - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * The application type. + */ + type: ApplicationsAPI.ApplicationType; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * UUID. + */ + id?: string; - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserRdpApplication { - /** - * The primary hostname and path secured by Access. This domain will be displayed - * if the app is visible in the App Launcher. - */ - domain: string; - - target_criteria: Array; - - /** - * The application type. - */ - type: ApplicationsAPI.ApplicationType; - - /** - * UUID. - */ - id?: string; - - /** - * When set to true, users can authenticate to this application using their WARP - * session. When set to false this application will always require direct IdP - * authentication. This setting always overrides the organization setting for WARP - * authentication. - */ - allow_authenticate_via_warp?: boolean; + /** + * When set to true, users can authenticate to this application using their WARP + * session. When set to false this application will always require direct IdP + * authentication. This setting always overrides the organization setting for WARP + * authentication. + */ + allow_authenticate_via_warp?: boolean; /** * Enables loading application content in an iFrame. @@ -15752,7 +13272,7 @@ export type ApplicationCreateParams = | ApplicationCreateParams.AppLauncherApplication | ApplicationCreateParams.DeviceEnrollmentPermissionsApplication | ApplicationCreateParams.BrowserIsolationPermissionsApplication - | ApplicationCreateParams.BookmarkApplication + | ApplicationCreateParams.AccessBookmarkProps | ApplicationCreateParams.InfrastructureApplication | ApplicationCreateParams.BrowserRdpApplication; @@ -17280,6 +14800,24 @@ export declare namespace ApplicationCreateParams { */ bg_color?: string; + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * Body param: The custom pages that will be displayed when applicable for this + * application + */ + custom_pages?: Array; + /** * Body param: The links in the App Launcher footer. */ @@ -17305,12 +14843,6 @@ export declare namespace ApplicationCreateParams { AppLauncherApplication.AccessAppPolicyLink | string | AppLauncherApplication.UnionMember2 >; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * Body param: The amount of time that tokens issued for this application will be * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us @@ -17430,105 +14962,6 @@ export declare namespace ApplicationCreateParams { */ session_duration?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface DeviceEnrollmentPermissionsApplication { @@ -17555,11 +14988,6 @@ export declare namespace ApplicationCreateParams { */ allowed_idps?: Array; - /** - * Body param: The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Body param: When set to `true`, users skip the identity provider selection step * during login. You must specify only one identity provider in allowed_idps. @@ -17567,25 +14995,22 @@ export declare namespace ApplicationCreateParams { auto_redirect_to_identity?: boolean; /** - * Body param: The background color of the App Launcher page. - */ - bg_color?: string; - - /** - * Body param: The links in the App Launcher footer. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. */ - footer_links?: Array; + custom_deny_url?: string; /** - * Body param: The background color of the App Launcher header. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. */ - header_bg_color?: string; + custom_non_identity_deny_url?: string; /** - * Body param: The design of the App Launcher landing page shown to users when they - * log in. + * Body param: The custom pages that will be displayed when applicable for this + * application */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + custom_pages?: Array; /** * Body param: The policies that Access applies to the application, in ascending @@ -17598,87 +15023,34 @@ export declare namespace ApplicationCreateParams { | DeviceEnrollmentPermissionsApplication.UnionMember2 >; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * Body param: The amount of time that tokens issued for this application will be * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us * (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. */ session_duration?: string; - - /** - * Body param: Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; } export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { + /** + * A JSON that links a reusable policy to an application. + */ + export interface AccessAppPolicyLink { /** - * The hypertext in the footer link. + * The UUID of the policy */ - name: string; + id?: string; /** - * the hyperlink in the footer link. + * The order of execution for this policy. Must be unique for each policy within an + * app. */ - url: string; + precedence?: number; } - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { + export interface UnionMember2 { /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - - /** - * A JSON that links a reusable policy to an application. - */ - export interface AccessAppPolicyLink { - /** - * The UUID of the policy - */ - id?: string; - - /** - * The order of execution for this policy. Must be unique for each policy within an - * app. - */ - precedence?: number; - } - - export interface UnionMember2 { - /** - * The UUID of the policy + * The UUID of the policy */ id?: string; @@ -17723,105 +15095,6 @@ export declare namespace ApplicationCreateParams { */ session_duration?: string; } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } } export interface BrowserIsolationPermissionsApplication { @@ -17848,11 +15121,6 @@ export declare namespace ApplicationCreateParams { */ allowed_idps?: Array; - /** - * Body param: The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Body param: When set to `true`, users skip the identity provider selection step * during login. You must specify only one identity provider in allowed_idps. @@ -17860,25 +15128,22 @@ export declare namespace ApplicationCreateParams { auto_redirect_to_identity?: boolean; /** - * Body param: The background color of the App Launcher page. - */ - bg_color?: string; - - /** - * Body param: The links in the App Launcher footer. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. */ - footer_links?: Array; + custom_deny_url?: string; /** - * Body param: The background color of the App Launcher header. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. */ - header_bg_color?: string; + custom_non_identity_deny_url?: string; /** - * Body param: The design of the App Launcher landing page shown to users when they - * log in. + * Body param: The custom pages that will be displayed when applicable for this + * application */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; + custom_pages?: Array; /** * Body param: The policies that Access applies to the application, in ascending @@ -17891,68 +15156,15 @@ export declare namespace ApplicationCreateParams { | BrowserIsolationPermissionsApplication.UnionMember2 >; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - /** * Body param: The amount of time that tokens issued for this application will be * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us * (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. */ session_duration?: string; - - /** - * Body param: Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; } export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - /** * A JSON that links a reusable policy to an application. */ @@ -18016,119 +15228,20 @@ export declare namespace ApplicationCreateParams { */ session_duration?: string; } + } + export interface AccessBookmarkProps { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + account_id?: string; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * Path param: The Account ID to use for this endpoint. Mutually exclusive with the - * Zone ID. - */ - account_id?: string; - - /** - * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the - * Account ID. - */ - zone_id?: string; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id?: string; /** * Body param: Displays the application in the App Launcher. @@ -18150,12 +15263,6 @@ export declare namespace ApplicationCreateParams { */ name?: string; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - /** * Body param: The tags you want assigned to an application. Tags are used to * filter applications in the App Launcher dashboard. @@ -18168,107 +15275,6 @@ export declare namespace ApplicationCreateParams { type?: ApplicationTypeParam; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { /** * Body param: @@ -18827,7 +15833,7 @@ export type ApplicationUpdateParams = | ApplicationUpdateParams.AppLauncherApplication | ApplicationUpdateParams.DeviceEnrollmentPermissionsApplication | ApplicationUpdateParams.BrowserIsolationPermissionsApplication - | ApplicationUpdateParams.BookmarkApplication + | ApplicationUpdateParams.AccessBookmarkProps | ApplicationUpdateParams.InfrastructureApplication | ApplicationUpdateParams.BrowserRdpApplication; @@ -20355,6 +17361,24 @@ export declare namespace ApplicationUpdateParams { */ bg_color?: string; + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * Body param: The custom pages that will be displayed when applicable for this + * application + */ + custom_pages?: Array; + /** * Body param: The links in the App Launcher footer. */ @@ -20380,12 +17404,6 @@ export declare namespace ApplicationUpdateParams { AppLauncherApplication.AccessAppPolicyLink | string | AppLauncherApplication.UnionMember2 >; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: AppLauncherApplication.SCIMConfig; - /** * Body param: The amount of time that tokens issued for this application will be * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us @@ -20505,108 +17523,142 @@ export declare namespace ApplicationUpdateParams { */ session_duration?: string; } + } + export interface DeviceEnrollmentPermissionsApplication { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * Body param: The application type. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; + type: ApplicationTypeParam; - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; + /** + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. + */ + account_id?: string; - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id?: string; - /** - * Whether SCIM provisioning is turned on for this application. + /** + * Body param: The identity providers your users can select when connecting to this + * application. Defaults to all IdPs configured in your account. + */ + allowed_idps?: Array; + + /** + * Body param: When set to `true`, users skip the identity provider selection step + * during login. You must specify only one identity provider in allowed_idps. + */ + auto_redirect_to_identity?: boolean; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. + */ + custom_deny_url?: string; + + /** + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. + */ + custom_non_identity_deny_url?: string; + + /** + * Body param: The custom pages that will be displayed when applicable for this + * application + */ + custom_pages?: Array; + + /** + * Body param: The policies that Access applies to the application, in ascending + * order of precedence. Items can reference existing policies or create new + * policies exclusive to the application. + */ + policies?: Array< + | DeviceEnrollmentPermissionsApplication.AccessAppPolicyLink + | string + | DeviceEnrollmentPermissionsApplication.UnionMember2 + >; + + /** + * Body param: The amount of time that tokens issued for this application will be + * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us + * (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. + */ + session_duration?: string; + } + + export namespace DeviceEnrollmentPermissionsApplication { + /** + * A JSON that links a reusable policy to an application. + */ + export interface AccessAppPolicyLink { + /** + * The UUID of the policy */ - enabled?: boolean; + id?: string; /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. + * The order of execution for this policy. Must be unique for each policy within an + * app. */ - mappings?: Array; + precedence?: number; } - export namespace SCIMConfig { + export interface UnionMember2 { /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. + * The UUID of the policy */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; + id?: string; - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; + /** + * Administrators who can approve a temporary authentication request. + */ + approval_groups?: Array; - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } + /** + * Requires the user to request access from an administrator at the start of each + * session. + */ + approval_required?: boolean; /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. + * Require this application to be served in an isolated browser for users matching + * this policy. 'Client Web Isolation' must be on for the account in order to use + * this feature. */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; + isolation_required?: boolean; - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; + /** + * The order of execution for this policy. Must be unique for each policy within an + * app. + */ + precedence?: number; - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } + /** + * A custom message that will appear on the purpose justification screen. + */ + purpose_justification_prompt?: string; + + /** + * Require users to enter a justification when they log in to the application. + */ + purpose_justification_required?: boolean; + + /** + * The amount of time that tokens issued for the application will be valid. Must be + * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, + * m, h. + */ + session_duration?: string; } } - export interface DeviceEnrollmentPermissionsApplication { + export interface BrowserIsolationPermissionsApplication { /** * Body param: The application type. */ @@ -20630,11 +17682,6 @@ export declare namespace ApplicationUpdateParams { */ allowed_idps?: Array; - /** - * Body param: The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - /** * Body param: When set to `true`, users skip the identity provider selection step * during login. You must specify only one identity provider in allowed_idps. @@ -20642,25 +17689,22 @@ export declare namespace ApplicationUpdateParams { auto_redirect_to_identity?: boolean; /** - * Body param: The background color of the App Launcher page. - */ - bg_color?: string; - - /** - * Body param: The links in the App Launcher footer. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing identity-based rules. */ - footer_links?: Array; + custom_deny_url?: string; /** - * Body param: The background color of the App Launcher header. + * Body param: The custom URL a user is redirected to when they are denied access + * to the application when failing non-identity rules. */ - header_bg_color?: string; + custom_non_identity_deny_url?: string; /** - * Body param: The design of the App Launcher landing page shown to users when they - * log in. + * Body param: The custom pages that will be displayed when applicable for this + * application */ - landing_page_design?: DeviceEnrollmentPermissionsApplication.LandingPageDesign; + custom_pages?: Array; /** * Body param: The policies that Access applies to the application, in ascending @@ -20668,73 +17712,20 @@ export declare namespace ApplicationUpdateParams { * policies exclusive to the application. */ policies?: Array< - | DeviceEnrollmentPermissionsApplication.AccessAppPolicyLink + | BrowserIsolationPermissionsApplication.AccessAppPolicyLink | string - | DeviceEnrollmentPermissionsApplication.UnionMember2 + | BrowserIsolationPermissionsApplication.UnionMember2 >; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: DeviceEnrollmentPermissionsApplication.SCIMConfig; - /** * Body param: The amount of time that tokens issued for this application will be * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us * (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. */ session_duration?: string; - - /** - * Body param: Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; } - export namespace DeviceEnrollmentPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - + export namespace BrowserIsolationPermissionsApplication { /** * A JSON that links a reusable policy to an application. */ @@ -20798,412 +17789,20 @@ export declare namespace ApplicationUpdateParams { */ session_duration?: string; } + } + export interface AccessBookmarkProps { /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; + account_id?: string; - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BrowserIsolationPermissionsApplication { - /** - * Body param: The application type. - */ - type: ApplicationTypeParam; - - /** - * Path param: The Account ID to use for this endpoint. Mutually exclusive with the - * Zone ID. - */ - account_id?: string; - - /** - * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the - * Account ID. - */ - zone_id?: string; - - /** - * Body param: The identity providers your users can select when connecting to this - * application. Defaults to all IdPs configured in your account. - */ - allowed_idps?: Array; - - /** - * Body param: The image URL of the logo shown in the App Launcher header. - */ - app_launcher_logo_url?: string; - - /** - * Body param: When set to `true`, users skip the identity provider selection step - * during login. You must specify only one identity provider in allowed_idps. - */ - auto_redirect_to_identity?: boolean; - - /** - * Body param: The background color of the App Launcher page. - */ - bg_color?: string; - - /** - * Body param: The links in the App Launcher footer. - */ - footer_links?: Array; - - /** - * Body param: The background color of the App Launcher header. - */ - header_bg_color?: string; - - /** - * Body param: The design of the App Launcher landing page shown to users when they - * log in. - */ - landing_page_design?: BrowserIsolationPermissionsApplication.LandingPageDesign; - - /** - * Body param: The policies that Access applies to the application, in ascending - * order of precedence. Items can reference existing policies or create new - * policies exclusive to the application. - */ - policies?: Array< - | BrowserIsolationPermissionsApplication.AccessAppPolicyLink - | string - | BrowserIsolationPermissionsApplication.UnionMember2 - >; - - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: BrowserIsolationPermissionsApplication.SCIMConfig; - - /** - * Body param: The amount of time that tokens issued for this application will be - * valid. Must be in the format `300ms` or `2h45m`. Valid time units are: ns, us - * (or µs), ms, s, m, h. Note: unsupported for infrastructure type applications. - */ - session_duration?: string; - - /** - * Body param: Determines when to skip the App Launcher landing page. - */ - skip_app_launcher_login_page?: boolean; - } - - export namespace BrowserIsolationPermissionsApplication { - export interface FooterLink { - /** - * The hypertext in the footer link. - */ - name: string; - - /** - * the hyperlink in the footer link. - */ - url: string; - } - - /** - * The design of the App Launcher landing page shown to users when they log in. - */ - export interface LandingPageDesign { - /** - * The background color of the log in button on the landing page. - */ - button_color?: string; - - /** - * The color of the text in the log in button on the landing page. - */ - button_text_color?: string; - - /** - * The URL of the image shown on the landing page. - */ - image_url?: string; - - /** - * The message shown on the landing page. - */ - message?: string; - - /** - * The title shown on the landing page. - */ - title?: string; - } - - /** - * A JSON that links a reusable policy to an application. - */ - export interface AccessAppPolicyLink { - /** - * The UUID of the policy - */ - id?: string; - - /** - * The order of execution for this policy. Must be unique for each policy within an - * app. - */ - precedence?: number; - } - - export interface UnionMember2 { - /** - * The UUID of the policy - */ - id?: string; - - /** - * Administrators who can approve a temporary authentication request. - */ - approval_groups?: Array; - - /** - * Requires the user to request access from an administrator at the start of each - * session. - */ - approval_required?: boolean; - - /** - * Require this application to be served in an isolated browser for users matching - * this policy. 'Client Web Isolation' must be on for the account in order to use - * this feature. - */ - isolation_required?: boolean; - - /** - * The order of execution for this policy. Must be unique for each policy within an - * app. - */ - precedence?: number; - - /** - * A custom message that will appear on the purpose justification screen. - */ - purpose_justification_prompt?: string; - - /** - * Require users to enter a justification when they log in to the application. - */ - purpose_justification_required?: boolean; - - /** - * The amount of time that tokens issued for the application will be valid. Must be - * in the format `300ms` or `2h45m`. Valid time units are: ns, us (or µs), ms, s, - * m, h. - */ - session_duration?: string; - } - - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - - export interface BookmarkApplication { - /** - * Path param: The Account ID to use for this endpoint. Mutually exclusive with the - * Zone ID. - */ - account_id?: string; - - /** - * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the - * Account ID. - */ - zone_id?: string; + /** + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. + */ + zone_id?: string; /** * Body param: Displays the application in the App Launcher. @@ -21225,12 +17824,6 @@ export declare namespace ApplicationUpdateParams { */ name?: string; - /** - * Body param: Configuration for provisioning to this application via SCIM. This is - * currently in closed beta. - */ - scim_config?: BookmarkApplication.SCIMConfig; - /** * Body param: The tags you want assigned to an application. Tags are used to * filter applications in the App Launcher dashboard. @@ -21243,107 +17836,6 @@ export declare namespace ApplicationUpdateParams { type?: ApplicationTypeParam; } - export namespace BookmarkApplication { - /** - * Configuration for provisioning to this application via SCIM. This is currently - * in closed beta. - */ - export interface SCIMConfig { - /** - * The UID of the IdP to use as the source for SCIM resources to provision to this - * application. - */ - idp_uid: string; - - /** - * The base URI for the application's SCIM-compatible API. - */ - remote_uri: string; - - /** - * Attributes for configuring HTTP Basic authentication scheme for SCIM - * provisioning to an application. - */ - authentication?: - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - | Array< - | ApplicationsAPI.SCIMConfigAuthenticationHTTPBasicParam - | ApplicationsAPI.SCIMConfigAuthenticationOAuthBearerTokenParam - | ApplicationsAPI.SCIMConfigAuthenticationOauth2Param - | SCIMConfig.AccessSCIMConfigAuthenticationAccessServiceToken - >; - - /** - * If false, propagates DELETE requests to the target application for SCIM - * resources. If true, sets 'active' to false on the SCIM resource. Note: Some - * targets do not support DELETE operations. - */ - deactivate_on_delete?: boolean; - - /** - * Whether SCIM provisioning is turned on for this application. - */ - enabled?: boolean; - - /** - * A list of mappings to apply to SCIM resources before provisioning them in this - * application. These can transform or filter the resources to be provisioned. - */ - mappings?: Array; - } - - export namespace SCIMConfig { - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - - /** - * Attributes for configuring Access Service Token authentication scheme for SCIM - * provisioning to an application. - */ - export interface AccessSCIMConfigAuthenticationAccessServiceToken { - /** - * Client ID of the Access service token used to authenticate with the remote - * service. - */ - client_id: string; - - /** - * Client secret of the Access service token used to authenticate with the remote - * service. - */ - client_secret: string; - - /** - * The authentication scheme to use when making SCIM requests to this application. - */ - scheme: 'access_service_token'; - } - } - } - export interface InfrastructureApplication { /** * Body param: @@ -21894,7 +18386,7 @@ export declare namespace ApplicationUpdateParams { } } -export interface ApplicationListParams { +export interface ApplicationListParams extends V4PagePaginationArrayParams { /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the * Zone ID. @@ -21970,12 +18462,12 @@ export interface ApplicationRevokeTokensParams { zone_id?: string; } -Applications.ApplicationListResponsesSinglePage = ApplicationListResponsesSinglePage; +Applications.ApplicationListResponsesV4PagePaginationArray = ApplicationListResponsesV4PagePaginationArray; Applications.CAs = CAs; -Applications.CAsSinglePage = CAsSinglePage; +Applications.CAsV4PagePaginationArray = CAsV4PagePaginationArray; Applications.UserPolicyChecks = UserPolicyChecks; Applications.Policies = Policies; -Applications.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage; +Applications.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray; Applications.PolicyTests = PolicyTests; Applications.Settings = Settings; @@ -22006,7 +18498,7 @@ export declare namespace Applications { type ApplicationDeleteResponse as ApplicationDeleteResponse, type ApplicationGetResponse as ApplicationGetResponse, type ApplicationRevokeTokensResponse as ApplicationRevokeTokensResponse, - ApplicationListResponsesSinglePage as ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray as ApplicationListResponsesV4PagePaginationArray, type ApplicationCreateParams as ApplicationCreateParams, type ApplicationUpdateParams as ApplicationUpdateParams, type ApplicationListParams as ApplicationListParams, @@ -22019,7 +18511,7 @@ export declare namespace Applications { CAs as CAs, type CA as CA, type CADeleteResponse as CADeleteResponse, - CAsSinglePage as CAsSinglePage, + CAsV4PagePaginationArray as CAsV4PagePaginationArray, type CACreateParams as CACreateParams, type CAListParams as CAListParams, type CADeleteParams as CADeleteParams, @@ -22060,7 +18552,7 @@ export declare namespace Applications { type PolicyListResponse as PolicyListResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyGetResponse as PolicyGetResponse, - PolicyListResponsesSinglePage as PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray as PolicyListResponsesV4PagePaginationArray, type PolicyCreateParams as PolicyCreateParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyListParams as PolicyListParams, diff --git a/src/resources/zero-trust/access/applications/cas.ts b/src/resources/zero-trust/access/applications/cas.ts index d326cdc71c..dd19ef7854 100644 --- a/src/resources/zero-trust/access/applications/cas.ts +++ b/src/resources/zero-trust/access/applications/cas.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../../resource'; import { isRequestOptions } from '../../../../core'; import * as Core from '../../../../core'; import { CloudflareError } from '../../../../error'; -import { SinglePage } from '../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class CAs extends APIResource { /** @@ -67,16 +67,16 @@ export class CAs extends APIResource { * } * ``` */ - list(params?: CAListParams, options?: Core.RequestOptions): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + list(params?: CAListParams, options?: Core.RequestOptions): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( params: CAListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } - const { account_id, zone_id } = params; + const { account_id, zone_id, ...query } = params; if (!account_id && !zone_id) { throw new CloudflareError('You must provide either account_id or zone_id.'); } @@ -95,8 +95,8 @@ export class CAs extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/apps/ca`, - CAsSinglePage, - options, + CAsV4PagePaginationArray, + { query, ...options }, ); } @@ -199,7 +199,7 @@ export class CAs extends APIResource { } } -export class CAsSinglePage extends SinglePage {} +export class CAsV4PagePaginationArray extends V4PagePaginationArray {} export interface CA { /** @@ -238,14 +238,16 @@ export interface CACreateParams { zone_id?: string; } -export interface CAListParams { +export interface CAListParams extends V4PagePaginationArrayParams { /** - * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. */ account_id?: string; /** - * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. */ zone_id?: string; } @@ -274,13 +276,13 @@ export interface CAGetParams { zone_id?: string; } -CAs.CAsSinglePage = CAsSinglePage; +CAs.CAsV4PagePaginationArray = CAsV4PagePaginationArray; export declare namespace CAs { export { type CA as CA, type CADeleteResponse as CADeleteResponse, - CAsSinglePage as CAsSinglePage, + CAsV4PagePaginationArray as CAsV4PagePaginationArray, type CACreateParams as CACreateParams, type CAListParams as CAListParams, type CADeleteParams as CADeleteParams, diff --git a/src/resources/zero-trust/access/applications/index.ts b/src/resources/zero-trust/access/applications/index.ts index b6f845d14a..e88bd2c2e5 100644 --- a/src/resources/zero-trust/access/applications/index.ts +++ b/src/resources/zero-trust/access/applications/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray, Applications, type AllowedHeaders, type AllowedIdPs, @@ -36,7 +36,7 @@ export { type ApplicationRevokeTokensParams, } from './applications'; export { - CAsSinglePage, + CAsV4PagePaginationArray, CAs, type CA, type CADeleteResponse, @@ -46,7 +46,7 @@ export { type CAGetParams, } from './cas'; export { - PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray, Policies, type AccessDevicePostureRule, type AccessRule, diff --git a/src/resources/zero-trust/access/applications/policies.ts b/src/resources/zero-trust/access/applications/policies.ts index 40bb6d497e..679bbbb4b2 100644 --- a/src/resources/zero-trust/access/applications/policies.ts +++ b/src/resources/zero-trust/access/applications/policies.ts @@ -6,7 +6,7 @@ import * as Core from '../../../../core'; import * as PoliciesAPI from '../policies'; import * as ApplicationsAPI from './applications'; import { CloudflareError } from '../../../../error'; -import { SinglePage } from '../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Policies extends APIResource { /** @@ -118,20 +118,20 @@ export class Policies extends APIResource { appId: string, params?: PolicyListParams, options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( appId: string, options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( appId: string, params: PolicyListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list(appId, {}, params); } - const { account_id, zone_id } = params; + const { account_id, zone_id, ...query } = params; if (!account_id && !zone_id) { throw new CloudflareError('You must provide either account_id or zone_id.'); } @@ -150,8 +150,8 @@ export class Policies extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/apps/${appId}/policies`, - PolicyListResponsesSinglePage, - options, + PolicyListResponsesV4PagePaginationArray, + { query, ...options }, ); } @@ -270,7 +270,7 @@ export class Policies extends APIResource { } } -export class PolicyListResponsesSinglePage extends SinglePage {} +export class PolicyListResponsesV4PagePaginationArray extends V4PagePaginationArray {} /** * Enforces a device posture rule has run successfully @@ -1669,14 +1669,16 @@ export interface PolicyUpdateParams { session_duration?: string; } -export interface PolicyListParams { +export interface PolicyListParams extends V4PagePaginationArrayParams { /** - * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. */ account_id?: string; /** - * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. */ zone_id?: string; } @@ -1705,7 +1707,7 @@ export interface PolicyGetParams { zone_id?: string; } -Policies.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage; +Policies.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray; export declare namespace Policies { export { @@ -1734,7 +1736,7 @@ export declare namespace Policies { type PolicyListResponse as PolicyListResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyGetResponse as PolicyGetResponse, - PolicyListResponsesSinglePage as PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray as PolicyListResponsesV4PagePaginationArray, type PolicyCreateParams as PolicyCreateParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyListParams as PolicyListParams, diff --git a/src/resources/zero-trust/access/certificates/certificates.ts b/src/resources/zero-trust/access/certificates/certificates.ts index b48af01936..47e03ff94b 100644 --- a/src/resources/zero-trust/access/certificates/certificates.ts +++ b/src/resources/zero-trust/access/certificates/certificates.ts @@ -12,7 +12,7 @@ import { Settings, } from './settings'; import { CloudflareError } from '../../../../error'; -import { SinglePage } from '../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Certificates extends APIResource { settings: SettingsAPI.Settings = new SettingsAPI.Settings(this._client); @@ -118,16 +118,16 @@ export class Certificates extends APIResource { list( params?: CertificateListParams, options?: Core.RequestOptions, - ): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( params: CertificateListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } - const { account_id, zone_id } = params; + const { account_id, zone_id, ...query } = params; if (!account_id && !zone_id) { throw new CloudflareError('You must provide either account_id or zone_id.'); } @@ -146,8 +146,8 @@ export class Certificates extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/certificates`, - CertificatesSinglePage, - options, + CertificatesV4PagePaginationArray, + { query, ...options }, ); } @@ -254,7 +254,7 @@ export class Certificates extends APIResource { } } -export class CertificatesSinglePage extends SinglePage {} +export class CertificatesV4PagePaginationArray extends V4PagePaginationArray {} /** * A fully-qualified domain name (FQDN). @@ -354,14 +354,16 @@ export interface CertificateUpdateParams { name?: string; } -export interface CertificateListParams { +export interface CertificateListParams extends V4PagePaginationArrayParams { /** - * The Account ID to use for this endpoint. Mutually exclusive with the Zone ID. + * Path param: The Account ID to use for this endpoint. Mutually exclusive with the + * Zone ID. */ account_id?: string; /** - * The Zone ID to use for this endpoint. Mutually exclusive with the Account ID. + * Path param: The Zone ID to use for this endpoint. Mutually exclusive with the + * Account ID. */ zone_id?: string; } @@ -390,7 +392,7 @@ export interface CertificateGetParams { zone_id?: string; } -Certificates.CertificatesSinglePage = CertificatesSinglePage; +Certificates.CertificatesV4PagePaginationArray = CertificatesV4PagePaginationArray; Certificates.Settings = Settings; Certificates.CertificateSettingsSinglePage = CertificateSettingsSinglePage; @@ -399,7 +401,7 @@ export declare namespace Certificates { type AssociatedHostnames as AssociatedHostnames, type Certificate as Certificate, type CertificateDeleteResponse as CertificateDeleteResponse, - CertificatesSinglePage as CertificatesSinglePage, + CertificatesV4PagePaginationArray as CertificatesV4PagePaginationArray, type CertificateCreateParams as CertificateCreateParams, type CertificateUpdateParams as CertificateUpdateParams, type CertificateListParams as CertificateListParams, diff --git a/src/resources/zero-trust/access/certificates/index.ts b/src/resources/zero-trust/access/certificates/index.ts index 9535a990ee..1eddc4eb6c 100644 --- a/src/resources/zero-trust/access/certificates/index.ts +++ b/src/resources/zero-trust/access/certificates/index.ts @@ -8,7 +8,7 @@ export { type SettingGetParams, } from './settings'; export { - CertificatesSinglePage, + CertificatesV4PagePaginationArray, Certificates, type AssociatedHostnames, type Certificate, diff --git a/src/resources/zero-trust/access/custom-pages.ts b/src/resources/zero-trust/access/custom-pages.ts index 4535110f34..4f8d2c232f 100644 --- a/src/resources/zero-trust/access/custom-pages.ts +++ b/src/resources/zero-trust/access/custom-pages.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class CustomPages extends APIResource { /** @@ -81,12 +81,12 @@ export class CustomPages extends APIResource { list( params: CustomPageListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; + ): Core.PagePromise { + const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/access/custom_pages`, - CustomPageWithoutHTMLsSinglePage, - options, + CustomPageWithoutHTMLsV4PagePaginationArray, + { query, ...options }, ); } @@ -143,7 +143,7 @@ export class CustomPages extends APIResource { } } -export class CustomPageWithoutHTMLsSinglePage extends SinglePage {} +export class CustomPageWithoutHTMLsV4PagePaginationArray extends V4PagePaginationArray {} export interface CustomPage { /** @@ -263,9 +263,9 @@ export interface CustomPageUpdateParams { app_count?: number; } -export interface CustomPageListParams { +export interface CustomPageListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; } @@ -284,14 +284,14 @@ export interface CustomPageGetParams { account_id: string; } -CustomPages.CustomPageWithoutHTMLsSinglePage = CustomPageWithoutHTMLsSinglePage; +CustomPages.CustomPageWithoutHTMLsV4PagePaginationArray = CustomPageWithoutHTMLsV4PagePaginationArray; export declare namespace CustomPages { export { type CustomPage as CustomPage, type CustomPageWithoutHTML as CustomPageWithoutHTML, type CustomPageDeleteResponse as CustomPageDeleteResponse, - CustomPageWithoutHTMLsSinglePage as CustomPageWithoutHTMLsSinglePage, + CustomPageWithoutHTMLsV4PagePaginationArray as CustomPageWithoutHTMLsV4PagePaginationArray, type CustomPageCreateParams as CustomPageCreateParams, type CustomPageUpdateParams as CustomPageUpdateParams, type CustomPageListParams as CustomPageListParams, diff --git a/src/resources/zero-trust/access/groups.ts b/src/resources/zero-trust/access/groups.ts index fa7ab4bcdd..e224772541 100644 --- a/src/resources/zero-trust/access/groups.ts +++ b/src/resources/zero-trust/access/groups.ts @@ -5,7 +5,7 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import * as PoliciesAPI from './applications/policies'; import { CloudflareError } from '../../../error'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Groups extends APIResource { /** @@ -117,12 +117,14 @@ export class Groups extends APIResource { list( params?: GroupListParams, options?: Core.RequestOptions, - ): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + ): Core.PagePromise; + list( + options?: Core.RequestOptions, + ): Core.PagePromise; list( params: GroupListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -145,7 +147,7 @@ export class Groups extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/groups`, - GroupListResponsesSinglePage, + GroupListResponsesV4PagePaginationArray, { query, ...options }, ); } @@ -251,9 +253,9 @@ export class Groups extends APIResource { } } -export class GroupListResponsesSinglePage extends SinglePage {} +export class GroupListResponsesV4PagePaginationArray extends V4PagePaginationArray {} -export class ZeroTrustGroupsSinglePage extends SinglePage {} +export class ZeroTrustGroupsV4PagePaginationArray extends V4PagePaginationArray {} export interface ZeroTrustGroup { /** @@ -550,7 +552,7 @@ export interface GroupUpdateParams { require?: Array; } -export interface GroupListParams { +export interface GroupListParams extends V4PagePaginationArrayParams { /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the * Zone ID. @@ -598,7 +600,7 @@ export interface GroupGetParams { zone_id?: string; } -Groups.GroupListResponsesSinglePage = GroupListResponsesSinglePage; +Groups.GroupListResponsesV4PagePaginationArray = GroupListResponsesV4PagePaginationArray; export declare namespace Groups { export { @@ -608,7 +610,7 @@ export declare namespace Groups { type GroupListResponse as GroupListResponse, type GroupDeleteResponse as GroupDeleteResponse, type GroupGetResponse as GroupGetResponse, - GroupListResponsesSinglePage as GroupListResponsesSinglePage, + GroupListResponsesV4PagePaginationArray as GroupListResponsesV4PagePaginationArray, type GroupCreateParams as GroupCreateParams, type GroupUpdateParams as GroupUpdateParams, type GroupListParams as GroupListParams, diff --git a/src/resources/zero-trust/access/index.ts b/src/resources/zero-trust/access/index.ts index d8a643ef19..52ccef53ba 100644 --- a/src/resources/zero-trust/access/index.ts +++ b/src/resources/zero-trust/access/index.ts @@ -2,15 +2,15 @@ export { Access } from './access'; export { - AccessUsersSinglePage, - UserListResponsesSinglePage, + AccessUsersV4PagePaginationArray, + UserListResponsesV4PagePaginationArray, Users, type AccessUser, type UserListResponse, type UserListParams, } from './users/index'; export { - ApplicationListResponsesSinglePage, + ApplicationListResponsesV4PagePaginationArray, Applications, type AllowedHeaders, type AllowedIdPs, @@ -56,7 +56,7 @@ export { type BookmarkGetParams, } from './bookmarks'; export { - CertificatesSinglePage, + CertificatesV4PagePaginationArray, Certificates, type AssociatedHostnames, type Certificate, @@ -68,7 +68,7 @@ export { type CertificateGetParams, } from './certificates/index'; export { - CustomPageWithoutHTMLsSinglePage, + CustomPageWithoutHTMLsV4PagePaginationArray, CustomPages, type CustomPage, type CustomPageWithoutHTML, @@ -101,7 +101,7 @@ export { } from './keys'; export { Logs } from './logs/index'; export { - PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray, Policies, type ApprovalGroup, type Policy, @@ -117,7 +117,7 @@ export { type PolicyGetParams, } from './policies'; export { - ServiceTokensSinglePage, + ServiceTokensV4PagePaginationArray, ServiceTokens, type ServiceToken, type ServiceTokenCreateResponse, @@ -131,7 +131,7 @@ export { type ServiceTokenRotateParams, } from './service-tokens'; export { - TagsSinglePage, + TagsV4PagePaginationArray, Tags, type Tag, type TagDeleteResponse, @@ -142,8 +142,8 @@ export { type TagGetParams, } from './tags'; export { - ZeroTrustGroupsSinglePage, - GroupListResponsesSinglePage, + ZeroTrustGroupsV4PagePaginationArray, + GroupListResponsesV4PagePaginationArray, Groups, type ZeroTrustGroup, type GroupCreateResponse, diff --git a/src/resources/zero-trust/access/logs/access-requests.ts b/src/resources/zero-trust/access/logs/access-requests.ts index df4320c80c..eb75000b09 100644 --- a/src/resources/zero-trust/access/logs/access-requests.ts +++ b/src/resources/zero-trust/access/logs/access-requests.ts @@ -48,6 +48,16 @@ export interface AccessRequestListParams { */ limit?: number; + /** + * Query param: Page number of results. + */ + page?: number; + + /** + * Query param: Number of results per page. + */ + per_page?: number; + /** * Query param: The earliest event timestamp to query. */ diff --git a/src/resources/zero-trust/access/logs/scim/index.ts b/src/resources/zero-trust/access/logs/scim/index.ts index 5655374211..877d415771 100644 --- a/src/resources/zero-trust/access/logs/scim/index.ts +++ b/src/resources/zero-trust/access/logs/scim/index.ts @@ -2,7 +2,7 @@ export { SCIM, type AccessRequest } from './scim'; export { - UpdateListResponsesSinglePage, + UpdateListResponsesV4PagePaginationArray, Updates, type UpdateListResponse, type UpdateListParams, diff --git a/src/resources/zero-trust/access/logs/scim/scim.ts b/src/resources/zero-trust/access/logs/scim/scim.ts index 68650a8fcd..cb7f3f88b6 100644 --- a/src/resources/zero-trust/access/logs/scim/scim.ts +++ b/src/resources/zero-trust/access/logs/scim/scim.ts @@ -2,7 +2,12 @@ import { APIResource } from '../../../../../resource'; import * as UpdatesAPI from './updates'; -import { UpdateListParams, UpdateListResponse, UpdateListResponsesSinglePage, Updates } from './updates'; +import { + UpdateListParams, + UpdateListResponse, + UpdateListResponsesV4PagePaginationArray, + Updates, +} from './updates'; export class SCIM extends APIResource { updates: UpdatesAPI.Updates = new UpdatesAPI.Updates(this._client); @@ -53,7 +58,7 @@ export interface AccessRequest { } SCIM.Updates = Updates; -SCIM.UpdateListResponsesSinglePage = UpdateListResponsesSinglePage; +SCIM.UpdateListResponsesV4PagePaginationArray = UpdateListResponsesV4PagePaginationArray; export declare namespace SCIM { export { type AccessRequest as AccessRequest }; @@ -61,7 +66,7 @@ export declare namespace SCIM { export { Updates as Updates, type UpdateListResponse as UpdateListResponse, - UpdateListResponsesSinglePage as UpdateListResponsesSinglePage, + UpdateListResponsesV4PagePaginationArray as UpdateListResponsesV4PagePaginationArray, type UpdateListParams as UpdateListParams, }; } diff --git a/src/resources/zero-trust/access/logs/scim/updates.ts b/src/resources/zero-trust/access/logs/scim/updates.ts index b65b7d4d40..1f81ddc56e 100644 --- a/src/resources/zero-trust/access/logs/scim/updates.ts +++ b/src/resources/zero-trust/access/logs/scim/updates.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../../resource'; import * as Core from '../../../../../core'; -import { SinglePage } from '../../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../../pagination'; export class Updates extends APIResource { /** @@ -29,17 +29,17 @@ export class Updates extends APIResource { list( params: UpdateListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/access/logs/scim/updates`, - UpdateListResponsesSinglePage, + UpdateListResponsesV4PagePaginationArray, { query, ...options }, ); } } -export class UpdateListResponsesSinglePage extends SinglePage {} +export class UpdateListResponsesV4PagePaginationArray extends V4PagePaginationArray {} export interface UpdateListResponse { /** @@ -96,7 +96,7 @@ export interface UpdateListResponse { status?: string; } -export interface UpdateListParams { +export interface UpdateListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ @@ -163,12 +163,12 @@ export interface UpdateListParams { until?: string; } -Updates.UpdateListResponsesSinglePage = UpdateListResponsesSinglePage; +Updates.UpdateListResponsesV4PagePaginationArray = UpdateListResponsesV4PagePaginationArray; export declare namespace Updates { export { type UpdateListResponse as UpdateListResponse, - UpdateListResponsesSinglePage as UpdateListResponsesSinglePage, + UpdateListResponsesV4PagePaginationArray as UpdateListResponsesV4PagePaginationArray, type UpdateListParams as UpdateListParams, }; } diff --git a/src/resources/zero-trust/access/policies.ts b/src/resources/zero-trust/access/policies.ts index 75f383f75a..2f2bdc7e5e 100644 --- a/src/resources/zero-trust/access/policies.ts +++ b/src/resources/zero-trust/access/policies.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; import * as ApplicationsAPI from './applications/applications'; import * as ApplicationsPoliciesAPI from './applications/policies'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Policies extends APIResource { /** @@ -89,12 +89,12 @@ export class Policies extends APIResource { list( params: PolicyListParams, options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params; + ): Core.PagePromise { + const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/access/policies`, - PolicyListResponsesSinglePage, - options, + PolicyListResponsesV4PagePaginationArray, + { query, ...options }, ); } @@ -148,7 +148,7 @@ export class Policies extends APIResource { } } -export class PolicyListResponsesSinglePage extends SinglePage {} +export class PolicyListResponsesV4PagePaginationArray extends V4PagePaginationArray {} /** * A group of email addresses that can approve a temporary authentication request. @@ -764,9 +764,9 @@ export interface PolicyUpdateParams { session_duration?: string; } -export interface PolicyListParams { +export interface PolicyListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; } @@ -785,7 +785,7 @@ export interface PolicyGetParams { account_id: string; } -Policies.PolicyListResponsesSinglePage = PolicyListResponsesSinglePage; +Policies.PolicyListResponsesV4PagePaginationArray = PolicyListResponsesV4PagePaginationArray; export declare namespace Policies { export { @@ -796,7 +796,7 @@ export declare namespace Policies { type PolicyListResponse as PolicyListResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyGetResponse as PolicyGetResponse, - PolicyListResponsesSinglePage as PolicyListResponsesSinglePage, + PolicyListResponsesV4PagePaginationArray as PolicyListResponsesV4PagePaginationArray, type PolicyCreateParams as PolicyCreateParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyListParams as PolicyListParams, diff --git a/src/resources/zero-trust/access/service-tokens.ts b/src/resources/zero-trust/access/service-tokens.ts index 5ec9861f54..85ec54641a 100644 --- a/src/resources/zero-trust/access/service-tokens.ts +++ b/src/resources/zero-trust/access/service-tokens.ts @@ -4,7 +4,7 @@ import { APIResource } from '../../../resource'; import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; import { CloudflareError } from '../../../error'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class ServiceTokens extends APIResource { /** @@ -108,12 +108,12 @@ export class ServiceTokens extends APIResource { list( params?: ServiceTokenListParams, options?: Core.RequestOptions, - ): Core.PagePromise; - list(options?: Core.RequestOptions): Core.PagePromise; + ): Core.PagePromise; + list(options?: Core.RequestOptions): Core.PagePromise; list( params: ServiceTokenListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -136,7 +136,7 @@ export class ServiceTokens extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/service_tokens`, - ServiceTokensSinglePage, + ServiceTokensV4PagePaginationArray, { query, ...options }, ); } @@ -296,7 +296,7 @@ export class ServiceTokens extends APIResource { } } -export class ServiceTokensSinglePage extends SinglePage {} +export class ServiceTokensV4PagePaginationArray extends V4PagePaginationArray {} export interface ServiceToken { /** @@ -453,7 +453,7 @@ export interface ServiceTokenUpdateParams { name?: string; } -export interface ServiceTokenListParams { +export interface ServiceTokenListParams extends V4PagePaginationArrayParams { /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the * Zone ID. @@ -515,14 +515,14 @@ export interface ServiceTokenRotateParams { account_id: string; } -ServiceTokens.ServiceTokensSinglePage = ServiceTokensSinglePage; +ServiceTokens.ServiceTokensV4PagePaginationArray = ServiceTokensV4PagePaginationArray; export declare namespace ServiceTokens { export { type ServiceToken as ServiceToken, type ServiceTokenCreateResponse as ServiceTokenCreateResponse, type ServiceTokenRotateResponse as ServiceTokenRotateResponse, - ServiceTokensSinglePage as ServiceTokensSinglePage, + ServiceTokensV4PagePaginationArray as ServiceTokensV4PagePaginationArray, type ServiceTokenCreateParams as ServiceTokenCreateParams, type ServiceTokenUpdateParams as ServiceTokenUpdateParams, type ServiceTokenListParams as ServiceTokenListParams, diff --git a/src/resources/zero-trust/access/tags.ts b/src/resources/zero-trust/access/tags.ts index debbc67f59..87e1ca984b 100644 --- a/src/resources/zero-trust/access/tags.ts +++ b/src/resources/zero-trust/access/tags.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class Tags extends APIResource { /** @@ -61,9 +61,15 @@ export class Tags extends APIResource { * } * ``` */ - list(params: TagListParams, options?: Core.RequestOptions): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/access/tags`, TagsSinglePage, options); + list( + params: TagListParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id, ...query } = params; + return this._client.getAPIList(`/accounts/${account_id}/access/tags`, TagsV4PagePaginationArray, { + query, + ...options, + }); } /** @@ -111,7 +117,7 @@ export class Tags extends APIResource { } } -export class TagsSinglePage extends SinglePage {} +export class TagsV4PagePaginationArray extends V4PagePaginationArray {} /** * A tag @@ -163,9 +169,9 @@ export interface TagUpdateParams { name: string; } -export interface TagListParams { +export interface TagListParams extends V4PagePaginationArrayParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; } @@ -184,13 +190,13 @@ export interface TagGetParams { account_id: string; } -Tags.TagsSinglePage = TagsSinglePage; +Tags.TagsV4PagePaginationArray = TagsV4PagePaginationArray; export declare namespace Tags { export { type Tag as Tag, type TagDeleteResponse as TagDeleteResponse, - TagsSinglePage as TagsSinglePage, + TagsV4PagePaginationArray as TagsV4PagePaginationArray, type TagCreateParams as TagCreateParams, type TagUpdateParams as TagUpdateParams, type TagListParams as TagListParams, diff --git a/src/resources/zero-trust/access/users/index.ts b/src/resources/zero-trust/access/users/index.ts index 4782e06a39..dd9172844b 100644 --- a/src/resources/zero-trust/access/users/index.ts +++ b/src/resources/zero-trust/access/users/index.ts @@ -1,8 +1,8 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - AccessUsersSinglePage, - UserListResponsesSinglePage, + AccessUsersV4PagePaginationArray, + UserListResponsesV4PagePaginationArray, Users, type AccessUser, type UserListResponse, diff --git a/src/resources/zero-trust/access/users/users.ts b/src/resources/zero-trust/access/users/users.ts index 05795ccba4..7117fd26df 100644 --- a/src/resources/zero-trust/access/users/users.ts +++ b/src/resources/zero-trust/access/users/users.ts @@ -20,7 +20,7 @@ import { } from './failed-logins'; import * as LastSeenIdentityAPI from './last-seen-identity'; import { Identity, LastSeenIdentity, LastSeenIdentityGetParams } from './last-seen-identity'; -import { SinglePage } from '../../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../../pagination'; export class Users extends APIResource { activeSessions: ActiveSessionsAPI.ActiveSessions = new ActiveSessionsAPI.ActiveSessions(this._client); @@ -45,18 +45,19 @@ export class Users extends APIResource { list( params: UserListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; - return this._client.getAPIList(`/accounts/${account_id}/access/users`, UserListResponsesSinglePage, { - query, - ...options, - }); + return this._client.getAPIList( + `/accounts/${account_id}/access/users`, + UserListResponsesV4PagePaginationArray, + { query, ...options }, + ); } } -export class UserListResponsesSinglePage extends SinglePage {} +export class UserListResponsesV4PagePaginationArray extends V4PagePaginationArray {} -export class AccessUsersSinglePage extends SinglePage {} +export class AccessUsersV4PagePaginationArray extends V4PagePaginationArray {} export interface AccessUser { /** @@ -178,7 +179,7 @@ export interface UserListResponse { updated_at?: string; } -export interface UserListParams { +export interface UserListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ @@ -200,7 +201,7 @@ export interface UserListParams { search?: string; } -Users.UserListResponsesSinglePage = UserListResponsesSinglePage; +Users.UserListResponsesV4PagePaginationArray = UserListResponsesV4PagePaginationArray; Users.ActiveSessions = ActiveSessions; Users.ActiveSessionListResponsesSinglePage = ActiveSessionListResponsesSinglePage; Users.LastSeenIdentity = LastSeenIdentity; @@ -211,7 +212,7 @@ export declare namespace Users { export { type AccessUser as AccessUser, type UserListResponse as UserListResponse, - UserListResponsesSinglePage as UserListResponsesSinglePage, + UserListResponsesV4PagePaginationArray as UserListResponsesV4PagePaginationArray, type UserListParams as UserListParams, }; diff --git a/src/resources/zero-trust/identity-providers/identity-providers.ts b/src/resources/zero-trust/identity-providers/identity-providers.ts index 40539cd025..b2ee02a43d 100644 --- a/src/resources/zero-trust/identity-providers/identity-providers.ts +++ b/src/resources/zero-trust/identity-providers/identity-providers.ts @@ -7,7 +7,7 @@ import * as IdentityProvidersAPI from './identity-providers'; import * as SCIMAPI from './scim/scim'; import { SCIM } from './scim/scim'; import { CloudflareError } from '../../../error'; -import { SinglePage } from '../../../pagination'; +import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination'; export class IdentityProviders extends APIResource { scim: SCIMAPI.SCIM = new SCIMAPI.SCIM(this._client); @@ -118,14 +118,14 @@ export class IdentityProviders extends APIResource { list( params?: IdentityProviderListParams, options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( options?: Core.RequestOptions, - ): Core.PagePromise; + ): Core.PagePromise; list( params: IdentityProviderListParams | Core.RequestOptions = {}, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { if (isRequestOptions(params)) { return this.list({}, params); } @@ -148,7 +148,7 @@ export class IdentityProviders extends APIResource { }; return this._client.getAPIList( `/${accountOrZone}/${accountOrZoneId}/access/identity_providers`, - IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray, { query, ...options }, ); } @@ -259,7 +259,7 @@ export class IdentityProviders extends APIResource { } } -export class IdentityProviderListResponsesSinglePage extends SinglePage {} +export class IdentityProviderListResponsesV4PagePaginationArray extends V4PagePaginationArray {} export interface AzureAD { /** @@ -4689,7 +4689,7 @@ export declare namespace IdentityProviderUpdateParams { } } -export interface IdentityProviderListParams { +export interface IdentityProviderListParams extends V4PagePaginationArrayParams { /** * Path param: The Account ID to use for this endpoint. Mutually exclusive with the * Zone ID. @@ -4733,7 +4733,8 @@ export interface IdentityProviderGetParams { zone_id?: string; } -IdentityProviders.IdentityProviderListResponsesSinglePage = IdentityProviderListResponsesSinglePage; +IdentityProviders.IdentityProviderListResponsesV4PagePaginationArray = + IdentityProviderListResponsesV4PagePaginationArray; IdentityProviders.SCIM = SCIM; export declare namespace IdentityProviders { @@ -4745,7 +4746,7 @@ export declare namespace IdentityProviders { type IdentityProviderType as IdentityProviderType, type IdentityProviderListResponse as IdentityProviderListResponse, type IdentityProviderDeleteResponse as IdentityProviderDeleteResponse, - IdentityProviderListResponsesSinglePage as IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray as IdentityProviderListResponsesV4PagePaginationArray, type IdentityProviderCreateParams as IdentityProviderCreateParams, type IdentityProviderUpdateParams as IdentityProviderUpdateParams, type IdentityProviderListParams as IdentityProviderListParams, diff --git a/src/resources/zero-trust/identity-providers/index.ts b/src/resources/zero-trust/identity-providers/index.ts index 21b7d4eafa..a254a5fb78 100644 --- a/src/resources/zero-trust/identity-providers/index.ts +++ b/src/resources/zero-trust/identity-providers/index.ts @@ -1,7 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { - IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray, IdentityProviders, type AzureAD, type GenericOAuthConfig, diff --git a/src/resources/zero-trust/identity-providers/scim/groups.ts b/src/resources/zero-trust/identity-providers/scim/groups.ts index c861306ce9..0f16eab6f7 100644 --- a/src/resources/zero-trust/identity-providers/scim/groups.ts +++ b/src/resources/zero-trust/identity-providers/scim/groups.ts @@ -3,7 +3,8 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as GroupsAPI from '../../access/groups'; -import { ZeroTrustGroupsSinglePage } from '../../access/groups'; +import { ZeroTrustGroupsV4PagePaginationArray } from '../../access/groups'; +import { type V4PagePaginationArrayParams } from '../../../../pagination'; export class Groups extends APIResource { /** @@ -25,17 +26,17 @@ export class Groups extends APIResource { identityProviderId: string, params: GroupListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/access/identity_providers/${identityProviderId}/scim/groups`, - ZeroTrustGroupsSinglePage, + ZeroTrustGroupsV4PagePaginationArray, { query, ...options }, ); } } -export interface GroupListParams { +export interface GroupListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ @@ -63,4 +64,4 @@ export declare namespace Groups { export { type GroupListParams as GroupListParams }; } -export { ZeroTrustGroupsSinglePage }; +export { ZeroTrustGroupsV4PagePaginationArray }; diff --git a/src/resources/zero-trust/identity-providers/scim/users.ts b/src/resources/zero-trust/identity-providers/scim/users.ts index d707d24bf3..76823e4d45 100644 --- a/src/resources/zero-trust/identity-providers/scim/users.ts +++ b/src/resources/zero-trust/identity-providers/scim/users.ts @@ -3,7 +3,8 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as UsersAPI from '../../access/users/users'; -import { AccessUsersSinglePage } from '../../access/users/users'; +import { AccessUsersV4PagePaginationArray } from '../../access/users/users'; +import { type V4PagePaginationArrayParams } from '../../../../pagination'; export class Users extends APIResource { /** @@ -25,17 +26,17 @@ export class Users extends APIResource { identityProviderId: string, params: UserListParams, options?: Core.RequestOptions, - ): Core.PagePromise { + ): Core.PagePromise { const { account_id, ...query } = params; return this._client.getAPIList( `/accounts/${account_id}/access/identity_providers/${identityProviderId}/scim/users`, - AccessUsersSinglePage, + AccessUsersV4PagePaginationArray, { query, ...options }, ); } } -export interface UserListParams { +export interface UserListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ @@ -73,4 +74,4 @@ export declare namespace Users { export { type UserListParams as UserListParams }; } -export { AccessUsersSinglePage }; +export { AccessUsersV4PagePaginationArray }; diff --git a/src/resources/zero-trust/index.ts b/src/resources/zero-trust/index.ts index 44ddba5326..4c4c69ca79 100644 --- a/src/resources/zero-trust/index.ts +++ b/src/resources/zero-trust/index.ts @@ -32,7 +32,7 @@ export { type GatewayListParams, } from './gateway/index'; export { - IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray, IdentityProviders, type AzureAD, type GenericOAuthConfig, diff --git a/src/resources/zero-trust/zero-trust.ts b/src/resources/zero-trust/zero-trust.ts index 8f9551aee7..fd2a007279 100644 --- a/src/resources/zero-trust/zero-trust.ts +++ b/src/resources/zero-trust/zero-trust.ts @@ -45,7 +45,7 @@ import { IdentityProviderGetParams, IdentityProviderListParams, IdentityProviderListResponse, - IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray, IdentityProviderSCIMConfig, IdentityProviderType, IdentityProviderUpdateParams, @@ -102,7 +102,8 @@ export class ZeroTrust extends APIResource { ZeroTrust.Devices = Devices; ZeroTrust.DevicesSinglePage = DevicesSinglePage; ZeroTrust.IdentityProviders = IdentityProviders; -ZeroTrust.IdentityProviderListResponsesSinglePage = IdentityProviderListResponsesSinglePage; +ZeroTrust.IdentityProviderListResponsesV4PagePaginationArray = + IdentityProviderListResponsesV4PagePaginationArray; ZeroTrust.Organizations = Organizations; ZeroTrust.Seats = Seats; ZeroTrust.SeatsSinglePage = SeatsSinglePage; @@ -135,7 +136,7 @@ export declare namespace ZeroTrust { type IdentityProviderType as IdentityProviderType, type IdentityProviderListResponse as IdentityProviderListResponse, type IdentityProviderDeleteResponse as IdentityProviderDeleteResponse, - IdentityProviderListResponsesSinglePage as IdentityProviderListResponsesSinglePage, + IdentityProviderListResponsesV4PagePaginationArray as IdentityProviderListResponsesV4PagePaginationArray, type IdentityProviderCreateParams as IdentityProviderCreateParams, type IdentityProviderUpdateParams as IdentityProviderUpdateParams, type IdentityProviderListParams as IdentityProviderListParams, diff --git a/tests/api-resources/zero-trust/access/custom-pages.test.ts b/tests/api-resources/zero-trust/access/custom-pages.test.ts index 96f2d36db4..81cbcc7f80 100644 --- a/tests/api-resources/zero-trust/access/custom-pages.test.ts +++ b/tests/api-resources/zero-trust/access/custom-pages.test.ts @@ -84,6 +84,8 @@ describe('resource customPages', () => { test('list: required and optional params', async () => { const response = await client.zeroTrust.access.customPages.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 0, + per_page: 0, }); }); diff --git a/tests/api-resources/zero-trust/access/logs/access-requests.test.ts b/tests/api-resources/zero-trust/access/logs/access-requests.test.ts index e7543bfc33..e939ee60e6 100644 --- a/tests/api-resources/zero-trust/access/logs/access-requests.test.ts +++ b/tests/api-resources/zero-trust/access/logs/access-requests.test.ts @@ -28,6 +28,8 @@ describe('resource accessRequests', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', direction: 'desc', limit: 0, + page: 0, + per_page: 0, since: '2020-07-01T05:20:00Z', until: '2020-10-01T05:20:00Z', }); diff --git a/tests/api-resources/zero-trust/access/logs/scim/updates.test.ts b/tests/api-resources/zero-trust/access/logs/scim/updates.test.ts index 9845417f67..65d7fd22cb 100644 --- a/tests/api-resources/zero-trust/access/logs/scim/updates.test.ts +++ b/tests/api-resources/zero-trust/access/logs/scim/updates.test.ts @@ -32,6 +32,8 @@ describe('resource updates', () => { direction: 'desc', idp_resource_id: 'idp_resource_id', limit: 10, + page: 0, + per_page: 0, request_method: ['DELETE', 'PATCH'], resource_group_name: 'ALL_EMPLOYEES', resource_type: ['USER', 'GROUP'], diff --git a/tests/api-resources/zero-trust/access/policies.test.ts b/tests/api-resources/zero-trust/access/policies.test.ts index f6ed1c6ab8..c798dd34ac 100644 --- a/tests/api-resources/zero-trust/access/policies.test.ts +++ b/tests/api-resources/zero-trust/access/policies.test.ts @@ -114,6 +114,8 @@ describe('resource policies', () => { test('list: required and optional params', async () => { const response = await client.zeroTrust.access.policies.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 0, + per_page: 0, }); }); diff --git a/tests/api-resources/zero-trust/access/tags.test.ts b/tests/api-resources/zero-trust/access/tags.test.ts index e39c23a0fe..8a05d324e8 100644 --- a/tests/api-resources/zero-trust/access/tags.test.ts +++ b/tests/api-resources/zero-trust/access/tags.test.ts @@ -67,6 +67,8 @@ describe('resource tags', () => { test('list: required and optional params', async () => { const response = await client.zeroTrust.access.tags.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353', + page: 0, + per_page: 0, }); }); diff --git a/tests/api-resources/zero-trust/access/users/users.test.ts b/tests/api-resources/zero-trust/access/users/users.test.ts index 994dff9d57..5a4a4c34f7 100644 --- a/tests/api-resources/zero-trust/access/users/users.test.ts +++ b/tests/api-resources/zero-trust/access/users/users.test.ts @@ -28,6 +28,8 @@ describe('resource users', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', email: 'email', name: 'name', + page: 0, + per_page: 0, search: 'search', }); }); diff --git a/tests/api-resources/zero-trust/identity-providers/scim/groups.test.ts b/tests/api-resources/zero-trust/identity-providers/scim/groups.test.ts index c9379309c4..729ee4f9f7 100644 --- a/tests/api-resources/zero-trust/identity-providers/scim/groups.test.ts +++ b/tests/api-resources/zero-trust/identity-providers/scim/groups.test.ts @@ -32,6 +32,8 @@ describe('resource groups', () => { cf_resource_id: 'a2abeb50-59c9-4c01-8c5c-963d3bf5700f', idp_resource_id: 'all_employees', name: 'ALL_EMPLOYEES', + page: 0, + per_page: 0, }, ); }); diff --git a/tests/api-resources/zero-trust/identity-providers/scim/users.test.ts b/tests/api-resources/zero-trust/identity-providers/scim/users.test.ts index f1ee5e2548..8604ee14e8 100644 --- a/tests/api-resources/zero-trust/identity-providers/scim/users.test.ts +++ b/tests/api-resources/zero-trust/identity-providers/scim/users.test.ts @@ -33,6 +33,8 @@ describe('resource users', () => { email: 'john.smith@example.com', idp_resource_id: 'john_smith_01', name: 'John Smith', + page: 0, + per_page: 0, username: 'John Smith', }, ); From 38688cce728f651174c0422dcf570b926d9b99e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:16:18 +0000 Subject: [PATCH 274/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d726b10283..12b73f27bd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d12e5f29ee59534bcbd3655ccc82d3f9b721562ce32d6a74905e4f64ea963ff3.yml -openapi_spec_hash: 816ab531b7373d57f9c701d5bb8dcd2a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8efc1376a00d3137b7e83d6ad94f80d1d8058d4997322d23fb263bcf50cdf112.yml +openapi_spec_hash: 6a0341306821788fa1c9f839bd0ae3cc config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 From a34298b6b1bb5583ba7b78d3a97f00656b9e2ef6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:32:59 +0000 Subject: [PATCH 275/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 12b73f27bd..52ee4dad2c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8efc1376a00d3137b7e83d6ad94f80d1d8058d4997322d23fb263bcf50cdf112.yml openapi_spec_hash: 6a0341306821788fa1c9f839bd0ae3cc -config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 +config_hash: 11218d4e895d6852fa70acc77ad5da3d From adb8ef593d8b62a2cd74c6aae39ce2760eb67a19 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:51:39 +0000 Subject: [PATCH 276/423] feat(api): api update --- .stats.yml | 4 +-- .../dispatch/namespaces/namespaces.ts | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 52ee4dad2c..cf70fd85f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8efc1376a00d3137b7e83d6ad94f80d1d8058d4997322d23fb263bcf50cdf112.yml -openapi_spec_hash: 6a0341306821788fa1c9f839bd0ae3cc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b3ce752c7b171704ed785a8f35bc61b15aa712792e749d831614cfff7b55058.yml +openapi_spec_hash: 6b85b7c798ade6f47a69fa057c470e35 config_hash: 11218d4e895d6852fa70acc77ad5da3d diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/namespaces.ts b/src/resources/workers-for-platforms/dispatch/namespaces/namespaces.ts index a44e6f918f..f33487efe6 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/namespaces.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/namespaces.ts @@ -156,6 +156,15 @@ export interface NamespaceCreateResponse { * The current number of scripts in this Dispatch Namespace. */ script_count?: number; + + /** + * Whether the Workers in the namespace are executed in a "trusted" manner. When a + * Worker is trusted, it has access to the shared caches for the zone in the Cache + * API, and has access to the `request.cf` object on incoming Requests. When a + * Worker is untrusted, caches are not shared across the zone, and `request.cf` is + * undefined. By default, Workers in a namespace are "untrusted". + */ + trusted_workers?: boolean; } export interface NamespaceListResponse { @@ -193,6 +202,15 @@ export interface NamespaceListResponse { * The current number of scripts in this Dispatch Namespace. */ script_count?: number; + + /** + * Whether the Workers in the namespace are executed in a "trusted" manner. When a + * Worker is trusted, it has access to the shared caches for the zone in the Cache + * API, and has access to the `request.cf` object on incoming Requests. When a + * Worker is untrusted, caches are not shared across the zone, and `request.cf` is + * undefined. By default, Workers in a namespace are "untrusted". + */ + trusted_workers?: boolean; } export type NamespaceDeleteResponse = unknown; @@ -232,6 +250,15 @@ export interface NamespaceGetResponse { * The current number of scripts in this Dispatch Namespace. */ script_count?: number; + + /** + * Whether the Workers in the namespace are executed in a "trusted" manner. When a + * Worker is trusted, it has access to the shared caches for the zone in the Cache + * API, and has access to the `request.cf` object on incoming Requests. When a + * Worker is untrusted, caches are not shared across the zone, and `request.cf` is + * undefined. By default, Workers in a namespace are "untrusted". + */ + trusted_workers?: boolean; } export interface NamespaceCreateParams { From d916074d228e5f8c91d71db1a2f2885ac015a760 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:57:12 +0000 Subject: [PATCH 277/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf70fd85f9..55f646768e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b3ce752c7b171704ed785a8f35bc61b15aa712792e749d831614cfff7b55058.yml -openapi_spec_hash: 6b85b7c798ade6f47a69fa057c470e35 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27b1891d24e38950564b12d1f9ab565b02fa7527bd3d06dc45250cc37c423fb0.yml +openapi_spec_hash: 5c8188e19c46a76b65f6ccfe4a4c97b2 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 66666baaec5270d5494793a2b6c6bf468e55ef9d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 22:29:02 +0000 Subject: [PATCH 278/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 55f646768e..eb2d0bb728 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-27b1891d24e38950564b12d1f9ab565b02fa7527bd3d06dc45250cc37c423fb0.yml -openapi_spec_hash: 5c8188e19c46a76b65f6ccfe4a4c97b2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml +openapi_spec_hash: d373e48170339983debabbd4136483a5 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 4dfca006515429c7e139cdfe286e230976746a8a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 06:01:42 +0000 Subject: [PATCH 279/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2d0bb728..38f1477ac4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml -openapi_spec_hash: d373e48170339983debabbd4136483a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-870f6e465dc981802dc4ddbd91434111cab6fa8185cb96cb0c4a863438d6a754.yml +openapi_spec_hash: 9640458896f5af41039c4ca2e7a35ba6 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 42d9dd41fcbba975d7f811cfc48bdd2765b33d2d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 06:17:44 +0000 Subject: [PATCH 280/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 38f1477ac4..eb2d0bb728 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-870f6e465dc981802dc4ddbd91434111cab6fa8185cb96cb0c4a863438d6a754.yml -openapi_spec_hash: 9640458896f5af41039c4ca2e7a35ba6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml +openapi_spec_hash: d373e48170339983debabbd4136483a5 config_hash: 11218d4e895d6852fa70acc77ad5da3d From ffb94ecf27bc0d7196d1f9862144cc5c902b1189 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 10:37:45 +0000 Subject: [PATCH 281/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2d0bb728..72fd55603f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml -openapi_spec_hash: d373e48170339983debabbd4136483a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e0278af6128513d1992eb23a3ad432b496c8f114419cc03cbf3b7af6fcae7f1.yml +openapi_spec_hash: 27779b846ee504f31056ac3d061881bd config_hash: 11218d4e895d6852fa70acc77ad5da3d From ae16c15fec085731cae5f6f648296797e386b807 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:06:09 +0000 Subject: [PATCH 282/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 72fd55603f..7a1a5ad1d4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7e0278af6128513d1992eb23a3ad432b496c8f114419cc03cbf3b7af6fcae7f1.yml -openapi_spec_hash: 27779b846ee504f31056ac3d061881bd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-443e71324e83ae9b850c9efc8b6f1d36484a739106eeacd9ef967af22ad0e667.yml +openapi_spec_hash: 397b3b4ec417b63d4d7536cdb080bdce config_hash: 11218d4e895d6852fa70acc77ad5da3d From 8c3cb529d42393e6771056686c0ee5be2df4c609 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 11:15:40 +0000 Subject: [PATCH 283/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7a1a5ad1d4..eb2d0bb728 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-443e71324e83ae9b850c9efc8b6f1d36484a739106eeacd9ef967af22ad0e667.yml -openapi_spec_hash: 397b3b4ec417b63d4d7536cdb080bdce +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml +openapi_spec_hash: d373e48170339983debabbd4136483a5 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 02fd730b808bd50605a5ed98597deef3ef86acdf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 13:19:28 +0000 Subject: [PATCH 284/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2d0bb728..8c2975e281 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml -openapi_spec_hash: d373e48170339983debabbd4136483a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-14791085dd4ce3334d4961ae51be5bddee3694ebf1cf16b92b91abbbd61d0033.yml +openapi_spec_hash: 8155d954b75d899686ee3e90a706c525 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 3ebbf86d8c057aa575c5f875874dbcc2563a46fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 13:47:37 +0000 Subject: [PATCH 285/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8c2975e281..ff4b9fba2d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-14791085dd4ce3334d4961ae51be5bddee3694ebf1cf16b92b91abbbd61d0033.yml -openapi_spec_hash: 8155d954b75d899686ee3e90a706c525 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b9fda61597165afeb52dd89847a1b340023c0f5fbfcc2af05ec495011667606.yml +openapi_spec_hash: 37f45f99d8e89b218f58dd74bac67b68 config_hash: 11218d4e895d6852fa70acc77ad5da3d From b0fe07a5be3a307a3aa9a0ff35647467dde7ca6e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 13:58:45 +0000 Subject: [PATCH 286/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ff4b9fba2d..eb2d0bb728 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4b9fda61597165afeb52dd89847a1b340023c0f5fbfcc2af05ec495011667606.yml -openapi_spec_hash: 37f45f99d8e89b218f58dd74bac67b68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml +openapi_spec_hash: d373e48170339983debabbd4136483a5 config_hash: 11218d4e895d6852fa70acc77ad5da3d From a8ff6bb88cd055c2441e5b9c389c352ae2b290a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:11:13 +0000 Subject: [PATCH 287/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2d0bb728..d6debe5a54 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml -openapi_spec_hash: d373e48170339983debabbd4136483a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9c03bed59c55b2d816ea915bcf2d3a8cd435f0732c7b53b35d00c79a731fcfb.yml +openapi_spec_hash: fba6aafdab9821761915c2d3a3e2479d config_hash: 11218d4e895d6852fa70acc77ad5da3d From 741b0a09bce3792cb40a8ba009f74863f46a4519 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:24:42 +0000 Subject: [PATCH 288/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6debe5a54..32920fbadb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9c03bed59c55b2d816ea915bcf2d3a8cd435f0732c7b53b35d00c79a731fcfb.yml -openapi_spec_hash: fba6aafdab9821761915c2d3a3e2479d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b460c56adc8154b9ea292abfdcb8c78d6110d418c37f281726b83ce763c2576.yml +openapi_spec_hash: 991675382e3cdf8e73196cd321d59e12 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 079a1df456d617aa4089c1a043a266ea98408916 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 14:46:30 +0000 Subject: [PATCH 289/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 32920fbadb..eb2d0bb728 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b460c56adc8154b9ea292abfdcb8c78d6110d418c37f281726b83ce763c2576.yml -openapi_spec_hash: 991675382e3cdf8e73196cd321d59e12 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml +openapi_spec_hash: d373e48170339983debabbd4136483a5 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 17f5471ca2f004b180bc6045e183a259a1014b55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 15:16:27 +0000 Subject: [PATCH 290/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index eb2d0bb728..211f2c7c17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8368d3a1fa6864067fed6a41705979b2b55f6f2c9750fbe2e97d7d2cfcc75bb7.yml -openapi_spec_hash: d373e48170339983debabbd4136483a5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-55089872538af7abbd3cbe61c5cfec47a93aed888977b0b73edcc0fe97be229d.yml +openapi_spec_hash: 07714b0a4d8b7abe3c671dc9490a935b config_hash: 11218d4e895d6852fa70acc77ad5da3d From 9a38fbd53f7b1fe9885e31bf643767e40e70198e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 16:01:43 +0000 Subject: [PATCH 291/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 211f2c7c17..03c185a501 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-55089872538af7abbd3cbe61c5cfec47a93aed888977b0b73edcc0fe97be229d.yml -openapi_spec_hash: 07714b0a4d8b7abe3c671dc9490a935b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61ee15027103b7521f9e8af3fe324d0ae82f78ae06b698235d732132f8e24855.yml +openapi_spec_hash: d12ccd191dabe55f50ce6a4ad15355a6 config_hash: 11218d4e895d6852fa70acc77ad5da3d From d223851bbb6c9cda1a6616316b794920a13d639e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 17:59:01 +0000 Subject: [PATCH 292/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 03c185a501..12e8bc6d0a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61ee15027103b7521f9e8af3fe324d0ae82f78ae06b698235d732132f8e24855.yml -openapi_spec_hash: d12ccd191dabe55f50ce6a4ad15355a6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ec774bdf5de1d462e90eef2ae707df91819ae8426bbd28e1968eae25f86b0a4.yml +openapi_spec_hash: 494018bf95f397e1cdd863dd5c5a33a9 config_hash: 11218d4e895d6852fa70acc77ad5da3d From 2bfc1d96b7e4b3ef0a5aaf786f60e91d46bbf4cd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 11:43:07 +0000 Subject: [PATCH 293/423] chore(internal): move publish config --- bin/publish-npm | 2 +- package.json | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/publish-npm b/bin/publish-npm index fa2243d248..45e8aa8088 100644 --- a/bin/publish-npm +++ b/bin/publish-npm @@ -58,4 +58,4 @@ else fi # Publish with the appropriate tag -yarn publish --access public --tag "$TAG" +yarn publish --tag "$TAG" diff --git a/package.json b/package.json index 37aa9320f6..3d02585891 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,9 @@ "**/*" ], "private": false, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "./scripts/test", "build": "./scripts/build", From e75721c672a7f4a4ac6061f09c5896f3459537b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 12:59:50 +0000 Subject: [PATCH 294/423] feat(api): api update --- .stats.yml | 8 +- api.md | 74 +- scripts/detect-breaking-changes | 5 +- src/resources/argo/smart-routing.ts | 46 +- src/resources/kv/index.ts | 1 + src/resources/kv/kv.ts | 2 + src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 9 +- src/resources/kv/namespaces/metadata.ts | 11 +- src/resources/kv/namespaces/namespaces.ts | 20 +- src/resources/kv/namespaces/values.ts | 3 +- .../load-balancers/load-balancers.ts | 485 ++++---- .../load-balancers/monitors/monitors.ts | 12 +- .../load-balancers/monitors/previews.ts | 2 +- .../load-balancers/monitors/references.ts | 2 +- src/resources/load-balancers/pools/health.ts | 6 +- src/resources/load-balancers/pools/pools.ts | 14 +- .../load-balancers/pools/references.ts | 2 +- src/resources/load-balancers/previews.ts | 4 +- src/resources/load-balancers/regions.ts | 4 +- src/resources/load-balancers/searches.ts | 2 +- src/resources/radar/ai/ai.ts | 45 +- src/resources/radar/ai/bots.ts | 648 +++++++++- src/resources/radar/ai/bots/bots.ts | 15 - src/resources/radar/ai/bots/summary.ts | 5 - src/resources/radar/ai/index.ts | 17 +- src/resources/radar/ai/timeseries-groups.ts | 5 - src/resources/radar/ai/to-markdown.ts | 67 - .../radar/{ai/bots/index.ts => ct.ts} | 3 +- src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + .../dispatch/namespaces/scripts/content.ts | 2 +- .../dispatch/namespaces/scripts/scripts.ts | 4 +- src/resources/workers/scripts/content.ts | 4 +- src/resources/workers/scripts/deployments.ts | 95 +- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 10 +- src/resources/workers/scripts/versions.ts | 4 +- src/resources/workers/workers.ts | 4 +- tests/api-resources/radar/ai/bots.test.ts | 135 ++ .../radar/ai/to-markdown.test.ts | 35 - .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 48 files changed, 3251 insertions(+), 605 deletions(-) delete mode 100644 src/resources/radar/ai/bots/bots.ts delete mode 100644 src/resources/radar/ai/bots/summary.ts delete mode 100644 src/resources/radar/ai/timeseries-groups.ts delete mode 100644 src/resources/radar/ai/to-markdown.ts rename src/resources/radar/{ai/bots/index.ts => ct.ts} (56%) create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/bots.test.ts delete mode 100644 tests/api-resources/radar/ai/to-markdown.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 12e8bc6d0a..c5d9a30386 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3ec774bdf5de1d462e90eef2ae707df91819ae8426bbd28e1968eae25f86b0a4.yml -openapi_spec_hash: 494018bf95f397e1cdd863dd5c5a33a9 -config_hash: 11218d4e895d6852fa70acc77ad5da3d +configured_endpoints: 1790 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-405704dec8d5041847ab820752a75813fe0e8ceabb72f42ba840ced58c0f8643.yml +openapi_spec_hash: 56d7b6b4cd0ca89589c3e6fa53b28225 +config_hash: 320699f1f989d92845c2558a970acd18 diff --git a/api.md b/api.md index 89ff9eae57..81515c1a8a 100644 --- a/api.md +++ b/api.md @@ -2120,17 +2120,16 @@ Methods: Types: -- DeploymentCreateResponse +- Deployment - DeploymentListResponse - DeploymentDeleteResponse -- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment ### Versions @@ -2233,6 +2232,7 @@ Methods: Types: +- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,13 +2268,9 @@ Methods: ### Metadata -Types: - -- MetadataGetResponse - Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any ### Values @@ -6335,16 +6331,6 @@ Methods: ## AI -### ToMarkdown - -Types: - -- ToMarkdownCreateResponse - -Methods: - -- client.radar.ai.toMarkdown.create(body, { ...params }) -> ToMarkdownCreateResponsesSinglePage - ### Inference #### Summary @@ -6375,9 +6361,17 @@ Methods: ### Bots -#### Summary +Types: -### TimeseriesGroups +- BotSummaryResponse +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summary(dimension, { ...params }) -> BotSummaryResponse +- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse ## Annotations @@ -6515,6 +6509,44 @@ Methods: - client.radar.bots.webCrawlers.summary(dimension, { ...params }) -> WebCrawlerSummaryResponse - client.radar.bots.webCrawlers.timeseriesGroups(dimension, { ...params }) -> WebCrawlerTimeseriesGroupsResponse +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Datasets Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..c67dcb7af0 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -537,11 +537,11 @@ TEST_PATHS=( tests/api-resources/url-scanner/scans.test.ts tests/api-resources/radar/radar.test.ts tests/api-resources/radar/ai/ai.test.ts - tests/api-resources/radar/ai/to-markdown.test.ts tests/api-resources/radar/ai/inference/inference.test.ts tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts @@ -555,6 +555,9 @@ TEST_PATHS=( tests/api-resources/radar/bgp/ips.test.ts tests/api-resources/radar/bots/bots.test.ts tests/api-resources/radar/bots/web-crawlers.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/datasets.test.ts tests/api-resources/radar/dns/dns.test.ts tests/api-resources/radar/dns/top.test.ts diff --git a/src/resources/argo/smart-routing.ts b/src/resources/argo/smart-routing.ts index 515727cb7a..79790b6aa6 100644 --- a/src/resources/argo/smart-routing.ts +++ b/src/resources/argo/smart-routing.ts @@ -50,9 +50,49 @@ export class SmartRouting extends APIResource { } } -export type SmartRoutingEditResponse = unknown; +export interface SmartRoutingEditResponse { + /** + * Specifies the identifier of the Argo Smart Routing setting. + */ + id: string; + + /** + * Specifies if the setting is editable. + */ + editable: boolean; + + /** + * Specifies the enablement value of Argo Smart Routing. + */ + value: 'on' | 'off'; + + /** + * Specifies the time when the setting was last modified. + */ + modified_on?: string; +} -export type SmartRoutingGetResponse = unknown; +export interface SmartRoutingGetResponse { + /** + * Specifies the identifier of the Argo Smart Routing setting. + */ + id: string; + + /** + * Specifies if the setting is editable. + */ + editable: boolean; + + /** + * Specifies the enablement value of Argo Smart Routing. + */ + value: 'on' | 'off'; + + /** + * Specifies the time when the setting was last modified. + */ + modified_on?: string; +} export interface SmartRoutingEditParams { /** @@ -61,7 +101,7 @@ export interface SmartRoutingEditParams { zone_id: string; /** - * Body param: Enables Argo Smart Routing. + * Body param: Specifies the enablement value of Argo Smart Routing. */ value: 'on' | 'off'; } diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index 6b8512b78a..d76651a083 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,6 +4,7 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 6edb9e18af..c216c0f0d4 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { + Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -30,6 +31,7 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..d7dc7a5289 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,10 +12,11 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..50e52613a9 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -117,7 +118,7 @@ export interface Key { */ expiration?: number; - metadata?: unknown; + metadata?: NamespacesAPI.Any; } export interface KeyBulkDeleteResponse { @@ -153,9 +154,9 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: unknown; + metadata: NamespacesAPI.Any; - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -268,7 +269,7 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 53db763063..f8135e1b5d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -11,7 +12,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const metadata = await client.kv.namespaces.metadata.get( + * const any = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -23,19 +24,17 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: MetadataGetResponse }> + ) as Core.APIPromise<{ result: NamespacesAPI.Any }> )._thenUnwrap((obj) => obj.result); } } -export type MetadataGetResponse = unknown; - export interface MetadataGetParams { /** * Identifier. @@ -44,5 +43,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..6e395d77c7 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -16,7 +17,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; +import { Metadata, MetadataGetParams } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -254,6 +255,10 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} +export type Any = unknown; + +export type AnyParam = unknown; + export interface Namespace { /** * Namespace identifier tag. @@ -312,9 +317,9 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: unknown; + metadata: NamespacesAPI.Any; - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -462,7 +467,7 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } @@ -481,6 +486,7 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -510,11 +516,7 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { - Metadata as Metadata, - type MetadataGetResponse as MetadataGetResponse, - type MetadataGetParams as MetadataGetParams, - }; + export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 03752a92d4..0a3c267c8c 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -136,7 +137,7 @@ export interface ValueUpdateParams { /** * Body param: */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } export interface ValueDeleteParams { diff --git a/src/resources/load-balancers/load-balancers.ts b/src/resources/load-balancers/load-balancers.ts index b0c4847381..1cd26f3e14 100644 --- a/src/resources/load-balancers/load-balancers.ts +++ b/src/resources/load-balancers/load-balancers.ts @@ -430,7 +430,7 @@ export interface LoadBalancer { networks?: Array; /** - * (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + * Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs * (ordered by their failover priority) for the PoP (datacenter). Any PoPs not * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. @@ -469,28 +469,25 @@ export interface LoadBalancer { /** * Specifies the type of session affinity the load balancer should use unless - * specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * specified as `"none"`. The supported types are: - `"cookie"`: On the first + * request to a proxied load balancer, a cookie is generated, encoding information + * of which origin the request will be forwarded to. Subsequent requests, by the + * same client to the same load balancer, will be sent to the origin server the + * cookie encodes, for the duration of the cookie and as long as the origin server + * remains healthy. If the cookie has expired or the origin server is unhealthy, + * then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + * same as `"cookie"` except the initial origin selection is stable and based on + * the client's ip address. - `"header"`: On the first request to a proxied load + * balancer, a session key based on the configured HTTP headers (see + * `session_affinity_attributes.headers`) is generated, encoding the request + * headers used for storing in the load balancer session state which origin the + * request will be forwarded to. Subsequent requests to the load balancer with the + * same headers will be sent to the same origin server, for the duration of the + * session and as long as the origin server remains healthy. If the session has + * been idle for the duration of `session_affinity_ttl` seconds or the origin + * server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: SessionAffinity; @@ -502,14 +499,13 @@ export interface LoadBalancer { /** * Time, in seconds, until a client's session expires after being created. Once the * expiry time has been reached, subsequent requests may get sent to a different - * origin server. The accepted ranges per `session_affinity` policy are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * origin server. The accepted ranges per `session_affinity` policy are: - + * `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + * explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; @@ -1025,7 +1021,7 @@ export namespace Rules { location_strategy?: LoadBalancersAPI.LocationStrategy; /** - * (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + * Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs * (ordered by their failover priority) for the PoP (datacenter). Any PoPs not * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. @@ -1053,28 +1049,25 @@ export namespace Rules { /** * Specifies the type of session affinity the load balancer should use unless - * specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * specified as `"none"`. The supported types are: - `"cookie"`: On the first + * request to a proxied load balancer, a cookie is generated, encoding information + * of which origin the request will be forwarded to. Subsequent requests, by the + * same client to the same load balancer, will be sent to the origin server the + * cookie encodes, for the duration of the cookie and as long as the origin server + * remains healthy. If the cookie has expired or the origin server is unhealthy, + * then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + * same as `"cookie"` except the initial origin selection is stable and based on + * the client's ip address. - `"header"`: On the first request to a proxied load + * balancer, a session key based on the configured HTTP headers (see + * `session_affinity_attributes.headers`) is generated, encoding the request + * headers used for storing in the load balancer session state which origin the + * request will be forwarded to. Subsequent requests to the load balancer with the + * same headers will be sent to the same origin server, for the duration of the + * session and as long as the origin server remains healthy. If the session has + * been idle for the duration of `session_affinity_ttl` seconds or the origin + * server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: LoadBalancersAPI.SessionAffinity; @@ -1086,14 +1079,13 @@ export namespace Rules { /** * Time, in seconds, until a client's session expires after being created. Once the * expiry time has been reached, subsequent requests may get sent to a different - * origin server. The accepted ranges per `session_affinity` policy are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * origin server. The accepted ranges per `session_affinity` policy are: - + * `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + * explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; @@ -1252,7 +1244,7 @@ export namespace RulesParam { location_strategy?: LoadBalancersAPI.LocationStrategyParam; /** - * (Enterprise only): A mapping of Cloudflare PoP identifiers to a list of pool IDs + * Enterprise only: A mapping of Cloudflare PoP identifiers to a list of pool IDs * (ordered by their failover priority) for the PoP (datacenter). Any PoPs not * explicitly defined will fall back to using the corresponding country_pool, then * region_pool mapping if it exists else to default_pools. @@ -1280,28 +1272,25 @@ export namespace RulesParam { /** * Specifies the type of session affinity the load balancer should use unless - * specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * specified as `"none"`. The supported types are: - `"cookie"`: On the first + * request to a proxied load balancer, a cookie is generated, encoding information + * of which origin the request will be forwarded to. Subsequent requests, by the + * same client to the same load balancer, will be sent to the origin server the + * cookie encodes, for the duration of the cookie and as long as the origin server + * remains healthy. If the cookie has expired or the origin server is unhealthy, + * then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + * same as `"cookie"` except the initial origin selection is stable and based on + * the client's ip address. - `"header"`: On the first request to a proxied load + * balancer, a session key based on the configured HTTP headers (see + * `session_affinity_attributes.headers`) is generated, encoding the request + * headers used for storing in the load balancer session state which origin the + * request will be forwarded to. Subsequent requests to the load balancer with the + * same headers will be sent to the same origin server, for the duration of the + * session and as long as the origin server remains healthy. If the session has + * been idle for the duration of `session_affinity_ttl` seconds or the origin + * server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: LoadBalancersAPI.SessionAffinityParam; @@ -1313,14 +1302,13 @@ export namespace RulesParam { /** * Time, in seconds, until a client's session expires after being created. Once the * expiry time has been reached, subsequent requests may get sent to a different - * origin server. The accepted ranges per `session_affinity` policy are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * origin server. The accepted ranges per `session_affinity` policy are: - + * `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used unless + * explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; @@ -1360,55 +1348,49 @@ export namespace RulesParam { /** * Specifies the type of session affinity the load balancer should use unless - * specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * specified as `"none"`. The supported types are: - `"cookie"`: On the first + * request to a proxied load balancer, a cookie is generated, encoding information + * of which origin the request will be forwarded to. Subsequent requests, by the + * same client to the same load balancer, will be sent to the origin server the + * cookie encodes, for the duration of the cookie and as long as the origin server + * remains healthy. If the cookie has expired or the origin server is unhealthy, + * then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + * same as `"cookie"` except the initial origin selection is stable and based on + * the client's ip address. - `"header"`: On the first request to a proxied load + * balancer, a session key based on the configured HTTP headers (see + * `session_affinity_attributes.headers`) is generated, encoding the request + * headers used for storing in the load balancer session state which origin the + * request will be forwarded to. Subsequent requests to the load balancer with the + * same headers will be sent to the same origin server, for the duration of the + * session and as long as the origin server remains healthy. If the session has + * been idle for the duration of `session_affinity_ttl` seconds or the origin + * server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ export type SessionAffinity = 'none' | 'cookie' | 'ip_cookie' | 'header'; /** * Specifies the type of session affinity the load balancer should use unless - * specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * specified as `"none"`. The supported types are: - `"cookie"`: On the first + * request to a proxied load balancer, a cookie is generated, encoding information + * of which origin the request will be forwarded to. Subsequent requests, by the + * same client to the same load balancer, will be sent to the origin server the + * cookie encodes, for the duration of the cookie and as long as the origin server + * remains healthy. If the cookie has expired or the origin server is unhealthy, + * then a new origin server is calculated and used. - `"ip_cookie"`: Behaves the + * same as `"cookie"` except the initial origin selection is stable and based on + * the client's ip address. - `"header"`: On the first request to a proxied load + * balancer, a session key based on the configured HTTP headers (see + * `session_affinity_attributes.headers`) is generated, encoding the request + * headers used for storing in the load balancer session state which origin the + * request will be forwarded to. Subsequent requests to the load balancer with the + * same headers will be sent to the same origin server, for the duration of the + * session and as long as the origin server remains healthy. If the session has + * been idle for the duration of `session_affinity_ttl` seconds or the origin + * server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ export type SessionAffinityParam = 'none' | 'cookie' | 'ip_cookie' | 'header'; @@ -1437,14 +1419,11 @@ export interface SessionAffinityAttributes { /** * When header `session_affinity` is enabled, this option can be used to specify * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. + * are: - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions aren't + * created. - `"false"`: Load balancing requests must contain _at least one_ of the + * HTTP headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. */ require_all_headers?: boolean; @@ -1466,15 +1445,13 @@ export interface SessionAffinityAttributes { /** * Configures the zero-downtime failover between origins within a pool when session * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. + * Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover + * takes place for sessions pinned to the origin (default). - `"temporary"`: + * Traffic will be sent to another other healthy origin until the originally pinned + * origin is available; note that this can potentially result in heavy origin + * flapping. - `"sticky"`: The session affinity cookie is updated and subsequent + * requests are sent to the new origin. Note: Zero-downtime failover with sticky + * sessions is currently not supported for session affinity by header. */ zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; } @@ -1504,14 +1481,11 @@ export interface SessionAffinityAttributesParam { /** * When header `session_affinity` is enabled, this option can be used to specify * how HTTP headers on load balancing requests will be used. The supported values - * are: - * - * - `"true"`: Load balancing requests must contain _all_ of the HTTP headers - * specified by the `headers` session affinity attribute, otherwise sessions - * aren't created. - * - `"false"`: Load balancing requests must contain _at least one_ of the HTTP - * headers specified by the `headers` session affinity attribute, otherwise - * sessions aren't created. + * are: - `"true"`: Load balancing requests must contain _all_ of the HTTP headers + * specified by the `headers` session affinity attribute, otherwise sessions aren't + * created. - `"false"`: Load balancing requests must contain _at least one_ of the + * HTTP headers specified by the `headers` session affinity attribute, otherwise + * sessions aren't created. */ require_all_headers?: boolean; @@ -1533,15 +1507,13 @@ export interface SessionAffinityAttributesParam { /** * Configures the zero-downtime failover between origins within a pool when session * affinity is enabled. This feature is currently incompatible with Argo, Tiered - * Cache, and Bandwidth Alliance. The supported values are: - * - * - `"none"`: No failover takes place for sessions pinned to the origin (default). - * - `"temporary"`: Traffic will be sent to another other healthy origin until the - * originally pinned origin is available; note that this can potentially result - * in heavy origin flapping. - * - `"sticky"`: The session affinity cookie is updated and subsequent requests are - * sent to the new origin. Note: Zero-downtime failover with sticky sessions is - * currently not supported for session affinity by header. + * Cache, and Bandwidth Alliance. The supported values are: - `"none"`: No failover + * takes place for sessions pinned to the origin (default). - `"temporary"`: + * Traffic will be sent to another other healthy origin until the originally pinned + * origin is available; note that this can potentially result in heavy origin + * flapping. - `"sticky"`: The session affinity cookie is updated and subsequent + * requests are sent to the new origin. Note: Zero-downtime failover with sticky + * sessions is currently not supported for session affinity by header. */ zero_downtime_failover?: 'none' | 'temporary' | 'sticky'; } @@ -1678,7 +1650,7 @@ export interface LoadBalancerCreateParams { networks?: Array; /** - * Body param: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list + * Body param: Enterprise only: A mapping of Cloudflare PoP identifiers to a list * of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. @@ -1718,28 +1690,25 @@ export interface LoadBalancerCreateParams { /** * Body param: Specifies the type of session affinity the load balancer should use - * unless specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * unless specified as `"none"`. The supported types are: - `"cookie"`: On the + * first request to a proxied load balancer, a cookie is generated, encoding + * information of which origin the request will be forwarded to. Subsequent + * requests, by the same client to the same load balancer, will be sent to the + * origin server the cookie encodes, for the duration of the cookie and as long as + * the origin server remains healthy. If the cookie has expired or the origin + * server is unhealthy, then a new origin server is calculated and used. - + * `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin + * selection is stable and based on the client's ip address. - `"header"`: On the + * first request to a proxied load balancer, a session key based on the configured + * HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding + * the request headers used for storing in the load balancer session state which + * origin the request will be forwarded to. Subsequent requests to the load + * balancer with the same headers will be sent to the same origin server, for the + * duration of the session and as long as the origin server remains healthy. If the + * session has been idle for the duration of `session_affinity_ttl` seconds or the + * origin server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: SessionAffinityParam; @@ -1752,14 +1721,12 @@ export interface LoadBalancerCreateParams { * Body param: Time, in seconds, until a client's session expires after being * created. Once the expiry time has been reached, subsequent requests may get sent * to a different origin server. The accepted ranges per `session_affinity` policy - * are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used + * unless explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; @@ -1862,7 +1829,7 @@ export interface LoadBalancerUpdateParams { networks?: Array; /** - * Body param: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list + * Body param: Enterprise only: A mapping of Cloudflare PoP identifiers to a list * of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. @@ -1902,28 +1869,25 @@ export interface LoadBalancerUpdateParams { /** * Body param: Specifies the type of session affinity the load balancer should use - * unless specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * unless specified as `"none"`. The supported types are: - `"cookie"`: On the + * first request to a proxied load balancer, a cookie is generated, encoding + * information of which origin the request will be forwarded to. Subsequent + * requests, by the same client to the same load balancer, will be sent to the + * origin server the cookie encodes, for the duration of the cookie and as long as + * the origin server remains healthy. If the cookie has expired or the origin + * server is unhealthy, then a new origin server is calculated and used. - + * `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin + * selection is stable and based on the client's ip address. - `"header"`: On the + * first request to a proxied load balancer, a session key based on the configured + * HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding + * the request headers used for storing in the load balancer session state which + * origin the request will be forwarded to. Subsequent requests to the load + * balancer with the same headers will be sent to the same origin server, for the + * duration of the session and as long as the origin server remains healthy. If the + * session has been idle for the duration of `session_affinity_ttl` seconds or the + * origin server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: SessionAffinityParam; @@ -1936,14 +1900,12 @@ export interface LoadBalancerUpdateParams { * Body param: Time, in seconds, until a client's session expires after being * created. Once the expiry time has been reached, subsequent requests may get sent * to a different origin server. The accepted ranges per `session_affinity` policy - * are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used + * unless explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; @@ -2049,7 +2011,7 @@ export interface LoadBalancerEditParams { name?: string; /** - * Body param: (Enterprise only): A mapping of Cloudflare PoP identifiers to a list + * Body param: Enterprise only: A mapping of Cloudflare PoP identifiers to a list * of pool IDs (ordered by their failover priority) for the PoP (datacenter). Any * PoPs not explicitly defined will fall back to using the corresponding * country_pool, then region_pool mapping if it exists else to default_pools. @@ -2089,28 +2051,25 @@ export interface LoadBalancerEditParams { /** * Body param: Specifies the type of session affinity the load balancer should use - * unless specified as `"none"`. The supported types are: - * - * - `"cookie"`: On the first request to a proxied load balancer, a cookie is - * generated, encoding information of which origin the request will be forwarded - * to. Subsequent requests, by the same client to the same load balancer, will be - * sent to the origin server the cookie encodes, for the duration of the cookie - * and as long as the origin server remains healthy. If the cookie has expired or - * the origin server is unhealthy, then a new origin server is calculated and - * used. - * - `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin - * selection is stable and based on the client's ip address. - * - `"header"`: On the first request to a proxied load balancer, a session key - * based on the configured HTTP headers (see - * `session_affinity_attributes.headers`) is generated, encoding the request - * headers used for storing in the load balancer session state which origin the - * request will be forwarded to. Subsequent requests to the load balancer with - * the same headers will be sent to the same origin server, for the duration of - * the session and as long as the origin server remains healthy. If the session - * has been idle for the duration of `session_affinity_ttl` seconds or the origin - * server is unhealthy, then a new origin server is calculated and used. See - * `headers` in `session_affinity_attributes` for additional required - * configuration. + * unless specified as `"none"`. The supported types are: - `"cookie"`: On the + * first request to a proxied load balancer, a cookie is generated, encoding + * information of which origin the request will be forwarded to. Subsequent + * requests, by the same client to the same load balancer, will be sent to the + * origin server the cookie encodes, for the duration of the cookie and as long as + * the origin server remains healthy. If the cookie has expired or the origin + * server is unhealthy, then a new origin server is calculated and used. - + * `"ip_cookie"`: Behaves the same as `"cookie"` except the initial origin + * selection is stable and based on the client's ip address. - `"header"`: On the + * first request to a proxied load balancer, a session key based on the configured + * HTTP headers (see `session_affinity_attributes.headers`) is generated, encoding + * the request headers used for storing in the load balancer session state which + * origin the request will be forwarded to. Subsequent requests to the load + * balancer with the same headers will be sent to the same origin server, for the + * duration of the session and as long as the origin server remains healthy. If the + * session has been idle for the duration of `session_affinity_ttl` seconds or the + * origin server is unhealthy, then a new origin server is calculated and used. See + * `headers` in `session_affinity_attributes` for additional required + * configuration. */ session_affinity?: SessionAffinityParam; @@ -2123,14 +2082,12 @@ export interface LoadBalancerEditParams { * Body param: Time, in seconds, until a client's session expires after being * created. Once the expiry time has been reached, subsequent requests may get sent * to a different origin server. The accepted ranges per `session_affinity` policy - * are: - * - * - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used - * unless explicitly set. The accepted range of values is between [1800, 604800]. - * - `"header"`: The current default of 1800 seconds will be used unless explicitly - * set. The accepted range of values is between [30, 3600]. Note: With session - * affinity by header, sessions only expire after they haven't been used for the - * number of seconds specified. + * are: - `"cookie"` / `"ip_cookie"`: The current default of 23 hours will be used + * unless explicitly set. The accepted range of values is between [1800, 604800]. - + * `"header"`: The current default of 1800 seconds will be used unless explicitly + * set. The accepted range of values is between [30, 3600]. Note: With session + * affinity by header, sessions only expire after they haven't been used for the + * number of seconds specified. */ session_affinity_ttl?: number; diff --git a/src/resources/load-balancers/monitors/monitors.ts b/src/resources/load-balancers/monitors/monitors.ts index 304af32535..e06f9f7ff9 100644 --- a/src/resources/load-balancers/monitors/monitors.ts +++ b/src/resources/load-balancers/monitors/monitors.ts @@ -272,7 +272,7 @@ export interface MonitorDeleteResponse { export interface MonitorCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -378,7 +378,7 @@ export interface MonitorCreateParams { export interface MonitorUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -484,21 +484,21 @@ export interface MonitorUpdateParams { export interface MonitorListParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface MonitorDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface MonitorEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -604,7 +604,7 @@ export interface MonitorEditParams { export interface MonitorGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/monitors/previews.ts b/src/resources/load-balancers/monitors/previews.ts index 857933228d..677afbce1c 100644 --- a/src/resources/load-balancers/monitors/previews.ts +++ b/src/resources/load-balancers/monitors/previews.ts @@ -43,7 +43,7 @@ export interface PreviewCreateResponse { export interface PreviewCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/load-balancers/monitors/references.ts b/src/resources/load-balancers/monitors/references.ts index 1baab9325b..024ca81ff9 100644 --- a/src/resources/load-balancers/monitors/references.ts +++ b/src/resources/load-balancers/monitors/references.ts @@ -47,7 +47,7 @@ export interface ReferenceGetResponse { export interface ReferenceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/pools/health.ts b/src/resources/load-balancers/pools/health.ts index 1af81d09e1..83f9743c4e 100644 --- a/src/resources/load-balancers/pools/health.ts +++ b/src/resources/load-balancers/pools/health.ts @@ -72,7 +72,7 @@ export interface HealthCreateResponse { */ export interface HealthGetResponse { /** - * Pool ID + * Pool ID. */ pool_id?: string; @@ -128,7 +128,7 @@ export namespace HealthGetResponse { export interface HealthCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -234,7 +234,7 @@ export interface HealthCreateParams { export interface HealthGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/pools/pools.ts b/src/resources/load-balancers/pools/pools.ts index c696ed078b..781cab4774 100644 --- a/src/resources/load-balancers/pools/pools.ts +++ b/src/resources/load-balancers/pools/pools.ts @@ -295,7 +295,7 @@ export interface PoolDeleteResponse { export interface PoolCreateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -378,7 +378,7 @@ export interface PoolCreateParams { export interface PoolUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -467,7 +467,7 @@ export interface PoolUpdateParams { export interface PoolListParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -480,14 +480,14 @@ export interface PoolListParams { export interface PoolDeleteParams { /** - * Identifier + * Identifier. */ account_id: string; } export interface PoolBulkEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -501,7 +501,7 @@ export interface PoolBulkEditParams { export interface PoolEditParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -590,7 +590,7 @@ export interface PoolEditParams { export interface PoolGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/pools/references.ts b/src/resources/load-balancers/pools/references.ts index e505f40a28..43a19e2dd9 100644 --- a/src/resources/load-balancers/pools/references.ts +++ b/src/resources/load-balancers/pools/references.ts @@ -47,7 +47,7 @@ export interface ReferenceGetResponse { export interface ReferenceGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/previews.ts b/src/resources/load-balancers/previews.ts index b6c786f552..0a68dbc4ee 100644 --- a/src/resources/load-balancers/previews.ts +++ b/src/resources/load-balancers/previews.ts @@ -44,7 +44,7 @@ export namespace PreviewGetResponse { export namespace item { /** - * The origin ipv4/ipv6 address or domain name mapped to it's health data. + * The origin ipv4/ipv6 address or domain name mapped to its health data. */ export interface load_balancing_origin_health_data { failure_reason?: string; @@ -60,7 +60,7 @@ export namespace PreviewGetResponse { export interface PreviewGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/regions.ts b/src/resources/load-balancers/regions.ts index d6e4fad916..4fd6224d9e 100644 --- a/src/resources/load-balancers/regions.ts +++ b/src/resources/load-balancers/regions.ts @@ -72,7 +72,7 @@ export type RegionGetResponse = unknown | string | null; export interface RegionListParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; @@ -94,7 +94,7 @@ export interface RegionListParams { export interface RegionGetParams { /** - * Identifier + * Identifier. */ account_id: string; } diff --git a/src/resources/load-balancers/searches.ts b/src/resources/load-balancers/searches.ts index 1ddf9765c4..b829e4d4d7 100644 --- a/src/resources/load-balancers/searches.ts +++ b/src/resources/load-balancers/searches.ts @@ -71,7 +71,7 @@ export namespace SearchListResponse { export interface SearchListParams extends V4PagePaginationParams { /** - * Path param: Identifier + * Path param: Identifier. */ account_id: string; diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..5dbc662ee1 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -1,46 +1,37 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; -import * as ToMarkdownAPI from './to-markdown'; +import * as BotsAPI from './bots'; import { - ToMarkdown, - ToMarkdownCreateParams, - ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage, -} from './to-markdown'; -import * as BotsAPI from './bots/bots'; -import { Bots } from './bots/bots'; + BotSummaryParams, + BotSummaryResponse, + BotTimeseriesGroupsParams, + BotTimeseriesGroupsResponse, + BotTimeseriesParams, + BotTimeseriesResponse, + Bots, +} from './bots'; import * as InferenceAPI from './inference/inference'; import { Inference } from './inference/inference'; export class AI extends APIResource { - toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); - timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( - this._client, - ); } -AI.ToMarkdown = ToMarkdown; -AI.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; AI.Inference = Inference; AI.Bots = Bots; -AI.TimeseriesGroups = TimeseriesGroups; export declare namespace AI { - export { - ToMarkdown as ToMarkdown, - type ToMarkdownCreateResponse as ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, - type ToMarkdownCreateParams as ToMarkdownCreateParams, - }; - export { Inference as Inference }; - export { Bots as Bots }; - - export { TimeseriesGroups as TimeseriesGroups }; + export { + Bots as Bots, + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/bots.ts b/src/resources/radar/ai/bots.ts index 6228f4a332..7a447e41a8 100644 --- a/src/resources/radar/ai/bots.ts +++ b/src/resources/radar/ai/bots.ts @@ -1,3 +1,649 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export * from './bots/index'; +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Bots extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: BotSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: BotSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: BotSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.timeseries(); + * ``` + */ + timeseries( + query?: BotTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: BotTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: BotTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: BotTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BotSummaryResponse { + /** + * Metadata for the results. + */ + meta: BotSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace BotSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface BotTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesResponse.Meta; + + [k: string]: + | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | BotTimeseriesResponse.Meta + | undefined; +} + +export namespace BotTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesGroupsResponse.Meta; + + serie_0: BotTimeseriesGroupsResponse.Serie0; +} + +export namespace BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface BotSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface BotTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface BotTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace Bots { + export { + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts deleted file mode 100644 index 0b5807ee07..0000000000 --- a/src/resources/radar/ai/bots/bots.ts +++ /dev/null @@ -1,15 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../../resource'; -import * as SummaryAPI from './summary'; -import { Summary } from './summary'; - -export class Bots extends APIResource { - summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); -} - -Bots.Summary = Summary; - -export declare namespace Bots { - export { Summary as Summary }; -} diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts deleted file mode 100644 index 5abd36afe8..0000000000 --- a/src/resources/radar/ai/bots/summary.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../../resource'; - -export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..d3a9bf9903 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,12 +1,13 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai'; -export { Bots } from './bots/index'; -export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; export { - ToMarkdownCreateResponsesSinglePage, - ToMarkdown, - type ToMarkdownCreateResponse, - type ToMarkdownCreateParams, -} from './to-markdown'; + Bots, + type BotSummaryResponse, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryParams, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots'; +export { Inference } from './inference/index'; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts deleted file mode 100644 index 17f65608eb..0000000000 --- a/src/resources/radar/ai/timeseries-groups.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; - -export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts deleted file mode 100644 index 1da4decd3e..0000000000 --- a/src/resources/radar/ai/to-markdown.ts +++ /dev/null @@ -1,67 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -import { SinglePage } from '../../../pagination'; -import { type BlobLike } from '../../../uploads'; - -export class ToMarkdown extends APIResource { - /** - * Convert Files into Markdown - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( - * fs.createReadStream('path/to/file'), - * fs.createReadStream('path/to/file'), - * )) { - * // ... - * } - * ``` - */ - create( - body: string | ArrayBufferView | ArrayBuffer | BlobLike, - params: ToMarkdownCreateParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params ?? {}; - return this._client.getAPIList( - `/accounts/${account_id}/ai/tomarkdown`, - ToMarkdownCreateResponsesSinglePage, - { - body, - method: 'post', - ...options, - headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, - __binaryRequest: true, - }, - ); - } -} - -export class ToMarkdownCreateResponsesSinglePage extends SinglePage {} - -export interface ToMarkdownCreateResponse { - data: string; - - format: string; - - mimeType: string; - - name: string; - - tokens: string; -} - -export type ToMarkdownCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; - -ToMarkdown.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; - -export declare namespace ToMarkdown { - export { - type ToMarkdownCreateResponse as ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, - type ToMarkdownCreateParams as ToMarkdownCreateParams, - }; -} diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ct.ts similarity index 56% rename from src/resources/radar/ai/bots/index.ts rename to src/resources/radar/ct.ts index 6f7091f3a3..a1db06bc41 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ct.ts @@ -1,4 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Bots } from './bots'; -export { Summary } from './summary'; +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..84d0eb905b 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -88,6 +98,7 @@ export class Radar extends APIResource { annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); @@ -116,6 +127,7 @@ Radar.AI = AI; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; +Radar.Ct = Ct; Radar.Datasets = Datasets; Radar.DNS = DNS; Radar.Netflows = Netflows; @@ -162,6 +174,16 @@ export declare namespace Radar { type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Datasets as Datasets, type DatasetListResponse as DatasetListResponse, diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts index 334fb51e5d..26364d14d4 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/content.ts @@ -91,7 +91,7 @@ export interface ContentUpdateParams { account_id: string; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker + * Body param: JSON-encoded metadata about the uploaded parts and Worker * configuration. */ metadata: WorkersAPI.WorkerMetadataParam; diff --git a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts index 292612c7bf..40c73ef770 100644 --- a/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts +++ b/src/resources/workers-for-platforms/dispatch/namespaces/scripts/scripts.ts @@ -271,7 +271,7 @@ export interface ScriptUpdateParams { account_id: string; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker + * Body param: JSON-encoded metadata about the uploaded parts and Worker * configuration. */ metadata: ScriptUpdateParams.Metadata; @@ -290,7 +290,7 @@ export interface ScriptUpdateParams { export namespace ScriptUpdateParams { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface Metadata { /** diff --git a/src/resources/workers/scripts/content.ts b/src/resources/workers/scripts/content.ts index 169a50c4d7..797ecb5dd4 100644 --- a/src/resources/workers/scripts/content.ts +++ b/src/resources/workers/scripts/content.ts @@ -84,7 +84,7 @@ export interface ContentUpdateParams { account_id: string; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker + * Body param: JSON-encoded metadata about the uploaded parts and Worker * configuration. */ metadata: ContentUpdateParams.Metadata; @@ -115,7 +115,7 @@ export interface ContentUpdateParams { export namespace ContentUpdateParams { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface Metadata { /** diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index c23e1d1b09..1283130f6b 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: DeploymentCreateResponse }> + }) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: DeploymentGetResponse }> + ) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } } -export interface DeploymentCreateResponse { +export interface Deployment { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface DeploymentCreateResponse { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: DeploymentCreateResponse.Annotations; + annotations?: Deployment.Annotations; author_email?: string; } -export namespace DeploymentCreateResponse { +export namespace Deployment { export interface Version { percentage: number; @@ -164,45 +164,7 @@ export namespace DeploymentCreateResponse { } export interface DeploymentListResponse { - deployments: Array; -} - -export namespace DeploymentListResponse { - export interface Deployment { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: Deployment.Annotations; - - author_email?: string; - } - - export namespace Deployment { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } - } + deployments: Array; } export interface DeploymentDeleteResponse { @@ -250,42 +212,6 @@ export namespace DeploymentDeleteResponse { } } -export interface DeploymentGetResponse { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: DeploymentGetResponse.Annotations; - - author_email?: string; -} - -export namespace DeploymentGetResponse { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } -} - export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -353,10 +279,9 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index ed521aefd1..73bd09f1ac 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,10 +4,9 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type DeploymentCreateResponse, + type Deployment, type DeploymentListResponse, type DeploymentDeleteResponse, - type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 8edb05a665..9e50ce8466 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,12 +7,11 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { + Deployment, DeploymentCreateParams, - DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, - DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -455,7 +454,7 @@ export interface ScriptUpdateParams { account_id: string; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker + * Body param: JSON-encoded metadata about the uploaded parts and Worker * configuration. */ metadata: ScriptUpdateParams.Metadata; @@ -474,7 +473,7 @@ export interface ScriptUpdateParams { export namespace ScriptUpdateParams { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface Metadata { /** @@ -1302,10 +1301,9 @@ export declare namespace Scripts { export { Deployments as Deployments, - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/versions.ts b/src/resources/workers/scripts/versions.ts index 38d224812b..1417fc3542 100644 --- a/src/resources/workers/scripts/versions.ts +++ b/src/resources/workers/scripts/versions.ts @@ -1276,7 +1276,7 @@ export interface VersionCreateParams { account_id: string; /** - * Body param: JSON encoded metadata about the uploaded parts and Worker + * Body param: JSON-encoded metadata about the uploaded parts and Worker * configuration. */ metadata: VersionCreateParams.Metadata; @@ -1295,7 +1295,7 @@ export interface VersionCreateParams { export namespace VersionCreateParams { /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface Metadata { /** diff --git a/src/resources/workers/workers.ts b/src/resources/workers/workers.ts index 62145d430b..3db9a31de7 100644 --- a/src/resources/workers/workers.ts +++ b/src/resources/workers/workers.ts @@ -181,7 +181,7 @@ export namespace SingleStepMigrationParam { } /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface WorkerMetadata { /** @@ -199,7 +199,7 @@ export interface WorkerMetadata { } /** - * JSON encoded metadata about the uploaded parts and Worker configuration. + * JSON-encoded metadata about the uploaded parts and Worker configuration. */ export interface WorkerMetadataParam { /** diff --git a/tests/api-resources/radar/ai/bots.test.ts b/tests/api-resources/radar/ai/bots.test.ts new file mode 100644 index 0000000000..f4f4374fe1 --- /dev/null +++ b/tests/api-resources/radar/ai/bots.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource bots', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.bots.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.bots.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ai.bots.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/to-markdown.test.ts b/tests/api-resources/radar/ai/to-markdown.test.ts deleted file mode 100644 index d7636b03fb..0000000000 --- a/tests/api-resources/radar/ai/to-markdown.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare, { toFile } from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource toMarkdown', () => { - // TODO: investigate prism error for invalid security scheme used - test.skip('create: only required params', async () => { - const responsePromise = client.radar.ai.toMarkdown.create( - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: investigate prism error for invalid security scheme used - test.skip('create: required and optional params', async () => { - const response = await client.radar.ai.toMarkdown.create( - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From f2bab590b48305a58cfabe5a1289b6db2ee8a826 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:46:33 +0000 Subject: [PATCH 295/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c5d9a30386..238717a8cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1790 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-405704dec8d5041847ab820752a75813fe0e8ceabb72f42ba840ced58c0f8643.yml -openapi_spec_hash: 56d7b6b4cd0ca89589c3e6fa53b28225 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml +openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 config_hash: 320699f1f989d92845c2558a970acd18 From 651f179a698a0da0d25376c538187e53697ec3c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 14:57:41 +0000 Subject: [PATCH 296/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 74 +- scripts/detect-breaking-changes | 5 +- src/resources/kv/index.ts | 1 - src/resources/kv/kv.ts | 2 - src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 9 +- src/resources/kv/namespaces/metadata.ts | 11 +- src/resources/kv/namespaces/namespaces.ts | 20 +- src/resources/kv/namespaces/values.ts | 3 +- src/resources/radar/ai/ai.ts | 45 +- src/resources/radar/ai/bots.ts | 648 +--------- src/resources/radar/ai/bots/bots.ts | 15 + .../radar/{ct.ts => ai/bots/index.ts} | 3 +- src/resources/radar/ai/bots/summary.ts | 5 + src/resources/radar/ai/index.ts | 17 +- src/resources/radar/ai/timeseries-groups.ts | 5 + src/resources/radar/ai/to-markdown.ts | 67 + src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - src/resources/workers/scripts/deployments.ts | 95 +- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- tests/api-resources/radar/ai/bots.test.ts | 135 -- .../radar/ai/to-markdown.test.ts | 35 + .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 32 files changed, 301 insertions(+), 2950 deletions(-) create mode 100644 src/resources/radar/ai/bots/bots.ts rename src/resources/radar/{ct.ts => ai/bots/index.ts} (56%) create mode 100644 src/resources/radar/ai/bots/summary.ts create mode 100644 src/resources/radar/ai/timeseries-groups.ts create mode 100644 src/resources/radar/ai/to-markdown.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/bots.test.ts create mode 100644 tests/api-resources/radar/ai/to-markdown.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 238717a8cd..99f7f054f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1790 +configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 -config_hash: 320699f1f989d92845c2558a970acd18 +config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 diff --git a/api.md b/api.md index 81515c1a8a..89ff9eae57 100644 --- a/api.md +++ b/api.md @@ -2120,16 +2120,17 @@ Methods: Types: -- Deployment +- DeploymentCreateResponse - DeploymentListResponse - DeploymentDeleteResponse +- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse ### Versions @@ -2232,7 +2233,6 @@ Methods: Types: -- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,9 +2268,13 @@ Methods: ### Metadata +Types: + +- MetadataGetResponse + Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse ### Values @@ -6331,6 +6335,16 @@ Methods: ## AI +### ToMarkdown + +Types: + +- ToMarkdownCreateResponse + +Methods: + +- client.radar.ai.toMarkdown.create(body, { ...params }) -> ToMarkdownCreateResponsesSinglePage + ### Inference #### Summary @@ -6361,17 +6375,9 @@ Methods: ### Bots -Types: - -- BotSummaryResponse -- BotTimeseriesResponse -- BotTimeseriesGroupsResponse - -Methods: +#### Summary -- client.radar.ai.bots.summary(dimension, { ...params }) -> BotSummaryResponse -- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse -- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse +### TimeseriesGroups ## Annotations @@ -6509,44 +6515,6 @@ Methods: - client.radar.bots.webCrawlers.summary(dimension, { ...params }) -> WebCrawlerSummaryResponse - client.radar.bots.webCrawlers.timeseriesGroups(dimension, { ...params }) -> WebCrawlerTimeseriesGroupsResponse -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Datasets Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index c67dcb7af0..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -537,11 +537,11 @@ TEST_PATHS=( tests/api-resources/url-scanner/scans.test.ts tests/api-resources/radar/radar.test.ts tests/api-resources/radar/ai/ai.test.ts + tests/api-resources/radar/ai/to-markdown.test.ts tests/api-resources/radar/ai/inference/inference.test.ts tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts @@ -555,9 +555,6 @@ TEST_PATHS=( tests/api-resources/radar/bgp/ips.test.ts tests/api-resources/radar/bots/bots.test.ts tests/api-resources/radar/bots/web-crawlers.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/datasets.test.ts tests/api-resources/radar/dns/dns.test.ts tests/api-resources/radar/dns/top.test.ts diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index d76651a083..6b8512b78a 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,7 +4,6 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index c216c0f0d4..6edb9e18af 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { - Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -31,7 +30,6 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index d7dc7a5289..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,11 +12,10 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 50e52613a9..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -118,7 +117,7 @@ export interface Key { */ expiration?: number; - metadata?: NamespacesAPI.Any; + metadata?: unknown; } export interface KeyBulkDeleteResponse { @@ -154,9 +153,9 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + metadata: unknown; - value: NamespacesAPI.Any; + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -269,7 +268,7 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index f8135e1b5d..53db763063 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -12,7 +11,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const any = await client.kv.namespaces.metadata.get( + * const metadata = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -24,17 +23,19 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: NamespacesAPI.Any }> + ) as Core.APIPromise<{ result: MetadataGetResponse }> )._thenUnwrap((obj) => obj.result); } } +export type MetadataGetResponse = unknown; + export interface MetadataGetParams { /** * Identifier. @@ -43,5 +44,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 6e395d77c7..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -17,7 +16,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams } from './metadata'; +import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -255,10 +254,6 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} -export type Any = unknown; - -export type AnyParam = unknown; - export interface Namespace { /** * Namespace identifier tag. @@ -317,9 +312,9 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + metadata: unknown; - value: NamespacesAPI.Any; + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -467,7 +462,7 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } } @@ -486,7 +481,6 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -516,7 +510,11 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; + export { + Metadata as Metadata, + type MetadataGetResponse as MetadataGetResponse, + type MetadataGetParams as MetadataGetParams, + }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 0a3c267c8c..03752a92d4 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -137,7 +136,7 @@ export interface ValueUpdateParams { /** * Body param: */ - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } export interface ValueDeleteParams { diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 5dbc662ee1..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -1,37 +1,46 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as BotsAPI from './bots'; +import * as TimeseriesGroupsAPI from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; +import * as ToMarkdownAPI from './to-markdown'; import { - BotSummaryParams, - BotSummaryResponse, - BotTimeseriesGroupsParams, - BotTimeseriesGroupsResponse, - BotTimeseriesParams, - BotTimeseriesResponse, - Bots, -} from './bots'; + ToMarkdown, + ToMarkdownCreateParams, + ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage, +} from './to-markdown'; +import * as BotsAPI from './bots/bots'; +import { Bots } from './bots/bots'; import * as InferenceAPI from './inference/inference'; import { Inference } from './inference/inference'; export class AI extends APIResource { + toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); + timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( + this._client, + ); } +AI.ToMarkdown = ToMarkdown; +AI.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; AI.Inference = Inference; AI.Bots = Bots; +AI.TimeseriesGroups = TimeseriesGroups; export declare namespace AI { - export { Inference as Inference }; - export { - Bots as Bots, - type BotSummaryResponse as BotSummaryResponse, - type BotTimeseriesResponse as BotTimeseriesResponse, - type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, - type BotSummaryParams as BotSummaryParams, - type BotTimeseriesParams as BotTimeseriesParams, - type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + ToMarkdown as ToMarkdown, + type ToMarkdownCreateResponse as ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, + type ToMarkdownCreateParams as ToMarkdownCreateParams, }; + + export { Inference as Inference }; + + export { Bots as Bots }; + + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/bots.ts b/src/resources/radar/ai/bots.ts index 7a447e41a8..6228f4a332 100644 --- a/src/resources/radar/ai/bots.ts +++ b/src/resources/radar/ai/bots.ts @@ -1,649 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Bots extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: BotSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: BotSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: BotSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.timeseries(); - * ``` - */ - timeseries( - query?: BotTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: BotTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: BotTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: BotTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface BotSummaryResponse { - /** - * Metadata for the results. - */ - meta: BotSummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace BotSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface BotTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: BotTimeseriesResponse.Meta; - - [k: string]: - | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | BotTimeseriesResponse.Meta - | undefined; -} - -export namespace BotTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface BotTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: BotTimeseriesGroupsResponse.Meta; - - serie_0: BotTimeseriesGroupsResponse.Serie0; -} - -export namespace BotTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface BotSummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface BotTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface BotTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace Bots { - export { - type BotSummaryResponse as BotSummaryResponse, - type BotTimeseriesResponse as BotTimeseriesResponse, - type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, - type BotSummaryParams as BotSummaryParams, - type BotTimeseriesParams as BotTimeseriesParams, - type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, - }; -} +export * from './bots/index'; diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts new file mode 100644 index 0000000000..0b5807ee07 --- /dev/null +++ b/src/resources/radar/ai/bots/bots.ts @@ -0,0 +1,15 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as SummaryAPI from './summary'; +import { Summary } from './summary'; + +export class Bots extends APIResource { + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); +} + +Bots.Summary = Summary; + +export declare namespace Bots { + export { Summary as Summary }; +} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ai/bots/index.ts similarity index 56% rename from src/resources/radar/ct.ts rename to src/resources/radar/ai/bots/index.ts index a1db06bc41..6f7091f3a3 100644 --- a/src/resources/radar/ct.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,3 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export * from './ct/index'; +export { Bots } from './bots'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts new file mode 100644 index 0000000000..5abd36afe8 --- /dev/null +++ b/src/resources/radar/ai/bots/summary.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; + +export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index d3a9bf9903..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,13 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai'; -export { - Bots, - type BotSummaryResponse, - type BotTimeseriesResponse, - type BotTimeseriesGroupsResponse, - type BotSummaryParams, - type BotTimeseriesParams, - type BotTimeseriesGroupsParams, -} from './bots'; +export { Bots } from './bots/index'; export { Inference } from './inference/index'; +export { TimeseriesGroups } from './timeseries-groups'; +export { + ToMarkdownCreateResponsesSinglePage, + ToMarkdown, + type ToMarkdownCreateResponse, + type ToMarkdownCreateParams, +} from './to-markdown'; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts new file mode 100644 index 0000000000..17f65608eb --- /dev/null +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; + +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts new file mode 100644 index 0000000000..1da4decd3e --- /dev/null +++ b/src/resources/radar/ai/to-markdown.ts @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; +import { type BlobLike } from '../../../uploads'; + +export class ToMarkdown extends APIResource { + /** + * Convert Files into Markdown + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( + * fs.createReadStream('path/to/file'), + * fs.createReadStream('path/to/file'), + * )) { + * // ... + * } + * ``` + */ + create( + body: string | ArrayBufferView | ArrayBuffer | BlobLike, + params: ToMarkdownCreateParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params ?? {}; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tomarkdown`, + ToMarkdownCreateResponsesSinglePage, + { + body, + method: 'post', + ...options, + headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, + __binaryRequest: true, + }, + ); + } +} + +export class ToMarkdownCreateResponsesSinglePage extends SinglePage {} + +export interface ToMarkdownCreateResponse { + data: string; + + format: string; + + mimeType: string; + + name: string; + + tokens: string; +} + +export type ToMarkdownCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; + +ToMarkdown.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; + +export declare namespace ToMarkdown { + export { + type ToMarkdownCreateResponse as ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, + type ToMarkdownCreateParams as ToMarkdownCreateParams, + }; +} diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 84d0eb905b..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -98,7 +88,6 @@ export class Radar extends APIResource { annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); @@ -127,7 +116,6 @@ Radar.AI = AI; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; -Radar.Ct = Ct; Radar.Datasets = Datasets; Radar.DNS = DNS; Radar.Netflows = Netflows; @@ -174,16 +162,6 @@ export declare namespace Radar { type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Datasets as Datasets, type DatasetListResponse as DatasetListResponse, diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index 1283130f6b..c23e1d1b09 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: Deployment }> + }) as Core.APIPromise<{ result: DeploymentCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: Deployment }> + ) as Core.APIPromise<{ result: DeploymentGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface Deployment { +export interface DeploymentCreateResponse { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface Deployment { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: Deployment.Annotations; + annotations?: DeploymentCreateResponse.Annotations; author_email?: string; } -export namespace Deployment { +export namespace DeploymentCreateResponse { export interface Version { percentage: number; @@ -164,7 +164,45 @@ export namespace Deployment { } export interface DeploymentListResponse { - deployments: Array; + deployments: Array; +} + +export namespace DeploymentListResponse { + export interface Deployment { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: Deployment.Annotations; + + author_email?: string; + } + + export namespace Deployment { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } + } } export interface DeploymentDeleteResponse { @@ -212,6 +250,42 @@ export namespace DeploymentDeleteResponse { } } +export interface DeploymentGetResponse { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: DeploymentGetResponse.Annotations; + + author_email?: string; +} + +export namespace DeploymentGetResponse { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } +} + export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -279,9 +353,10 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 73bd09f1ac..ed521aefd1 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,9 +4,10 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type Deployment, + type DeploymentCreateResponse, type DeploymentListResponse, type DeploymentDeleteResponse, + type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 9e50ce8466..efe5a31446 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,11 +7,12 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { - Deployment, DeploymentCreateParams, + DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, + DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1301,9 +1302,10 @@ export declare namespace Scripts { export { Deployments as Deployments, - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/tests/api-resources/radar/ai/bots.test.ts b/tests/api-resources/radar/ai/bots.test.ts deleted file mode 100644 index f4f4374fe1..0000000000 --- a/tests/api-resources/radar/ai/bots.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource bots', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.bots.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.bots.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ai.bots.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.bots.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ai/to-markdown.test.ts b/tests/api-resources/radar/ai/to-markdown.test.ts new file mode 100644 index 0000000000..d7636b03fb --- /dev/null +++ b/tests/api-resources/radar/ai/to-markdown.test.ts @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare, { toFile } from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource toMarkdown', () => { + // TODO: investigate prism error for invalid security scheme used + test.skip('create: only required params', async () => { + const responsePromise = client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // TODO: investigate prism error for invalid security scheme used + test.skip('create: required and optional params', async () => { + const response = await client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); + }); +}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From afaabaad39785cfa99294a320dafbee54f1ca2e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 15:02:04 +0000 Subject: [PATCH 297/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 2 +- api.md | 14 ++- src/resources/kv/index.ts | 1 + src/resources/kv/kv.ts | 2 + src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 9 +- src/resources/kv/namespaces/metadata.ts | 11 ++- src/resources/kv/namespaces/namespaces.ts | 20 +++-- src/resources/kv/namespaces/values.ts | 3 +- src/resources/workers/scripts/deployments.ts | 95 +++----------------- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- 12 files changed, 47 insertions(+), 122 deletions(-) diff --git a/.stats.yml b/.stats.yml index 99f7f054f0..e42a8fae72 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 -config_hash: a433f3793b734bc6fcc9d9e0c27ff8c2 +config_hash: b9d4fdd8e697af382ae0ca080ed71364 diff --git a/api.md b/api.md index 89ff9eae57..c56e5f1f88 100644 --- a/api.md +++ b/api.md @@ -2120,17 +2120,16 @@ Methods: Types: -- DeploymentCreateResponse +- Deployment - DeploymentListResponse - DeploymentDeleteResponse -- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment ### Versions @@ -2233,6 +2232,7 @@ Methods: Types: +- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,13 +2268,9 @@ Methods: ### Metadata -Types: - -- MetadataGetResponse - Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any ### Values diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index 6b8512b78a..d76651a083 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,6 +4,7 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 6edb9e18af..c216c0f0d4 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { + Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -30,6 +31,7 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..d7dc7a5289 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,10 +12,11 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..50e52613a9 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -117,7 +118,7 @@ export interface Key { */ expiration?: number; - metadata?: unknown; + metadata?: NamespacesAPI.Any; } export interface KeyBulkDeleteResponse { @@ -153,9 +154,9 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: unknown; + metadata: NamespacesAPI.Any; - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -268,7 +269,7 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 53db763063..f8135e1b5d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -11,7 +12,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const metadata = await client.kv.namespaces.metadata.get( + * const any = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -23,19 +24,17 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: MetadataGetResponse }> + ) as Core.APIPromise<{ result: NamespacesAPI.Any }> )._thenUnwrap((obj) => obj.result); } } -export type MetadataGetResponse = unknown; - export interface MetadataGetParams { /** * Identifier. @@ -44,5 +43,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..6e395d77c7 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -16,7 +17,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; +import { Metadata, MetadataGetParams } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -254,6 +255,10 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} +export type Any = unknown; + +export type AnyParam = unknown; + export interface Namespace { /** * Namespace identifier tag. @@ -312,9 +317,9 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: unknown; + metadata: NamespacesAPI.Any; - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -462,7 +467,7 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } @@ -481,6 +486,7 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -510,11 +516,7 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { - Metadata as Metadata, - type MetadataGetResponse as MetadataGetResponse, - type MetadataGetParams as MetadataGetParams, - }; + export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 03752a92d4..0a3c267c8c 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -136,7 +137,7 @@ export interface ValueUpdateParams { /** * Body param: */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } export interface ValueDeleteParams { diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index c23e1d1b09..1283130f6b 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: DeploymentCreateResponse }> + }) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: DeploymentGetResponse }> + ) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } } -export interface DeploymentCreateResponse { +export interface Deployment { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface DeploymentCreateResponse { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: DeploymentCreateResponse.Annotations; + annotations?: Deployment.Annotations; author_email?: string; } -export namespace DeploymentCreateResponse { +export namespace Deployment { export interface Version { percentage: number; @@ -164,45 +164,7 @@ export namespace DeploymentCreateResponse { } export interface DeploymentListResponse { - deployments: Array; -} - -export namespace DeploymentListResponse { - export interface Deployment { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: Deployment.Annotations; - - author_email?: string; - } - - export namespace Deployment { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } - } + deployments: Array; } export interface DeploymentDeleteResponse { @@ -250,42 +212,6 @@ export namespace DeploymentDeleteResponse { } } -export interface DeploymentGetResponse { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: DeploymentGetResponse.Annotations; - - author_email?: string; -} - -export namespace DeploymentGetResponse { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } -} - export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -353,10 +279,9 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index ed521aefd1..73bd09f1ac 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,10 +4,9 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type DeploymentCreateResponse, + type Deployment, type DeploymentListResponse, type DeploymentDeleteResponse, - type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index efe5a31446..9e50ce8466 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,12 +7,11 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { + Deployment, DeploymentCreateParams, - DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, - DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1302,10 +1301,9 @@ export declare namespace Scripts { export { Deployments as Deployments, - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, From b8165887056f71717deaf9f15083c4266c426267 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 15:05:09 +0000 Subject: [PATCH 298/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 60 +- scripts/detect-breaking-changes | 5 +- src/resources/radar/ai/ai.ts | 45 +- src/resources/radar/ai/bots.ts | 648 +++++++++- src/resources/radar/ai/bots/bots.ts | 15 - src/resources/radar/ai/bots/summary.ts | 5 - src/resources/radar/ai/index.ts | 17 +- src/resources/radar/ai/timeseries-groups.ts | 5 - src/resources/radar/ai/to-markdown.ts | 67 - .../radar/{ai/bots/index.ts => ct.ts} | 3 +- src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + tests/api-resources/radar/ai/bots.test.ts | 135 ++ .../radar/ai/to-markdown.test.ts | 35 - .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 22 files changed, 2904 insertions(+), 180 deletions(-) delete mode 100644 src/resources/radar/ai/bots/bots.ts delete mode 100644 src/resources/radar/ai/bots/summary.ts delete mode 100644 src/resources/radar/ai/timeseries-groups.ts delete mode 100644 src/resources/radar/ai/to-markdown.ts rename src/resources/radar/{ai/bots/index.ts => ct.ts} (56%) create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/bots.test.ts delete mode 100644 tests/api-resources/radar/ai/to-markdown.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index e42a8fae72..238717a8cd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 +configured_endpoints: 1790 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 -config_hash: b9d4fdd8e697af382ae0ca080ed71364 +config_hash: 320699f1f989d92845c2558a970acd18 diff --git a/api.md b/api.md index c56e5f1f88..81515c1a8a 100644 --- a/api.md +++ b/api.md @@ -6331,16 +6331,6 @@ Methods: ## AI -### ToMarkdown - -Types: - -- ToMarkdownCreateResponse - -Methods: - -- client.radar.ai.toMarkdown.create(body, { ...params }) -> ToMarkdownCreateResponsesSinglePage - ### Inference #### Summary @@ -6371,9 +6361,17 @@ Methods: ### Bots -#### Summary +Types: -### TimeseriesGroups +- BotSummaryResponse +- BotTimeseriesResponse +- BotTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summary(dimension, { ...params }) -> BotSummaryResponse +- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse +- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse ## Annotations @@ -6511,6 +6509,44 @@ Methods: - client.radar.bots.webCrawlers.summary(dimension, { ...params }) -> WebCrawlerSummaryResponse - client.radar.bots.webCrawlers.timeseriesGroups(dimension, { ...params }) -> WebCrawlerTimeseriesGroupsResponse +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Datasets Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..c67dcb7af0 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -537,11 +537,11 @@ TEST_PATHS=( tests/api-resources/url-scanner/scans.test.ts tests/api-resources/radar/radar.test.ts tests/api-resources/radar/ai/ai.test.ts - tests/api-resources/radar/ai/to-markdown.test.ts tests/api-resources/radar/ai/inference/inference.test.ts tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts @@ -555,6 +555,9 @@ TEST_PATHS=( tests/api-resources/radar/bgp/ips.test.ts tests/api-resources/radar/bots/bots.test.ts tests/api-resources/radar/bots/web-crawlers.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/datasets.test.ts tests/api-resources/radar/dns/dns.test.ts tests/api-resources/radar/dns/top.test.ts diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..5dbc662ee1 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -1,46 +1,37 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; -import * as ToMarkdownAPI from './to-markdown'; +import * as BotsAPI from './bots'; import { - ToMarkdown, - ToMarkdownCreateParams, - ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage, -} from './to-markdown'; -import * as BotsAPI from './bots/bots'; -import { Bots } from './bots/bots'; + BotSummaryParams, + BotSummaryResponse, + BotTimeseriesGroupsParams, + BotTimeseriesGroupsResponse, + BotTimeseriesParams, + BotTimeseriesResponse, + Bots, +} from './bots'; import * as InferenceAPI from './inference/inference'; import { Inference } from './inference/inference'; export class AI extends APIResource { - toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); - timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( - this._client, - ); } -AI.ToMarkdown = ToMarkdown; -AI.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; AI.Inference = Inference; AI.Bots = Bots; -AI.TimeseriesGroups = TimeseriesGroups; export declare namespace AI { - export { - ToMarkdown as ToMarkdown, - type ToMarkdownCreateResponse as ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, - type ToMarkdownCreateParams as ToMarkdownCreateParams, - }; - export { Inference as Inference }; - export { Bots as Bots }; - - export { TimeseriesGroups as TimeseriesGroups }; + export { + Bots as Bots, + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/bots.ts b/src/resources/radar/ai/bots.ts index 6228f4a332..7a447e41a8 100644 --- a/src/resources/radar/ai/bots.ts +++ b/src/resources/radar/ai/bots.ts @@ -1,3 +1,649 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export * from './bots/index'; +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Bots extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: BotSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: BotSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: BotSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.timeseries(); + * ``` + */ + timeseries( + query?: BotTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: BotTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: BotTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: BotTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface BotSummaryResponse { + /** + * Metadata for the results. + */ + meta: BotSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace BotSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface BotTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesResponse.Meta; + + [k: string]: + | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | BotTimeseriesResponse.Meta + | undefined; +} + +export namespace BotTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: BotTimeseriesGroupsResponse.Meta; + + serie_0: BotTimeseriesGroupsResponse.Serie0; +} + +export namespace BotTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface BotSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface BotTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface BotTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace Bots { + export { + type BotSummaryResponse as BotSummaryResponse, + type BotTimeseriesResponse as BotTimeseriesResponse, + type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, + type BotSummaryParams as BotSummaryParams, + type BotTimeseriesParams as BotTimeseriesParams, + type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts deleted file mode 100644 index 0b5807ee07..0000000000 --- a/src/resources/radar/ai/bots/bots.ts +++ /dev/null @@ -1,15 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../../resource'; -import * as SummaryAPI from './summary'; -import { Summary } from './summary'; - -export class Bots extends APIResource { - summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); -} - -Bots.Summary = Summary; - -export declare namespace Bots { - export { Summary as Summary }; -} diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts deleted file mode 100644 index 5abd36afe8..0000000000 --- a/src/resources/radar/ai/bots/summary.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../../resource'; - -export class Summary extends APIResource {} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..d3a9bf9903 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,12 +1,13 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai'; -export { Bots } from './bots/index'; -export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; export { - ToMarkdownCreateResponsesSinglePage, - ToMarkdown, - type ToMarkdownCreateResponse, - type ToMarkdownCreateParams, -} from './to-markdown'; + Bots, + type BotSummaryResponse, + type BotTimeseriesResponse, + type BotTimeseriesGroupsResponse, + type BotSummaryParams, + type BotTimeseriesParams, + type BotTimeseriesGroupsParams, +} from './bots'; +export { Inference } from './inference/index'; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts deleted file mode 100644 index 17f65608eb..0000000000 --- a/src/resources/radar/ai/timeseries-groups.ts +++ /dev/null @@ -1,5 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; - -export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts deleted file mode 100644 index 1da4decd3e..0000000000 --- a/src/resources/radar/ai/to-markdown.ts +++ /dev/null @@ -1,67 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import * as Core from '../../../core'; -import { SinglePage } from '../../../pagination'; -import { type BlobLike } from '../../../uploads'; - -export class ToMarkdown extends APIResource { - /** - * Convert Files into Markdown - * - * @example - * ```ts - * // Automatically fetches more pages as needed. - * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( - * fs.createReadStream('path/to/file'), - * fs.createReadStream('path/to/file'), - * )) { - * // ... - * } - * ``` - */ - create( - body: string | ArrayBufferView | ArrayBuffer | BlobLike, - params: ToMarkdownCreateParams, - options?: Core.RequestOptions, - ): Core.PagePromise { - const { account_id } = params ?? {}; - return this._client.getAPIList( - `/accounts/${account_id}/ai/tomarkdown`, - ToMarkdownCreateResponsesSinglePage, - { - body, - method: 'post', - ...options, - headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, - __binaryRequest: true, - }, - ); - } -} - -export class ToMarkdownCreateResponsesSinglePage extends SinglePage {} - -export interface ToMarkdownCreateResponse { - data: string; - - format: string; - - mimeType: string; - - name: string; - - tokens: string; -} - -export type ToMarkdownCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; - -ToMarkdown.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; - -export declare namespace ToMarkdown { - export { - type ToMarkdownCreateResponse as ToMarkdownCreateResponse, - ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, - type ToMarkdownCreateParams as ToMarkdownCreateParams, - }; -} diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ct.ts similarity index 56% rename from src/resources/radar/ai/bots/index.ts rename to src/resources/radar/ct.ts index 6f7091f3a3..a1db06bc41 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ct.ts @@ -1,4 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Bots } from './bots'; -export { Summary } from './summary'; +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..84d0eb905b 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -88,6 +98,7 @@ export class Radar extends APIResource { annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); @@ -116,6 +127,7 @@ Radar.AI = AI; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; +Radar.Ct = Ct; Radar.Datasets = Datasets; Radar.DNS = DNS; Radar.Netflows = Netflows; @@ -162,6 +174,16 @@ export declare namespace Radar { type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Datasets as Datasets, type DatasetListResponse as DatasetListResponse, diff --git a/tests/api-resources/radar/ai/bots.test.ts b/tests/api-resources/radar/ai/bots.test.ts new file mode 100644 index 0000000000..f4f4374fe1 --- /dev/null +++ b/tests/api-resources/radar/ai/bots.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource bots', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.bots.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.bots.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ai.bots.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/to-markdown.test.ts b/tests/api-resources/radar/ai/to-markdown.test.ts deleted file mode 100644 index d7636b03fb..0000000000 --- a/tests/api-resources/radar/ai/to-markdown.test.ts +++ /dev/null @@ -1,35 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare, { toFile } from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource toMarkdown', () => { - // TODO: investigate prism error for invalid security scheme used - test.skip('create: only required params', async () => { - const responsePromise = client.radar.ai.toMarkdown.create( - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - // TODO: investigate prism error for invalid security scheme used - test.skip('create: required and optional params', async () => { - const response = await client.radar.ai.toMarkdown.create( - await toFile(Buffer.from('# my file contents'), 'README.md'), - await toFile(Buffer.from('# my file contents'), 'README.md'), - ); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From 72c433647949e8c4aa7f2323fc1b0ebb94cacf64 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 15:48:48 +0000 Subject: [PATCH 299/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 102 +-- scripts/detect-breaking-changes | 10 +- src/resources/radar/ai/ai.ts | 45 +- src/resources/radar/ai/bots.ts | 648 +---------------- src/resources/radar/ai/bots/bots.ts | 31 + src/resources/radar/ai/bots/index.ts | 12 + src/resources/radar/ai/bots/summary.ts | 652 ++++++++++++++++++ src/resources/radar/ai/index.ts | 17 +- src/resources/radar/ai/timeseries-groups.ts | 5 + src/resources/radar/ai/to-markdown.ts | 67 ++ src/resources/radar/radar.ts | 24 +- .../ai/{bots.test.ts => bots/summary.test.ts} | 24 +- .../radar/ai/to-markdown.test.ts | 35 + 14 files changed, 928 insertions(+), 748 deletions(-) create mode 100644 src/resources/radar/ai/bots/bots.ts create mode 100644 src/resources/radar/ai/bots/index.ts create mode 100644 src/resources/radar/ai/bots/summary.ts create mode 100644 src/resources/radar/ai/timeseries-groups.ts create mode 100644 src/resources/radar/ai/to-markdown.ts rename tests/api-resources/radar/ai/{bots.test.ts => bots/summary.test.ts} (85%) create mode 100644 tests/api-resources/radar/ai/to-markdown.test.ts diff --git a/.stats.yml b/.stats.yml index 238717a8cd..f2551e991a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1790 +configured_endpoints: 1791 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 -config_hash: 320699f1f989d92845c2558a970acd18 +config_hash: f20ebbab54916fcc81ef643e3acda11a diff --git a/api.md b/api.md index 81515c1a8a..7212780476 100644 --- a/api.md +++ b/api.md @@ -6331,6 +6331,16 @@ Methods: ## AI +### ToMarkdown + +Types: + +- ToMarkdownCreateResponse + +Methods: + +- client.radar.ai.toMarkdown.create(body, { ...params }) -> ToMarkdownCreateResponsesSinglePage + ### Inference #### Summary @@ -6361,17 +6371,59 @@ Methods: ### Bots +#### Summary + +Types: + +- SummarySummaryResponse +- SummaryTimeseriesResponse +- SummaryTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summary.summary(dimension, { ...params }) -> SummarySummaryResponse +- client.radar.ai.bots.summary.timeseries({ ...params }) -> SummaryTimeseriesResponse +- client.radar.ai.bots.summary.timeseriesGroups(dimension, { ...params }) -> SummaryTimeseriesGroupsResponse + +### TimeseriesGroups + +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + Types: -- BotSummaryResponse -- BotTimeseriesResponse -- BotTimeseriesGroupsResponse +- AuthorityListResponse +- AuthorityGetResponse Methods: -- client.radar.ai.bots.summary(dimension, { ...params }) -> BotSummaryResponse -- client.radar.ai.bots.timeseries({ ...params }) -> BotTimeseriesResponse -- client.radar.ai.bots.timeseriesGroups(dimension, { ...params }) -> BotTimeseriesGroupsResponse +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse ## Annotations @@ -6509,44 +6561,6 @@ Methods: - client.radar.bots.webCrawlers.summary(dimension, { ...params }) -> WebCrawlerSummaryResponse - client.radar.bots.webCrawlers.timeseriesGroups(dimension, { ...params }) -> WebCrawlerTimeseriesGroupsResponse -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Datasets Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index c67dcb7af0..695ff40abf 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -537,11 +537,16 @@ TEST_PATHS=( tests/api-resources/url-scanner/scans.test.ts tests/api-resources/radar/radar.test.ts tests/api-resources/radar/ai/ai.test.ts + tests/api-resources/radar/ai/to-markdown.test.ts tests/api-resources/radar/ai/inference/inference.test.ts tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts @@ -555,9 +560,6 @@ TEST_PATHS=( tests/api-resources/radar/bgp/ips.test.ts tests/api-resources/radar/bots/bots.test.ts tests/api-resources/radar/bots/web-crawlers.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/datasets.test.ts tests/api-resources/radar/dns/dns.test.ts tests/api-resources/radar/dns/top.test.ts diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 5dbc662ee1..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -1,37 +1,46 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import * as BotsAPI from './bots'; +import * as TimeseriesGroupsAPI from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; +import * as ToMarkdownAPI from './to-markdown'; import { - BotSummaryParams, - BotSummaryResponse, - BotTimeseriesGroupsParams, - BotTimeseriesGroupsResponse, - BotTimeseriesParams, - BotTimeseriesResponse, - Bots, -} from './bots'; + ToMarkdown, + ToMarkdownCreateParams, + ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage, +} from './to-markdown'; +import * as BotsAPI from './bots/bots'; +import { Bots } from './bots/bots'; import * as InferenceAPI from './inference/inference'; import { Inference } from './inference/inference'; export class AI extends APIResource { + toMarkdown: ToMarkdownAPI.ToMarkdown = new ToMarkdownAPI.ToMarkdown(this._client); inference: InferenceAPI.Inference = new InferenceAPI.Inference(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); + timeseriesGroups: TimeseriesGroupsAPI.TimeseriesGroups = new TimeseriesGroupsAPI.TimeseriesGroups( + this._client, + ); } +AI.ToMarkdown = ToMarkdown; +AI.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; AI.Inference = Inference; AI.Bots = Bots; +AI.TimeseriesGroups = TimeseriesGroups; export declare namespace AI { - export { Inference as Inference }; - export { - Bots as Bots, - type BotSummaryResponse as BotSummaryResponse, - type BotTimeseriesResponse as BotTimeseriesResponse, - type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, - type BotSummaryParams as BotSummaryParams, - type BotTimeseriesParams as BotTimeseriesParams, - type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, + ToMarkdown as ToMarkdown, + type ToMarkdownCreateResponse as ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, + type ToMarkdownCreateParams as ToMarkdownCreateParams, }; + + export { Inference as Inference }; + + export { Bots as Bots }; + + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/bots.ts b/src/resources/radar/ai/bots.ts index 7a447e41a8..6228f4a332 100644 --- a/src/resources/radar/ai/bots.ts +++ b/src/resources/radar/ai/bots.ts @@ -1,649 +1,3 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Bots extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: BotSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: BotSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: BotSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.timeseries(); - * ``` - */ - timeseries( - query?: BotTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: BotTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: BotTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.timeseriesGroups('USER_AGENT'); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: BotTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: BotTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: BotTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface BotSummaryResponse { - /** - * Metadata for the results. - */ - meta: BotSummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace BotSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface BotTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: BotTimeseriesResponse.Meta; - - [k: string]: - | BotTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | BotTimeseriesResponse.Meta - | undefined; -} - -export namespace BotTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface BotTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: BotTimeseriesGroupsResponse.Meta; - - serie_0: BotTimeseriesGroupsResponse.Serie0; -} - -export namespace BotTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface BotSummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface BotTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface BotTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace Bots { - export { - type BotSummaryResponse as BotSummaryResponse, - type BotTimeseriesResponse as BotTimeseriesResponse, - type BotTimeseriesGroupsResponse as BotTimeseriesGroupsResponse, - type BotSummaryParams as BotSummaryParams, - type BotTimeseriesParams as BotTimeseriesParams, - type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, - }; -} +export * from './bots/index'; diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts new file mode 100644 index 0000000000..73d8006eed --- /dev/null +++ b/src/resources/radar/ai/bots/bots.ts @@ -0,0 +1,31 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import * as SummaryAPI from './summary'; +import { + Summary, + SummarySummaryParams, + SummarySummaryResponse, + SummaryTimeseriesGroupsParams, + SummaryTimeseriesGroupsResponse, + SummaryTimeseriesParams, + SummaryTimeseriesResponse, +} from './summary'; + +export class Bots extends APIResource { + summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); +} + +Bots.Summary = Summary; + +export declare namespace Bots { + export { + Summary as Summary, + type SummarySummaryResponse as SummarySummaryResponse, + type SummaryTimeseriesResponse as SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, + type SummarySummaryParams as SummarySummaryParams, + type SummaryTimeseriesParams as SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts new file mode 100644 index 0000000000..1305297f21 --- /dev/null +++ b/src/resources/radar/ai/bots/index.ts @@ -0,0 +1,12 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { Bots } from './bots'; +export { + Summary, + type SummarySummaryResponse, + type SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse, + type SummarySummaryParams, + type SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams, +} from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts new file mode 100644 index 0000000000..0b1513f156 --- /dev/null +++ b/src/resources/radar/ai/bots/summary.ts @@ -0,0 +1,652 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; + +export class Summary extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summary.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: SummarySummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: SummarySummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: SummarySummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.timeseries(); + * ``` + */ + timeseries( + query?: SummaryTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: SummaryTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: SummaryTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: SummaryTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: SummaryTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummarySummaryResponse { + /** + * Metadata for the results. + */ + meta: SummarySummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SummarySummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SummaryTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: SummaryTimeseriesResponse.Meta; + + [k: string]: + | SummaryTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | SummaryTimeseriesResponse.Meta + | undefined; +} + +export namespace SummaryTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface SummaryTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: SummaryTimeseriesGroupsResponse.Meta; + + serie_0: SummaryTimeseriesGroupsResponse.Serie0; +} + +export namespace SummaryTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface SummarySummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface SummaryTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface SummaryTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace Summary { + export { + type SummarySummaryResponse as SummarySummaryResponse, + type SummaryTimeseriesResponse as SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, + type SummarySummaryParams as SummarySummaryParams, + type SummaryTimeseriesParams as SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index d3a9bf9903..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -1,13 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { AI } from './ai'; -export { - Bots, - type BotSummaryResponse, - type BotTimeseriesResponse, - type BotTimeseriesGroupsResponse, - type BotSummaryParams, - type BotTimeseriesParams, - type BotTimeseriesGroupsParams, -} from './bots'; +export { Bots } from './bots/index'; export { Inference } from './inference/index'; +export { TimeseriesGroups } from './timeseries-groups'; +export { + ToMarkdownCreateResponsesSinglePage, + ToMarkdown, + type ToMarkdownCreateResponse, + type ToMarkdownCreateParams, +} from './to-markdown'; diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts new file mode 100644 index 0000000000..17f65608eb --- /dev/null +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; + +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ai/to-markdown.ts b/src/resources/radar/ai/to-markdown.ts new file mode 100644 index 0000000000..1da4decd3e --- /dev/null +++ b/src/resources/radar/ai/to-markdown.ts @@ -0,0 +1,67 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import * as Core from '../../../core'; +import { SinglePage } from '../../../pagination'; +import { type BlobLike } from '../../../uploads'; + +export class ToMarkdown extends APIResource { + /** + * Convert Files into Markdown + * + * @example + * ```ts + * // Automatically fetches more pages as needed. + * for await (const toMarkdownCreateResponse of client.radar.ai.toMarkdown.create( + * fs.createReadStream('path/to/file'), + * fs.createReadStream('path/to/file'), + * )) { + * // ... + * } + * ``` + */ + create( + body: string | ArrayBufferView | ArrayBuffer | BlobLike, + params: ToMarkdownCreateParams, + options?: Core.RequestOptions, + ): Core.PagePromise { + const { account_id } = params ?? {}; + return this._client.getAPIList( + `/accounts/${account_id}/ai/tomarkdown`, + ToMarkdownCreateResponsesSinglePage, + { + body, + method: 'post', + ...options, + headers: { 'Content-Type': 'application/octet-stream', ...options?.headers }, + __binaryRequest: true, + }, + ); + } +} + +export class ToMarkdownCreateResponsesSinglePage extends SinglePage {} + +export interface ToMarkdownCreateResponse { + data: string; + + format: string; + + mimeType: string; + + name: string; + + tokens: string; +} + +export type ToMarkdownCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; + +ToMarkdown.ToMarkdownCreateResponsesSinglePage = ToMarkdownCreateResponsesSinglePage; + +export declare namespace ToMarkdown { + export { + type ToMarkdownCreateResponse as ToMarkdownCreateResponse, + ToMarkdownCreateResponsesSinglePage as ToMarkdownCreateResponsesSinglePage, + type ToMarkdownCreateParams as ToMarkdownCreateParams, + }; +} diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 84d0eb905b..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -95,10 +95,10 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); datasets: DatasetsAPI.Datasets = new DatasetsAPI.Datasets(this._client); dns: DNSAPI.DNS = new DNSAPI.DNS(this._client); netflows: NetflowsAPI.Netflows = new NetflowsAPI.Netflows(this._client); @@ -124,10 +124,10 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; -Radar.Ct = Ct; Radar.Datasets = Datasets; Radar.DNS = DNS; Radar.Netflows = Netflows; @@ -148,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, @@ -174,16 +184,6 @@ export declare namespace Radar { type BotTimeseriesGroupsParams as BotTimeseriesGroupsParams, }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Datasets as Datasets, type DatasetListResponse as DatasetListResponse, diff --git a/tests/api-resources/radar/ai/bots.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts similarity index 85% rename from tests/api-resources/radar/ai/bots.test.ts rename to tests/api-resources/radar/ai/bots/summary.test.ts index f4f4374fe1..4e0c817887 100644 --- a/tests/api-resources/radar/ai/bots.test.ts +++ b/tests/api-resources/radar/ai/bots/summary.test.ts @@ -9,9 +9,9 @@ const client = new Cloudflare({ baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', }); -describe('resource bots', () => { +describe('resource summary', () => { test('summary', async () => { - const responsePromise = client.radar.ai.bots.summary('USER_AGENT'); + const responsePromise = client.radar.ai.bots.summary.summary('USER_AGENT'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -24,14 +24,14 @@ describe('resource bots', () => { test('summary: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.radar.ai.bots.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + client.radar.ai.bots.summary.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); test('summary: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.radar.ai.bots.summary( + client.radar.ai.bots.summary.summary( 'USER_AGENT', { asn: ['string'], @@ -51,7 +51,7 @@ describe('resource bots', () => { }); test('timeseries', async () => { - const responsePromise = client.radar.ai.bots.timeseries(); + const responsePromise = client.radar.ai.bots.summary.timeseries(); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -63,15 +63,15 @@ describe('resource bots', () => { test('timeseries: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ai.bots.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); + await expect( + client.radar.ai.bots.summary.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); }); test('timeseries: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.radar.ai.bots.timeseries( + client.radar.ai.bots.summary.timeseries( { aggInterval: '1h', asn: ['string'], @@ -92,7 +92,7 @@ describe('resource bots', () => { }); test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.bots.timeseriesGroups('USER_AGENT'); + const responsePromise = client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT'); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -105,14 +105,14 @@ describe('resource bots', () => { test('timeseriesGroups: request options instead of params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.radar.ai.bots.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), ).rejects.toThrow(Cloudflare.NotFoundError); }); test('timeseriesGroups: request options and params are passed correctly', async () => { // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error await expect( - client.radar.ai.bots.timeseriesGroups( + client.radar.ai.bots.summary.timeseriesGroups( 'USER_AGENT', { aggInterval: '1h', diff --git a/tests/api-resources/radar/ai/to-markdown.test.ts b/tests/api-resources/radar/ai/to-markdown.test.ts new file mode 100644 index 0000000000..d7636b03fb --- /dev/null +++ b/tests/api-resources/radar/ai/to-markdown.test.ts @@ -0,0 +1,35 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare, { toFile } from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource toMarkdown', () => { + // TODO: investigate prism error for invalid security scheme used + test.skip('create: only required params', async () => { + const responsePromise = client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + // TODO: investigate prism error for invalid security scheme used + test.skip('create: required and optional params', async () => { + const response = await client.radar.ai.toMarkdown.create( + await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), + ); + }); +}); From 5131caf374ef5ae11954501290fadc80d3198d07 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:21:39 +0000 Subject: [PATCH 300/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f2551e991a..f3de093828 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a617495230e553e067b258702b644f898b56c21bdf238c1eb2dd10df376f098d.yml -openapi_spec_hash: ae16f120056f9a9558a408f0c1ecb626 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e2ec268e22e3025809b88fd51b63b4a353a0b7a6e98fb6b90694e16941a50fed.yml +openapi_spec_hash: 2c0d5d5f3f98f2666bd36ccfef4f6b04 config_hash: f20ebbab54916fcc81ef643e3acda11a From 675012aa3109236a64eaa16fe7de257532b27d60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:33:00 +0000 Subject: [PATCH 301/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f3de093828..73b02c3ec3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e2ec268e22e3025809b88fd51b63b4a353a0b7a6e98fb6b90694e16941a50fed.yml -openapi_spec_hash: 2c0d5d5f3f98f2666bd36ccfef4f6b04 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9a90d84374801d79af8d42da10e9e44874cec797e617f1216dfcc8ba7830c74.yml +openapi_spec_hash: 28e5f4bfda0207bee55dbb865c79ec55 config_hash: f20ebbab54916fcc81ef643e3acda11a From 03790cc32ca9e8930a770468349f346d4fb0de26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:51:37 +0000 Subject: [PATCH 302/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 50 - scripts/detect-breaking-changes | 5 - src/resources/radar/ai/bots/bots.ts | 20 +- src/resources/radar/ai/bots/index.ts | 10 +- src/resources/radar/ai/bots/summary.ts | 649 +--------- src/resources/radar/ct.ts | 3 - src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - .../radar/ai/bots/summary.test.ts | 135 -- .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 17 files changed, 6 insertions(+), 2910 deletions(-) delete mode 100644 src/resources/radar/ct.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 73b02c3ec3..2e879b9d01 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1791 +configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9a90d84374801d79af8d42da10e9e44874cec797e617f1216dfcc8ba7830c74.yml openapi_spec_hash: 28e5f4bfda0207bee55dbb865c79ec55 -config_hash: f20ebbab54916fcc81ef643e3acda11a +config_hash: b9d4fdd8e697af382ae0ca080ed71364 diff --git a/api.md b/api.md index 7212780476..c56e5f1f88 100644 --- a/api.md +++ b/api.md @@ -6373,58 +6373,8 @@ Methods: #### Summary -Types: - -- SummarySummaryResponse -- SummaryTimeseriesResponse -- SummaryTimeseriesGroupsResponse - -Methods: - -- client.radar.ai.bots.summary.summary(dimension, { ...params }) -> SummarySummaryResponse -- client.radar.ai.bots.summary.timeseries({ ...params }) -> SummaryTimeseriesResponse -- client.radar.ai.bots.summary.timeseriesGroups(dimension, { ...params }) -> SummaryTimeseriesGroupsResponse - ### TimeseriesGroups -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 695ff40abf..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,11 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots/bots.test.ts - tests/api-resources/radar/ai/bots/summary.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 73d8006eed..0b5807ee07 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,15 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { - Summary, - SummarySummaryParams, - SummarySummaryResponse, - SummaryTimeseriesGroupsParams, - SummaryTimeseriesGroupsResponse, - SummaryTimeseriesParams, - SummaryTimeseriesResponse, -} from './summary'; +import { Summary } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -19,13 +11,5 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { - Summary as Summary, - type SummarySummaryResponse as SummarySummaryResponse, - type SummaryTimeseriesResponse as SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, - type SummarySummaryParams as SummarySummaryParams, - type SummaryTimeseriesParams as SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, - }; + export { Summary as Summary }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 1305297f21..6f7091f3a3 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,12 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { - Summary, - type SummarySummaryResponse, - type SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse, - type SummarySummaryParams, - type SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams, -} from './summary'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 0b1513f156..5abd36afe8 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,652 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import { isRequestOptions } from '../../../../core'; -import * as Core from '../../../../core'; -export class Summary extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.summary.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: SummarySummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: SummarySummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: SummarySummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.timeseries(); - * ``` - */ - timeseries( - query?: SummaryTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: SummaryTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: SummaryTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: SummaryTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: SummaryTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: SummaryTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummarySummaryResponse { - /** - * Metadata for the results. - */ - meta: SummarySummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SummarySummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface SummaryTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: SummaryTimeseriesResponse.Meta; - - [k: string]: - | SummaryTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | SummaryTimeseriesResponse.Meta - | undefined; -} - -export namespace SummaryTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface SummaryTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: SummaryTimeseriesGroupsResponse.Meta; - - serie_0: SummaryTimeseriesGroupsResponse.Serie0; -} - -export namespace SummaryTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface SummarySummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface SummaryTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface SummaryTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace Summary { - export { - type SummarySummaryResponse as SummarySummaryResponse, - type SummaryTimeseriesResponse as SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, - type SummarySummaryParams as SummarySummaryParams, - type SummaryTimeseriesParams as SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, - }; -} +export class Summary extends APIResource {} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts deleted file mode 100644 index a1db06bc41..0000000000 --- a/src/resources/radar/ct.ts +++ /dev/null @@ -1,3 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -95,7 +85,6 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -124,7 +113,6 @@ export class Radar extends APIResource { } Radar.AI = AI; -Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -148,16 +136,6 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts deleted file mode 100644 index 4e0c817887..0000000000 --- a/tests/api-resources/radar/ai/bots/summary.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.bots.summary.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.bots.summary.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseries({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From 1e599dba6756b84fdeffee72081db5acde7a88fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 16:54:46 +0000 Subject: [PATCH 303/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2e879b9d01..f91b4ad64d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f9a90d84374801d79af8d42da10e9e44874cec797e617f1216dfcc8ba7830c74.yml -openapi_spec_hash: 28e5f4bfda0207bee55dbb865c79ec55 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d29c1e70887bd472c25d48c358ba851139fcc930f17ffbbaa9238ff39703f3b3.yml +openapi_spec_hash: d6caa65eb04fb7db824895ee7546840b config_hash: b9d4fdd8e697af382ae0ca080ed71364 From 1f1b27ba1250143ae8d553acd557c3db5bd7effd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:03:27 +0000 Subject: [PATCH 304/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f91b4ad64d..2a70e2dcdf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d29c1e70887bd472c25d48c358ba851139fcc930f17ffbbaa9238ff39703f3b3.yml -openapi_spec_hash: d6caa65eb04fb7db824895ee7546840b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25f79230acbf5564029435e6700847ca6b305d69c22275f5bb3d30f9bd444248.yml +openapi_spec_hash: 2727f5cbcbd4237cffed9be9cdb13be8 config_hash: b9d4fdd8e697af382ae0ca080ed71364 From 42f7739d60d816e7ce638c7ceedc0782690ad3a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:19:22 +0000 Subject: [PATCH 305/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2a70e2dcdf..7926df9d83 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-25f79230acbf5564029435e6700847ca6b305d69c22275f5bb3d30f9bd444248.yml -openapi_spec_hash: 2727f5cbcbd4237cffed9be9cdb13be8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c87aabfe1a4b5767dc9741b55cba51ed28534836c0f2a28b94b88bc589a0d4c.yml +openapi_spec_hash: 1300a84cfdde355a8b3202895ff8a68c config_hash: b9d4fdd8e697af382ae0ca080ed71364 From 5635608d6d0de4d2bb6b086567713a2e6e65e8b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:27:38 +0000 Subject: [PATCH 306/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7926df9d83..ef434e4f97 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c87aabfe1a4b5767dc9741b55cba51ed28534836c0f2a28b94b88bc589a0d4c.yml -openapi_spec_hash: 1300a84cfdde355a8b3202895ff8a68c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1fea735a9e3424d6cd6646c8a14ccd0e6c6ce885ce34a585ad764af2ada19f02.yml +openapi_spec_hash: 730af0206f7ccc7b5cbac52c11d3f15c config_hash: b9d4fdd8e697af382ae0ca080ed71364 From af24f1d79e4ccd2d37852ef4f2447de1ca56f5b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:39:05 +0000 Subject: [PATCH 307/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ef434e4f97..c6ee61c4cb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1fea735a9e3424d6cd6646c8a14ccd0e6c6ce885ce34a585ad764af2ada19f02.yml -openapi_spec_hash: 730af0206f7ccc7b5cbac52c11d3f15c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40a079dbb85e5e676a053a11a44e5f9409f52c5a1f399839b80d14f5691a19dc.yml +openapi_spec_hash: 46d597c240cc28a3af45126aa06ce8a7 config_hash: b9d4fdd8e697af382ae0ca080ed71364 From 3d49f76900ec9db55188383a9540a055e0d2f7c4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 17:50:46 +0000 Subject: [PATCH 308/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c6ee61c4cb..dcb740e448 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-40a079dbb85e5e676a053a11a44e5f9409f52c5a1f399839b80d14f5691a19dc.yml -openapi_spec_hash: 46d597c240cc28a3af45126aa06ce8a7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0658ffdc63aa0d55f5c8e270bc9c40632a48795a5ce98f2bb1cbf4816f300b06.yml +openapi_spec_hash: a2941e95e7db3e393daf9a949913a239 config_hash: b9d4fdd8e697af382ae0ca080ed71364 From 7c24b14521f92d9c80bb1a5f039c43bb33c62c1b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 18:11:25 +0000 Subject: [PATCH 309/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 50 + scripts/detect-breaking-changes | 5 + src/resources/radar/ai/bots/bots.ts | 20 +- src/resources/radar/ai/bots/index.ts | 10 +- src/resources/radar/ai/bots/summary.ts | 649 +++++++++- src/resources/radar/ct.ts | 3 + src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + .../radar/ai/bots/summary.test.ts | 135 ++ .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 17 files changed, 2910 insertions(+), 6 deletions(-) create mode 100644 src/resources/radar/ct.ts create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index dcb740e448..7bde188da0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 +configured_endpoints: 1791 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0658ffdc63aa0d55f5c8e270bc9c40632a48795a5ce98f2bb1cbf4816f300b06.yml openapi_spec_hash: a2941e95e7db3e393daf9a949913a239 -config_hash: b9d4fdd8e697af382ae0ca080ed71364 +config_hash: 7c3cbd6dda654becf4764fb52b4bd6af diff --git a/api.md b/api.md index c56e5f1f88..7212780476 100644 --- a/api.md +++ b/api.md @@ -6373,8 +6373,58 @@ Methods: #### Summary +Types: + +- SummarySummaryResponse +- SummaryTimeseriesResponse +- SummaryTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.bots.summary.summary(dimension, { ...params }) -> SummarySummaryResponse +- client.radar.ai.bots.summary.timeseries({ ...params }) -> SummaryTimeseriesResponse +- client.radar.ai.bots.summary.timeseriesGroups(dimension, { ...params }) -> SummaryTimeseriesGroupsResponse + ### TimeseriesGroups +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..695ff40abf 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,11 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 0b5807ee07..73d8006eed 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,15 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary } from './summary'; +import { + Summary, + SummarySummaryParams, + SummarySummaryResponse, + SummaryTimeseriesGroupsParams, + SummaryTimeseriesGroupsResponse, + SummaryTimeseriesParams, + SummaryTimeseriesResponse, +} from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,5 +19,13 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { Summary as Summary }; + export { + Summary as Summary, + type SummarySummaryResponse as SummarySummaryResponse, + type SummaryTimeseriesResponse as SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, + type SummarySummaryParams as SummarySummaryParams, + type SummaryTimeseriesParams as SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 6f7091f3a3..1305297f21 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,12 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary } from './summary'; +export { + Summary, + type SummarySummaryResponse, + type SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse, + type SummarySummaryParams, + type SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams, +} from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 5abd36afe8..0b1513f156 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,5 +1,652 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; -export class Summary extends APIResource {} +export class Summary extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = await client.radar.ai.bots.summary.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: SummarySummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: SummarySummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: SummarySummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.timeseries(); + * ``` + */ + timeseries( + query?: SummaryTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: SummaryTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: SummaryTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.bots.summary.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: SummaryTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: SummaryTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: SummaryTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummarySummaryResponse { + /** + * Metadata for the results. + */ + meta: SummarySummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SummarySummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SummaryTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: SummaryTimeseriesResponse.Meta; + + [k: string]: + | SummaryTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | SummaryTimeseriesResponse.Meta + | undefined; +} + +export namespace SummaryTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface SummaryTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: SummaryTimeseriesGroupsResponse.Meta; + + serie_0: SummaryTimeseriesGroupsResponse.Serie0; +} + +export namespace SummaryTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface SummarySummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface SummaryTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface SummaryTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace Summary { + export { + type SummarySummaryResponse as SummarySummaryResponse, + type SummaryTimeseriesResponse as SummaryTimeseriesResponse, + type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, + type SummarySummaryParams as SummarySummaryParams, + type SummaryTimeseriesParams as SummaryTimeseriesParams, + type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts new file mode 100644 index 0000000000..a1db06bc41 --- /dev/null +++ b/src/resources/radar/ct.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -85,6 +95,7 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -113,6 +124,7 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -136,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts new file mode 100644 index 0000000000..4e0c817887 --- /dev/null +++ b/tests/api-resources/radar/ai/bots/summary.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.bots.summary.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.bots.summary.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From b97353dff144dc1c88de4a54ec8584fd322d43e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 19:11:13 +0000 Subject: [PATCH 310/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 57 +- scripts/detect-breaking-changes | 5 - src/resources/kv/index.ts | 1 - src/resources/kv/kv.ts | 2 - src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 21 +- src/resources/kv/namespaces/metadata.ts | 14 +- src/resources/kv/namespaces/namespaces.ts | 29 +- src/resources/kv/namespaces/values.ts | 5 +- src/resources/radar/ai/bots/bots.ts | 20 +- src/resources/radar/ai/bots/index.ts | 10 +- src/resources/radar/ai/bots/summary.ts | 649 +--------- src/resources/radar/ct.ts | 3 - src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/bots/summary.test.ts | 135 -- .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 25 files changed, 59 insertions(+), 2943 deletions(-) delete mode 100644 src/resources/radar/ct.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 7bde188da0..ae45c8b44a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0658ffdc63aa0d55f5c8e270bc9c40632a48795a5ce98f2bb1cbf4816f300b06.yml +configured_endpoints: 1781 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76c8256920b2bd7137188518a6747268f4305216b2bca45dedbe37cc94d08b7d.yml openapi_spec_hash: a2941e95e7db3e393daf9a949913a239 -config_hash: 7c3cbd6dda654becf4764fb52b4bd6af +config_hash: 15d50e2518d77349fcb62469f2a01431 diff --git a/api.md b/api.md index 7212780476..3d30fde3fd 100644 --- a/api.md +++ b/api.md @@ -2232,7 +2232,6 @@ Methods: Types: -- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,9 +2267,13 @@ Methods: ### Metadata +Types: + +- MetadataGetResponse + Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse ### Values @@ -6373,58 +6376,8 @@ Methods: #### Summary -Types: - -- SummarySummaryResponse -- SummaryTimeseriesResponse -- SummaryTimeseriesGroupsResponse - -Methods: - -- client.radar.ai.bots.summary.summary(dimension, { ...params }) -> SummarySummaryResponse -- client.radar.ai.bots.summary.timeseries({ ...params }) -> SummaryTimeseriesResponse -- client.radar.ai.bots.summary.timeseriesGroups(dimension, { ...params }) -> SummaryTimeseriesGroupsResponse - ### TimeseriesGroups -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 695ff40abf..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,11 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/bots/bots.test.ts - tests/api-resources/radar/ai/bots/summary.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index d76651a083..6b8512b78a 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,7 +4,6 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index c216c0f0d4..6edb9e18af 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { - Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -31,7 +30,6 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index d7dc7a5289..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,11 +12,10 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 50e52613a9..ad094eeddb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -118,7 +117,10 @@ export interface Key { */ expiration?: number; - metadata?: NamespacesAPI.Any; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } export interface KeyBulkDeleteResponse { @@ -154,9 +156,15 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -269,7 +277,10 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index f8135e1b5d..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -12,7 +11,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const any = await client.kv.namespaces.metadata.get( + * const metadata = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -24,17 +23,22 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: NamespacesAPI.Any }> + ) as Core.APIPromise<{ result: MetadataGetResponse }> )._thenUnwrap((obj) => obj.result); } } +/** + * Arbitrary JSON that is associated with a key. + */ +export type MetadataGetResponse = unknown; + export interface MetadataGetParams { /** * Identifier. @@ -43,5 +47,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 6e395d77c7..3f8f3b7a90 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -17,7 +16,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams } from './metadata'; +import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -255,10 +254,6 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} -export type Any = unknown; - -export type AnyParam = unknown; - export interface Namespace { /** * Namespace identifier tag. @@ -317,9 +312,15 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -467,7 +468,10 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } @@ -486,7 +490,6 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -516,7 +519,11 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; + export { + Metadata as Metadata, + type MetadataGetResponse as MetadataGetResponse, + type MetadataGetParams as MetadataGetParams, + }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 0a3c267c8c..29174df308 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -135,9 +134,9 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: + * Body param: Associates arbitrary JSON data with a key/value pair. */ - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } export interface ValueDeleteParams { diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 73d8006eed..0b5807ee07 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,15 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { - Summary, - SummarySummaryParams, - SummarySummaryResponse, - SummaryTimeseriesGroupsParams, - SummaryTimeseriesGroupsResponse, - SummaryTimeseriesParams, - SummaryTimeseriesResponse, -} from './summary'; +import { Summary } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -19,13 +11,5 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { - Summary as Summary, - type SummarySummaryResponse as SummarySummaryResponse, - type SummaryTimeseriesResponse as SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, - type SummarySummaryParams as SummarySummaryParams, - type SummaryTimeseriesParams as SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, - }; + export { Summary as Summary }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 1305297f21..6f7091f3a3 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,12 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { - Summary, - type SummarySummaryResponse, - type SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse, - type SummarySummaryParams, - type SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams, -} from './summary'; +export { Summary } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 0b1513f156..5abd36afe8 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,652 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; -import { isRequestOptions } from '../../../../core'; -import * as Core from '../../../../core'; -export class Summary extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = await client.radar.ai.bots.summary.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: SummarySummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: SummarySummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: SummarySummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.timeseries(); - * ``` - */ - timeseries( - query?: SummaryTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: SummaryTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: SummaryTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.bots.summary.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: SummaryTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: SummaryTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: SummaryTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface SummarySummaryResponse { - /** - * Metadata for the results. - */ - meta: SummarySummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace SummarySummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface SummaryTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: SummaryTimeseriesResponse.Meta; - - [k: string]: - | SummaryTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | SummaryTimeseriesResponse.Meta - | undefined; -} - -export namespace SummaryTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface SummaryTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: SummaryTimeseriesGroupsResponse.Meta; - - serie_0: SummaryTimeseriesGroupsResponse.Serie0; -} - -export namespace SummaryTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface SummarySummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface SummaryTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface SummaryTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace Summary { - export { - type SummarySummaryResponse as SummarySummaryResponse, - type SummaryTimeseriesResponse as SummaryTimeseriesResponse, - type SummaryTimeseriesGroupsResponse as SummaryTimeseriesGroupsResponse, - type SummarySummaryParams as SummarySummaryParams, - type SummaryTimeseriesParams as SummaryTimeseriesParams, - type SummaryTimeseriesGroupsParams as SummaryTimeseriesGroupsParams, - }; -} +export class Summary extends APIResource {} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts deleted file mode 100644 index a1db06bc41..0000000000 --- a/src/resources/radar/ct.ts +++ /dev/null @@ -1,3 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -95,7 +85,6 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -124,7 +113,6 @@ export class Radar extends APIResource { } Radar.AI = AI; -Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -148,16 +136,6 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..03fbaa4b52 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, + metadata: {}, }); }); diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts deleted file mode 100644 index 4e0c817887..0000000000 --- a/tests/api-resources/radar/ai/bots/summary.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource summary', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.bots.summary.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.bots.summary.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseries({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.bots.summary.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From c79965da601db233f93527a350ea9eb6478b1595 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 19:17:52 +0000 Subject: [PATCH 311/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +-- api.md | 7 ++--- src/resources/kv/index.ts | 1 + src/resources/kv/kv.ts | 2 ++ src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 21 ++++---------- src/resources/kv/namespaces/metadata.ts | 14 ++++----- src/resources/kv/namespaces/namespaces.ts | 29 +++++++------------ src/resources/kv/namespaces/values.ts | 5 ++-- .../kv/namespaces/values.test.ts | 2 +- 10 files changed, 34 insertions(+), 54 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae45c8b44a..9f5cc58428 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-76c8256920b2bd7137188518a6747268f4305216b2bca45dedbe37cc94d08b7d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0658ffdc63aa0d55f5c8e270bc9c40632a48795a5ce98f2bb1cbf4816f300b06.yml openapi_spec_hash: a2941e95e7db3e393daf9a949913a239 -config_hash: 15d50e2518d77349fcb62469f2a01431 +config_hash: 31525fc9404677e20330cc748dfaf55d diff --git a/api.md b/api.md index 3d30fde3fd..c56e5f1f88 100644 --- a/api.md +++ b/api.md @@ -2232,6 +2232,7 @@ Methods: Types: +- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2267,13 +2268,9 @@ Methods: ### Metadata -Types: - -- MetadataGetResponse - Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any ### Values diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index 6b8512b78a..d76651a083 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,6 +4,7 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 6edb9e18af..c216c0f0d4 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { + Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -30,6 +31,7 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..d7dc7a5289 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,10 +12,11 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index ad094eeddb..50e52613a9 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -117,10 +118,7 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.Any; } export interface KeyBulkDeleteResponse { @@ -156,15 +154,9 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ - metadata: unknown; + metadata: NamespacesAPI.Any; - /** - * The value associated with the key. - */ - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -277,10 +269,7 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 927ba8a17d..f8135e1b5d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -11,7 +12,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const metadata = await client.kv.namespaces.metadata.get( + * const any = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -23,22 +24,17 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: MetadataGetResponse }> + ) as Core.APIPromise<{ result: NamespacesAPI.Any }> )._thenUnwrap((obj) => obj.result); } } -/** - * Arbitrary JSON that is associated with a key. - */ -export type MetadataGetResponse = unknown; - export interface MetadataGetParams { /** * Identifier. @@ -47,5 +43,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 3f8f3b7a90..6e395d77c7 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -16,7 +17,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; +import { Metadata, MetadataGetParams } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -254,6 +255,10 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} +export type Any = unknown; + +export type AnyParam = unknown; + export interface Namespace { /** * Namespace identifier tag. @@ -312,15 +317,9 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ - metadata: unknown; + metadata: NamespacesAPI.Any; - /** - * The value associated with the key. - */ - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -468,10 +467,7 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } @@ -490,6 +486,7 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -519,11 +516,7 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { - Metadata as Metadata, - type MetadataGetResponse as MetadataGetResponse, - type MetadataGetParams as MetadataGetParams, - }; + export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 29174df308..0a3c267c8c 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -134,9 +135,9 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: Associates arbitrary JSON data with a key/value pair. + * Body param: */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } export interface ValueDeleteParams { diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 03fbaa4b52..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); From 6a83cdbcb5538308fdae95a193485633e94bc37b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 19:22:55 +0000 Subject: [PATCH 312/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9f5cc58428..6abd234b47 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0658ffdc63aa0d55f5c8e270bc9c40632a48795a5ce98f2bb1cbf4816f300b06.yml -openapi_spec_hash: a2941e95e7db3e393daf9a949913a239 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b38f28ba3552f326a2ec9fc4615422171d6dc98faa77e0862deeed2e1a763b15.yml +openapi_spec_hash: 9b73eeefc13fe490a03fa32eac4dba4b config_hash: 31525fc9404677e20330cc748dfaf55d From a146088d121c07dc23c3d5b705237650581debd5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 19:26:01 +0000 Subject: [PATCH 313/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6abd234b47..e952e7eba9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b38f28ba3552f326a2ec9fc4615422171d6dc98faa77e0862deeed2e1a763b15.yml -openapi_spec_hash: 9b73eeefc13fe490a03fa32eac4dba4b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a3e699bbf77e618e1afa9631b41d80fd98f3d3b6187fe87df18f28a77a96447.yml +openapi_spec_hash: 80d36e16e59229ecbcd3e8118496bd5e config_hash: 31525fc9404677e20330cc748dfaf55d From c7659bbf2bb19c1c14c0996fd96026f0c22d69f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 20:31:47 +0000 Subject: [PATCH 314/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e952e7eba9..da3fc146dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7a3e699bbf77e618e1afa9631b41d80fd98f3d3b6187fe87df18f28a77a96447.yml -openapi_spec_hash: 80d36e16e59229ecbcd3e8118496bd5e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f552d9d66684cd309a04567e09c14c86cf824a1776da6b25b27de302bc0686dc.yml +openapi_spec_hash: 97f316cb6055691278d565061afcd9cd config_hash: 31525fc9404677e20330cc748dfaf55d From 67d59b8e48eb61a8a6e8fc7a6d7865e435087605 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 20:56:06 +0000 Subject: [PATCH 315/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/workers/scripts/scripts.ts | 15 ++++++++++++--- .../api-resources/workers/scripts/scripts.test.ts | 5 ++++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index da3fc146dd..c3e5e8298b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f552d9d66684cd309a04567e09c14c86cf824a1776da6b25b27de302bc0686dc.yml -openapi_spec_hash: 97f316cb6055691278d565061afcd9cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45f3d528a7290d80336539cc59fdf9074526ae8c5b5b012a9d8c597db4f151d7.yml +openapi_spec_hash: 8cf560393053b3a83f0ad48b20515589 config_hash: 31525fc9404677e20330cc748dfaf55d diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 9e50ce8466..2f5b74a81c 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -145,8 +145,11 @@ export class Scripts extends APIResource { * ``` */ list(params: ScriptListParams, options?: Core.RequestOptions): Core.PagePromise { - const { account_id } = params; - return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptsSinglePage, options); + const { account_id, ...query } = params; + return this._client.getAPIList(`/accounts/${account_id}/workers/scripts`, ScriptsSinglePage, { + query, + ...options, + }); } /** @@ -1202,9 +1205,15 @@ export namespace ScriptUpdateParams { export interface ScriptListParams { /** - * Identifier. + * Path param: Identifier. */ account_id: string; + + /** + * Query param: Filter scripts by tags. Format: comma-separated list of tag:allowed + * pairs where allowed is 'yes' or 'no'. + */ + tags?: string; } export interface ScriptDeleteParams { diff --git a/tests/api-resources/workers/scripts/scripts.test.ts b/tests/api-resources/workers/scripts/scripts.test.ts index a4cdd14332..30c2f60090 100644 --- a/tests/api-resources/workers/scripts/scripts.test.ts +++ b/tests/api-resources/workers/scripts/scripts.test.ts @@ -86,7 +86,10 @@ describe('resource scripts', () => { }); test('list: required and optional params', async () => { - const response = await client.workers.scripts.list({ account_id: '023e105f4ecef8ad9ca31a8372d0c353' }); + const response = await client.workers.scripts.list({ + account_id: '023e105f4ecef8ad9ca31a8372d0c353', + tags: 'production:yes,staging:no', + }); }); test('delete: only required params', async () => { From e58450fe462cd6326c4d78eeb346cb5e8fd97bef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:07:35 +0000 Subject: [PATCH 316/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c3e5e8298b..bf934d1432 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-45f3d528a7290d80336539cc59fdf9074526ae8c5b5b012a9d8c597db4f151d7.yml -openapi_spec_hash: 8cf560393053b3a83f0ad48b20515589 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7fefb795a9012f9de9a4c91401cee8e6bb4d1d85d82a39876498f57fb3577e36.yml +openapi_spec_hash: 63d999b81a6dbd5853b5d03caee1bbd9 config_hash: 31525fc9404677e20330cc748dfaf55d From 5a4fa8e74a6043b5948c28a08e0d885ad5e94c55 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:20:40 +0000 Subject: [PATCH 317/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +-- api.md | 7 +++-- src/resources/kv/index.ts | 1 - src/resources/kv/kv.ts | 2 -- src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 21 ++++++++++---- src/resources/kv/namespaces/metadata.ts | 14 +++++---- src/resources/kv/namespaces/namespaces.ts | 29 ++++++++++++------- src/resources/kv/namespaces/values.ts | 5 ++-- .../kv/namespaces/values.test.ts | 2 +- 10 files changed, 54 insertions(+), 34 deletions(-) diff --git a/.stats.yml b/.stats.yml index bf934d1432..c5d7d9f25c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7fefb795a9012f9de9a4c91401cee8e6bb4d1d85d82a39876498f57fb3577e36.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b3250e2cf9d093a1afed111732820f38dd819b29f10df34d5e0ff8de82520cff.yml openapi_spec_hash: 63d999b81a6dbd5853b5d03caee1bbd9 -config_hash: 31525fc9404677e20330cc748dfaf55d +config_hash: 15d50e2518d77349fcb62469f2a01431 diff --git a/api.md b/api.md index c56e5f1f88..3d30fde3fd 100644 --- a/api.md +++ b/api.md @@ -2232,7 +2232,6 @@ Methods: Types: -- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,9 +2267,13 @@ Methods: ### Metadata +Types: + +- MetadataGetResponse + Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse ### Values diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index d76651a083..6b8512b78a 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,7 +4,6 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index c216c0f0d4..6edb9e18af 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { - Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -31,7 +30,6 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index d7dc7a5289..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,11 +12,10 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 50e52613a9..ad094eeddb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -118,7 +117,10 @@ export interface Key { */ expiration?: number; - metadata?: NamespacesAPI.Any; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } export interface KeyBulkDeleteResponse { @@ -154,9 +156,15 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -269,7 +277,10 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index f8135e1b5d..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -12,7 +11,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const any = await client.kv.namespaces.metadata.get( + * const metadata = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -24,17 +23,22 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: NamespacesAPI.Any }> + ) as Core.APIPromise<{ result: MetadataGetResponse }> )._thenUnwrap((obj) => obj.result); } } +/** + * Arbitrary JSON that is associated with a key. + */ +export type MetadataGetResponse = unknown; + export interface MetadataGetParams { /** * Identifier. @@ -43,5 +47,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 6e395d77c7..3f8f3b7a90 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -17,7 +16,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams } from './metadata'; +import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -255,10 +254,6 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} -export type Any = unknown; - -export type AnyParam = unknown; - export interface Namespace { /** * Namespace identifier tag. @@ -317,9 +312,15 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -467,7 +468,10 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } @@ -486,7 +490,6 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -516,7 +519,11 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; + export { + Metadata as Metadata, + type MetadataGetResponse as MetadataGetResponse, + type MetadataGetParams as MetadataGetParams, + }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 0a3c267c8c..29174df308 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -135,9 +134,9 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: + * Body param: Associates arbitrary JSON data with a key/value pair. */ - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } export interface ValueDeleteParams { diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..03fbaa4b52 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, + metadata: {}, }); }); From 944607f56cefb45ad6e717a23d14a2a6230b2f9a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:37:10 +0000 Subject: [PATCH 318/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c5d7d9f25c..7b83b31577 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b3250e2cf9d093a1afed111732820f38dd819b29f10df34d5e0ff8de82520cff.yml -openapi_spec_hash: 63d999b81a6dbd5853b5d03caee1bbd9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ea91d139afaf80f2468b5b9b2fcb24ccbf28c589d1f10f5b7730383c37bdb9a.yml +openapi_spec_hash: 78736a54ab3ca8aded7f06764822dcd8 config_hash: 15d50e2518d77349fcb62469f2a01431 From c5d5ffd20a6cbd4d2dae2c86237deff01fb83218 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:40:05 +0000 Subject: [PATCH 319/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7b83b31577..2cc8e05358 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ea91d139afaf80f2468b5b9b2fcb24ccbf28c589d1f10f5b7730383c37bdb9a.yml openapi_spec_hash: 78736a54ab3ca8aded7f06764822dcd8 -config_hash: 15d50e2518d77349fcb62469f2a01431 +config_hash: 242134bf2dc570f5555bf479c40a42d0 From 66e9c82126ca40b2e8aace1d723f71132281c8a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:42:34 +0000 Subject: [PATCH 320/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2cc8e05358..b191a954af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5ea91d139afaf80f2468b5b9b2fcb24ccbf28c589d1f10f5b7730383c37bdb9a.yml -openapi_spec_hash: 78736a54ab3ca8aded7f06764822dcd8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-97d96a216e844ce5d0e2fcaea34f8e35db45dea86068bd95a88d3bb33a6f0c0d.yml +openapi_spec_hash: 4fa5e37d0d49108f256d15dde5edef42 config_hash: 242134bf2dc570f5555bf479c40a42d0 From b80775eb66d13ac543c11645f34186cd00988852 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:45:28 +0000 Subject: [PATCH 321/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 57 +- scripts/detect-breaking-changes | 4 + src/resources/kv/index.ts | 1 + src/resources/kv/kv.ts | 2 + src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 21 +- src/resources/kv/namespaces/metadata.ts | 14 +- src/resources/kv/namespaces/namespaces.ts | 29 +- src/resources/kv/namespaces/values.ts | 5 +- src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +++++++++- src/resources/radar/ct.ts | 3 + src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/timeseries-groups.test.ts | 135 ++ .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 25 files changed, 2943 insertions(+), 59 deletions(-) create mode 100644 src/resources/radar/ct.ts create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index b191a954af..57481221fb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-97d96a216e844ce5d0e2fcaea34f8e35db45dea86068bd95a88d3bb33a6f0c0d.yml +configured_endpoints: 1791 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-49375f41281b35f1b625e078e2905d704bee269f9bc2854ee6560013dd7e10d1.yml openapi_spec_hash: 4fa5e37d0d49108f256d15dde5edef42 -config_hash: 242134bf2dc570f5555bf479c40a42d0 +config_hash: 066949474762c52657970040c532cfca diff --git a/api.md b/api.md index 3d30fde3fd..9b967f6b25 100644 --- a/api.md +++ b/api.md @@ -2232,6 +2232,7 @@ Methods: Types: +- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2267,13 +2268,9 @@ Methods: ### Metadata -Types: - -- MetadataGetResponse - Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any ### Values @@ -6378,6 +6375,56 @@ Methods: ### TimeseriesGroups +Types: + +- TimeseriesGroupSummaryResponse +- TimeseriesGroupTimeseriesResponse +- TimeseriesGroupTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse + +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..d9960b46eb 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,10 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index 6b8512b78a..d76651a083 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,6 +4,7 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index 6edb9e18af..c216c0f0d4 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,6 +3,7 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { + Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -30,6 +31,7 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index e2cf87739d..d7dc7a5289 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,10 +12,11 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, + type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index ad094eeddb..50e52613a9 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -117,10 +118,7 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.Any; } export interface KeyBulkDeleteResponse { @@ -156,15 +154,9 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ - metadata: unknown; + metadata: NamespacesAPI.Any; - /** - * The value associated with the key. - */ - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -277,10 +269,7 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 927ba8a17d..f8135e1b5d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -11,7 +12,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const metadata = await client.kv.namespaces.metadata.get( + * const any = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -23,22 +24,17 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: MetadataGetResponse }> + ) as Core.APIPromise<{ result: NamespacesAPI.Any }> )._thenUnwrap((obj) => obj.result); } } -/** - * Arbitrary JSON that is associated with a key. - */ -export type MetadataGetResponse = unknown; - export interface MetadataGetParams { /** * Identifier. @@ -47,5 +43,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 3f8f3b7a90..6e395d77c7 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -16,7 +17,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; +import { Metadata, MetadataGetParams } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -254,6 +255,10 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} +export type Any = unknown; + +export type AnyParam = unknown; + export interface Namespace { /** * Namespace identifier tag. @@ -312,15 +317,9 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ - metadata: unknown; + metadata: NamespacesAPI.Any; - /** - * The value associated with the key. - */ - value: unknown; + value: NamespacesAPI.Any; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -468,10 +467,7 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } } @@ -490,6 +486,7 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { + type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -519,11 +516,7 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { - Metadata as Metadata, - type MetadataGetResponse as MetadataGetResponse, - type MetadataGetParams as MetadataGetParams, - }; + export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 29174df308..0a3c267c8c 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,6 +2,7 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; +import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -134,9 +135,9 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: Associates arbitrary JSON data with a key/value pair. + * Body param: */ - metadata?: unknown; + metadata?: NamespacesAPI.AnyParam; } export interface ValueDeleteParams { diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..859934963d 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,15 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupSummaryParams, + TimeseriesGroupSummaryResponse, + TimeseriesGroupTimeseriesGroupsParams, + TimeseriesGroupTimeseriesGroupsResponse, + TimeseriesGroupTimeseriesParams, + TimeseriesGroupTimeseriesResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +50,13 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..1ae7394bd6 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,15 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..e8e532a6be 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,653 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseries(); + * ``` + */ + timeseries( + query?: TimeseriesGroupTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesResponse.Meta; + + [k: string]: + | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | TimeseriesGroupTimeseriesResponse.Meta + | undefined; +} + +export namespace TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; + + serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; +} + +export namespace TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface TimeseriesGroupTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface TimeseriesGroupTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts new file mode 100644 index 0000000000..a1db06bc41 --- /dev/null +++ b/src/resources/radar/ct.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -85,6 +95,7 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -113,6 +124,7 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -136,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 03fbaa4b52..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..5a72ed2d24 --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From 57c2584c49bca7da6c1475f6b8192e567434300f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 21:47:53 +0000 Subject: [PATCH 322/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 57 +- scripts/detect-breaking-changes | 4 - src/resources/kv/index.ts | 1 - src/resources/kv/kv.ts | 2 - src/resources/kv/namespaces/index.ts | 3 +- src/resources/kv/namespaces/keys.ts | 21 +- src/resources/kv/namespaces/metadata.ts | 14 +- src/resources/kv/namespaces/namespaces.ts | 29 +- src/resources/kv/namespaces/values.ts | 5 +- src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +--------- src/resources/radar/ct.ts | 3 - src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/timeseries-groups.test.ts | 135 -- .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 25 files changed, 59 insertions(+), 2943 deletions(-) delete mode 100644 src/resources/radar/ct.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 57481221fb..b191a954af 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-49375f41281b35f1b625e078e2905d704bee269f9bc2854ee6560013dd7e10d1.yml +configured_endpoints: 1781 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-97d96a216e844ce5d0e2fcaea34f8e35db45dea86068bd95a88d3bb33a6f0c0d.yml openapi_spec_hash: 4fa5e37d0d49108f256d15dde5edef42 -config_hash: 066949474762c52657970040c532cfca +config_hash: 242134bf2dc570f5555bf479c40a42d0 diff --git a/api.md b/api.md index 9b967f6b25..3d30fde3fd 100644 --- a/api.md +++ b/api.md @@ -2232,7 +2232,6 @@ Methods: Types: -- Any - Namespace - NamespaceDeleteResponse - NamespaceBulkDeleteResponse @@ -2268,9 +2267,13 @@ Methods: ### Metadata +Types: + +- MetadataGetResponse + Methods: -- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> Any +- client.kv.namespaces.metadata.get(namespaceId, keyName, { ...params }) -> MetadataGetResponse ### Values @@ -6375,56 +6378,6 @@ Methods: ### TimeseriesGroups -Types: - -- TimeseriesGroupSummaryResponse -- TimeseriesGroupTimeseriesResponse -- TimeseriesGroupTimeseriesGroupsResponse - -Methods: - -- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse -- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse -- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse - -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index d9960b46eb..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,10 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/kv/index.ts b/src/resources/kv/index.ts index d76651a083..6b8512b78a 100644 --- a/src/resources/kv/index.ts +++ b/src/resources/kv/index.ts @@ -4,7 +4,6 @@ export { KV } from './kv'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/kv.ts b/src/resources/kv/kv.ts index c216c0f0d4..6edb9e18af 100644 --- a/src/resources/kv/kv.ts +++ b/src/resources/kv/kv.ts @@ -3,7 +3,6 @@ import { APIResource } from '../../resource'; import * as NamespacesAPI from './namespaces/namespaces'; import { - Any, Namespace, NamespaceBulkDeleteParams, NamespaceBulkDeleteResponse, @@ -31,7 +30,6 @@ KV.NamespacesV4PagePaginationArray = NamespacesV4PagePaginationArray; export declare namespace KV { export { Namespaces as Namespaces, - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/index.ts b/src/resources/kv/namespaces/index.ts index d7dc7a5289..e2cf87739d 100644 --- a/src/resources/kv/namespaces/index.ts +++ b/src/resources/kv/namespaces/index.ts @@ -12,11 +12,10 @@ export { type KeyBulkGetParams, type KeyBulkUpdateParams, } from './keys'; -export { Metadata, type MetadataGetParams } from './metadata'; +export { Metadata, type MetadataGetResponse, type MetadataGetParams } from './metadata'; export { NamespacesV4PagePaginationArray, Namespaces, - type Any, type Namespace, type NamespaceDeleteResponse, type NamespaceBulkDeleteResponse, diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index 50e52613a9..ad094eeddb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { CursorLimitPagination, type CursorLimitPaginationParams } from '../../../pagination'; export class Keys extends APIResource { @@ -118,7 +117,10 @@ export interface Key { */ expiration?: number; - metadata?: NamespacesAPI.Any; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } export interface KeyBulkDeleteResponse { @@ -154,9 +156,15 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -269,7 +277,10 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index f8135e1b5d..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; export class Metadata extends APIResource { /** @@ -12,7 +11,7 @@ export class Metadata extends APIResource { * * @example * ```ts - * const any = await client.kv.namespaces.metadata.get( + * const metadata = await client.kv.namespaces.metadata.get( * '0f2ac74b498b48028cb68387c421e279', * 'My-Key', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, @@ -24,17 +23,22 @@ export class Metadata extends APIResource { keyName: string, params: MetadataGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/storage/kv/namespaces/${namespaceId}/metadata/${keyName}`, options, - ) as Core.APIPromise<{ result: NamespacesAPI.Any }> + ) as Core.APIPromise<{ result: MetadataGetResponse }> )._thenUnwrap((obj) => obj.result); } } +/** + * Arbitrary JSON that is associated with a key. + */ +export type MetadataGetResponse = unknown; + export interface MetadataGetParams { /** * Identifier. @@ -43,5 +47,5 @@ export interface MetadataGetParams { } export declare namespace Metadata { - export { type MetadataGetParams as MetadataGetParams }; + export { type MetadataGetResponse as MetadataGetResponse, type MetadataGetParams as MetadataGetParams }; } diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 6e395d77c7..3f8f3b7a90 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import * as KeysAPI from './keys'; import { Key, @@ -17,7 +16,7 @@ import { KeysCursorLimitPagination, } from './keys'; import * as MetadataAPI from './metadata'; -import { Metadata, MetadataGetParams } from './metadata'; +import { Metadata, MetadataGetParams, MetadataGetResponse } from './metadata'; import * as ValuesAPI from './values'; import { ValueDeleteParams, @@ -255,10 +254,6 @@ export class Namespaces extends APIResource { export class NamespacesV4PagePaginationArray extends V4PagePaginationArray {} -export type Any = unknown; - -export type AnyParam = unknown; - export interface Namespace { /** * Namespace identifier tag. @@ -317,9 +312,15 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - metadata: NamespacesAPI.Any; + /** + * The metadata associated with the key. + */ + metadata: unknown; - value: NamespacesAPI.Any; + /** + * The value associated with the key. + */ + value: unknown; /** * Expires the key at a certain time, measured in number of seconds since the UNIX @@ -467,7 +468,10 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - metadata?: NamespacesAPI.AnyParam; + /** + * Arbitrary JSON that is associated with a key. + */ + metadata?: unknown; } } @@ -486,7 +490,6 @@ Namespaces.Values = ValuesAPIValues; export declare namespace Namespaces { export { - type Any as Any, type Namespace as Namespace, type NamespaceDeleteResponse as NamespaceDeleteResponse, type NamespaceBulkDeleteResponse as NamespaceBulkDeleteResponse, @@ -516,7 +519,11 @@ export declare namespace Namespaces { type KeyBulkUpdateParams as KeyBulkUpdateParams, }; - export { Metadata as Metadata, type MetadataGetParams as MetadataGetParams }; + export { + Metadata as Metadata, + type MetadataGetResponse as MetadataGetResponse, + type MetadataGetParams as MetadataGetParams, + }; export { ValuesAPIValues as Values, diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 0a3c267c8c..29174df308 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../../resource'; import * as Core from '../../../core'; -import * as NamespacesAPI from './namespaces'; import { type Response } from '../../../_shims/index'; export class Values extends APIResource { @@ -135,9 +134,9 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: + * Body param: Associates arbitrary JSON data with a key/value pair. */ - metadata?: NamespacesAPI.AnyParam; + metadata?: unknown; } export interface ValueDeleteParams { diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 859934963d..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,15 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupSummaryParams, - TimeseriesGroupSummaryResponse, - TimeseriesGroupTimeseriesGroupsParams, - TimeseriesGroupTimeseriesGroupsResponse, - TimeseriesGroupTimeseriesParams, - TimeseriesGroupTimeseriesResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -50,13 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 1ae7394bd6..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,15 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index e8e532a6be..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,653 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseries(); - * ``` - */ - timeseries( - query?: TimeseriesGroupTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupSummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesResponse.Meta; - - [k: string]: - | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | TimeseriesGroupTimeseriesResponse.Meta - | undefined; -} - -export namespace TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; - - serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; -} - -export namespace TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupSummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface TimeseriesGroupTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface TimeseriesGroupTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts deleted file mode 100644 index a1db06bc41..0000000000 --- a/src/resources/radar/ct.ts +++ /dev/null @@ -1,3 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -95,7 +85,6 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -124,7 +113,6 @@ export class Radar extends APIResource { } Radar.AI = AI; -Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -148,16 +136,6 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..03fbaa4b52 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, + metadata: {}, }); }); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 5a72ed2d24..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From 7b8e864ccd6a5113f0dc19c795c745e4276839dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:18:15 +0000 Subject: [PATCH 323/423] feat(api): api update --- .stats.yml | 4 +- .../certificate-packs/certificate-packs.ts | 130 +++++++++++++++++- 2 files changed, 130 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index b191a954af..9bd25d2427 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-97d96a216e844ce5d0e2fcaea34f8e35db45dea86068bd95a88d3bb33a6f0c0d.yml -openapi_spec_hash: 4fa5e37d0d49108f256d15dde5edef42 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d71a3caeff1c20ff21ed71844ae8abde6c126959582dd71de1b90eae7b72d534.yml +openapi_spec_hash: ecfcefd6283b0343bfde6ebdf545bbac config_hash: 242134bf2dc570f5555bf479c40a42d0 diff --git a/src/resources/ssl/certificate-packs/certificate-packs.ts b/src/resources/ssl/certificate-packs/certificate-packs.ts index 8ce7a97e6b..9ec84ff8a9 100644 --- a/src/resources/ssl/certificate-packs/certificate-packs.ts +++ b/src/resources/ssl/certificate-packs/certificate-packs.ts @@ -227,19 +227,82 @@ export interface CertificatePackCreateResponse { /** * Type of certificate pack. */ - type?: 'advanced'; + type?: + | 'mh_custom' + | 'managed_hostname' + | 'sni_custom' + | 'universal' + | 'advanced' + | 'total_tls' + | 'keyless' + | 'legacy_custom'; + + /** + * Domain validation errors that have been received by the certificate authority + * (CA). + */ + validation_errors?: Array; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; + /** + * Certificates' validation records. Only present when certificate pack is in + * "pending_validation" status + */ + validation_records?: Array; + /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } +export namespace CertificatePackCreateResponse { + export interface ValidationError { + /** + * A domain validation error. + */ + message?: string; + } + + /** + * Certificate's required validation record. + */ + export interface ValidationRecord { + /** + * The set of email addresses that the certificate authority (CA) will use to + * complete domain validation. + */ + emails?: Array; + + /** + * The content that the certificate authority (CA) will expect to find at the + * http_url during the domain validation. + */ + http_body?: string; + + /** + * The url that will be checked during domain validation. + */ + http_url?: string; + + /** + * The hostname that the certificate authority (CA) will check for a TXT record + * during domain validation . + */ + txt_name?: string; + + /** + * The TXT record that the certificate authority (CA) will check during domain + * validation. + */ + txt_value?: string; + } +} + export type CertificatePackListResponse = unknown; export interface CertificatePackDeleteResponse { @@ -282,19 +345,82 @@ export interface CertificatePackEditResponse { /** * Type of certificate pack. */ - type?: 'advanced'; + type?: + | 'mh_custom' + | 'managed_hostname' + | 'sni_custom' + | 'universal' + | 'advanced' + | 'total_tls' + | 'keyless' + | 'legacy_custom'; + + /** + * Domain validation errors that have been received by the certificate authority + * (CA). + */ + validation_errors?: Array; /** * Validation Method selected for the order. */ validation_method?: 'txt' | 'http' | 'email'; + /** + * Certificates' validation records. Only present when certificate pack is in + * "pending_validation" status + */ + validation_records?: Array; + /** * Validity Days selected for the order. */ validity_days?: 14 | 30 | 90 | 365; } +export namespace CertificatePackEditResponse { + export interface ValidationError { + /** + * A domain validation error. + */ + message?: string; + } + + /** + * Certificate's required validation record. + */ + export interface ValidationRecord { + /** + * The set of email addresses that the certificate authority (CA) will use to + * complete domain validation. + */ + emails?: Array; + + /** + * The content that the certificate authority (CA) will expect to find at the + * http_url during the domain validation. + */ + http_body?: string; + + /** + * The url that will be checked during domain validation. + */ + http_url?: string; + + /** + * The hostname that the certificate authority (CA) will check for a TXT record + * during domain validation . + */ + txt_name?: string; + + /** + * The TXT record that the certificate authority (CA) will check during domain + * validation. + */ + txt_value?: string; + } +} + export type CertificatePackGetResponse = unknown; export interface CertificatePackCreateParams { From c5376c982625f9ded80371ad58d276bd191d5503 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:29:23 +0000 Subject: [PATCH 324/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9bd25d2427..a354f1c23e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d71a3caeff1c20ff21ed71844ae8abde6c126959582dd71de1b90eae7b72d534.yml -openapi_spec_hash: ecfcefd6283b0343bfde6ebdf545bbac +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a66b152f46266b737843e7dfab7fd98ae9925d00128fb645d022f21bd911b2a4.yml +openapi_spec_hash: 34dc58def0a9aa7c72373d0a7eed3a02 config_hash: 242134bf2dc570f5555bf479c40a42d0 From 50367041c804e8e8a1f265d6b7c1320f3b2254e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:41:09 +0000 Subject: [PATCH 325/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a354f1c23e..6ab893c81c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a66b152f46266b737843e7dfab7fd98ae9925d00128fb645d022f21bd911b2a4.yml -openapi_spec_hash: 34dc58def0a9aa7c72373d0a7eed3a02 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6da44431e359acdf57d5687dea451c8c58ff7bab307cef01dcc67da0720e1565.yml +openapi_spec_hash: b42898f75ff1acaeee459202913f8f52 config_hash: 242134bf2dc570f5555bf479c40a42d0 From 388c745f43524d03bcaf899bc2755cfe1f497547 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 6 Aug 2025 22:53:24 +0000 Subject: [PATCH 326/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6ab893c81c..e501f19e45 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6da44431e359acdf57d5687dea451c8c58ff7bab307cef01dcc67da0720e1565.yml -openapi_spec_hash: b42898f75ff1acaeee459202913f8f52 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c1d674052f49e34e2feb04843e641f9ca3c79b492c9b9440c51894cfbce66af.yml +openapi_spec_hash: 8c79504157ef4bf2cf6fb6124d4f7149 config_hash: 242134bf2dc570f5555bf479c40a42d0 From a0666061ab072870d5235b1db65cbf9885814373 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 00:23:06 +0000 Subject: [PATCH 327/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e501f19e45..6bfb5497c3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5c1d674052f49e34e2feb04843e641f9ca3c79b492c9b9440c51894cfbce66af.yml -openapi_spec_hash: 8c79504157ef4bf2cf6fb6124d4f7149 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e2e1c71770e0719154b0fa5505a81eb536f609b75d166e7ba11cf5e9a1150c62.yml +openapi_spec_hash: 9cc5818507ab62c376edac3786aa216b config_hash: 242134bf2dc570f5555bf479c40a42d0 From d7d58fc0fdc08009d3e294733204d664e6957204 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 00:38:41 +0000 Subject: [PATCH 328/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6bfb5497c3..2d17904dd6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e2e1c71770e0719154b0fa5505a81eb536f609b75d166e7ba11cf5e9a1150c62.yml -openapi_spec_hash: 9cc5818507ab62c376edac3786aa216b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c35ceaa57ff731aa0a379ee4284a6e9608940b917c362163d52feb4be72c8d31.yml +openapi_spec_hash: 07fccce915fde9d81a0294df06c47cb4 config_hash: 242134bf2dc570f5555bf479c40a42d0 From 26e58297407804597161880791d7ca8c541e88a8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 04:37:51 +0000 Subject: [PATCH 329/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 50 + scripts/detect-breaking-changes | 4 + src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +++++++++- src/resources/radar/ct.ts | 3 + src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + .../radar/ai/timeseries-groups.test.ts | 135 ++ .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 17 files changed, 2910 insertions(+), 6 deletions(-) create mode 100644 src/resources/radar/ct.ts create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 2d17904dd6..25f7488585 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 +configured_endpoints: 1791 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c35ceaa57ff731aa0a379ee4284a6e9608940b917c362163d52feb4be72c8d31.yml openapi_spec_hash: 07fccce915fde9d81a0294df06c47cb4 -config_hash: 242134bf2dc570f5555bf479c40a42d0 +config_hash: a369123b780ef98d372657aadaf013ee diff --git a/api.md b/api.md index 3d30fde3fd..6f9167b05f 100644 --- a/api.md +++ b/api.md @@ -6378,6 +6378,56 @@ Methods: ### TimeseriesGroups +Types: + +- TimeseriesGroupSummaryResponse +- TimeseriesGroupTimeseriesResponse +- TimeseriesGroupTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse + +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..d9960b46eb 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,10 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..859934963d 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,15 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupSummaryParams, + TimeseriesGroupSummaryResponse, + TimeseriesGroupTimeseriesGroupsParams, + TimeseriesGroupTimeseriesGroupsResponse, + TimeseriesGroupTimeseriesParams, + TimeseriesGroupTimeseriesResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +50,13 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..1ae7394bd6 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,15 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..e8e532a6be 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,653 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseries(); + * ``` + */ + timeseries( + query?: TimeseriesGroupTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesResponse.Meta; + + [k: string]: + | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | TimeseriesGroupTimeseriesResponse.Meta + | undefined; +} + +export namespace TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; + + serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; +} + +export namespace TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface TimeseriesGroupTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface TimeseriesGroupTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts new file mode 100644 index 0000000000..a1db06bc41 --- /dev/null +++ b/src/resources/radar/ct.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -85,6 +95,7 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -113,6 +124,7 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -136,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..5a72ed2d24 --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From b08950b360c0d5f62b2b464fefc779046e2fd95e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 04:58:45 +0000 Subject: [PATCH 330/423] feat(api): api update --- .stats.yml | 4 +- src/resources/bot-management.ts | 72 ++++++++++++++++++++++ tests/api-resources/bot-management.test.ts | 1 + 3 files changed, 75 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 25f7488585..9cf7fd4c20 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c35ceaa57ff731aa0a379ee4284a6e9608940b917c362163d52feb4be72c8d31.yml -openapi_spec_hash: 07fccce915fde9d81a0294df06c47cb4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68e2c48d15c00e0f04f76f066813a87e61922428c0decfd20d5b306cc1f874fb.yml +openapi_spec_hash: 5fde58aafaa296f76dce8626a9c5437c config_hash: a369123b780ef98d372657aadaf013ee diff --git a/src/resources/bot-management.ts b/src/resources/bot-management.ts index 5200d8a7d5..e7ad4ba777 100644 --- a/src/resources/bot-management.ts +++ b/src/resources/bot-management.ts @@ -136,6 +136,12 @@ export interface BotFightModeConfiguration { */ fight_mode?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * A read-only field that shows which unauthorized settings are currently active on * the zone. These settings typically result from upgrades or downgrades. @@ -211,6 +217,12 @@ export interface BotFightModeConfigurationParam { * Whether to enable Bot Fight Mode. */ fight_mode?: boolean; + + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; } export interface SubscriptionConfiguration { @@ -238,6 +250,12 @@ export interface SubscriptionConfiguration { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * A read-only field that shows which unauthorized settings are currently active on * the zone. These settings typically result from upgrades or downgrades. @@ -322,6 +340,12 @@ export interface SubscriptionConfigurationParam { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Whether to disable tracking the highest bot score for a session in the Bot * Management cookie. @@ -347,6 +371,12 @@ export interface SuperBotFightModeDefinitelyConfiguration { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -419,6 +449,12 @@ export interface SuperBotFightModeDefinitelyConfigurationParam { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -460,6 +496,12 @@ export interface SuperBotFightModeLikelyConfiguration { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -531,6 +573,12 @@ export interface SuperBotFightModeLikelyConfigurationParam { */ enable_js?: boolean; + /** + * Enable cloudflare managed robots.txt. If an existing robots.txt is detected, + * then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -606,6 +654,12 @@ export declare namespace BotManagementUpdateParams { * Body param: Whether to enable Bot Fight Mode. */ fight_mode?: boolean; + + /** + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; } export interface SuperBotFightModeDefinitelyConfiguration { @@ -632,6 +686,12 @@ export declare namespace BotManagementUpdateParams { */ enable_js?: boolean; + /** + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -681,6 +741,12 @@ export declare namespace BotManagementUpdateParams { */ enable_js?: boolean; + /** + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Body param: Whether to optimize Super Bot Fight Mode protections for Wordpress. */ @@ -743,6 +809,12 @@ export declare namespace BotManagementUpdateParams { */ enable_js?: boolean; + /** + * Body param: Enable cloudflare managed robots.txt. If an existing robots.txt is + * detected, then managed robots.txt will be prepended to the existing robots.txt. + */ + is_robots_txt_managed?: boolean; + /** * Body param: Whether to disable tracking the highest bot score for a session in * the Bot Management cookie. diff --git a/tests/api-resources/bot-management.test.ts b/tests/api-resources/bot-management.test.ts index 28d4e1ca3a..1d2e90cbde 100644 --- a/tests/api-resources/bot-management.test.ts +++ b/tests/api-resources/bot-management.test.ts @@ -28,6 +28,7 @@ describe('resource botManagement', () => { crawler_protection: 'enabled', enable_js: true, fight_mode: true, + is_robots_txt_managed: true, }); }); From 396f9ed9f18301978b8dbfd9fc4614a4fdac7fb9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 06:10:38 +0000 Subject: [PATCH 331/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9cf7fd4c20..789052ece7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-68e2c48d15c00e0f04f76f066813a87e61922428c0decfd20d5b306cc1f874fb.yml -openapi_spec_hash: 5fde58aafaa296f76dce8626a9c5437c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-534bd90652db1579acb4f2a21a18923986ce86036b707e3ca095f279172d9ab3.yml +openapi_spec_hash: a229a3b281f6e4a507c1b6c05f55395b config_hash: a369123b780ef98d372657aadaf013ee From 98025e4a67b4cbd02f3b9e116c3787ba99c72eec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 08:27:05 +0000 Subject: [PATCH 332/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 789052ece7..d6b1a68591 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-534bd90652db1579acb4f2a21a18923986ce86036b707e3ca095f279172d9ab3.yml -openapi_spec_hash: a229a3b281f6e4a507c1b6c05f55395b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-acb3c664676e3a3811ba2758e61a56bfd5290c66c9e015967b48c22a9fc030bc.yml +openapi_spec_hash: e9eb3a22e4a2bc290960a161766fc8f9 config_hash: a369123b780ef98d372657aadaf013ee From 1658ccf95d86ead6f156205eeb0b6ab9d1e56444 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 08:38:57 +0000 Subject: [PATCH 333/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d6b1a68591..53131f5741 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-acb3c664676e3a3811ba2758e61a56bfd5290c66c9e015967b48c22a9fc030bc.yml -openapi_spec_hash: e9eb3a22e4a2bc290960a161766fc8f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cbe3c24d92fc79f7dcd5ce17d93d68914aaef939a808bf165a79a724557e002c.yml +openapi_spec_hash: 54b44d217fb3b69d1f991fa8cad7dbdb config_hash: a369123b780ef98d372657aadaf013ee From 65c3d6a0e9065bdf28b131489cbf2cf74eb7669e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 09:07:47 +0000 Subject: [PATCH 334/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 53131f5741..5131c0cab2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cbe3c24d92fc79f7dcd5ce17d93d68914aaef939a808bf165a79a724557e002c.yml -openapi_spec_hash: 54b44d217fb3b69d1f991fa8cad7dbdb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-178c6a903442de2ad7a37f70294735cb890d27fd53921b6d945ed7d840b7c963.yml +openapi_spec_hash: 49ab374af397a0e30036acc25bfc12e6 config_hash: a369123b780ef98d372657aadaf013ee From 46e7f2631edcfa8d6b505199a26af74044901c87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 10:45:08 +0000 Subject: [PATCH 335/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5131c0cab2..e3384f1e9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-178c6a903442de2ad7a37f70294735cb890d27fd53921b6d945ed7d840b7c963.yml -openapi_spec_hash: 49ab374af397a0e30036acc25bfc12e6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-18a8922781d7ab41b15e55d7f944f5199a2cb376a75f30493e0b53594697e876.yml +openapi_spec_hash: dc7c8dc7977503e167d33f4e61538b07 config_hash: a369123b780ef98d372657aadaf013ee From a1fb491073de07a92470ba89cec803328abf3153 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:22:37 +0000 Subject: [PATCH 336/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e3384f1e9c..96278e10e4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-18a8922781d7ab41b15e55d7f944f5199a2cb376a75f30493e0b53594697e876.yml -openapi_spec_hash: dc7c8dc7977503e167d33f4e61538b07 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aae5bc3dd2044698eb06f0f43f3b9faf332b51705c8d1e388e30eb83cf23b4f4.yml +openapi_spec_hash: 2fa2142d09ad6810582fa0950a23e978 config_hash: a369123b780ef98d372657aadaf013ee From ccf8a40a0fa8ecff2b38dc6902a793313ed29e42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 12:31:53 +0000 Subject: [PATCH 337/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 57 +- scripts/detect-breaking-changes | 4 - src/index.ts | 8 + src/pagination.ts | 73 ++ src/resources/kv/namespaces/keys.ts | 12 - src/resources/kv/namespaces/metadata.ts | 3 - src/resources/kv/namespaces/namespaces.ts | 9 - src/resources/kv/namespaces/values.ts | 2 +- src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +--------- src/resources/radar/ct.ts | 3 - src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - src/resources/workers/scripts/deployments.ts | 95 +- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/timeseries-groups.test.ts | 135 -- .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 27 files changed, 185 insertions(+), 2953 deletions(-) delete mode 100644 src/resources/radar/ct.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 96278e10e4..d68e52d1ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aae5bc3dd2044698eb06f0f43f3b9faf332b51705c8d1e388e30eb83cf23b4f4.yml +configured_endpoints: 1781 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3789da414df5e55a6347441e22086536eb4e2c535b266b70748006b3a632abbe.yml openapi_spec_hash: 2fa2142d09ad6810582fa0950a23e978 -config_hash: a369123b780ef98d372657aadaf013ee +config_hash: ab4569f2e8dd52d04ef8493482a67230 diff --git a/api.md b/api.md index 6f9167b05f..89ff9eae57 100644 --- a/api.md +++ b/api.md @@ -2120,16 +2120,17 @@ Methods: Types: -- Deployment +- DeploymentCreateResponse - DeploymentListResponse - DeploymentDeleteResponse +- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse ### Versions @@ -6378,56 +6379,6 @@ Methods: ### TimeseriesGroups -Types: - -- TimeseriesGroupSummaryResponse -- TimeseriesGroupTimeseriesResponse -- TimeseriesGroupTimeseriesGroupsResponse - -Methods: - -- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse -- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse -- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse - -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index d9960b46eb..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,10 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/index.ts b/src/index.ts index 112d9389ca..fd232692e2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,6 +8,8 @@ import * as Pagination from './pagination'; import { type CursorLimitPaginationParams, CursorLimitPaginationResponse, + type CursorPaginationAfterParams, + CursorPaginationAfterResponse, type CursorPaginationParams, CursorPaginationResponse, SinglePageResponse, @@ -607,6 +609,12 @@ export declare namespace Cloudflare { type CursorPaginationResponse as CursorPaginationResponse, }; + export import CursorPaginationAfter = Pagination.CursorPaginationAfter; + export { + type CursorPaginationAfterParams as CursorPaginationAfterParams, + type CursorPaginationAfterResponse as CursorPaginationAfterResponse, + }; + export import CursorLimitPagination = Pagination.CursorLimitPagination; export { type CursorLimitPaginationParams as CursorLimitPaginationParams, diff --git a/src/pagination.ts b/src/pagination.ts index 8f6f5d7115..2c73ebb899 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,6 +1,7 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; +import * as StainlessPageResourceAPI from './resources/stainless-page-resource'; export interface V4PagePaginationResponse { result: V4PagePaginationResponse.Result; @@ -194,6 +195,78 @@ export class CursorPagination extends AbstractPage implements Cursor } } +export interface CursorPaginationAfterResponse { + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; +} + +export namespace CursorPaginationAfterResponse { + export interface ResultInfo { + cursors?: StainlessPageResourceAPI.ResultInfo.Cursors; + } + + export namespace ResultInfo { + export interface Cursors { + after?: string; + } + } +} + +export interface CursorPaginationAfterParams { + cursor?: string; + + per_page?: number; +} + +export class CursorPaginationAfter + extends AbstractPage + implements CursorPaginationAfterResponse +{ + result: Array; + + result_info: CursorPaginationAfterResponse.ResultInfo; + + constructor( + client: APIClient, + response: Response, + body: CursorPaginationAfterResponse, + options: FinalRequestOptions, + ) { + super(client, response, body, options); + + this.result = body.result || []; + this.result_info = body.result_info || {}; + } + + getPaginatedItems(): Item[] { + return this.result ?? []; + } + + // @deprecated Please use `nextPageInfo()` instead + nextPageParams(): Partial | null { + const info = this.nextPageInfo(); + if (!info) return null; + if ('params' in info) return info.params; + const params = Object.fromEntries(info.url.searchParams); + if (!Object.keys(params).length) return null; + return params; + } + + nextPageInfo(): PageInfo | null { + const cursor = this.result_info?.cursors?.after; + if (!cursor) { + return null; + } + + return { + params: { + cursor, + }, + }; + } +} + export interface CursorLimitPaginationResponse { result: Array; diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index ad094eeddb..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -117,9 +117,6 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } @@ -156,14 +153,8 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ metadata: unknown; - /** - * The value associated with the key. - */ value: unknown; /** @@ -277,9 +268,6 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 927ba8a17d..53db763063 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,9 +34,6 @@ export class Metadata extends APIResource { } } -/** - * Arbitrary JSON that is associated with a key. - */ export type MetadataGetResponse = unknown; export interface MetadataGetParams { diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 3f8f3b7a90..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -312,14 +312,8 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ metadata: unknown; - /** - * The value associated with the key. - */ value: unknown; /** @@ -468,9 +462,6 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 29174df308..03752a92d4 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -134,7 +134,7 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: Associates arbitrary JSON data with a key/value pair. + * Body param: */ metadata?: unknown; } diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 859934963d..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,15 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupSummaryParams, - TimeseriesGroupSummaryResponse, - TimeseriesGroupTimeseriesGroupsParams, - TimeseriesGroupTimeseriesGroupsResponse, - TimeseriesGroupTimeseriesParams, - TimeseriesGroupTimeseriesResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -50,13 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 1ae7394bd6..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,15 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index e8e532a6be..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,653 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseries(); - * ``` - */ - timeseries( - query?: TimeseriesGroupTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupSummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesResponse.Meta; - - [k: string]: - | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | TimeseriesGroupTimeseriesResponse.Meta - | undefined; -} - -export namespace TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; - - serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; -} - -export namespace TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupSummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface TimeseriesGroupTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface TimeseriesGroupTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts deleted file mode 100644 index a1db06bc41..0000000000 --- a/src/resources/radar/ct.ts +++ /dev/null @@ -1,3 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -95,7 +85,6 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -124,7 +113,6 @@ export class Radar extends APIResource { } Radar.AI = AI; -Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -148,16 +136,6 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index 1283130f6b..c23e1d1b09 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: Deployment }> + }) as Core.APIPromise<{ result: DeploymentCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: Deployment }> + ) as Core.APIPromise<{ result: DeploymentGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface Deployment { +export interface DeploymentCreateResponse { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface Deployment { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: Deployment.Annotations; + annotations?: DeploymentCreateResponse.Annotations; author_email?: string; } -export namespace Deployment { +export namespace DeploymentCreateResponse { export interface Version { percentage: number; @@ -164,7 +164,45 @@ export namespace Deployment { } export interface DeploymentListResponse { - deployments: Array; + deployments: Array; +} + +export namespace DeploymentListResponse { + export interface Deployment { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: Deployment.Annotations; + + author_email?: string; + } + + export namespace Deployment { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } + } } export interface DeploymentDeleteResponse { @@ -212,6 +250,42 @@ export namespace DeploymentDeleteResponse { } } +export interface DeploymentGetResponse { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: DeploymentGetResponse.Annotations; + + author_email?: string; +} + +export namespace DeploymentGetResponse { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } +} + export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -279,9 +353,10 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 73bd09f1ac..ed521aefd1 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,9 +4,10 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type Deployment, + type DeploymentCreateResponse, type DeploymentListResponse, type DeploymentDeleteResponse, + type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 2f5b74a81c..e4db71c985 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,11 +7,12 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { - Deployment, DeploymentCreateParams, + DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, + DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1310,9 +1311,10 @@ export declare namespace Scripts { export { Deployments as Deployments, - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 03fbaa4b52..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 5a72ed2d24..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From 95ab96c4643ee4a82fbaf8b0b35d2b890cd58b2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:05:48 +0000 Subject: [PATCH 338/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d68e52d1ed..5d0f9ceac0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3789da414df5e55a6347441e22086536eb4e2c535b266b70748006b3a632abbe.yml -openapi_spec_hash: 2fa2142d09ad6810582fa0950a23e978 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01b74ae6c99ff44416edfd361be5693b27c35ba9de2f8555a6d9fd71b9fc90b1.yml +openapi_spec_hash: 85174ea3049952fc986f59536ba93763 config_hash: ab4569f2e8dd52d04ef8493482a67230 From 309bde8431f3cf0b4b08ec013a1aad973de05175 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 14:34:43 +0000 Subject: [PATCH 339/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d0f9ceac0..edb52ec157 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-01b74ae6c99ff44416edfd361be5693b27c35ba9de2f8555a6d9fd71b9fc90b1.yml -openapi_spec_hash: 85174ea3049952fc986f59536ba93763 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61efcd164767e3f8332014ee08fb0954e862be7b6bcf18f46479a17b5f2d4f56.yml +openapi_spec_hash: fca7c0597d59120ecdb9733c76b629c6 config_hash: ab4569f2e8dd52d04ef8493482a67230 From 20ac41655661d52185ebbce94c090a5c693fc36d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:10:44 +0000 Subject: [PATCH 340/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index edb52ec157..1b8000e5f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-61efcd164767e3f8332014ee08fb0954e862be7b6bcf18f46479a17b5f2d4f56.yml -openapi_spec_hash: fca7c0597d59120ecdb9733c76b629c6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6720d970f0c421ac12847cf37511544f9b2105ed2bfadd817f571168a842051a.yml +openapi_spec_hash: 2b8094c0c365554f8f56ca86dbe14753 config_hash: ab4569f2e8dd52d04ef8493482a67230 From 3016cced31eca0751a640143bfe7aafd2ae8bd25 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:25:32 +0000 Subject: [PATCH 341/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1b8000e5f9..dbc862113b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6720d970f0c421ac12847cf37511544f9b2105ed2bfadd817f571168a842051a.yml -openapi_spec_hash: 2b8094c0c365554f8f56ca86dbe14753 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-381ed84335cfa747d09c66cc65add15e3daceb84368f59aa9ce9067c5706d516.yml +openapi_spec_hash: f4d8980ef4fa4c092ab0dfcb5cdb85f8 config_hash: ab4569f2e8dd52d04ef8493482a67230 From 0239b4f5af23bc80f13cfab247250ea834e81de5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 15:56:02 +0000 Subject: [PATCH 342/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/logpush/datasets/fields.ts | 2 +- src/resources/logpush/jobs.ts | 30 +++++++++++++----------- src/resources/logpush/ownership.ts | 4 ++-- src/resources/logpush/validate.ts | 4 ++-- 5 files changed, 23 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index dbc862113b..1d2b49fa8c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-381ed84335cfa747d09c66cc65add15e3daceb84368f59aa9ce9067c5706d516.yml -openapi_spec_hash: f4d8980ef4fa4c092ab0dfcb5cdb85f8 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b3a5962f102d4bffee87e6012f4afa9bd954a19c3bd78c368887941fb8ba92c.yml +openapi_spec_hash: 23a363af2dc9dbe00b2e21fa0df67c43 config_hash: ab4569f2e8dd52d04ef8493482a67230 diff --git a/src/resources/logpush/datasets/fields.ts b/src/resources/logpush/datasets/fields.ts index 37067a4577..cf6c38a078 100644 --- a/src/resources/logpush/datasets/fields.ts +++ b/src/resources/logpush/datasets/fields.ts @@ -7,7 +7,7 @@ import { CloudflareError } from '../../../error'; export class Fields extends APIResource { /** - * Lists all fields available for a dataset. The response result is an object with + * Lists all fields available for a dataset. The response result is. an object with * key-value pairs, where keys are field names, and values are descriptions. * * @example diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index ebb9b098e1..9ffff8c7ea 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -35,6 +35,7 @@ export class Jobs extends APIResource { * sample_rate: 1, * timestamp_format: 'unixnano', * }, + * ownership_challenge: '00000000000000000000', * }); * ``` */ @@ -90,6 +91,7 @@ export class Jobs extends APIResource { * sample_rate: 1, * timestamp_format: 'unixnano', * }, + * ownership_challenge: '00000000000000000000', * }); * ``` */ @@ -311,8 +313,8 @@ export interface LogpushJob { | null; /** - * Uniquely identifies a resource (such as an s3 bucket) where data will be pushed. - * Additional configuration parameters supported by the destination may be + * Uniquely identifies a resource (such as an s3 bucket) where data. will be + * pushed. Additional configuration parameters supported by the destination may be * included. */ destination_conf?: string; @@ -323,7 +325,7 @@ export interface LogpushJob { enabled?: boolean; /** - * If not null, the job is currently failing. Failures are usually repetitive + * If not null, the job is currently failing. Failures are usually. repetitive * (example: no permissions to write to destination bucket). Only the last failure * is recorded. On successful execution of a job the error_message and last_error * are set to null. @@ -332,7 +334,7 @@ export interface LogpushJob { /** * @deprecated This field is deprecated. Please use `max_upload_*` parameters - * instead. The frequency at which Cloudflare sends batches of logs to your + * instead. . The frequency at which Cloudflare sends batches of logs to your * destination. Setting frequency to high sends your logs in larger quantities of * smaller files. Setting frequency to low sends logs in smaller quantities of * larger files. @@ -354,9 +356,9 @@ export interface LogpushJob { last_complete?: string | null; /** - * Records the last time the job failed. If not null, the job is currently failing. - * If null, the job has either never failed or has run successfully at least once - * since last failure. See also the error_message field. + * Records the last time the job failed. If not null, the job is currently. + * failing. If null, the job has either never failed or has run successfully at + * least once since last failure. See also the error_message field. */ last_error?: string | null; @@ -394,7 +396,7 @@ export interface LogpushJob { max_upload_records?: 0 | number | null; /** - * Optional human readable job name. Not unique. Cloudflare suggests that you set + * Optional human readable job name. Not unique. Cloudflare suggests. that you set * this to a meaningful string, like the domain name, to make it easier to identify * your job. */ @@ -568,7 +570,7 @@ export interface JobDeleteResponse { export interface JobCreateParams { /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ @@ -632,7 +634,7 @@ export interface JobCreateParams { /** * @deprecated Body param: This field is deprecated. Please use `max_upload_*` - * parameters instead. The frequency at which Cloudflare sends batches of logs to + * parameters instead. . The frequency at which Cloudflare sends batches of logs to * your destination. Setting frequency to high sends your logs in larger quantities * of smaller files. Setting frequency to low sends logs in smaller quantities of * larger files. @@ -679,7 +681,7 @@ export interface JobCreateParams { max_upload_records?: 0 | number | null; /** - * Body param: Optional human readable job name. Not unique. Cloudflare suggests + * Body param: Optional human readable job name. Not unique. Cloudflare suggests. * that you set this to a meaningful string, like the domain name, to make it * easier to identify your job. */ @@ -711,7 +713,7 @@ export interface JobUpdateParams { zone_id?: string; /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ @@ -731,7 +733,7 @@ export interface JobUpdateParams { /** * @deprecated Body param: This field is deprecated. Please use `max_upload_*` - * parameters instead. The frequency at which Cloudflare sends batches of logs to + * parameters instead. . The frequency at which Cloudflare sends batches of logs to * your destination. Setting frequency to high sends your logs in larger quantities * of smaller files. Setting frequency to low sends logs in smaller quantities of * larger files. @@ -778,7 +780,7 @@ export interface JobUpdateParams { max_upload_records?: 0 | number | null; /** - * Body param: Optional human readable job name. Not unique. Cloudflare suggests + * Body param: Optional human readable job name. Not unique. Cloudflare suggests. * that you set this to a meaningful string, like the domain name, to make it * easier to identify your job. */ diff --git a/src/resources/logpush/ownership.ts b/src/resources/logpush/ownership.ts index b7281f9514..2bff2f6744 100644 --- a/src/resources/logpush/ownership.ts +++ b/src/resources/logpush/ownership.ts @@ -102,7 +102,7 @@ export interface OwnershipCreateResponse { export interface OwnershipCreateParams { /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ @@ -123,7 +123,7 @@ export interface OwnershipCreateParams { export interface OwnershipValidateParams { /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ diff --git a/src/resources/logpush/validate.ts b/src/resources/logpush/validate.ts index f3fa9c7e6d..c96f7480c0 100644 --- a/src/resources/logpush/validate.ts +++ b/src/resources/logpush/validate.ts @@ -146,7 +146,7 @@ export interface ValidateOriginResponse { export interface ValidateDestinationParams { /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ @@ -167,7 +167,7 @@ export interface ValidateDestinationParams { export interface ValidateDestinationExistsParams { /** - * Body param: Uniquely identifies a resource (such as an s3 bucket) where data + * Body param: Uniquely identifies a resource (such as an s3 bucket) where data. * will be pushed. Additional configuration parameters supported by the destination * may be included. */ From b4e04158da1bb348cfb08f692cfd64a10708c23f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:06:54 +0000 Subject: [PATCH 343/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 57 +- scripts/detect-breaking-changes | 4 + src/resources/kv/namespaces/keys.ts | 12 + src/resources/kv/namespaces/metadata.ts | 3 + src/resources/kv/namespaces/namespaces.ts | 9 + src/resources/kv/namespaces/values.ts | 2 +- src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +++++++++- src/resources/radar/ct.ts | 3 + src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + src/resources/workers/scripts/deployments.ts | 95 +- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/timeseries-groups.test.ts | 135 ++ .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 25 files changed, 2953 insertions(+), 104 deletions(-) create mode 100644 src/resources/radar/ct.ts create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 1d2b49fa8c..37ab062d0d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b3a5962f102d4bffee87e6012f4afa9bd954a19c3bd78c368887941fb8ba92c.yml +configured_endpoints: 1791 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8783b0f77ab63a7cc14d158b83a90d8c8f13ab825092a9b4001b40d683ac9d98.yml openapi_spec_hash: 23a363af2dc9dbe00b2e21fa0df67c43 -config_hash: ab4569f2e8dd52d04ef8493482a67230 +config_hash: 8387cc6cd9749c918304b96bee7ac652 diff --git a/api.md b/api.md index 89ff9eae57..6f9167b05f 100644 --- a/api.md +++ b/api.md @@ -2120,17 +2120,16 @@ Methods: Types: -- DeploymentCreateResponse +- Deployment - DeploymentListResponse - DeploymentDeleteResponse -- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment ### Versions @@ -6379,6 +6378,56 @@ Methods: ### TimeseriesGroups +Types: + +- TimeseriesGroupSummaryResponse +- TimeseriesGroupTimeseriesResponse +- TimeseriesGroupTimeseriesGroupsResponse + +Methods: + +- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse + +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..d9960b46eb 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,10 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..ad094eeddb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -117,6 +117,9 @@ export interface Key { */ expiration?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } @@ -153,8 +156,14 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { + /** + * The metadata associated with the key. + */ metadata: unknown; + /** + * The value associated with the key. + */ value: unknown; /** @@ -268,6 +277,9 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 53db763063..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,6 +34,9 @@ export class Metadata extends APIResource { } } +/** + * Arbitrary JSON that is associated with a key. + */ export type MetadataGetResponse = unknown; export interface MetadataGetParams { diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..3f8f3b7a90 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -312,8 +312,14 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { + /** + * The metadata associated with the key. + */ metadata: unknown; + /** + * The value associated with the key. + */ value: unknown; /** @@ -462,6 +468,9 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 03752a92d4..29174df308 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -134,7 +134,7 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: + * Body param: Associates arbitrary JSON data with a key/value pair. */ metadata?: unknown; } diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..859934963d 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,15 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupSummaryParams, + TimeseriesGroupSummaryResponse, + TimeseriesGroupTimeseriesGroupsParams, + TimeseriesGroupTimeseriesGroupsResponse, + TimeseriesGroupTimeseriesParams, + TimeseriesGroupTimeseriesResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +50,13 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..1ae7394bd6 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,15 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..e8e532a6be 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,653 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseries(); + * ``` + */ + timeseries( + query?: TimeseriesGroupTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupSummaryResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesResponse.Meta; + + [k: string]: + | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | TimeseriesGroupTimeseriesResponse.Meta + | undefined; +} + +export namespace TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; + + serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; +} + +export namespace TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface TimeseriesGroupTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface TimeseriesGroupTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, + }; +} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts new file mode 100644 index 0000000000..a1db06bc41 --- /dev/null +++ b/src/resources/radar/ct.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -85,6 +95,7 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -113,6 +124,7 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -136,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index c23e1d1b09..1283130f6b 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: DeploymentCreateResponse }> + }) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: DeploymentGetResponse }> + ) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } } -export interface DeploymentCreateResponse { +export interface Deployment { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface DeploymentCreateResponse { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: DeploymentCreateResponse.Annotations; + annotations?: Deployment.Annotations; author_email?: string; } -export namespace DeploymentCreateResponse { +export namespace Deployment { export interface Version { percentage: number; @@ -164,45 +164,7 @@ export namespace DeploymentCreateResponse { } export interface DeploymentListResponse { - deployments: Array; -} - -export namespace DeploymentListResponse { - export interface Deployment { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: Deployment.Annotations; - - author_email?: string; - } - - export namespace Deployment { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } - } + deployments: Array; } export interface DeploymentDeleteResponse { @@ -250,42 +212,6 @@ export namespace DeploymentDeleteResponse { } } -export interface DeploymentGetResponse { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: DeploymentGetResponse.Annotations; - - author_email?: string; -} - -export namespace DeploymentGetResponse { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } -} - export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -353,10 +279,9 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index ed521aefd1..73bd09f1ac 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,10 +4,9 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type DeploymentCreateResponse, + type Deployment, type DeploymentListResponse, type DeploymentDeleteResponse, - type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index e4db71c985..2f5b74a81c 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,12 +7,11 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { + Deployment, DeploymentCreateParams, - DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, - DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1311,10 +1310,9 @@ export declare namespace Scripts { export { Deployments as Deployments, - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..03fbaa4b52 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, + metadata: {}, }); }); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..5a72ed2d24 --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,135 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From dc6a64d91d0e8b09a1ed83a2b1a0dff74dc105ed Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:09:20 +0000 Subject: [PATCH 344/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 37ab062d0d..a53531047d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8783b0f77ab63a7cc14d158b83a90d8c8f13ab825092a9b4001b40d683ac9d98.yml -openapi_spec_hash: 23a363af2dc9dbe00b2e21fa0df67c43 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4bf4b10bc892007da9de2bdf4daadd3b2e816c2742371bf87183c60d2fc6924.yml +openapi_spec_hash: e73c85ddbb9a0041bb56e19a37475a5b config_hash: 8387cc6cd9749c918304b96bee7ac652 From fde89f4efafb931fc105560584ea4b8d0d91e753 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:37:51 +0000 Subject: [PATCH 345/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a53531047d..af6ac7d802 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1791 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4bf4b10bc892007da9de2bdf4daadd3b2e816c2742371bf87183c60d2fc6924.yml -openapi_spec_hash: e73c85ddbb9a0041bb56e19a37475a5b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd1bc86694bdc2e2deb05f0e743afa87b94ff96a55b10fdd6a15b11fa7ee34c0.yml +openapi_spec_hash: 9fa312b08e4ba5659a03d7143210437f config_hash: 8387cc6cd9749c918304b96bee7ac652 From e1544186b24a6abcf13d974bcc58f0f2b6885de0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:40:53 +0000 Subject: [PATCH 346/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 50 - scripts/detect-breaking-changes | 4 - src/index.ts | 8 - src/pagination.ts | 73 -- src/resources/radar/ai/ai.ts | 20 +- src/resources/radar/ai/index.ts | 10 +- src/resources/radar/ai/timeseries-groups.ts | 650 +--------- src/resources/radar/ct.ts | 3 - src/resources/radar/ct/authorities.ts | 301 ----- src/resources/radar/ct/ct.ts | 1107 ----------------- src/resources/radar/ct/index.ts | 25 - src/resources/radar/ct/logs.ts | 271 ---- src/resources/radar/index.ts | 9 - src/resources/radar/radar.ts | 22 - .../radar/ai/timeseries-groups.test.ts | 135 -- .../radar/ct/authorities.test.ts | 73 -- tests/api-resources/radar/ct/ct.test.ts | 167 --- tests/api-resources/radar/ct/logs.test.ts | 65 - 19 files changed, 6 insertions(+), 2991 deletions(-) delete mode 100644 src/resources/radar/ct.ts delete mode 100644 src/resources/radar/ct/authorities.ts delete mode 100644 src/resources/radar/ct/ct.ts delete mode 100644 src/resources/radar/ct/index.ts delete mode 100644 src/resources/radar/ct/logs.ts delete mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts delete mode 100644 tests/api-resources/radar/ct/authorities.test.ts delete mode 100644 tests/api-resources/radar/ct/ct.test.ts delete mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index af6ac7d802..e219ee0f76 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1791 +configured_endpoints: 1781 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd1bc86694bdc2e2deb05f0e743afa87b94ff96a55b10fdd6a15b11fa7ee34c0.yml openapi_spec_hash: 9fa312b08e4ba5659a03d7143210437f -config_hash: 8387cc6cd9749c918304b96bee7ac652 +config_hash: cbc31befc4267a7deb9d79b1767a2b65 diff --git a/api.md b/api.md index 6f9167b05f..3d30fde3fd 100644 --- a/api.md +++ b/api.md @@ -6378,56 +6378,6 @@ Methods: ### TimeseriesGroups -Types: - -- TimeseriesGroupSummaryResponse -- TimeseriesGroupTimeseriesResponse -- TimeseriesGroupTimeseriesGroupsResponse - -Methods: - -- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse -- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse -- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse - -## Ct - -Types: - -- CtSummaryResponse -- CtTimeseriesResponse -- CtTimeseriesGroupsResponse - -Methods: - -- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse -- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse -- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse - -### Authorities - -Types: - -- AuthorityListResponse -- AuthorityGetResponse - -Methods: - -- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse -- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse - -### Logs - -Types: - -- LogListResponse -- LogGetResponse - -Methods: - -- client.radar.ct.logs.list({ ...params }) -> LogListResponse -- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse - ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index d9960b46eb..975bf26d7d 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,10 +542,6 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts - tests/api-resources/radar/ai/timeseries-groups.test.ts - tests/api-resources/radar/ct/ct.test.ts - tests/api-resources/radar/ct/authorities.test.ts - tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/index.ts b/src/index.ts index fd232692e2..112d9389ca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,8 +8,6 @@ import * as Pagination from './pagination'; import { type CursorLimitPaginationParams, CursorLimitPaginationResponse, - type CursorPaginationAfterParams, - CursorPaginationAfterResponse, type CursorPaginationParams, CursorPaginationResponse, SinglePageResponse, @@ -609,12 +607,6 @@ export declare namespace Cloudflare { type CursorPaginationResponse as CursorPaginationResponse, }; - export import CursorPaginationAfter = Pagination.CursorPaginationAfter; - export { - type CursorPaginationAfterParams as CursorPaginationAfterParams, - type CursorPaginationAfterResponse as CursorPaginationAfterResponse, - }; - export import CursorLimitPagination = Pagination.CursorLimitPagination; export { type CursorLimitPaginationParams as CursorLimitPaginationParams, diff --git a/src/pagination.ts b/src/pagination.ts index 2c73ebb899..8f6f5d7115 100644 --- a/src/pagination.ts +++ b/src/pagination.ts @@ -1,7 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { AbstractPage, Response, APIClient, FinalRequestOptions, PageInfo } from './core'; -import * as StainlessPageResourceAPI from './resources/stainless-page-resource'; export interface V4PagePaginationResponse { result: V4PagePaginationResponse.Result; @@ -195,78 +194,6 @@ export class CursorPagination extends AbstractPage implements Cursor } } -export interface CursorPaginationAfterResponse { - result: Array; - - result_info: CursorPaginationAfterResponse.ResultInfo; -} - -export namespace CursorPaginationAfterResponse { - export interface ResultInfo { - cursors?: StainlessPageResourceAPI.ResultInfo.Cursors; - } - - export namespace ResultInfo { - export interface Cursors { - after?: string; - } - } -} - -export interface CursorPaginationAfterParams { - cursor?: string; - - per_page?: number; -} - -export class CursorPaginationAfter - extends AbstractPage - implements CursorPaginationAfterResponse -{ - result: Array; - - result_info: CursorPaginationAfterResponse.ResultInfo; - - constructor( - client: APIClient, - response: Response, - body: CursorPaginationAfterResponse, - options: FinalRequestOptions, - ) { - super(client, response, body, options); - - this.result = body.result || []; - this.result_info = body.result_info || {}; - } - - getPaginatedItems(): Item[] { - return this.result ?? []; - } - - // @deprecated Please use `nextPageInfo()` instead - nextPageParams(): Partial | null { - const info = this.nextPageInfo(); - if (!info) return null; - if ('params' in info) return info.params; - const params = Object.fromEntries(info.url.searchParams); - if (!Object.keys(params).length) return null; - return params; - } - - nextPageInfo(): PageInfo | null { - const cursor = this.result_info?.cursors?.after; - if (!cursor) { - return null; - } - - return { - params: { - cursor, - }, - }; - } -} - export interface CursorLimitPaginationResponse { result: Array; diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 859934963d..9644b4f759 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,15 +2,7 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { - TimeseriesGroupSummaryParams, - TimeseriesGroupSummaryResponse, - TimeseriesGroupTimeseriesGroupsParams, - TimeseriesGroupTimeseriesGroupsResponse, - TimeseriesGroupTimeseriesParams, - TimeseriesGroupTimeseriesResponse, - TimeseriesGroups, -} from './timeseries-groups'; +import { TimeseriesGroups } from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -50,13 +42,5 @@ export declare namespace AI { export { Bots as Bots }; - export { - TimeseriesGroups as TimeseriesGroups, - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; + export { TimeseriesGroups as TimeseriesGroups }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 1ae7394bd6..7eca533538 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,15 +3,7 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { - TimeseriesGroups, - type TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams, -} from './timeseries-groups'; +export { TimeseriesGroups } from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index e8e532a6be..17f65608eb 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,653 +1,5 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource { - /** - * Retrieves an aggregated summary of AI bots HTTP requests grouped by the - * specified dimension. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.summary( - * 'USER_AGENT', - * ); - * ``` - */ - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves AI bots HTTP request volume over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseries(); - * ``` - */ - timeseries( - query?: TimeseriesGroupTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ - result: TimeseriesGroupTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the - * specified dimension over time. - * - * @example - * ```ts - * const response = - * await client.radar.ai.timeseriesGroups.timeseriesGroups( - * 'USER_AGENT', - * ); - * ``` - */ - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query?: TimeseriesGroupTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', - query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { - query, - ...options, - }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupSummaryResponse.Meta; - - summary_0: { [key: string]: string }; -} - -export namespace TimeseriesGroupSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } -} - -export interface TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesResponse.Meta; - - [k: string]: - | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | TimeseriesGroupTimeseriesResponse.Meta - | undefined; -} - -export namespace TimeseriesGroupTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; - - serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; -} - -export namespace TimeseriesGroupTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface Serie0 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } -} - -export interface TimeseriesGroupSummaryParams { - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; -} - -export interface TimeseriesGroupTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by user agent. - */ - userAgent?: Array; -} - -export interface TimeseriesGroupTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by Autonomous System. Specify one or more Autonomous System - * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from - * results. For example, `-174, 3356` excludes results from AS174, but includes - * results from AS3356. - */ - asn?: Array; - - /** - * Filters results by continent. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude continents from results. For example, `-EU,NA` - * excludes results from EU, but includes results from NA. - */ - continent?: Array; - - /** - * Filters results by bot crawl purpose. - */ - crawlPurpose?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by location. Specify a comma-separated list of alpha-2 codes. - * Prefix with `-` to exclude locations from results. For example, `-US,PT` - * excludes results from the US, but includes results from PT. - */ - location?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; -} - -export declare namespace TimeseriesGroups { - export { - type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, - type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, - type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, - type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, - type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, - type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, - }; -} +export class TimeseriesGroups extends APIResource {} diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts deleted file mode 100644 index a1db06bc41..0000000000 --- a/src/resources/radar/ct.ts +++ /dev/null @@ -1,3 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts deleted file mode 100644 index 1737426fe1..0000000000 --- a/src/resources/radar/ct/authorities.ts +++ /dev/null @@ -1,301 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Authorities extends APIResource { - /** - * Retrieves a list of certificate authorities. - * - * @example - * ```ts - * const authorities = - * await client.radar.ct.authorities.list(); - * ``` - */ - list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: AuthorityListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ - result: AuthorityListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested CA information. - * - * @example - * ```ts - * const authority = await client.radar.ct.authorities.get( - * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - * ); - * ``` - */ - get( - caSlug: string, - query?: AuthorityGetParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - caSlug: string, - query: AuthorityGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(caSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ - result: AuthorityGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface AuthorityListResponse { - certificateAuthorities: Array; -} - -export namespace AuthorityListResponse { - export interface CertificateAuthority { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } -} - -export interface AuthorityGetResponse { - certificateAuthority: AuthorityGetResponse.CertificateAuthority; -} - -export namespace AuthorityGetResponse { - export interface CertificateAuthority { - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - appleStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The authorityKeyIdentifier value extracted from the certificate PEM. - */ - authorityKeyIdentifier: string; - - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - chromeStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The two-letter ISO country code where the CA organization is based. - */ - country: string; - - /** - * The full country name corresponding to the country code. - */ - countryName: string; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - microsoftStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The inclusion status of a Certificate Authority (CA) in the trust store. - */ - mozillaStatus: - | 'INCLUDED' - | 'NOT_YET_INCLUDED' - | 'NOT_INCLUDED' - | 'NOT_BEFORE' - | 'REMOVED' - | 'DISABLED' - | 'BLOCKED'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The organization that owns and operates the CA. - */ - owner: string; - - /** - * The name of the parent/root certificate authority that issued this intermediate - * certificate. - */ - parentName: string; - - /** - * The SHA-256 fingerprint of the parent certificate. - */ - parentSha256Fingerprint: string; - - /** - * CAs from the same owner. - */ - related: Array; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - - /** - * The subjectKeyIdentifier value extracted from the certificate PEM. - */ - subjectKeyIdentifier: string; - - /** - * The start date of the certificate’s validity period (ISO format). - */ - validFrom: string; - - /** - * The end date of the certificate’s validity period (ISO format). - */ - validTo: string; - } - - export namespace CertificateAuthority { - export interface Related { - /** - * Specifies the type of certificate in the trust chain. - */ - certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; - - /** - * The full name of the certificate authority (CA). - */ - name: string; - - /** - * The current revocation status of a Certificate Authority (CA) certificate. - */ - revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; - - /** - * The SHA-256 fingerprint of the intermediate certificate. - */ - sha256Fingerprint: string; - } - } -} - -export interface AuthorityListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface AuthorityGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Authorities { - export { - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; -} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts deleted file mode 100644 index 9f5873a4d2..0000000000 --- a/src/resources/radar/ct/ct.ts +++ /dev/null @@ -1,1107 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; -import * as AuthoritiesAPI from './authorities'; -import { - Authorities, - AuthorityGetParams, - AuthorityGetResponse, - AuthorityListParams, - AuthorityListResponse, -} from './authorities'; -import * as LogsAPI from './logs'; -import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; - -export class Ct extends APIResource { - authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); - logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); - - /** - * Retrieves an aggregated summary of certificates grouped by the specified - * dimension. - * - * @example - * ```ts - * const response = await client.radar.ct.summary('CA'); - * ``` - */ - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtSummaryParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - summary( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtSummaryParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.summary(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtSummaryResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves certificate volume over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseries(); - * ``` - */ - timeseries( - query?: CtTimeseriesParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseries(options?: Core.RequestOptions): Core.APIPromise; - timeseries( - query: CtTimeseriesParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseries({}, query); - } - return ( - this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the distribution of certificates grouped by chosen the specified - * dimension over time. - * - * @example - * ```ts - * const response = await client.radar.ct.timeseriesGroups( - * 'CA', - * ); - * ``` - */ - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query?: CtTimeseriesGroupsParams, - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - options?: Core.RequestOptions, - ): Core.APIPromise; - timeseriesGroups( - dimension: - | 'CA' - | 'CA_OWNER' - | 'DURATION' - | 'ENTRY_TYPE' - | 'EXPIRATION_STATUS' - | 'HAS_IPS' - | 'HAS_WILDCARDS' - | 'LOG' - | 'LOG_API' - | 'LOG_OPERATOR' - | 'PUBLIC_KEY_ALGORITHM' - | 'SIGNATURE_ALGORITHM' - | 'TLD' - | 'VALIDATION_LEVEL', - query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.timeseriesGroups(dimension, {}, query); - } - return ( - this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ - result: CtTimeseriesGroupsResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface CtSummaryResponse { - /** - * Metadata for the results. - */ - meta: CtSummaryResponse.Meta; - - summary_0: - | { [key: string]: string } - | CtSummaryResponse.UnionMember1 - | CtSummaryResponse.UnionMember2 - | CtSummaryResponse.UnionMember3 - | CtSummaryResponse.UnionMember4 - | CtSummaryResponse.UnionMember5 - | CtSummaryResponse.UnionMember6 - | CtSummaryResponse.UnionMember7; -} - -export namespace CtSummaryResponse { - /** - * Metadata for the results. - */ - export interface Meta { - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnionMember1 { - rfc6962: string; - - static: string; - } - - export interface UnionMember2 { - gt_121d: string; - - gt_16d_lte_31d: string; - - gt_31d_lte_91d: string; - - gt_3d_lte_16d: string; - - gt_91d_lte_121d: string; - - lte_3d: string; - } - - export interface UnionMember3 { - CERTIFICATE: string; - - PRECERTIFICATE: string; - } - - export interface UnionMember4 { - EXPIRED: string; - - VALID: string; - } - - export interface UnionMember5 { - NEGATIVE: string; - - POSITIVE: string; - } - - export interface UnionMember6 { - DSA: string; - - ECDSA: string; - - RSA: string; - } - - export interface UnionMember7 { - domain: string; - - extended: string; - - organization: string; - - unknown: string; - } -} - -export interface CtTimeseriesResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesResponse.Meta; - - [k: string]: - | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb - | CtTimeseriesResponse.Meta - | undefined; -} - -export namespace CtTimeseriesResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { - timestamps: Array; - - values: Array; - } -} - -export interface CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - meta: CtTimeseriesGroupsResponse.Meta; - - serie_0: - | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 - | CtTimeseriesGroupsResponse.UnionMember1 - | CtTimeseriesGroupsResponse.UnionMember2 - | CtTimeseriesGroupsResponse.UnionMember3 - | CtTimeseriesGroupsResponse.UnionMember4 - | CtTimeseriesGroupsResponse.UnionMember5 - | CtTimeseriesGroupsResponse.UnionMember6 - | CtTimeseriesGroupsResponse.UnionMember7; -} - -export namespace CtTimeseriesGroupsResponse { - /** - * Metadata for the results. - */ - export interface Meta { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; - - confidenceInfo: Meta.ConfidenceInfo; - - dateRange: Array; - - /** - * Timestamp of the last dataset update. - */ - lastUpdated: string; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization: - | 'PERCENTAGE' - | 'MIN0_MAX' - | 'MIN_MAX' - | 'RAW_VALUES' - | 'PERCENTAGE_CHANGE' - | 'ROLLING_AVERAGE' - | 'OVERLAPPED_PERCENTAGE' - | 'RATIO'; - - /** - * Measurement units for the results. - */ - units: Array; - } - - export namespace Meta { - export interface ConfidenceInfo { - annotations: Array; - - /** - * Provides an indication of how much confidence Cloudflare has in the data. - */ - level: number; - } - - export namespace ConfidenceInfo { - /** - * Annotation associated with the result (e.g. outage or other type of event). - */ - export interface Annotation { - dataSource: string; - - description: string; - - endDate: string; - - eventType: string; - - /** - * Whether event is a single point in time or a time range. - */ - isInstantaneous: boolean; - - linkedUrl: string; - - startDate: string; - } - } - - export interface DateRange { - /** - * Adjusted end of date range. - */ - endTime: string; - - /** - * Adjusted start of date range. - */ - startTime: string; - } - - export interface Unit { - name: string; - - value: string; - } - } - - export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { - timestamps: Array; - - [k: string]: Array | Array | undefined; - } - - export interface UnionMember1 { - rfc6962: Array; - - static: Array; - } - - export interface UnionMember2 { - gt_121d: Array; - - gt_16d_lte_31d: Array; - - gt_31d_lte_91d: Array; - - gt_3d_lte_16d: Array; - - gt_91d_lte_121d: Array; - - lte_3d: Array; - } - - export interface UnionMember3 { - CERTIFICATE: Array; - - PRECERTIFICATE: Array; - } - - export interface UnionMember4 { - EXPIRED: Array; - - VALID: Array; - } - - export interface UnionMember5 { - NEGATIVE: Array; - - POSITIVE: Array; - } - - export interface UnionMember6 { - DSA: Array; - - ECDSA: Array; - - RSA: Array; - } - - export interface UnionMember7 { - domain: Array; - - extended: Array; - - organization: Array; - - unknown: Array; - } -} - -export interface CtSummaryParams { - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -export interface CtTimeseriesGroupsParams { - /** - * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). - * Refer to - * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). - */ - aggInterval?: '15m' | '1h' | '1d' | '1w'; - - /** - * Filters results by certificate authority. - */ - ca?: Array; - - /** - * Filters results by certificate authority owner. - */ - caOwner?: Array; - - /** - * End of the date range (inclusive). - */ - dateEnd?: Array; - - /** - * Filters results by date range. For example, use `7d` and `7dcontrol` to compare - * this week with the previous week. Use this parameter or set specific start and - * end dates (`dateStart` and `dateEnd` parameters). - */ - dateRange?: Array; - - /** - * Start of the date range. - */ - dateStart?: Array; - - /** - * Filters results by certificate duration. - */ - duration?: Array< - | 'LTE_3D' - | 'GT_3D_LTE_7D' - | 'GT_7D_LTE_10D' - | 'GT_10D_LTE_47D' - | 'GT_47D_LTE_100D' - | 'GT_100D_LTE_200D' - | 'GT_200D' - >; - - /** - * Filters results by entry type (certificate vs. pre-certificate). - */ - entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; - - /** - * Filters results by expiration status (expired vs. valid). - */ - expirationStatus?: Array<'EXPIRED' | 'VALID'>; - - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Filters results based on whether the certificates are bound to specific IP - * addresses. - */ - hasIps?: Array; - - /** - * Filters results based on whether the certificates contain wildcard domains. - */ - hasWildcards?: Array; - - /** - * Limits the number of objects per group to the top items within the specified - * time range. When item count exceeds the limit, extra items appear grouped under - * an "other" category. - */ - limitPerGroup?: number; - - /** - * Filters results by certificate log. - */ - log?: Array; - - /** - * Filters results by certificate log API (RFC6962 vs. static). - */ - logApi?: Array<'RFC6962' | 'STATIC'>; - - /** - * Filters results by certificate log operator. - */ - logOperator?: Array; - - /** - * Array of names used to label the series in the response. - */ - name?: Array; - - /** - * Normalization method applied to the results. Refer to - * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). - */ - normalization?: 'RAW_VALUES' | 'PERCENTAGE'; - - /** - * Filters results by public key algorithm. - */ - publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; - - /** - * Filters results by signature algorithm. - */ - signatureAlgorithm?: Array< - | 'DSA_SHA_1' - | 'DSA_SHA_256' - | 'ECDSA_SHA_1' - | 'ECDSA_SHA_256' - | 'ECDSA_SHA_384' - | 'ECDSA_SHA_512' - | 'PSS_SHA_256' - | 'PSS_SHA_384' - | 'PSS_SHA_512' - | 'RSA_MD2' - | 'RSA_MD5' - | 'RSA_SHA_1' - | 'RSA_SHA_256' - | 'RSA_SHA_384' - | 'RSA_SHA_512' - >; - - /** - * Filters results by top-level domain. - */ - tld?: Array; - - /** - * Specifies whether to filter out duplicate certificates and pre-certificates. Set - * to true for unique entries only. - */ - uniqueEntries?: Array<'true' | 'false'>; - - /** - * Filters results by validation level. - */ - validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; -} - -Ct.Authorities = Authorities; -Ct.Logs = Logs; - -export declare namespace Ct { - export { - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - - export { - Authorities as Authorities, - type AuthorityListResponse as AuthorityListResponse, - type AuthorityGetResponse as AuthorityGetResponse, - type AuthorityListParams as AuthorityListParams, - type AuthorityGetParams as AuthorityGetParams, - }; - - export { - Logs as Logs, - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts deleted file mode 100644 index 20a5137e83..0000000000 --- a/src/resources/radar/ct/index.ts +++ /dev/null @@ -1,25 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -export { - Authorities, - type AuthorityListResponse, - type AuthorityGetResponse, - type AuthorityListParams, - type AuthorityGetParams, -} from './authorities'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct'; -export { - Logs, - type LogListResponse, - type LogGetResponse, - type LogListParams, - type LogGetParams, -} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts deleted file mode 100644 index 4ba71c4acf..0000000000 --- a/src/resources/radar/ct/logs.ts +++ /dev/null @@ -1,271 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import { APIResource } from '../../../resource'; -import { isRequestOptions } from '../../../core'; -import * as Core from '../../../core'; - -export class Logs extends APIResource { - /** - * Retrieves a list of certificate logs. - * - * @example - * ```ts - * const logs = await client.radar.ct.logs.list(); - * ``` - */ - list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; - list(options?: Core.RequestOptions): Core.APIPromise; - list( - query: LogListParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.list({}, query); - } - return ( - this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ - result: LogListResponse; - }> - )._thenUnwrap((obj) => obj.result); - } - - /** - * Retrieves the requested certificate log information. - * - * @example - * ```ts - * const log = await client.radar.ct.logs.get('argon2024'); - * ``` - */ - get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; - get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; - get( - logSlug: string, - query: LogGetParams | Core.RequestOptions = {}, - options?: Core.RequestOptions, - ): Core.APIPromise { - if (isRequestOptions(query)) { - return this.get(logSlug, {}, query); - } - return ( - this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ - result: LogGetResponse; - }> - )._thenUnwrap((obj) => obj.result); - } -} - -export interface LogListResponse { - certificateLogs: Array; -} - -export namespace LogListResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } -} - -export interface LogGetResponse { - certificateLog: LogGetResponse.CertificateLog; -} - -export namespace LogGetResponse { - export interface CertificateLog { - /** - * The API standard that the certificate log follows. - */ - api: 'RFC6962' | 'STATIC'; - - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * The organization responsible for operating the certificate log. - */ - operator: string; - - /** - * Log performance metrics, including averages and per-endpoint details. - */ - performance: CertificateLog.Performance | null; - - /** - * Logs from the same operator. - */ - related: Array; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - - /** - * Timestamp of when the log state was last updated. - */ - stateTimestamp: string; - - /** - * The URL for the certificate log. - */ - url: string; - } - - export namespace CertificateLog { - /** - * Log performance metrics, including averages and per-endpoint details. - */ - export interface Performance { - endpoints: Array; - - responseTime: number; - - uptime: number; - } - - export namespace Performance { - export interface Endpoint { - /** - * The certificate log endpoint names used in performance metrics. - */ - endpoint: - | 'add-chain (new)' - | 'add-chain (old)' - | 'add-pre-chain (new)' - | 'add-pre-chain (old)' - | 'get-entries' - | 'get-roots' - | 'get-sth'; - - responseTime: number; - - uptime: number; - } - } - - export interface Related { - /** - * A brief description of the certificate log. - */ - description: string; - - /** - * The end date and time for when the log will stop accepting certificates. - */ - endExclusive: string; - - /** - * A URL-friendly, kebab-case identifier for the certificate log. - */ - slug: string; - - /** - * The start date and time for when the log starts accepting certificates. - */ - startInclusive: string; - - /** - * The current state of the certificate log. More details about log states can be - * found here: - * https://googlechrome.github.io/CertificateTransparency/log_states.html - */ - state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; - } - } -} - -export interface LogListParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; - - /** - * Limits the number of objects returned in the response. - */ - limit?: number; - - /** - * Skips the specified number of objects before fetching the results. - */ - offset?: number; -} - -export interface LogGetParams { - /** - * Format in which results will be returned. - */ - format?: 'JSON' | 'CSV'; -} - -export declare namespace Logs { - export { - type LogListResponse as LogListResponse, - type LogGetResponse as LogGetResponse, - type LogListParams as LogListParams, - type LogGetParams as LogGetParams, - }; -} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 9b9bba8ee0..5aadae8272 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,15 +18,6 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; -export { - Ct, - type CtSummaryResponse, - type CtTimeseriesResponse, - type CtTimeseriesGroupsResponse, - type CtSummaryParams, - type CtTimeseriesParams, - type CtTimeseriesGroupsParams, -} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 0ed666d88a..7a3971e2c9 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,16 +44,6 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; -import * as CtAPI from './ct/ct'; -import { - Ct, - CtSummaryParams, - CtSummaryResponse, - CtTimeseriesGroupsParams, - CtTimeseriesGroupsResponse, - CtTimeseriesParams, - CtTimeseriesResponse, -} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -95,7 +85,6 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); - ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -124,7 +113,6 @@ export class Radar extends APIResource { } Radar.AI = AI; -Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -148,16 +136,6 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; - export { - Ct as Ct, - type CtSummaryResponse as CtSummaryResponse, - type CtTimeseriesResponse as CtTimeseriesResponse, - type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, - type CtSummaryParams as CtSummaryParams, - type CtTimeseriesParams as CtTimeseriesParams, - type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, - }; - export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts deleted file mode 100644 index 5a72ed2d24..0000000000 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ /dev/null @@ -1,135 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource timeseriesGroups', () => { - test('summary', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.summary( - 'USER_AGENT', - { - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseries( - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - userAgent: ['string'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ai.timeseriesGroups.timeseriesGroups( - 'USER_AGENT', - { - aggInterval: '1h', - asn: ['string'], - continent: ['string'], - crawlPurpose: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - format: 'JSON', - limitPerGroup: 10, - location: ['string'], - name: ['main_series'], - normalization: 'MIN0_MAX', - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts deleted file mode 100644 index 667531af94..0000000000 --- a/tests/api-resources/radar/ct/authorities.test.ts +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource authorities', () => { - test('list', async () => { - const responsePromise = client.radar.ct.authorities.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - ); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { - path: '/_stainless_unknown_path', - }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.authorities.get( - '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', - { format: 'JSON' }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts deleted file mode 100644 index b57cd5b1b0..0000000000 --- a/tests/api-resources/radar/ct/ct.test.ts +++ /dev/null @@ -1,167 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource ct', () => { - test('summary', async () => { - const responsePromise = client.radar.ct.summary('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('summary: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('summary: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.summary( - 'CA', - { - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseries', async () => { - const responsePromise = client.radar.ct.timeseries(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseries: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('timeseries: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseries( - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups', async () => { - const responsePromise = client.radar.ct.timeseriesGroups('CA'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('timeseriesGroups: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('timeseriesGroups: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.timeseriesGroups( - 'CA', - { - aggInterval: '1h', - ca: ['string'], - caOwner: ['string'], - dateEnd: ['2019-12-27T18:11:19.117Z'], - dateRange: ['7d'], - dateStart: ['2019-12-27T18:11:19.117Z'], - duration: ['LTE_3D'], - entryType: ['PRECERTIFICATE'], - expirationStatus: ['EXPIRED'], - format: 'JSON', - hasIps: [true], - hasWildcards: [true], - limitPerGroup: 10, - log: ['string'], - logApi: ['RFC6962'], - logOperator: ['string'], - name: ['main_series'], - normalization: 'RAW_VALUES', - publicKeyAlgorithm: ['DSA'], - signatureAlgorithm: ['DSA_SHA_1'], - tld: ['string'], - uniqueEntries: ['true'], - validationLevel: ['DOMAIN'], - }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts deleted file mode 100644 index 0654ffffe1..0000000000 --- a/tests/api-resources/radar/ct/logs.test.ts +++ /dev/null @@ -1,65 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -import Cloudflare from 'cloudflare'; -import { Response } from 'node-fetch'; - -const client = new Cloudflare({ - apiKey: '144c9defac04969c7bfad8efaa8ea194', - apiEmail: 'user@example.com', - baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', -}); - -describe('resource logs', () => { - test('list', async () => { - const responsePromise = client.radar.ct.logs.list(); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('list: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('list: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.list( - { format: 'JSON', limit: 5, offset: 0 }, - { path: '/_stainless_unknown_path' }, - ), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); - - test('get', async () => { - const responsePromise = client.radar.ct.logs.get('argon2024'); - const rawResponse = await responsePromise.asResponse(); - expect(rawResponse).toBeInstanceOf(Response); - const response = await responsePromise; - expect(response).not.toBeInstanceOf(Response); - const dataAndResponse = await responsePromise.withResponse(); - expect(dataAndResponse.data).toBe(response); - expect(dataAndResponse.response).toBe(rawResponse); - }); - - test('get: request options instead of params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( - Cloudflare.NotFoundError, - ); - }); - - test('get: request options and params are passed correctly', async () => { - // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error - await expect( - client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), - ).rejects.toThrow(Cloudflare.NotFoundError); - }); -}); From 6750686b8c3d19bb3f486d741ad9550039dbad02 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:45:56 +0000 Subject: [PATCH 347/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- api.md | 7 +- src/resources/kv/namespaces/keys.ts | 12 --- src/resources/kv/namespaces/metadata.ts | 3 - src/resources/kv/namespaces/namespaces.ts | 9 -- src/resources/kv/namespaces/values.ts | 2 +- src/resources/workers/scripts/deployments.ts | 95 +++++++++++++++++-- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- .../kv/namespaces/values.test.ts | 2 +- 10 files changed, 99 insertions(+), 44 deletions(-) diff --git a/.stats.yml b/.stats.yml index e219ee0f76..eacdfe2ea5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bd1bc86694bdc2e2deb05f0e743afa87b94ff96a55b10fdd6a15b11fa7ee34c0.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6eb17c94a367941ef4fd3ad0750ea42308813e96e904d31b776ed848d849be90.yml openapi_spec_hash: 9fa312b08e4ba5659a03d7143210437f -config_hash: cbc31befc4267a7deb9d79b1767a2b65 +config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 diff --git a/api.md b/api.md index 3d30fde3fd..89ff9eae57 100644 --- a/api.md +++ b/api.md @@ -2120,16 +2120,17 @@ Methods: Types: -- Deployment +- DeploymentCreateResponse - DeploymentListResponse - DeploymentDeleteResponse +- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse ### Versions diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index ad094eeddb..bf958a6d6f 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -117,9 +117,6 @@ export interface Key { */ expiration?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } @@ -156,14 +153,8 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ metadata: unknown; - /** - * The value associated with the key. - */ value: unknown; /** @@ -277,9 +268,6 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 927ba8a17d..53db763063 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,9 +34,6 @@ export class Metadata extends APIResource { } } -/** - * Arbitrary JSON that is associated with a key. - */ export type MetadataGetResponse = unknown; export interface MetadataGetParams { diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 3f8f3b7a90..32b1ec889c 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -312,14 +312,8 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { - /** - * The metadata associated with the key. - */ metadata: unknown; - /** - * The value associated with the key. - */ value: unknown; /** @@ -468,9 +462,6 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; - /** - * Arbitrary JSON that is associated with a key. - */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 29174df308..03752a92d4 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -134,7 +134,7 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: Associates arbitrary JSON data with a key/value pair. + * Body param: */ metadata?: unknown; } diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index 1283130f6b..c23e1d1b09 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: Deployment }> + }) as Core.APIPromise<{ result: DeploymentCreateResponse }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: Deployment }> + ) as Core.APIPromise<{ result: DeploymentGetResponse }> )._thenUnwrap((obj) => obj.result); } } -export interface Deployment { +export interface DeploymentCreateResponse { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface Deployment { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: Deployment.Annotations; + annotations?: DeploymentCreateResponse.Annotations; author_email?: string; } -export namespace Deployment { +export namespace DeploymentCreateResponse { export interface Version { percentage: number; @@ -164,7 +164,45 @@ export namespace Deployment { } export interface DeploymentListResponse { - deployments: Array; + deployments: Array; +} + +export namespace DeploymentListResponse { + export interface Deployment { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: Deployment.Annotations; + + author_email?: string; + } + + export namespace Deployment { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } + } } export interface DeploymentDeleteResponse { @@ -212,6 +250,42 @@ export namespace DeploymentDeleteResponse { } } +export interface DeploymentGetResponse { + id: string; + + created_on: string; + + source: string; + + strategy: 'percentage'; + + versions: Array; + + annotations?: DeploymentGetResponse.Annotations; + + author_email?: string; +} + +export namespace DeploymentGetResponse { + export interface Version { + percentage: number; + + version_id: string; + } + + export interface Annotations { + /** + * Human-readable message about the deployment. Truncated to 100 bytes. + */ + 'workers/message'?: string; + + /** + * Operation that triggered the creation of the deployment. + */ + 'workers/triggered_by'?: string; + } +} + export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -279,9 +353,10 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index 73bd09f1ac..ed521aefd1 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,9 +4,10 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type Deployment, + type DeploymentCreateResponse, type DeploymentListResponse, type DeploymentDeleteResponse, + type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index 2f5b74a81c..e4db71c985 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,11 +7,12 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { - Deployment, DeploymentCreateParams, + DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, + DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1310,9 +1311,10 @@ export declare namespace Scripts { export { Deployments as Deployments, - type Deployment as Deployment, + type DeploymentCreateResponse as DeploymentCreateResponse, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, + type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 03fbaa4b52..6ae2915c03 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: {}, + metadata: { someMetadataKey: 'someMetadataValue' }, }); }); From fef43ec41c8edad0bd394a1d63a6bf974f9b1426 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:04:55 +0000 Subject: [PATCH 348/423] feat(api): api update --- .stats.yml | 6 +- api.md | 16 ++ scripts/detect-breaking-changes | 3 + src/resources/radar/ai/ai.ts | 12 +- src/resources/radar/ai/bots/bots.ts | 8 +- src/resources/radar/ai/bots/index.ts | 2 +- src/resources/radar/ai/bots/summary.ts | 190 +++++++++++++++- src/resources/radar/ai/index.ts | 6 +- src/resources/radar/ai/timeseries-groups.ts | 211 +++++++++++++++++- .../radar/ai/bots/summary.test.ts | 50 +++++ .../radar/ai/timeseries-groups.test.ts | 51 +++++ 11 files changed, 544 insertions(+), 11 deletions(-) create mode 100644 tests/api-resources/radar/ai/bots/summary.test.ts create mode 100644 tests/api-resources/radar/ai/timeseries-groups.test.ts diff --git a/.stats.yml b/.stats.yml index eacdfe2ea5..8bedb57e2c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1781 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6eb17c94a367941ef4fd3ad0750ea42308813e96e904d31b776ed848d849be90.yml -openapi_spec_hash: 9fa312b08e4ba5659a03d7143210437f +configured_endpoints: 1783 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c3722d2349434f1cf268b7f391080c3905e8b66b20a00bef2e00104a8e83f8fc.yml +openapi_spec_hash: 4e221dc6dd407ab6dab265a68adf140a config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 diff --git a/api.md b/api.md index 89ff9eae57..61517419dd 100644 --- a/api.md +++ b/api.md @@ -6377,8 +6377,24 @@ Methods: #### Summary +Types: + +- SummaryUserAgentResponse + +Methods: + +- client.radar.ai.bots.summary.userAgent({ ...params }) -> SummaryUserAgentResponse + ### TimeseriesGroups +Types: + +- TimeseriesGroupUserAgentResponse + +Methods: + +- client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index 975bf26d7d..b039f24cfa 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -542,6 +542,9 @@ TEST_PATHS=( tests/api-resources/radar/ai/inference/summary.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/timeseries-groups.test.ts tests/api-resources/radar/ai/inference/timeseries-groups/summary.test.ts + tests/api-resources/radar/ai/bots/bots.test.ts + tests/api-resources/radar/ai/bots/summary.test.ts + tests/api-resources/radar/ai/timeseries-groups.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 9644b4f759..6ba8476430 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -2,7 +2,11 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; -import { TimeseriesGroups } from './timeseries-groups'; +import { + TimeseriesGroupUserAgentParams, + TimeseriesGroupUserAgentResponse, + TimeseriesGroups, +} from './timeseries-groups'; import * as ToMarkdownAPI from './to-markdown'; import { ToMarkdown, @@ -42,5 +46,9 @@ export declare namespace AI { export { Bots as Bots }; - export { TimeseriesGroups as TimeseriesGroups }; + export { + TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/bots.ts b/src/resources/radar/ai/bots/bots.ts index 0b5807ee07..865665cba6 100644 --- a/src/resources/radar/ai/bots/bots.ts +++ b/src/resources/radar/ai/bots/bots.ts @@ -2,7 +2,7 @@ import { APIResource } from '../../../../resource'; import * as SummaryAPI from './summary'; -import { Summary } from './summary'; +import { Summary, SummaryUserAgentParams, SummaryUserAgentResponse } from './summary'; export class Bots extends APIResource { summary: SummaryAPI.Summary = new SummaryAPI.Summary(this._client); @@ -11,5 +11,9 @@ export class Bots extends APIResource { Bots.Summary = Summary; export declare namespace Bots { - export { Summary as Summary }; + export { + Summary as Summary, + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; } diff --git a/src/resources/radar/ai/bots/index.ts b/src/resources/radar/ai/bots/index.ts index 6f7091f3a3..c94177cbcd 100644 --- a/src/resources/radar/ai/bots/index.ts +++ b/src/resources/radar/ai/bots/index.ts @@ -1,4 +1,4 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. export { Bots } from './bots'; -export { Summary } from './summary'; +export { Summary, type SummaryUserAgentResponse, type SummaryUserAgentParams } from './summary'; diff --git a/src/resources/radar/ai/bots/summary.ts b/src/resources/radar/ai/bots/summary.ts index 5abd36afe8..75c99603d5 100644 --- a/src/resources/radar/ai/bots/summary.ts +++ b/src/resources/radar/ai/bots/summary.ts @@ -1,5 +1,193 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../../resource'; +import { isRequestOptions } from '../../../../core'; +import * as Core from '../../../../core'; -export class Summary extends APIResource {} +export class Summary extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent. + * + * @deprecated + */ + userAgent( + query?: SummaryUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: SummaryUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/summary/user_agent', { query, ...options }) as Core.APIPromise<{ + result: SummaryUserAgentResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + meta: SummaryUserAgentResponse.Meta; + + summary_0: { [key: string]: string }; +} + +export namespace SummaryUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface SummaryUserAgentParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace Summary { + export { + type SummaryUserAgentResponse as SummaryUserAgentResponse, + type SummaryUserAgentParams as SummaryUserAgentParams, + }; +} diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index 7eca533538..a6a9f99c81 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -3,7 +3,11 @@ export { AI } from './ai'; export { Bots } from './bots/index'; export { Inference } from './inference/index'; -export { TimeseriesGroups } from './timeseries-groups'; +export { + TimeseriesGroups, + type TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams, +} from './timeseries-groups'; export { ToMarkdownCreateResponsesSinglePage, ToMarkdown, diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 17f65608eb..6ad0edfd47 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -1,5 +1,214 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; -export class TimeseriesGroups extends APIResource {} +export class TimeseriesGroups extends APIResource { + /** + * Retrieves the distribution of traffic by AI user agent over time. + * + * @deprecated + */ + userAgent( + query?: TimeseriesGroupUserAgentParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + userAgent(options?: Core.RequestOptions): Core.APIPromise; + userAgent( + query: TimeseriesGroupUserAgentParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.userAgent({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries_groups/user_agent', { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupUserAgentResponse }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupUserAgentResponse.Meta; + + serie_0: TimeseriesGroupUserAgentResponse.Serie0; +} + +export namespace TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupUserAgentParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export declare namespace TimeseriesGroups { + export { + type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, + }; +} diff --git a/tests/api-resources/radar/ai/bots/summary.test.ts b/tests/api-resources/radar/ai/bots/summary.test.ts new file mode 100644 index 0000000000..e45f8279d7 --- /dev/null +++ b/tests/api-resources/radar/ai/bots/summary.test.ts @@ -0,0 +1,50 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource summary', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.bots.summary.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.bots.summary.userAgent( + { + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts new file mode 100644 index 0000000000..386515626c --- /dev/null +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -0,0 +1,51 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource timeseriesGroups', () => { + test('userAgent', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('userAgent: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('userAgent: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.userAgent( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From 219b51d74e4abb3fd8a416207d08f573d05d33a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:24:31 +0000 Subject: [PATCH 349/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8bedb57e2c..83e29a9cc4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c3722d2349434f1cf268b7f391080c3905e8b66b20a00bef2e00104a8e83f8fc.yml -openapi_spec_hash: 4e221dc6dd407ab6dab265a68adf140a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fe757f953ceee55fb8765b7430b2b79a83066dd028cfb9cb9675f1517b8a8477.yml +openapi_spec_hash: 19c21bffcb71ae54c8330f66bbd4e16f config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 From add0e98cfd5d27bd90d225b6ad2bc6b82b0ef2b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:43:13 +0000 Subject: [PATCH 350/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 83e29a9cc4..de1f73f050 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fe757f953ceee55fb8765b7430b2b79a83066dd028cfb9cb9675f1517b8a8477.yml -openapi_spec_hash: 19c21bffcb71ae54c8330f66bbd4e16f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d47ddc96f80664679aaa7ddc5568da7d468897a64186ba69028911c252f9e87.yml +openapi_spec_hash: 33162d0d0c1c2008b72ee681145ac178 config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 From 4af87a316051e5dfe45bc5953f1b96770fb8a95a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 17:47:00 +0000 Subject: [PATCH 351/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index de1f73f050..d7504dcda2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5d47ddc96f80664679aaa7ddc5568da7d468897a64186ba69028911c252f9e87.yml -openapi_spec_hash: 33162d0d0c1c2008b72ee681145ac178 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4d7fca0b7a49a9a62bd63d2f3dcf8fa41b043108bd9281e66e340a20e3d1e9f.yml +openapi_spec_hash: 0f77f49062aa19772e3ec7e50089b085 config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 From 3a32fea54a69321a7596804e605861161771114a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:02:26 +0000 Subject: [PATCH 352/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d7504dcda2..95c0074fbe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d4d7fca0b7a49a9a62bd63d2f3dcf8fa41b043108bd9281e66e340a20e3d1e9f.yml -openapi_spec_hash: 0f77f49062aa19772e3ec7e50089b085 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af490fa6410745bf6ef4d68cd0173ffb8fc14323815ef6a98970ad57eb84d255.yml +openapi_spec_hash: db57aa8f254715d1e1922686ead68d58 config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 From e6f0bcc64c514667b751b85501bf17719be200c9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:07:25 +0000 Subject: [PATCH 353/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 6 +- api.md | 51 +- scripts/detect-breaking-changes | 3 + src/resources/kv/namespaces/keys.ts | 12 + src/resources/kv/namespaces/metadata.ts | 3 + src/resources/kv/namespaces/namespaces.ts | 9 + src/resources/kv/namespaces/values.ts | 2 +- src/resources/radar/ai/ai.ts | 12 + src/resources/radar/ai/index.ts | 6 + src/resources/radar/ai/timeseries-groups.ts | 649 +++++++++- src/resources/radar/ct.ts | 3 + src/resources/radar/ct/authorities.ts | 301 +++++ src/resources/radar/ct/ct.ts | 1107 +++++++++++++++++ src/resources/radar/ct/index.ts | 25 + src/resources/radar/ct/logs.ts | 271 ++++ src/resources/radar/index.ts | 9 + src/resources/radar/radar.ts | 22 + src/resources/workers/scripts/deployments.ts | 95 +- src/resources/workers/scripts/index.ts | 3 +- src/resources/workers/scripts/scripts.ts | 6 +- .../kv/namespaces/values.test.ts | 2 +- .../radar/ai/timeseries-groups.test.ts | 123 ++ .../radar/ct/authorities.test.ts | 73 ++ tests/api-resources/radar/ct/ct.test.ts | 167 +++ tests/api-resources/radar/ct/logs.test.ts | 65 + 25 files changed, 2921 insertions(+), 104 deletions(-) create mode 100644 src/resources/radar/ct.ts create mode 100644 src/resources/radar/ct/authorities.ts create mode 100644 src/resources/radar/ct/ct.ts create mode 100644 src/resources/radar/ct/index.ts create mode 100644 src/resources/radar/ct/logs.ts create mode 100644 tests/api-resources/radar/ct/authorities.test.ts create mode 100644 tests/api-resources/radar/ct/ct.test.ts create mode 100644 tests/api-resources/radar/ct/logs.test.ts diff --git a/.stats.yml b/.stats.yml index 95c0074fbe..758076bdd3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 1783 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-af490fa6410745bf6ef4d68cd0173ffb8fc14323815ef6a98970ad57eb84d255.yml +configured_endpoints: 1793 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b7c0537a0860328effd3714b260a2bfb86ce635f9010cc22cd530e57131e491.yml openapi_spec_hash: db57aa8f254715d1e1922686ead68d58 -config_hash: b5608440cfd3f75f7cfabd36fbc7cd88 +config_hash: 04c3e87def66bed3001640fca84ff9c5 diff --git a/api.md b/api.md index 61517419dd..af8555c139 100644 --- a/api.md +++ b/api.md @@ -2120,17 +2120,16 @@ Methods: Types: -- DeploymentCreateResponse +- Deployment - DeploymentListResponse - DeploymentDeleteResponse -- DeploymentGetResponse Methods: -- client.workers.scripts.deployments.create(scriptName, { ...params }) -> DeploymentCreateResponse +- client.workers.scripts.deployments.create(scriptName, { ...params }) -> Deployment - client.workers.scripts.deployments.list(scriptName, { ...params }) -> DeploymentListResponse - client.workers.scripts.deployments.delete(scriptName, deploymentId, { ...params }) -> DeploymentDeleteResponse -- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> DeploymentGetResponse +- client.workers.scripts.deployments.get(scriptName, deploymentId, { ...params }) -> Deployment ### Versions @@ -6389,12 +6388,56 @@ Methods: Types: +- TimeseriesGroupSummaryResponse +- TimeseriesGroupTimeseriesResponse +- TimeseriesGroupTimeseriesGroupsResponse - TimeseriesGroupUserAgentResponse Methods: +- client.radar.ai.timeseriesGroups.summary(dimension, { ...params }) -> TimeseriesGroupSummaryResponse +- client.radar.ai.timeseriesGroups.timeseries({ ...params }) -> TimeseriesGroupTimeseriesResponse +- client.radar.ai.timeseriesGroups.timeseriesGroups(dimension, { ...params }) -> TimeseriesGroupTimeseriesGroupsResponse - client.radar.ai.timeseriesGroups.userAgent({ ...params }) -> TimeseriesGroupUserAgentResponse +## Ct + +Types: + +- CtSummaryResponse +- CtTimeseriesResponse +- CtTimeseriesGroupsResponse + +Methods: + +- client.radar.ct.summary(dimension, { ...params }) -> CtSummaryResponse +- client.radar.ct.timeseries({ ...params }) -> CtTimeseriesResponse +- client.radar.ct.timeseriesGroups(dimension, { ...params }) -> CtTimeseriesGroupsResponse + +### Authorities + +Types: + +- AuthorityListResponse +- AuthorityGetResponse + +Methods: + +- client.radar.ct.authorities.list({ ...params }) -> AuthorityListResponse +- client.radar.ct.authorities.get(caSlug, { ...params }) -> AuthorityGetResponse + +### Logs + +Types: + +- LogListResponse +- LogGetResponse + +Methods: + +- client.radar.ct.logs.list({ ...params }) -> LogListResponse +- client.radar.ct.logs.get(logSlug, { ...params }) -> LogGetResponse + ## Annotations Types: diff --git a/scripts/detect-breaking-changes b/scripts/detect-breaking-changes index b039f24cfa..27e8a8086e 100755 --- a/scripts/detect-breaking-changes +++ b/scripts/detect-breaking-changes @@ -545,6 +545,9 @@ TEST_PATHS=( tests/api-resources/radar/ai/bots/bots.test.ts tests/api-resources/radar/ai/bots/summary.test.ts tests/api-resources/radar/ai/timeseries-groups.test.ts + tests/api-resources/radar/ct/ct.test.ts + tests/api-resources/radar/ct/authorities.test.ts + tests/api-resources/radar/ct/logs.test.ts tests/api-resources/radar/annotations/annotations.test.ts tests/api-resources/radar/annotations/outages.test.ts tests/api-resources/radar/bgp/bgp.test.ts diff --git a/src/resources/kv/namespaces/keys.ts b/src/resources/kv/namespaces/keys.ts index bf958a6d6f..ad094eeddb 100644 --- a/src/resources/kv/namespaces/keys.ts +++ b/src/resources/kv/namespaces/keys.ts @@ -117,6 +117,9 @@ export interface Key { */ expiration?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } @@ -153,8 +156,14 @@ export namespace KeyBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { + /** + * The metadata associated with the key. + */ metadata: unknown; + /** + * The value associated with the key. + */ value: unknown; /** @@ -268,6 +277,9 @@ export namespace KeyBulkUpdateParams { */ expiration_ttl?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/metadata.ts b/src/resources/kv/namespaces/metadata.ts index 53db763063..927ba8a17d 100644 --- a/src/resources/kv/namespaces/metadata.ts +++ b/src/resources/kv/namespaces/metadata.ts @@ -34,6 +34,9 @@ export class Metadata extends APIResource { } } +/** + * Arbitrary JSON that is associated with a key. + */ export type MetadataGetResponse = unknown; export interface MetadataGetParams { diff --git a/src/resources/kv/namespaces/namespaces.ts b/src/resources/kv/namespaces/namespaces.ts index 32b1ec889c..3f8f3b7a90 100644 --- a/src/resources/kv/namespaces/namespaces.ts +++ b/src/resources/kv/namespaces/namespaces.ts @@ -312,8 +312,14 @@ export namespace NamespaceBulkGetResponse { export namespace WorkersKVBulkGetResultWithMetadata { export interface Values { + /** + * The metadata associated with the key. + */ metadata: unknown; + /** + * The value associated with the key. + */ value: unknown; /** @@ -462,6 +468,9 @@ export namespace NamespaceBulkUpdateParams { */ expiration_ttl?: number; + /** + * Arbitrary JSON that is associated with a key. + */ metadata?: unknown; } } diff --git a/src/resources/kv/namespaces/values.ts b/src/resources/kv/namespaces/values.ts index 03752a92d4..29174df308 100644 --- a/src/resources/kv/namespaces/values.ts +++ b/src/resources/kv/namespaces/values.ts @@ -134,7 +134,7 @@ export interface ValueUpdateParams { expiration_ttl?: number; /** - * Body param: + * Body param: Associates arbitrary JSON data with a key/value pair. */ metadata?: unknown; } diff --git a/src/resources/radar/ai/ai.ts b/src/resources/radar/ai/ai.ts index 6ba8476430..c4830c1214 100755 --- a/src/resources/radar/ai/ai.ts +++ b/src/resources/radar/ai/ai.ts @@ -3,6 +3,12 @@ import { APIResource } from '../../../resource'; import * as TimeseriesGroupsAPI from './timeseries-groups'; import { + TimeseriesGroupSummaryParams, + TimeseriesGroupSummaryResponse, + TimeseriesGroupTimeseriesGroupsParams, + TimeseriesGroupTimeseriesGroupsResponse, + TimeseriesGroupTimeseriesParams, + TimeseriesGroupTimeseriesResponse, TimeseriesGroupUserAgentParams, TimeseriesGroupUserAgentResponse, TimeseriesGroups, @@ -48,7 +54,13 @@ export declare namespace AI { export { TimeseriesGroups as TimeseriesGroups, + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, }; } diff --git a/src/resources/radar/ai/index.ts b/src/resources/radar/ai/index.ts index a6a9f99c81..d56384a99a 100755 --- a/src/resources/radar/ai/index.ts +++ b/src/resources/radar/ai/index.ts @@ -5,7 +5,13 @@ export { Bots } from './bots/index'; export { Inference } from './inference/index'; export { TimeseriesGroups, + type TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse, type TimeseriesGroupUserAgentResponse, + type TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams, type TimeseriesGroupUserAgentParams, } from './timeseries-groups'; export { diff --git a/src/resources/radar/ai/timeseries-groups.ts b/src/resources/radar/ai/timeseries-groups.ts index 6ad0edfd47..1dc92a1590 100644 --- a/src/resources/radar/ai/timeseries-groups.ts +++ b/src/resources/radar/ai/timeseries-groups.ts @@ -5,6 +5,107 @@ import { isRequestOptions } from '../../../core'; import * as Core from '../../../core'; export class TimeseriesGroups extends APIResource { + /** + * Retrieves an aggregated summary of AI bots HTTP requests grouped by the + * specified dimension. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.summary( + * 'USER_AGENT', + * ); + * ``` + */ + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves AI bots HTTP request volume over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseries(); + * ``` + */ + timeseries( + query?: TimeseriesGroupTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: TimeseriesGroupTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ai/bots/timeseries', { query, ...options }) as Core.APIPromise<{ + result: TimeseriesGroupTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of HTTP requests from AI bots, grouped by chosen the + * specified dimension over time. + * + * @example + * ```ts + * const response = + * await client.radar.ai.timeseriesGroups.timeseriesGroups( + * 'USER_AGENT', + * ); + * ``` + */ + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query?: TimeseriesGroupTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: 'USER_AGENT' | 'CRAWL_PURPOSE', + query: TimeseriesGroupTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ai/bots/timeseries_groups/${dimension}`, { + query, + ...options, + }) as Core.APIPromise<{ result: TimeseriesGroupTimeseriesGroupsResponse }> + )._thenUnwrap((obj) => obj.result); + } + /** * Retrieves the distribution of traffic by AI user agent over time. * @@ -31,16 +132,226 @@ export class TimeseriesGroups extends APIResource { } } -export interface TimeseriesGroupUserAgentResponse { +export interface TimeseriesGroupSummaryResponse { /** * Metadata for the results. */ - meta: TimeseriesGroupUserAgentResponse.Meta; + meta: TimeseriesGroupSummaryResponse.Meta; - serie_0: TimeseriesGroupUserAgentResponse.Serie0; + summary_0: { [key: string]: string }; } -export namespace TimeseriesGroupUserAgentResponse { +export namespace TimeseriesGroupSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } +} + +export interface TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesResponse.Meta; + + [k: string]: + | TimeseriesGroupTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | TimeseriesGroupTimeseriesResponse.Meta + | undefined; +} + +export namespace TimeseriesGroupTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface TimeseriesGroupTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupTimeseriesGroupsResponse.Meta; + + serie_0: TimeseriesGroupTimeseriesGroupsResponse.Serie0; +} + +export namespace TimeseriesGroupTimeseriesGroupsResponse { /** * Metadata for the results. */ @@ -141,6 +452,330 @@ export namespace TimeseriesGroupUserAgentResponse { } } +export interface TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + meta: TimeseriesGroupUserAgentResponse.Meta; + + serie_0: TimeseriesGroupUserAgentResponse.Serie0; +} + +export namespace TimeseriesGroupUserAgentResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface Serie0 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } +} + +export interface TimeseriesGroupSummaryParams { + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; +} + +export interface TimeseriesGroupTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by user agent. + */ + userAgent?: Array; +} + +export interface TimeseriesGroupTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by Autonomous System. Specify one or more Autonomous System + * Numbers (ASNs) as a comma-separated list. Prefix with `-` to exclude ASNs from + * results. For example, `-174, 3356` excludes results from AS174, but includes + * results from AS3356. + */ + asn?: Array; + + /** + * Filters results by continent. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude continents from results. For example, `-EU,NA` + * excludes results from EU, but includes results from NA. + */ + continent?: Array; + + /** + * Filters results by bot crawl purpose. + */ + crawlPurpose?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by location. Specify a comma-separated list of alpha-2 codes. + * Prefix with `-` to exclude locations from results. For example, `-US,PT` + * excludes results from the US, but includes results from PT. + */ + location?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'PERCENTAGE_CHANGE' | 'MIN0_MAX'; +} + export interface TimeseriesGroupUserAgentParams { /** * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). @@ -208,7 +843,13 @@ export interface TimeseriesGroupUserAgentParams { export declare namespace TimeseriesGroups { export { + type TimeseriesGroupSummaryResponse as TimeseriesGroupSummaryResponse, + type TimeseriesGroupTimeseriesResponse as TimeseriesGroupTimeseriesResponse, + type TimeseriesGroupTimeseriesGroupsResponse as TimeseriesGroupTimeseriesGroupsResponse, type TimeseriesGroupUserAgentResponse as TimeseriesGroupUserAgentResponse, + type TimeseriesGroupSummaryParams as TimeseriesGroupSummaryParams, + type TimeseriesGroupTimeseriesParams as TimeseriesGroupTimeseriesParams, + type TimeseriesGroupTimeseriesGroupsParams as TimeseriesGroupTimeseriesGroupsParams, type TimeseriesGroupUserAgentParams as TimeseriesGroupUserAgentParams, }; } diff --git a/src/resources/radar/ct.ts b/src/resources/radar/ct.ts new file mode 100644 index 0000000000..a1db06bc41 --- /dev/null +++ b/src/resources/radar/ct.ts @@ -0,0 +1,3 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export * from './ct/index'; diff --git a/src/resources/radar/ct/authorities.ts b/src/resources/radar/ct/authorities.ts new file mode 100644 index 0000000000..1737426fe1 --- /dev/null +++ b/src/resources/radar/ct/authorities.ts @@ -0,0 +1,301 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Authorities extends APIResource { + /** + * Retrieves a list of certificate authorities. + * + * @example + * ```ts + * const authorities = + * await client.radar.ct.authorities.list(); + * ``` + */ + list(query?: AuthorityListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: AuthorityListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/authorities', { query, ...options }) as Core.APIPromise<{ + result: AuthorityListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested CA information. + * + * @example + * ```ts + * const authority = await client.radar.ct.authorities.get( + * '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + * ); + * ``` + */ + get( + caSlug: string, + query?: AuthorityGetParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + get(caSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + caSlug: string, + query: AuthorityGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(caSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/authorities/${caSlug}`, { query, ...options }) as Core.APIPromise<{ + result: AuthorityGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface AuthorityListResponse { + certificateAuthorities: Array; +} + +export namespace AuthorityListResponse { + export interface CertificateAuthority { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } +} + +export interface AuthorityGetResponse { + certificateAuthority: AuthorityGetResponse.CertificateAuthority; +} + +export namespace AuthorityGetResponse { + export interface CertificateAuthority { + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + appleStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The authorityKeyIdentifier value extracted from the certificate PEM. + */ + authorityKeyIdentifier: string; + + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + chromeStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The two-letter ISO country code where the CA organization is based. + */ + country: string; + + /** + * The full country name corresponding to the country code. + */ + countryName: string; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + microsoftStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The inclusion status of a Certificate Authority (CA) in the trust store. + */ + mozillaStatus: + | 'INCLUDED' + | 'NOT_YET_INCLUDED' + | 'NOT_INCLUDED' + | 'NOT_BEFORE' + | 'REMOVED' + | 'DISABLED' + | 'BLOCKED'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The organization that owns and operates the CA. + */ + owner: string; + + /** + * The name of the parent/root certificate authority that issued this intermediate + * certificate. + */ + parentName: string; + + /** + * The SHA-256 fingerprint of the parent certificate. + */ + parentSha256Fingerprint: string; + + /** + * CAs from the same owner. + */ + related: Array; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + + /** + * The subjectKeyIdentifier value extracted from the certificate PEM. + */ + subjectKeyIdentifier: string; + + /** + * The start date of the certificate’s validity period (ISO format). + */ + validFrom: string; + + /** + * The end date of the certificate’s validity period (ISO format). + */ + validTo: string; + } + + export namespace CertificateAuthority { + export interface Related { + /** + * Specifies the type of certificate in the trust chain. + */ + certificateRecordType: 'ROOT_CERTIFICATE' | 'INTERMEDIATE_CERTIFICATE'; + + /** + * The full name of the certificate authority (CA). + */ + name: string; + + /** + * The current revocation status of a Certificate Authority (CA) certificate. + */ + revocationStatus: 'NOT_REVOKED' | 'REVOKED' | 'PARENT_CERT_REVOKED'; + + /** + * The SHA-256 fingerprint of the intermediate certificate. + */ + sha256Fingerprint: string; + } + } +} + +export interface AuthorityListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface AuthorityGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Authorities { + export { + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; +} diff --git a/src/resources/radar/ct/ct.ts b/src/resources/radar/ct/ct.ts new file mode 100644 index 0000000000..9f5873a4d2 --- /dev/null +++ b/src/resources/radar/ct/ct.ts @@ -0,0 +1,1107 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; +import * as AuthoritiesAPI from './authorities'; +import { + Authorities, + AuthorityGetParams, + AuthorityGetResponse, + AuthorityListParams, + AuthorityListResponse, +} from './authorities'; +import * as LogsAPI from './logs'; +import { LogGetParams, LogGetResponse, LogListParams, LogListResponse, Logs } from './logs'; + +export class Ct extends APIResource { + authorities: AuthoritiesAPI.Authorities = new AuthoritiesAPI.Authorities(this._client); + logs: LogsAPI.Logs = new LogsAPI.Logs(this._client); + + /** + * Retrieves an aggregated summary of certificates grouped by the specified + * dimension. + * + * @example + * ```ts + * const response = await client.radar.ct.summary('CA'); + * ``` + */ + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtSummaryParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + summary( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtSummaryParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.summary(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/summary/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtSummaryResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves certificate volume over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseries(); + * ``` + */ + timeseries( + query?: CtTimeseriesParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseries(options?: Core.RequestOptions): Core.APIPromise; + timeseries( + query: CtTimeseriesParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseries({}, query); + } + return ( + this._client.get('/radar/ct/timeseries', { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the distribution of certificates grouped by chosen the specified + * dimension over time. + * + * @example + * ```ts + * const response = await client.radar.ct.timeseriesGroups( + * 'CA', + * ); + * ``` + */ + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query?: CtTimeseriesGroupsParams, + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + options?: Core.RequestOptions, + ): Core.APIPromise; + timeseriesGroups( + dimension: + | 'CA' + | 'CA_OWNER' + | 'DURATION' + | 'ENTRY_TYPE' + | 'EXPIRATION_STATUS' + | 'HAS_IPS' + | 'HAS_WILDCARDS' + | 'LOG' + | 'LOG_API' + | 'LOG_OPERATOR' + | 'PUBLIC_KEY_ALGORITHM' + | 'SIGNATURE_ALGORITHM' + | 'TLD' + | 'VALIDATION_LEVEL', + query: CtTimeseriesGroupsParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.timeseriesGroups(dimension, {}, query); + } + return ( + this._client.get(`/radar/ct/timeseries_groups/${dimension}`, { query, ...options }) as Core.APIPromise<{ + result: CtTimeseriesGroupsResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface CtSummaryResponse { + /** + * Metadata for the results. + */ + meta: CtSummaryResponse.Meta; + + summary_0: + | { [key: string]: string } + | CtSummaryResponse.UnionMember1 + | CtSummaryResponse.UnionMember2 + | CtSummaryResponse.UnionMember3 + | CtSummaryResponse.UnionMember4 + | CtSummaryResponse.UnionMember5 + | CtSummaryResponse.UnionMember6 + | CtSummaryResponse.UnionMember7; +} + +export namespace CtSummaryResponse { + /** + * Metadata for the results. + */ + export interface Meta { + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnionMember1 { + rfc6962: string; + + static: string; + } + + export interface UnionMember2 { + gt_121d: string; + + gt_16d_lte_31d: string; + + gt_31d_lte_91d: string; + + gt_3d_lte_16d: string; + + gt_91d_lte_121d: string; + + lte_3d: string; + } + + export interface UnionMember3 { + CERTIFICATE: string; + + PRECERTIFICATE: string; + } + + export interface UnionMember4 { + EXPIRED: string; + + VALID: string; + } + + export interface UnionMember5 { + NEGATIVE: string; + + POSITIVE: string; + } + + export interface UnionMember6 { + DSA: string; + + ECDSA: string; + + RSA: string; + } + + export interface UnionMember7 { + domain: string; + + extended: string; + + organization: string; + + unknown: string; + } +} + +export interface CtTimeseriesResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesResponse.Meta; + + [k: string]: + | CtTimeseriesResponse.unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb + | CtTimeseriesResponse.Meta + | undefined; +} + +export namespace CtTimeseriesResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface unnamed_schema_ref_75bae70cf28e6bcef364b9840db3bdeb { + timestamps: Array; + + values: Array; + } +} + +export interface CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + meta: CtTimeseriesGroupsResponse.Meta; + + serie_0: + | CtTimeseriesGroupsResponse.UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 + | CtTimeseriesGroupsResponse.UnionMember1 + | CtTimeseriesGroupsResponse.UnionMember2 + | CtTimeseriesGroupsResponse.UnionMember3 + | CtTimeseriesGroupsResponse.UnionMember4 + | CtTimeseriesGroupsResponse.UnionMember5 + | CtTimeseriesGroupsResponse.UnionMember6 + | CtTimeseriesGroupsResponse.UnionMember7; +} + +export namespace CtTimeseriesGroupsResponse { + /** + * Metadata for the results. + */ + export interface Meta { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval: 'FIFTEEN_MINUTES' | 'ONE_HOUR' | 'ONE_DAY' | 'ONE_WEEK' | 'ONE_MONTH'; + + confidenceInfo: Meta.ConfidenceInfo; + + dateRange: Array; + + /** + * Timestamp of the last dataset update. + */ + lastUpdated: string; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization: + | 'PERCENTAGE' + | 'MIN0_MAX' + | 'MIN_MAX' + | 'RAW_VALUES' + | 'PERCENTAGE_CHANGE' + | 'ROLLING_AVERAGE' + | 'OVERLAPPED_PERCENTAGE' + | 'RATIO'; + + /** + * Measurement units for the results. + */ + units: Array; + } + + export namespace Meta { + export interface ConfidenceInfo { + annotations: Array; + + /** + * Provides an indication of how much confidence Cloudflare has in the data. + */ + level: number; + } + + export namespace ConfidenceInfo { + /** + * Annotation associated with the result (e.g. outage or other type of event). + */ + export interface Annotation { + dataSource: string; + + description: string; + + endDate: string; + + eventType: string; + + /** + * Whether event is a single point in time or a time range. + */ + isInstantaneous: boolean; + + linkedUrl: string; + + startDate: string; + } + } + + export interface DateRange { + /** + * Adjusted end of date range. + */ + endTime: string; + + /** + * Adjusted start of date range. + */ + startTime: string; + } + + export interface Unit { + name: string; + + value: string; + } + } + + export interface UnnamedSchemaRef7826220e105d84352ba1108d9ed88e55 { + timestamps: Array; + + [k: string]: Array | Array | undefined; + } + + export interface UnionMember1 { + rfc6962: Array; + + static: Array; + } + + export interface UnionMember2 { + gt_121d: Array; + + gt_16d_lte_31d: Array; + + gt_31d_lte_91d: Array; + + gt_3d_lte_16d: Array; + + gt_91d_lte_121d: Array; + + lte_3d: Array; + } + + export interface UnionMember3 { + CERTIFICATE: Array; + + PRECERTIFICATE: Array; + } + + export interface UnionMember4 { + EXPIRED: Array; + + VALID: Array; + } + + export interface UnionMember5 { + NEGATIVE: Array; + + POSITIVE: Array; + } + + export interface UnionMember6 { + DSA: Array; + + ECDSA: Array; + + RSA: Array; + } + + export interface UnionMember7 { + domain: Array; + + extended: Array; + + organization: Array; + + unknown: Array; + } +} + +export interface CtSummaryParams { + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +export interface CtTimeseriesGroupsParams { + /** + * Aggregation interval of the results (e.g., in 15 minutes or 1 hour intervals). + * Refer to + * [Aggregation intervals](https://developers.cloudflare.com/radar/concepts/aggregation-intervals/). + */ + aggInterval?: '15m' | '1h' | '1d' | '1w'; + + /** + * Filters results by certificate authority. + */ + ca?: Array; + + /** + * Filters results by certificate authority owner. + */ + caOwner?: Array; + + /** + * End of the date range (inclusive). + */ + dateEnd?: Array; + + /** + * Filters results by date range. For example, use `7d` and `7dcontrol` to compare + * this week with the previous week. Use this parameter or set specific start and + * end dates (`dateStart` and `dateEnd` parameters). + */ + dateRange?: Array; + + /** + * Start of the date range. + */ + dateStart?: Array; + + /** + * Filters results by certificate duration. + */ + duration?: Array< + | 'LTE_3D' + | 'GT_3D_LTE_7D' + | 'GT_7D_LTE_10D' + | 'GT_10D_LTE_47D' + | 'GT_47D_LTE_100D' + | 'GT_100D_LTE_200D' + | 'GT_200D' + >; + + /** + * Filters results by entry type (certificate vs. pre-certificate). + */ + entryType?: Array<'PRECERTIFICATE' | 'CERTIFICATE'>; + + /** + * Filters results by expiration status (expired vs. valid). + */ + expirationStatus?: Array<'EXPIRED' | 'VALID'>; + + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Filters results based on whether the certificates are bound to specific IP + * addresses. + */ + hasIps?: Array; + + /** + * Filters results based on whether the certificates contain wildcard domains. + */ + hasWildcards?: Array; + + /** + * Limits the number of objects per group to the top items within the specified + * time range. When item count exceeds the limit, extra items appear grouped under + * an "other" category. + */ + limitPerGroup?: number; + + /** + * Filters results by certificate log. + */ + log?: Array; + + /** + * Filters results by certificate log API (RFC6962 vs. static). + */ + logApi?: Array<'RFC6962' | 'STATIC'>; + + /** + * Filters results by certificate log operator. + */ + logOperator?: Array; + + /** + * Array of names used to label the series in the response. + */ + name?: Array; + + /** + * Normalization method applied to the results. Refer to + * [Normalization methods](https://developers.cloudflare.com/radar/concepts/normalization/). + */ + normalization?: 'RAW_VALUES' | 'PERCENTAGE'; + + /** + * Filters results by public key algorithm. + */ + publicKeyAlgorithm?: Array<'DSA' | 'ECDSA' | 'RSA'>; + + /** + * Filters results by signature algorithm. + */ + signatureAlgorithm?: Array< + | 'DSA_SHA_1' + | 'DSA_SHA_256' + | 'ECDSA_SHA_1' + | 'ECDSA_SHA_256' + | 'ECDSA_SHA_384' + | 'ECDSA_SHA_512' + | 'PSS_SHA_256' + | 'PSS_SHA_384' + | 'PSS_SHA_512' + | 'RSA_MD2' + | 'RSA_MD5' + | 'RSA_SHA_1' + | 'RSA_SHA_256' + | 'RSA_SHA_384' + | 'RSA_SHA_512' + >; + + /** + * Filters results by top-level domain. + */ + tld?: Array; + + /** + * Specifies whether to filter out duplicate certificates and pre-certificates. Set + * to true for unique entries only. + */ + uniqueEntries?: Array<'true' | 'false'>; + + /** + * Filters results by validation level. + */ + validationLevel?: Array<'DOMAIN' | 'ORGANIZATION' | 'EXTENDED'>; +} + +Ct.Authorities = Authorities; +Ct.Logs = Logs; + +export declare namespace Ct { + export { + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + + export { + Authorities as Authorities, + type AuthorityListResponse as AuthorityListResponse, + type AuthorityGetResponse as AuthorityGetResponse, + type AuthorityListParams as AuthorityListParams, + type AuthorityGetParams as AuthorityGetParams, + }; + + export { + Logs as Logs, + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/ct/index.ts b/src/resources/radar/ct/index.ts new file mode 100644 index 0000000000..20a5137e83 --- /dev/null +++ b/src/resources/radar/ct/index.ts @@ -0,0 +1,25 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +export { + Authorities, + type AuthorityListResponse, + type AuthorityGetResponse, + type AuthorityListParams, + type AuthorityGetParams, +} from './authorities'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct'; +export { + Logs, + type LogListResponse, + type LogGetResponse, + type LogListParams, + type LogGetParams, +} from './logs'; diff --git a/src/resources/radar/ct/logs.ts b/src/resources/radar/ct/logs.ts new file mode 100644 index 0000000000..4ba71c4acf --- /dev/null +++ b/src/resources/radar/ct/logs.ts @@ -0,0 +1,271 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import { APIResource } from '../../../resource'; +import { isRequestOptions } from '../../../core'; +import * as Core from '../../../core'; + +export class Logs extends APIResource { + /** + * Retrieves a list of certificate logs. + * + * @example + * ```ts + * const logs = await client.radar.ct.logs.list(); + * ``` + */ + list(query?: LogListParams, options?: Core.RequestOptions): Core.APIPromise; + list(options?: Core.RequestOptions): Core.APIPromise; + list( + query: LogListParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.list({}, query); + } + return ( + this._client.get('/radar/ct/logs', { query, ...options }) as Core.APIPromise<{ + result: LogListResponse; + }> + )._thenUnwrap((obj) => obj.result); + } + + /** + * Retrieves the requested certificate log information. + * + * @example + * ```ts + * const log = await client.radar.ct.logs.get('argon2024'); + * ``` + */ + get(logSlug: string, query?: LogGetParams, options?: Core.RequestOptions): Core.APIPromise; + get(logSlug: string, options?: Core.RequestOptions): Core.APIPromise; + get( + logSlug: string, + query: LogGetParams | Core.RequestOptions = {}, + options?: Core.RequestOptions, + ): Core.APIPromise { + if (isRequestOptions(query)) { + return this.get(logSlug, {}, query); + } + return ( + this._client.get(`/radar/ct/logs/${logSlug}`, { query, ...options }) as Core.APIPromise<{ + result: LogGetResponse; + }> + )._thenUnwrap((obj) => obj.result); + } +} + +export interface LogListResponse { + certificateLogs: Array; +} + +export namespace LogListResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } +} + +export interface LogGetResponse { + certificateLog: LogGetResponse.CertificateLog; +} + +export namespace LogGetResponse { + export interface CertificateLog { + /** + * The API standard that the certificate log follows. + */ + api: 'RFC6962' | 'STATIC'; + + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * The organization responsible for operating the certificate log. + */ + operator: string; + + /** + * Log performance metrics, including averages and per-endpoint details. + */ + performance: CertificateLog.Performance | null; + + /** + * Logs from the same operator. + */ + related: Array; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + + /** + * Timestamp of when the log state was last updated. + */ + stateTimestamp: string; + + /** + * The URL for the certificate log. + */ + url: string; + } + + export namespace CertificateLog { + /** + * Log performance metrics, including averages and per-endpoint details. + */ + export interface Performance { + endpoints: Array; + + responseTime: number; + + uptime: number; + } + + export namespace Performance { + export interface Endpoint { + /** + * The certificate log endpoint names used in performance metrics. + */ + endpoint: + | 'add-chain (new)' + | 'add-chain (old)' + | 'add-pre-chain (new)' + | 'add-pre-chain (old)' + | 'get-entries' + | 'get-roots' + | 'get-sth'; + + responseTime: number; + + uptime: number; + } + } + + export interface Related { + /** + * A brief description of the certificate log. + */ + description: string; + + /** + * The end date and time for when the log will stop accepting certificates. + */ + endExclusive: string; + + /** + * A URL-friendly, kebab-case identifier for the certificate log. + */ + slug: string; + + /** + * The start date and time for when the log starts accepting certificates. + */ + startInclusive: string; + + /** + * The current state of the certificate log. More details about log states can be + * found here: + * https://googlechrome.github.io/CertificateTransparency/log_states.html + */ + state: 'USABLE' | 'PENDING' | 'QUALIFIED' | 'READ_ONLY' | 'RETIRED' | 'REJECTED'; + } + } +} + +export interface LogListParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; + + /** + * Limits the number of objects returned in the response. + */ + limit?: number; + + /** + * Skips the specified number of objects before fetching the results. + */ + offset?: number; +} + +export interface LogGetParams { + /** + * Format in which results will be returned. + */ + format?: 'JSON' | 'CSV'; +} + +export declare namespace Logs { + export { + type LogListResponse as LogListResponse, + type LogGetResponse as LogGetResponse, + type LogListParams as LogListParams, + type LogGetParams as LogGetParams, + }; +} diff --git a/src/resources/radar/index.ts b/src/resources/radar/index.ts index 5aadae8272..9b9bba8ee0 100644 --- a/src/resources/radar/index.ts +++ b/src/resources/radar/index.ts @@ -18,6 +18,15 @@ export { type BotTimeseriesParams, type BotTimeseriesGroupsParams, } from './bots/index'; +export { + Ct, + type CtSummaryResponse, + type CtTimeseriesResponse, + type CtTimeseriesGroupsResponse, + type CtSummaryParams, + type CtTimeseriesParams, + type CtTimeseriesGroupsParams, +} from './ct/index'; export { DNS, type DNSTimeseriesResponse, type DNSTimeseriesParams } from './dns/index'; export { Datasets, diff --git a/src/resources/radar/radar.ts b/src/resources/radar/radar.ts index 7a3971e2c9..0ed666d88a 100644 --- a/src/resources/radar/radar.ts +++ b/src/resources/radar/radar.ts @@ -44,6 +44,16 @@ import { BotTimeseriesResponse, Bots, } from './bots/bots'; +import * as CtAPI from './ct/ct'; +import { + Ct, + CtSummaryParams, + CtSummaryResponse, + CtTimeseriesGroupsParams, + CtTimeseriesGroupsResponse, + CtTimeseriesParams, + CtTimeseriesResponse, +} from './ct/ct'; import * as DNSAPI from './dns/dns'; import { DNS, DNSTimeseriesParams, DNSTimeseriesResponse } from './dns/dns'; import * as EmailAPI from './email/email'; @@ -85,6 +95,7 @@ import { VerifiedBots } from './verified-bots/verified-bots'; export class Radar extends APIResource { ai: AIAPI.AI = new AIAPI.AI(this._client); + ct: CtAPI.Ct = new CtAPI.Ct(this._client); annotations: AnnotationsAPI.Annotations = new AnnotationsAPI.Annotations(this._client); bgp: BGPAPI.BGP = new BGPAPI.BGP(this._client); bots: BotsAPI.Bots = new BotsAPI.Bots(this._client); @@ -113,6 +124,7 @@ export class Radar extends APIResource { } Radar.AI = AI; +Radar.Ct = Ct; Radar.Annotations = Annotations; Radar.BGP = BGP; Radar.Bots = Bots; @@ -136,6 +148,16 @@ Radar.LeakedCredentials = LeakedCredentials; export declare namespace Radar { export { AI as AI }; + export { + Ct as Ct, + type CtSummaryResponse as CtSummaryResponse, + type CtTimeseriesResponse as CtTimeseriesResponse, + type CtTimeseriesGroupsResponse as CtTimeseriesGroupsResponse, + type CtSummaryParams as CtSummaryParams, + type CtTimeseriesParams as CtTimeseriesParams, + type CtTimeseriesGroupsParams as CtTimeseriesGroupsParams, + }; + export { Annotations as Annotations, type AnnotationListResponse as AnnotationListResponse, diff --git a/src/resources/workers/scripts/deployments.ts b/src/resources/workers/scripts/deployments.ts index c23e1d1b09..1283130f6b 100644 --- a/src/resources/workers/scripts/deployments.ts +++ b/src/resources/workers/scripts/deployments.ts @@ -33,14 +33,14 @@ export class Deployments extends APIResource { scriptName: string, params: DeploymentCreateParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id, force, ...body } = params; return ( this._client.post(`/accounts/${account_id}/workers/scripts/${scriptName}/deployments`, { query: { force }, body, ...options, - }) as Core.APIPromise<{ result: DeploymentCreateResponse }> + }) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } @@ -116,18 +116,18 @@ export class Deployments extends APIResource { deploymentId: string, params: DeploymentGetParams, options?: Core.RequestOptions, - ): Core.APIPromise { + ): Core.APIPromise { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/workers/scripts/${scriptName}/deployments/${deploymentId}`, options, - ) as Core.APIPromise<{ result: DeploymentGetResponse }> + ) as Core.APIPromise<{ result: Deployment }> )._thenUnwrap((obj) => obj.result); } } -export interface DeploymentCreateResponse { +export interface Deployment { id: string; created_on: string; @@ -136,14 +136,14 @@ export interface DeploymentCreateResponse { strategy: 'percentage'; - versions: Array; + versions: Array; - annotations?: DeploymentCreateResponse.Annotations; + annotations?: Deployment.Annotations; author_email?: string; } -export namespace DeploymentCreateResponse { +export namespace Deployment { export interface Version { percentage: number; @@ -164,45 +164,7 @@ export namespace DeploymentCreateResponse { } export interface DeploymentListResponse { - deployments: Array; -} - -export namespace DeploymentListResponse { - export interface Deployment { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: Deployment.Annotations; - - author_email?: string; - } - - export namespace Deployment { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } - } + deployments: Array; } export interface DeploymentDeleteResponse { @@ -250,42 +212,6 @@ export namespace DeploymentDeleteResponse { } } -export interface DeploymentGetResponse { - id: string; - - created_on: string; - - source: string; - - strategy: 'percentage'; - - versions: Array; - - annotations?: DeploymentGetResponse.Annotations; - - author_email?: string; -} - -export namespace DeploymentGetResponse { - export interface Version { - percentage: number; - - version_id: string; - } - - export interface Annotations { - /** - * Human-readable message about the deployment. Truncated to 100 bytes. - */ - 'workers/message'?: string; - - /** - * Operation that triggered the creation of the deployment. - */ - 'workers/triggered_by'?: string; - } -} - export interface DeploymentCreateParams { /** * Path param: Identifier. @@ -353,10 +279,9 @@ export interface DeploymentGetParams { export declare namespace Deployments { export { - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/index.ts b/src/resources/workers/scripts/index.ts index ed521aefd1..73bd09f1ac 100644 --- a/src/resources/workers/scripts/index.ts +++ b/src/resources/workers/scripts/index.ts @@ -4,10 +4,9 @@ export { Assets } from './assets/index'; export { Content, type ContentUpdateParams, type ContentGetParams } from './content'; export { Deployments, - type DeploymentCreateResponse, + type Deployment, type DeploymentListResponse, type DeploymentDeleteResponse, - type DeploymentGetResponse, type DeploymentCreateParams, type DeploymentListParams, type DeploymentDeleteParams, diff --git a/src/resources/workers/scripts/scripts.ts b/src/resources/workers/scripts/scripts.ts index e4db71c985..2f5b74a81c 100644 --- a/src/resources/workers/scripts/scripts.ts +++ b/src/resources/workers/scripts/scripts.ts @@ -7,12 +7,11 @@ import * as ContentAPI from './content'; import { Content, ContentGetParams, ContentUpdateParams } from './content'; import * as DeploymentsAPI from './deployments'; import { + Deployment, DeploymentCreateParams, - DeploymentCreateResponse, DeploymentDeleteParams, DeploymentDeleteResponse, DeploymentGetParams, - DeploymentGetResponse, DeploymentListParams, DeploymentListResponse, Deployments, @@ -1311,10 +1310,9 @@ export declare namespace Scripts { export { Deployments as Deployments, - type DeploymentCreateResponse as DeploymentCreateResponse, + type Deployment as Deployment, type DeploymentListResponse as DeploymentListResponse, type DeploymentDeleteResponse as DeploymentDeleteResponse, - type DeploymentGetResponse as DeploymentGetResponse, type DeploymentCreateParams as DeploymentCreateParams, type DeploymentListParams as DeploymentListParams, type DeploymentDeleteParams as DeploymentDeleteParams, diff --git a/tests/api-resources/kv/namespaces/values.test.ts b/tests/api-resources/kv/namespaces/values.test.ts index 6ae2915c03..03fbaa4b52 100644 --- a/tests/api-resources/kv/namespaces/values.test.ts +++ b/tests/api-resources/kv/namespaces/values.test.ts @@ -32,7 +32,7 @@ describe('resource values', () => { value: 'Some Value', expiration: 1578435000, expiration_ttl: 300, - metadata: { someMetadataKey: 'someMetadataValue' }, + metadata: {}, }); }); diff --git a/tests/api-resources/radar/ai/timeseries-groups.test.ts b/tests/api-resources/radar/ai/timeseries-groups.test.ts index 386515626c..10134f56bd 100644 --- a/tests/api-resources/radar/ai/timeseries-groups.test.ts +++ b/tests/api-resources/radar/ai/timeseries-groups.test.ts @@ -10,6 +10,129 @@ const client = new Cloudflare({ }); describe('resource timeseriesGroups', () => { + test('summary', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.summary('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.summary( + 'USER_AGENT', + { + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries({ path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseries( + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + userAgent: ['string'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups('USER_AGENT', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ai.timeseriesGroups.timeseriesGroups( + 'USER_AGENT', + { + aggInterval: '1h', + asn: ['string'], + continent: ['string'], + crawlPurpose: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + format: 'JSON', + limitPerGroup: 10, + location: ['string'], + name: ['main_series'], + normalization: 'MIN0_MAX', + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + test('userAgent', async () => { const responsePromise = client.radar.ai.timeseriesGroups.userAgent(); const rawResponse = await responsePromise.asResponse(); diff --git a/tests/api-resources/radar/ct/authorities.test.ts b/tests/api-resources/radar/ct/authorities.test.ts new file mode 100644 index 0000000000..667531af94 --- /dev/null +++ b/tests/api-resources/radar/ct/authorities.test.ts @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource authorities', () => { + test('list', async () => { + const responsePromise = client.radar.ct.authorities.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.authorities.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + ); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get('24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', { + path: '/_stainless_unknown_path', + }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.authorities.get( + '24EDD4E503A8D3FDB5FFB4AF66C887359901CBE687A5A0760D10A08EED99A7C3', + { format: 'JSON' }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/ct.test.ts b/tests/api-resources/radar/ct/ct.test.ts new file mode 100644 index 0000000000..b57cd5b1b0 --- /dev/null +++ b/tests/api-resources/radar/ct/ct.test.ts @@ -0,0 +1,167 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource ct', () => { + test('summary', async () => { + const responsePromise = client.radar.ct.summary('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('summary: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.summary('CA', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('summary: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.summary( + 'CA', + { + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseries', async () => { + const responsePromise = client.radar.ct.timeseries(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseries: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.timeseries({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('timeseries: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseries( + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups', async () => { + const responsePromise = client.radar.ct.timeseriesGroups('CA'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('timeseriesGroups: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups('CA', { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('timeseriesGroups: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.timeseriesGroups( + 'CA', + { + aggInterval: '1h', + ca: ['string'], + caOwner: ['string'], + dateEnd: ['2019-12-27T18:11:19.117Z'], + dateRange: ['7d'], + dateStart: ['2019-12-27T18:11:19.117Z'], + duration: ['LTE_3D'], + entryType: ['PRECERTIFICATE'], + expirationStatus: ['EXPIRED'], + format: 'JSON', + hasIps: [true], + hasWildcards: [true], + limitPerGroup: 10, + log: ['string'], + logApi: ['RFC6962'], + logOperator: ['string'], + name: ['main_series'], + normalization: 'RAW_VALUES', + publicKeyAlgorithm: ['DSA'], + signatureAlgorithm: ['DSA_SHA_1'], + tld: ['string'], + uniqueEntries: ['true'], + validationLevel: ['DOMAIN'], + }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); diff --git a/tests/api-resources/radar/ct/logs.test.ts b/tests/api-resources/radar/ct/logs.test.ts new file mode 100644 index 0000000000..0654ffffe1 --- /dev/null +++ b/tests/api-resources/radar/ct/logs.test.ts @@ -0,0 +1,65 @@ +// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +import Cloudflare from 'cloudflare'; +import { Response } from 'node-fetch'; + +const client = new Cloudflare({ + apiKey: '144c9defac04969c7bfad8efaa8ea194', + apiEmail: 'user@example.com', + baseURL: process.env['TEST_API_BASE_URL'] ?? 'http://127.0.0.1:4010', +}); + +describe('resource logs', () => { + test('list', async () => { + const responsePromise = client.radar.ct.logs.list(); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('list: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.list({ path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('list: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.list( + { format: 'JSON', limit: 5, offset: 0 }, + { path: '/_stainless_unknown_path' }, + ), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); + + test('get', async () => { + const responsePromise = client.radar.ct.logs.get('argon2024'); + const rawResponse = await responsePromise.asResponse(); + expect(rawResponse).toBeInstanceOf(Response); + const response = await responsePromise; + expect(response).not.toBeInstanceOf(Response); + const dataAndResponse = await responsePromise.withResponse(); + expect(dataAndResponse.data).toBe(response); + expect(dataAndResponse.response).toBe(rawResponse); + }); + + test('get: request options instead of params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect(client.radar.ct.logs.get('argon2024', { path: '/_stainless_unknown_path' })).rejects.toThrow( + Cloudflare.NotFoundError, + ); + }); + + test('get: request options and params are passed correctly', async () => { + // ensure the request options are being passed correctly by passing an invalid HTTP method in order to cause an error + await expect( + client.radar.ct.logs.get('argon2024', { format: 'JSON' }, { path: '/_stainless_unknown_path' }), + ).rejects.toThrow(Cloudflare.NotFoundError); + }); +}); From 865b019ccad82950f2eeb6fb3e96fc3714c94a30 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 18:54:07 +0000 Subject: [PATCH 354/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 758076bdd3..159f3b5964 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9b7c0537a0860328effd3714b260a2bfb86ce635f9010cc22cd530e57131e491.yml -openapi_spec_hash: db57aa8f254715d1e1922686ead68d58 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0c8a5530c3799d070e9368fc73414a45f21daf36b71d305be8a389d0e448fcd.yml +openapi_spec_hash: 8a2cca04118a5b3dccf4ea5fe2ff96b3 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 1894ba3f353df40b053368b856254850f025bc27 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:05:46 +0000 Subject: [PATCH 355/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 159f3b5964..7df8627bf0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-a0c8a5530c3799d070e9368fc73414a45f21daf36b71d305be8a389d0e448fcd.yml -openapi_spec_hash: 8a2cca04118a5b3dccf4ea5fe2ff96b3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6ac9a4271e2658235eb38282005c4cf060ec723b95166a8085dee817e465372d.yml +openapi_spec_hash: f5ab9771c10da467310b27b9202972ad config_hash: 04c3e87def66bed3001640fca84ff9c5 From 0c8dfe1e272af3d788956d188a55156a2244edc3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:18:28 +0000 Subject: [PATCH 356/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7df8627bf0..8508de079b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6ac9a4271e2658235eb38282005c4cf060ec723b95166a8085dee817e465372d.yml -openapi_spec_hash: f5ab9771c10da467310b27b9202972ad +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2275968ec9f18f589ad98c62d14df19751ae16d1d9500c0bc08b6e06f966fb06.yml +openapi_spec_hash: 36162e63852598deb1ed7b57582e3b80 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 9e426141f704602afe31da83f5dad6a1babfcc44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:48:24 +0000 Subject: [PATCH 357/423] fix(methods): define methods with parameters and binary body correctly --- src/resources/zero-trust/dlp/datasets/datasets.ts | 3 ++- src/resources/zero-trust/dlp/datasets/index.ts | 2 +- src/resources/zero-trust/dlp/datasets/upload.ts | 9 ++++++++- .../zero-trust/dlp/datasets/versions/entries.ts | 5 ++++- src/resources/zero-trust/dlp/datasets/versions/index.ts | 2 +- .../zero-trust/dlp/datasets/versions/versions.ts | 8 ++++++-- .../api-resources/zero-trust/dlp/datasets/upload.test.ts | 1 + .../zero-trust/dlp/datasets/versions/entries.test.ts | 1 + 8 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/resources/zero-trust/dlp/datasets/datasets.ts b/src/resources/zero-trust/dlp/datasets/datasets.ts index 06d9063140..ef7b0cb2cc 100644 --- a/src/resources/zero-trust/dlp/datasets/datasets.ts +++ b/src/resources/zero-trust/dlp/datasets/datasets.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../resource'; import * as Core from '../../../../core'; import * as UploadAPI from './upload'; -import { NewVersion, Upload as UploadAPIUpload, UploadCreateParams } from './upload'; +import { NewVersion, Upload as UploadAPIUpload, UploadCreateParams, UploadEditParams } from './upload'; import * as VersionsAPI from './versions/versions'; import { VersionCreateParams, @@ -309,6 +309,7 @@ export declare namespace Datasets { UploadAPIUpload as Upload, type NewVersion as NewVersion, type UploadCreateParams as UploadCreateParams, + type UploadEditParams as UploadEditParams, }; export { diff --git a/src/resources/zero-trust/dlp/datasets/index.ts b/src/resources/zero-trust/dlp/datasets/index.ts index 33b9a6ce27..1b8e055782 100644 --- a/src/resources/zero-trust/dlp/datasets/index.ts +++ b/src/resources/zero-trust/dlp/datasets/index.ts @@ -12,7 +12,7 @@ export { type DatasetDeleteParams, type DatasetGetParams, } from './datasets'; -export { Upload, type NewVersion, type UploadCreateParams } from './upload'; +export { Upload, type NewVersion, type UploadCreateParams, type UploadEditParams } from './upload'; export { VersionCreateResponsesSinglePage, Versions, diff --git a/src/resources/zero-trust/dlp/datasets/upload.ts b/src/resources/zero-trust/dlp/datasets/upload.ts index ee68c9f2a7..14247bdef3 100644 --- a/src/resources/zero-trust/dlp/datasets/upload.ts +++ b/src/resources/zero-trust/dlp/datasets/upload.ts @@ -53,6 +53,7 @@ export class Upload extends APIResource { datasetId: string, version: number, dataset: string | ArrayBufferView | ArrayBuffer | BlobLike, + params: UploadEditParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -97,6 +98,12 @@ export interface UploadCreateParams { account_id: string; } +export type UploadEditParams = string | ArrayBufferView | ArrayBuffer | BlobLike; + export declare namespace Upload { - export { type NewVersion as NewVersion, type UploadCreateParams as UploadCreateParams }; + export { + type NewVersion as NewVersion, + type UploadCreateParams as UploadCreateParams, + type UploadEditParams as UploadEditParams, + }; } diff --git a/src/resources/zero-trust/dlp/datasets/versions/entries.ts b/src/resources/zero-trust/dlp/datasets/versions/entries.ts index 6982ee71da..84eaf6ca57 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/entries.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/entries.ts @@ -26,6 +26,7 @@ export class Entries extends APIResource { version: number, entryId: string, datasetVersionEntry: string | ArrayBufferView | ArrayBuffer | BlobLike, + params: EntryCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id } = params; @@ -53,6 +54,8 @@ export interface EntryCreateResponse { upload_status: 'empty' | 'uploading' | 'pending' | 'processing' | 'failed' | 'complete'; } +export type EntryCreateParams = string | ArrayBufferView | ArrayBuffer | BlobLike; + export declare namespace Entries { - export { type EntryCreateResponse as EntryCreateResponse }; + export { type EntryCreateResponse as EntryCreateResponse, type EntryCreateParams as EntryCreateParams }; } diff --git a/src/resources/zero-trust/dlp/datasets/versions/index.ts b/src/resources/zero-trust/dlp/datasets/versions/index.ts index 40458e879c..fa61430711 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/index.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/index.ts @@ -1,6 +1,6 @@ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -export { Entries, type EntryCreateResponse } from './entries'; +export { Entries, type EntryCreateResponse, type EntryCreateParams } from './entries'; export { VersionCreateResponsesSinglePage, Versions, diff --git a/src/resources/zero-trust/dlp/datasets/versions/versions.ts b/src/resources/zero-trust/dlp/datasets/versions/versions.ts index 254bc0b4da..a97887e4a8 100755 --- a/src/resources/zero-trust/dlp/datasets/versions/versions.ts +++ b/src/resources/zero-trust/dlp/datasets/versions/versions.ts @@ -3,7 +3,7 @@ import { APIResource } from '../../../../../resource'; import * as Core from '../../../../../core'; import * as EntriesAPI from './entries'; -import { Entries, EntryCreateResponse } from './entries'; +import { Entries, EntryCreateParams, EntryCreateResponse } from './entries'; import { SinglePage } from '../../../../../pagination'; export class Versions extends APIResource { @@ -98,5 +98,9 @@ export declare namespace Versions { type VersionCreateParams as VersionCreateParams, }; - export { Entries as Entries, type EntryCreateResponse as EntryCreateResponse }; + export { + Entries as Entries, + type EntryCreateResponse as EntryCreateResponse, + type EntryCreateParams as EntryCreateParams, + }; } diff --git a/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts b/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts index 889b4773eb..b43dc89588 100644 --- a/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts +++ b/tests/api-resources/zero-trust/dlp/datasets/upload.test.ts @@ -37,6 +37,7 @@ describe('resource upload', () => { '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', 0, await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); diff --git a/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts b/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts index 5be46fba56..eeb925dd20 100755 --- a/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts +++ b/tests/api-resources/zero-trust/dlp/datasets/versions/entries.test.ts @@ -17,6 +17,7 @@ describe('resource entries', () => { 0, '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', await toFile(Buffer.from('# my file contents'), 'README.md'), + await toFile(Buffer.from('# my file contents'), 'README.md'), ); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); From 11bf1eace686e5e0b2a9dbbbd0ef13db15fdf4ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 19:51:18 +0000 Subject: [PATCH 358/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8508de079b..8e7518c172 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2275968ec9f18f589ad98c62d14df19751ae16d1d9500c0bc08b6e06f966fb06.yml -openapi_spec_hash: 36162e63852598deb1ed7b57582e3b80 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cbde2182fdbe0146bf27acdc85e0a1b7161a48bb5039e59fc5424cb36dd74372.yml +openapi_spec_hash: 76edd868782f1ce0ec52c1eba1796dcd config_hash: 04c3e87def66bed3001640fca84ff9c5 From 109c90af559a2b0147306bcac62015643fc84e44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 20:05:28 +0000 Subject: [PATCH 359/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8e7518c172..411b6041fe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-cbde2182fdbe0146bf27acdc85e0a1b7161a48bb5039e59fc5424cb36dd74372.yml -openapi_spec_hash: 76edd868782f1ce0ec52c1eba1796dcd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37c97fd25e8db5b49e188efa919adf3b6d5b30dbee4c4751d2f1ff4fdebdcdbe.yml +openapi_spec_hash: 6b99ffab8f208d284e6c7cd4e34f593b config_hash: 04c3e87def66bed3001640fca84ff9c5 From 86ecd14d69fbea6d39f00730d479a19da8080e26 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 20:26:06 +0000 Subject: [PATCH 360/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 411b6041fe..58673cb097 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-37c97fd25e8db5b49e188efa919adf3b6d5b30dbee4c4751d2f1ff4fdebdcdbe.yml -openapi_spec_hash: 6b99ffab8f208d284e6c7cd4e34f593b +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-62bb7031f42f3cf5e996eefe9a435a089a91d6d94dbcf7d874f8221947f0d153.yml +openapi_spec_hash: 2da3acf58d0b42e63eb261de872f1821 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 516b705bd987a9a15753e0089a8e38b5dc8ca252 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 20:37:51 +0000 Subject: [PATCH 361/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 58673cb097..5c75a21f36 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-62bb7031f42f3cf5e996eefe9a435a089a91d6d94dbcf7d874f8221947f0d153.yml -openapi_spec_hash: 2da3acf58d0b42e63eb261de872f1821 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e78b4bc647262d0774f4c7de0dc25d1f56b904a9fb3adac57efde3c810da45ed.yml +openapi_spec_hash: b63dfc0fdfe7186e439f90bafcbc63ec config_hash: 04c3e87def66bed3001640fca84ff9c5 From 14405f2bedda7cd56ca956ef4a6d4c385c2483e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 23:21:06 +0000 Subject: [PATCH 362/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5c75a21f36..a2934489f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e78b4bc647262d0774f4c7de0dc25d1f56b904a9fb3adac57efde3c810da45ed.yml -openapi_spec_hash: b63dfc0fdfe7186e439f90bafcbc63ec +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c42b672d810255d0f53e57f64594a7d413dc6c0b433103687a1726c087b2ae3.yml +openapi_spec_hash: 5e4c9712e90d0fb17f8ad5730f7a3b09 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 44c098454f9d1387d43e8a6ee5a726726b9a9731 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 06:12:36 +0000 Subject: [PATCH 363/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a2934489f9..1342501438 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9c42b672d810255d0f53e57f64594a7d413dc6c0b433103687a1726c087b2ae3.yml -openapi_spec_hash: 5e4c9712e90d0fb17f8ad5730f7a3b09 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-84ac1448434e1aa8f7c29fe29fc769790eeaf212ae4e90e3a42436f75ebf5fff.yml +openapi_spec_hash: def17e04f31be977a0d395f8ba727434 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 4f0be2308634bcf8e1f88d71e9ecf3e5c2d13e01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 06:24:01 +0000 Subject: [PATCH 364/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1342501438..a660448575 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-84ac1448434e1aa8f7c29fe29fc769790eeaf212ae4e90e3a42436f75ebf5fff.yml -openapi_spec_hash: def17e04f31be977a0d395f8ba727434 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9cabdcbfde47affe28e5b346e22a8b2d468a6a17c30a86a33c15e18c08a1367e.yml +openapi_spec_hash: 3e179602de47ab63cde2acda49ce91c5 config_hash: 04c3e87def66bed3001640fca84ff9c5 From ee5db3920423de5af9c2d222d49a6ef21179999d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 11:17:02 +0000 Subject: [PATCH 365/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a660448575..67a415c3a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9cabdcbfde47affe28e5b346e22a8b2d468a6a17c30a86a33c15e18c08a1367e.yml -openapi_spec_hash: 3e179602de47ab63cde2acda49ce91c5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c332037b2e3a81eddd5e4a3679c6fed381e622f670e29ba8c253b3025ffcada.yml +openapi_spec_hash: abf5539486b185e473486e76aaa77f1d config_hash: 04c3e87def66bed3001640fca84ff9c5 From 7d842babdf5ef180edf499fcb9691dc0f871b55c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 11:29:06 +0000 Subject: [PATCH 366/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/dns/zone-transfers/force-axfr.ts | 2 +- src/resources/dns/zone-transfers/outgoing/outgoing.ts | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 67a415c3a8..767a982bfd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c332037b2e3a81eddd5e4a3679c6fed381e622f670e29ba8c253b3025ffcada.yml -openapi_spec_hash: abf5539486b185e473486e76aaa77f1d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e5b26e5cf334f361471217b18dff786f8e79e4b5d43184666a390bfc3869021.yml +openapi_spec_hash: 32d560f182d8fb9c03f555971a0775da config_hash: 04c3e87def66bed3001640fca84ff9c5 diff --git a/src/resources/dns/zone-transfers/force-axfr.ts b/src/resources/dns/zone-transfers/force-axfr.ts index bd521a4a0a..32234249f2 100644 --- a/src/resources/dns/zone-transfers/force-axfr.ts +++ b/src/resources/dns/zone-transfers/force-axfr.ts @@ -28,7 +28,7 @@ export class ForceAXFRResource extends APIResource { } /** - * When force_axfr query parameter is set to true, the response is a simple string + * When force_axfr query parameter is set to true, the response is a simple string. */ export type ForceAXFR = string; diff --git a/src/resources/dns/zone-transfers/outgoing/outgoing.ts b/src/resources/dns/zone-transfers/outgoing/outgoing.ts index 1b70efd330..af3129b4d8 100644 --- a/src/resources/dns/zone-transfers/outgoing/outgoing.ts +++ b/src/resources/dns/zone-transfers/outgoing/outgoing.ts @@ -179,12 +179,12 @@ export class OutgoingResource extends APIResource { } /** - * The zone transfer status of a primary zone + * The zone transfer status of a primary zone. */ export type DisableTransfer = string; /** - * The zone transfer status of a primary zone + * The zone transfer status of a primary zone. */ export type EnableTransfer = string; @@ -223,7 +223,7 @@ export interface Outgoing { } /** - * The zone transfer status of a primary zone + * The zone transfer status of a primary zone. */ export type OutgoingStatus = string | null; @@ -301,7 +301,7 @@ export interface OutgoingDeleteResponse { /** * When force_notify query parameter is set to true, the response is a simple - * string + * string. */ export type OutgoingForceNotifyResponse = string; From f3c034be383ed919d518d58a8056dae4c32df3b1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:07:21 +0000 Subject: [PATCH 367/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 767a982bfd..4a92c5d3c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5e5b26e5cf334f361471217b18dff786f8e79e4b5d43184666a390bfc3869021.yml -openapi_spec_hash: 32d560f182d8fb9c03f555971a0775da +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f27e2315b599b5384a98e008c755645dd6da83de4a3bfb1c339bfef398c8c4e8.yml +openapi_spec_hash: f2f1e85a9e91db5a569fe1984bd7a2eb config_hash: 04c3e87def66bed3001640fca84ff9c5 From dfd013de839f2daf7fb80b56089ccb3aa97b7ed9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:19:27 +0000 Subject: [PATCH 368/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4a92c5d3c1..b23ad541b4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f27e2315b599b5384a98e008c755645dd6da83de4a3bfb1c339bfef398c8c4e8.yml -openapi_spec_hash: f2f1e85a9e91db5a569fe1984bd7a2eb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-32bc949445e533ae61b8912df7fb03c73b3ad27cc4a63fd6e3a21ccd88699bae.yml +openapi_spec_hash: 9476bf4244f89c1c69c65a4f32f5b67c config_hash: 04c3e87def66bed3001640fca84ff9c5 From 4f140855062de9623333bafc2bd824bc3d9e04e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 13:31:28 +0000 Subject: [PATCH 369/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b23ad541b4..d27ecd6fda 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-32bc949445e533ae61b8912df7fb03c73b3ad27cc4a63fd6e3a21ccd88699bae.yml -openapi_spec_hash: 9476bf4244f89c1c69c65a4f32f5b67c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-beffc995921b667ba25f0a43d72e1fd3d63353f38ce940bd871374a02c6ff3c4.yml +openapi_spec_hash: dd5e5bb12a7fb6918628f8ae6aaa7095 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 855647211ba0999c962727142b4118af9cff0294 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 14:06:42 +0000 Subject: [PATCH 370/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d27ecd6fda..740b389c9c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-beffc995921b667ba25f0a43d72e1fd3d63353f38ce940bd871374a02c6ff3c4.yml -openapi_spec_hash: dd5e5bb12a7fb6918628f8ae6aaa7095 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04b4dbda89df6bee81c7e2dbb83fe3b82e5a06d8f5d6c88dc0e5ca91e81fe7b6.yml +openapi_spec_hash: 61a00ddb0dd600d4e2b6258cc2da1517 config_hash: 04c3e87def66bed3001640fca84ff9c5 From faca212882af72073b7e5ff9dd474d6ed181013e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 14:09:48 +0000 Subject: [PATCH 371/423] feat(api): api update --- .stats.yml | 4 +- src/resources/dns/records.ts | 100 +++++++++++++++++------------------ 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/.stats.yml b/.stats.yml index 740b389c9c..04d4015d8e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-04b4dbda89df6bee81c7e2dbb83fe3b82e5a06d8f5d6c88dc0e5ca91e81fe7b6.yml -openapi_spec_hash: 61a00ddb0dd600d4e2b6258cc2da1517 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-67567350789775e1a836ca8c4ec5c9a53fa4f323317bd70350e07a1112d5ada5.yml +openapi_spec_hash: 5dfd94e9f9564db9e16524beebb3fc2d config_hash: 04c3e87def66bed3001640fca84ff9c5 diff --git a/src/resources/dns/records.ts b/src/resources/dns/records.ts index ec1bbbf851..e430b9af32 100644 --- a/src/resources/dns/records.ts +++ b/src/resources/dns/records.ts @@ -2498,17 +2498,17 @@ export namespace HTTPSRecord { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -2587,17 +2587,17 @@ export namespace HTTPSRecordParam { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -4957,17 +4957,17 @@ export namespace SSHFPRecord { */ export interface Data { /** - * algorithm. + * Algorithm. */ algorithm?: number; /** - * fingerprint. + * Fingerprint. */ fingerprint?: string; /** - * type. + * Type. */ type?: number; } @@ -5046,17 +5046,17 @@ export namespace SSHFPRecordParam { */ export interface Data { /** - * algorithm. + * Algorithm. */ algorithm?: number; /** - * fingerprint. + * Fingerprint. */ fingerprint?: string; /** - * type. + * Type. */ type?: number; } @@ -5140,17 +5140,17 @@ export namespace SVCBRecord { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -5229,17 +5229,17 @@ export namespace SVCBRecordParam { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -5323,7 +5323,7 @@ export namespace TLSARecord { */ export interface Data { /** - * certificate. + * Certificate. */ certificate?: string; @@ -5417,7 +5417,7 @@ export namespace TLSARecordParam { */ export interface Data { /** - * certificate. + * Certificate. */ certificate?: string; @@ -6949,17 +6949,17 @@ export declare namespace RecordCreateParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -7495,17 +7495,17 @@ export declare namespace RecordCreateParams { */ export interface Data { /** - * algorithm. + * Algorithm. */ algorithm?: number; /** - * fingerprint. + * Fingerprint. */ fingerprint?: string; /** - * type. + * Type. */ type?: number; } @@ -7590,17 +7590,17 @@ export declare namespace RecordCreateParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -7685,7 +7685,7 @@ export declare namespace RecordCreateParams { */ export interface Data { /** - * certificate. + * Certificate. */ certificate?: string; @@ -8921,17 +8921,17 @@ export declare namespace RecordUpdateParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -9467,17 +9467,17 @@ export declare namespace RecordUpdateParams { */ export interface Data { /** - * algorithm. + * Algorithm. */ algorithm?: number; /** - * fingerprint. + * Fingerprint. */ fingerprint?: string; /** - * type. + * Type. */ type?: number; } @@ -9562,17 +9562,17 @@ export declare namespace RecordUpdateParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -9657,7 +9657,7 @@ export declare namespace RecordUpdateParams { */ export interface Data { /** - * certificate. + * Certificate. */ certificate?: string; @@ -11242,17 +11242,17 @@ export declare namespace RecordEditParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -11788,17 +11788,17 @@ export declare namespace RecordEditParams { */ export interface Data { /** - * algorithm. + * Algorithm. */ algorithm?: number; /** - * fingerprint. + * Fingerprint. */ fingerprint?: string; /** - * type. + * Type. */ type?: number; } @@ -11883,17 +11883,17 @@ export declare namespace RecordEditParams { */ export interface Data { /** - * priority. + * Priority. */ priority?: number; /** - * target. + * Target. */ target?: string; /** - * value. + * Value. */ value?: string; } @@ -11978,7 +11978,7 @@ export declare namespace RecordEditParams { */ export interface Data { /** - * certificate. + * Certificate. */ certificate?: string; From e1040df40477696b625969041b8da3f01753b9ce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 14:21:11 +0000 Subject: [PATCH 372/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 04d4015d8e..36c4c7eae0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-67567350789775e1a836ca8c4ec5c9a53fa4f323317bd70350e07a1112d5ada5.yml -openapi_spec_hash: 5dfd94e9f9564db9e16524beebb3fc2d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-12c7ef1b80d689839fef017bc6e9527136d95490b7fbb169a7c8243c2be688f6.yml +openapi_spec_hash: 5a7818b9dd6cc7d2e000e6877046408c config_hash: 04c3e87def66bed3001640fca84ff9c5 From 051c4bb0f4a4c07bc1bffba01fd12ead9c97be1f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:00:21 +0000 Subject: [PATCH 373/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 36c4c7eae0..34ebfdd596 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-12c7ef1b80d689839fef017bc6e9527136d95490b7fbb169a7c8243c2be688f6.yml -openapi_spec_hash: 5a7818b9dd6cc7d2e000e6877046408c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-309a2f8b7e10a2f4d3cfe42d7ed8e4ef02f5081bae592d0df8d8f623a2d01bf3.yml +openapi_spec_hash: 5d7b7f6f4c0cbc4d4f44bba16a9db6cd config_hash: 04c3e87def66bed3001640fca84ff9c5 From 46cff9f7b4bc6ac78ada94700e21abb077fc93c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:40:30 +0000 Subject: [PATCH 374/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 34ebfdd596..0223afb971 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-309a2f8b7e10a2f4d3cfe42d7ed8e4ef02f5081bae592d0df8d8f623a2d01bf3.yml -openapi_spec_hash: 5d7b7f6f4c0cbc4d4f44bba16a9db6cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c6d30b7a866fd32c0b27180e6e9b9f8a13470fe21d79219202e3a276bc661e2.yml +openapi_spec_hash: 5af32e7087f544ec004b8d45420e43a4 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 0abe2f1b714fa07c99a0d36b8bcdf39825ca0f60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 15:53:09 +0000 Subject: [PATCH 375/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0223afb971..7632a2c28f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c6d30b7a866fd32c0b27180e6e9b9f8a13470fe21d79219202e3a276bc661e2.yml -openapi_spec_hash: 5af32e7087f544ec004b8d45420e43a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c39530790744067bb5d09fefab0e414d18697fce2690c2f52da298f08e7bcca.yml +openapi_spec_hash: 39d4197e09118db78aeed346881c8b2a config_hash: 04c3e87def66bed3001640fca84ff9c5 From 5fd3a206bf79b846b74e13e29fbb63057d5ea7e0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 16:43:35 +0000 Subject: [PATCH 376/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7632a2c28f..222228b5e3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c39530790744067bb5d09fefab0e414d18697fce2690c2f52da298f08e7bcca.yml -openapi_spec_hash: 39d4197e09118db78aeed346881c8b2a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0574073001b6b428f7386fc9ca44fabe62c8bc5a847d95562ee2323f3c9b6a67.yml +openapi_spec_hash: ad1967eeef8dbedb206fb08af6dc4d27 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 4be38e2662887960f68260b06d137399119a1137 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 17:46:52 +0000 Subject: [PATCH 377/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 222228b5e3..0c5dedacf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-0574073001b6b428f7386fc9ca44fabe62c8bc5a847d95562ee2323f3c9b6a67.yml -openapi_spec_hash: ad1967eeef8dbedb206fb08af6dc4d27 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-06d843e2fcca63d37e478baf278ee9742ee1bf2e7437a90d3c0012c22bd33d40.yml +openapi_spec_hash: 573db89684c93d64e4535ae82c9cfa6f config_hash: 04c3e87def66bed3001640fca84ff9c5 From 8e313d66854ac6c476b20abd364d0b3a8308ed49 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 18:04:13 +0000 Subject: [PATCH 378/423] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae6a0..0b28f6ea23 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From b36f332f928f34398c6aea081d36d78da3925968 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 18:52:21 +0000 Subject: [PATCH 379/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0c5dedacf9..0223afb971 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-06d843e2fcca63d37e478baf278ee9742ee1bf2e7437a90d3c0012c22bd33d40.yml -openapi_spec_hash: 573db89684c93d64e4535ae82c9cfa6f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c6d30b7a866fd32c0b27180e6e9b9f8a13470fe21d79219202e3a276bc661e2.yml +openapi_spec_hash: 5af32e7087f544ec004b8d45420e43a4 config_hash: 04c3e87def66bed3001640fca84ff9c5 From a1dd871a9c29f2a2a04bbbe0da2a372f3bcb19e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:13:21 +0000 Subject: [PATCH 380/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0223afb971..19f74e3ae8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7c6d30b7a866fd32c0b27180e6e9b9f8a13470fe21d79219202e3a276bc661e2.yml -openapi_spec_hash: 5af32e7087f544ec004b8d45420e43a4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3cd5b89ef5cff45c65d141c96dfe065299281e626eae2cc6a046172a40144c55.yml +openapi_spec_hash: 04eb2655bb014790ad44b0af8ed3445a config_hash: 04c3e87def66bed3001640fca84ff9c5 From 4630ec749686786279ef04041197b7d1e0acd729 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:25:39 +0000 Subject: [PATCH 381/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 19f74e3ae8..1ff04f5c0b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3cd5b89ef5cff45c65d141c96dfe065299281e626eae2cc6a046172a40144c55.yml -openapi_spec_hash: 04eb2655bb014790ad44b0af8ed3445a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c56ab457f4ea2aab2ad3b66f82c677c8196d5ad1e7fb4874579b9d7b2355a26c.yml +openapi_spec_hash: 7cf4fecd0d141df5ab7d1e3d98c1a407 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 455b40fbda3008fe61cfa605b6fb5fbfee50f9e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 19:30:46 +0000 Subject: [PATCH 382/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/ai-gateway/ai-gateway.ts | 15 +++++++++++++++ src/resources/ai-gateway/logs.ts | 14 ++++++++++---- tests/api-resources/ai-gateway/ai-gateway.test.ts | 1 + 4 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1ff04f5c0b..a37377bbc1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-c56ab457f4ea2aab2ad3b66f82c677c8196d5ad1e7fb4874579b9d7b2355a26c.yml -openapi_spec_hash: 7cf4fecd0d141df5ab7d1e3d98c1a407 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-88044265dcef2c68ec26e486f2a6eb3b846e85b338387f3d623f1e5c5ccee8d2.yml +openapi_spec_hash: 65aa487039344e9b4f8a2e3ef908f93c config_hash: 04c3e87def66bed3001640fca84ff9c5 diff --git a/src/resources/ai-gateway/ai-gateway.ts b/src/resources/ai-gateway/ai-gateway.ts index ca019da35e..c619ead6b7 100644 --- a/src/resources/ai-gateway/ai-gateway.ts +++ b/src/resources/ai-gateway/ai-gateway.ts @@ -240,6 +240,8 @@ export interface AIGatewayCreateResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayUpdateResponse { @@ -279,6 +281,8 @@ export interface AIGatewayUpdateResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayListResponse { @@ -318,6 +322,8 @@ export interface AIGatewayListResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayDeleteResponse { @@ -357,6 +363,8 @@ export interface AIGatewayDeleteResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayGetResponse { @@ -396,6 +404,8 @@ export interface AIGatewayGetResponse { logpush?: boolean; logpush_public_key?: string | null; + + store_id?: string | null; } export interface AIGatewayCreateParams { @@ -525,6 +535,11 @@ export interface AIGatewayUpdateParams { * Body param: */ logpush_public_key?: string | null; + + /** + * Body param: + */ + store_id?: string | null; } export interface AIGatewayListParams extends V4PagePaginationArrayParams { diff --git a/src/resources/ai-gateway/logs.ts b/src/resources/ai-gateway/logs.ts index 4142a8ce6e..f2df3ca255 100644 --- a/src/resources/ai-gateway/logs.ts +++ b/src/resources/ai-gateway/logs.ts @@ -408,6 +408,7 @@ export namespace LogListParams { | 'created_at' | 'request_content_type' | 'response_content_type' + | 'request_type' | 'success' | 'cached' | 'provider' @@ -420,11 +421,13 @@ export namespace LogListParams { | 'duration' | 'feedback' | 'event_id' - | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id'; + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; @@ -477,6 +480,7 @@ export namespace LogDeleteParams { | 'created_at' | 'request_content_type' | 'response_content_type' + | 'request_type' | 'success' | 'cached' | 'provider' @@ -489,11 +493,13 @@ export namespace LogDeleteParams { | 'duration' | 'feedback' | 'event_id' - | 'request_type' | 'metadata.key' | 'metadata.value' | 'prompts.prompt_id' - | 'prompts.version_id'; + | 'prompts.version_id' + | 'authentication' + | 'wholesale' + | 'compatibilityMode'; operator: 'eq' | 'neq' | 'contains' | 'lt' | 'gt'; diff --git a/tests/api-resources/ai-gateway/ai-gateway.test.ts b/tests/api-resources/ai-gateway/ai-gateway.test.ts index fdb863542c..2b8f9cbe5c 100644 --- a/tests/api-resources/ai-gateway/ai-gateway.test.ts +++ b/tests/api-resources/ai-gateway/ai-gateway.test.ts @@ -81,6 +81,7 @@ describe('resource aiGateway', () => { log_management_strategy: 'STOP_INSERTING', logpush: true, logpush_public_key: 'xxxxxxxxxxxxxxxx', + store_id: 'store_id', }); }); From e85bdcbbdf089818a13244cfc418ded868fda765 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 20:13:11 +0000 Subject: [PATCH 383/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a37377bbc1..2479e4518f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-88044265dcef2c68ec26e486f2a6eb3b846e85b338387f3d623f1e5c5ccee8d2.yml -openapi_spec_hash: 65aa487039344e9b4f8a2e3ef908f93c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee54b4b7573b8d72a1cc5ea3c2218d6ba68af5e7ac3fb54d392398bd3538e5b8.yml +openapi_spec_hash: d7c0384dce142ed1938f9f00c20231bb config_hash: 04c3e87def66bed3001640fca84ff9c5 From 9126b3de9ce5f46c63d04ebb2effaf7fd0b54d15 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 20:28:07 +0000 Subject: [PATCH 384/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2479e4518f..1db74f5b8f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee54b4b7573b8d72a1cc5ea3c2218d6ba68af5e7ac3fb54d392398bd3538e5b8.yml -openapi_spec_hash: d7c0384dce142ed1938f9f00c20231bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c5e1e39cb8f415b434514a657cd1d7ff550ec03b2ee0530ce7238c7a14a7f65.yml +openapi_spec_hash: 2ae4896f918cf402bde602672930ef39 config_hash: 04c3e87def66bed3001640fca84ff9c5 From fdb3eea95a69997f100d559f6b7221f87081603a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 20:31:07 +0000 Subject: [PATCH 385/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1db74f5b8f..ae411be76c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1c5e1e39cb8f415b434514a657cd1d7ff550ec03b2ee0530ce7238c7a14a7f65.yml -openapi_spec_hash: 2ae4896f918cf402bde602672930ef39 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b8e1dbaaf6d219cc93cf890a1c5eee22464d53994c0135af2bd575ec04f4633.yml +openapi_spec_hash: 7f912d56bd17a6197f37cad70250bef6 config_hash: 04c3e87def66bed3001640fca84ff9c5 From 5f2237bc35fb24a7c300d50f1fde80e019427934 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 21:15:28 +0000 Subject: [PATCH 386/423] chore(api): upload stainless config from cloudflare-config --- .stats.yml | 4 +- src/resources/rules/lists/items.ts | 234 ++++++++++++++++++++++++++++- 2 files changed, 234 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae411be76c..0be12995a5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-5b8e1dbaaf6d219cc93cf890a1c5eee22464d53994c0135af2bd575ec04f4633.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f61590aa8911086b5c879a035656860c8ea7919bc350836130d9ed1d94cb7a8.yml openapi_spec_hash: 7f912d56bd17a6197f37cad70250bef6 -config_hash: 04c3e87def66bed3001640fca84ff9c5 +config_hash: 79f17109e02e2ed32ead147f166f5879 diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index 9ace9d4bac..c8676b4b14 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -181,7 +181,122 @@ export interface ItemUpdateResponse { operation_id: string; } -export type ItemListResponse = unknown; +export type ItemListResponse = + | ItemListResponse.ListsListItemIPFull + | ItemListResponse.ListsListItemHostnameFull + | ItemListResponse.ListsListItemRedirectFull + | ItemListResponse.ListsListItemASNFull; + +export namespace ItemListResponse { + export interface ListsListItemIPFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemHostnameFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + * 0 to 9, wildcards (\*), and the hyphen (-). + */ + hostname: ListsAPI.Hostname; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemRedirectFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * The definition of the redirect. + */ + redirect: ListsAPI.Redirect; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemASNFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * Defines a non-negative 32 bit integer. + */ + asn: number; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } +} export interface ItemDeleteResponse { /** @@ -190,7 +305,122 @@ export interface ItemDeleteResponse { operation_id: string; } -export type ItemGetResponse = unknown; +export type ItemGetResponse = + | ItemGetResponse.ListsListItemIPFull + | ItemGetResponse.ListsListItemHostnameFull + | ItemGetResponse.ListsListItemRedirectFull + | ItemGetResponse.ListsListItemASNFull; + +export namespace ItemGetResponse { + export interface ListsListItemIPFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * An IPv4 address, an IPv4 CIDR, an IPv6 address, or an IPv6 CIDR. + */ + ip: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemHostnameFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * Valid characters for hostnames are ASCII(7) letters from a to z, the digits from + * 0 to 9, wildcards (\*), and the hyphen (-). + */ + hostname: ListsAPI.Hostname; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemRedirectFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * The definition of the redirect. + */ + redirect: ListsAPI.Redirect; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } + + export interface ListsListItemASNFull { + /** + * The unique ID of the list. + */ + id: string; + + /** + * Defines a non-negative 32 bit integer. + */ + asn: number; + + /** + * The RFC 3339 timestamp of when the list was created. + */ + created_on: string; + + /** + * The RFC 3339 timestamp of when the list was last modified. + */ + modified_on: string; + + /** + * Defines an informative summary of the list item. + */ + comment?: string; + } +} export interface ItemCreateParams { /** From 6114cd05308867542a61d94158c70ad28deb7ae6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 21:29:32 +0000 Subject: [PATCH 387/423] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2049e31b03..7bce0516b5 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From c62efb36f40ddf5275df06e2bc146c44c3b631d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 22:59:13 +0000 Subject: [PATCH 388/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0be12995a5..cb4854899b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2f61590aa8911086b5c879a035656860c8ea7919bc350836130d9ed1d94cb7a8.yml -openapi_spec_hash: 7f912d56bd17a6197f37cad70250bef6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e59946253b8768ea146078107ead73b0775175480eddba54d4fa3f13822c31c2.yml +openapi_spec_hash: 67f2efb87ce3ffc66c09cf24d6607743 config_hash: 79f17109e02e2ed32ead147f166f5879 From 3272d43f13b03dbe4f2e592da55a03d079b8f5eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 23:15:47 +0000 Subject: [PATCH 389/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index cb4854899b..d66a5daf6d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e59946253b8768ea146078107ead73b0775175480eddba54d4fa3f13822c31c2.yml -openapi_spec_hash: 67f2efb87ce3ffc66c09cf24d6607743 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbd4e6c3ab4e3b96ae8957e338aa31aa10ce77274aae8f478838196fdc210203.yml +openapi_spec_hash: 835ba581ccb588c4f698ae7d476d7392 config_hash: 79f17109e02e2ed32ead147f166f5879 From 734070bea826b63104c39d28dcf4387fd7fd983d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 06:11:58 +0000 Subject: [PATCH 390/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d66a5daf6d..7f3f300abf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-bbd4e6c3ab4e3b96ae8957e338aa31aa10ce77274aae8f478838196fdc210203.yml -openapi_spec_hash: 835ba581ccb588c4f698ae7d476d7392 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9462ea63a6850cca7ee8d88315551066c25f925fbbbd087ba4360180024bcc28.yml +openapi_spec_hash: dedfb197e1a2876d72ea096e28f35be1 config_hash: 79f17109e02e2ed32ead147f166f5879 From 6a29f54d8f5ca465b4e0cadec165a78a00b74eec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 9 Aug 2025 14:07:32 +0000 Subject: [PATCH 391/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f3f300abf..fb9c4e5b3a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9462ea63a6850cca7ee8d88315551066c25f925fbbbd087ba4360180024bcc28.yml -openapi_spec_hash: dedfb197e1a2876d72ea096e28f35be1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1677943b082a90d987da00cff66d03f711576aeeab436f29364b7b8a140cf88e.yml +openapi_spec_hash: 8d98a21b7ff5915639c0a9c2b61cf0f3 config_hash: 79f17109e02e2ed32ead147f166f5879 From 683afb9dfc7f52ce6f25de5badfa313cec66cd40 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 06:13:25 +0000 Subject: [PATCH 392/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fb9c4e5b3a..ae87eaf89b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1677943b082a90d987da00cff66d03f711576aeeab436f29364b7b8a140cf88e.yml -openapi_spec_hash: 8d98a21b7ff5915639c0a9c2b61cf0f3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-273166ab6b60273f270563e012482584e19f311d74f4694711e2aa3473afc369.yml +openapi_spec_hash: 155d4f9c4f4aba89eb7aa4851eb4774f config_hash: 79f17109e02e2ed32ead147f166f5879 From 2a4f1b85b2b7ca5fcaaa80df2016f69a262c7f78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 06:10:15 +0000 Subject: [PATCH 393/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ae87eaf89b..1a08da4198 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-273166ab6b60273f270563e012482584e19f311d74f4694711e2aa3473afc369.yml -openapi_spec_hash: 155d4f9c4f4aba89eb7aa4851eb4774f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aae234ec92301ef168d6d5345dddc749641e2830e0d20ae6599cd2997693c24f.yml +openapi_spec_hash: e31c51c813229c359079d01a98c5e011 config_hash: 79f17109e02e2ed32ead147f166f5879 From d34be4a92c383f7588d9b2d441c687bb25644b35 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 07:23:12 +0000 Subject: [PATCH 394/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a08da4198..c4783438c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-aae234ec92301ef168d6d5345dddc749641e2830e0d20ae6599cd2997693c24f.yml -openapi_spec_hash: e31c51c813229c359079d01a98c5e011 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f85053e98144c5e0bd9b65553108f095e5d91a26cc5124b258954ab24cef1519.yml +openapi_spec_hash: ec1ac03165e3872b2313735bc7a39273 config_hash: 79f17109e02e2ed32ead147f166f5879 From cc91d6e4a897f98e41b46b20d69402e944f2e9fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:24:46 +0000 Subject: [PATCH 395/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c4783438c8..8e6a0149ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f85053e98144c5e0bd9b65553108f095e5d91a26cc5124b258954ab24cef1519.yml -openapi_spec_hash: ec1ac03165e3872b2313735bc7a39273 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f392b091b16d88e442edc2a20e5b01dbc58bcbaef4489abc2b0fd554e1a878b.yml +openapi_spec_hash: 12849acd0845e2a3fa471ea880df3197 config_hash: 79f17109e02e2ed32ead147f166f5879 From 0038e49f4484e45920aa88cd59a48e7778602946 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 08:58:16 +0000 Subject: [PATCH 396/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8e6a0149ab..b3b40b9087 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4f392b091b16d88e442edc2a20e5b01dbc58bcbaef4489abc2b0fd554e1a878b.yml -openapi_spec_hash: 12849acd0845e2a3fa471ea880df3197 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dde6d209f78bcbc379c45619d46a518a8facebca366a150505994a244cf716bc.yml +openapi_spec_hash: 1eb48e887e2539d2679d23de30814bd0 config_hash: 79f17109e02e2ed32ead147f166f5879 From a6d690d4db7578fd9397dc5f0d4c06951bafee41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:04:47 +0000 Subject: [PATCH 397/423] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b3b40b9087..a0b31a3980 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dde6d209f78bcbc379c45619d46a518a8facebca366a150505994a244cf716bc.yml openapi_spec_hash: 1eb48e887e2539d2679d23de30814bd0 -config_hash: 79f17109e02e2ed32ead147f166f5879 +config_hash: de4c81cee29cd7dd907279e8916b334f From 56ec6a4da564399857e86ee89dfa3616425cb684 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 09:51:32 +0000 Subject: [PATCH 398/423] feat(api): api update --- .stats.yml | 4 +- src/resources/custom-nameservers.ts | 2 +- src/resources/dns/dns.ts | 2 +- src/resources/zones/custom-nameservers.ts | 51 ++++++++++++++++++----- 4 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.stats.yml b/.stats.yml index a0b31a3980..757530a8f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-dde6d209f78bcbc379c45619d46a518a8facebca366a150505994a244cf716bc.yml -openapi_spec_hash: 1eb48e887e2539d2679d23de30814bd0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa228e0e5630576fb09caf637762c0fd38ba8bc29ae5dad88ba612cb391cd25c.yml +openapi_spec_hash: 29022fdca536eab9103acd0f2ea986d9 config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/custom-nameservers.ts b/src/resources/custom-nameservers.ts index 9e8ba96e78..8542a87c22 100644 --- a/src/resources/custom-nameservers.ts +++ b/src/resources/custom-nameservers.ts @@ -102,7 +102,7 @@ export interface CustomNameserver { status: 'moved' | 'pending' | 'verified'; /** - * Identifier + * Identifier. */ zone_tag: string; diff --git a/src/resources/dns/dns.ts b/src/resources/dns/dns.ts index 49d6d2b48e..14dfa81f31 100644 --- a/src/resources/dns/dns.ts +++ b/src/resources/dns/dns.ts @@ -74,7 +74,7 @@ export class DNS extends APIResource { /** * Nominal metric values, broken down by time interval. */ -export type DNSAnalyticsNominalMetric = Array; +export type DNSAnalyticsNominalMetric = Array; export interface DNSAnalyticsQuery { /** diff --git a/src/resources/zones/custom-nameservers.ts b/src/resources/zones/custom-nameservers.ts index a24f5a3e4a..d5374a1553 100644 --- a/src/resources/zones/custom-nameservers.ts +++ b/src/resources/zones/custom-nameservers.ts @@ -2,7 +2,6 @@ import { APIResource } from '../../resource'; import * as Core from '../../core'; -import * as Shared from '../shared'; import { SinglePage } from '../../pagination'; /** @@ -58,12 +57,12 @@ export class CustomNameserverUpdateResponsesSinglePage extends SinglePage; + errors: Array; - messages: Array; + messages: Array; /** - * Whether the API call was successful + * Whether the API call was successful. */ success: true; @@ -81,24 +80,56 @@ export interface CustomNameserverGetResponse { } export namespace CustomNameserverGetResponse { + 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; } @@ -106,7 +137,7 @@ export namespace CustomNameserverGetResponse { export interface CustomNameserverUpdateParams { /** - * Path param: Identifier + * Path param: Identifier. */ zone_id: string; @@ -123,7 +154,7 @@ export interface CustomNameserverUpdateParams { export interface CustomNameserverGetParams { /** - * Identifier + * Identifier. */ zone_id: string; } From 95e089d607f8eb8f24a447bdbdcfcc89ff45525e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:03:18 +0000 Subject: [PATCH 399/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 757530a8f8..c5178da589 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fa228e0e5630576fb09caf637762c0fd38ba8bc29ae5dad88ba612cb391cd25c.yml -openapi_spec_hash: 29022fdca536eab9103acd0f2ea986d9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fde5d91d3e24873d38fc142b636e11c721fe619e4272560cba04c37807aaa9b3.yml +openapi_spec_hash: 267c42563fdd103f56408776986141a9 config_hash: de4c81cee29cd7dd907279e8916b334f From a447abcb898e898829f27a356f7e41433e530b91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:17:11 +0000 Subject: [PATCH 400/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index c5178da589..887d24ccfe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-fde5d91d3e24873d38fc142b636e11c721fe619e4272560cba04c37807aaa9b3.yml -openapi_spec_hash: 267c42563fdd103f56408776986141a9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f7681635d53a6621672260d7c100544abb5ac1765e79a1050125ede065ddc3ce.yml +openapi_spec_hash: a9bf548865fe679f0fd5946d8ac43dc3 config_hash: de4c81cee29cd7dd907279e8916b334f From 8339d1bf24de714a26fe110b2cd254f15bf43d5a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:20:46 +0000 Subject: [PATCH 401/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/shared.ts | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 887d24ccfe..8789e979d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-f7681635d53a6621672260d7c100544abb5ac1765e79a1050125ede065ddc3ce.yml -openapi_spec_hash: a9bf548865fe679f0fd5946d8ac43dc3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b80363dff8a9093d4f64908a5266d96097c56e8b786850513ad10807e3f61441.yml +openapi_spec_hash: 03f0955df4a358d12749e4d530a17fa6 config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/shared.ts b/src/resources/shared.ts index 7f91d0aad0..22daf55aff 100644 --- a/src/resources/shared.ts +++ b/src/resources/shared.ts @@ -140,6 +140,13 @@ export interface CloudflareTunnel { */ account_tag?: string; + /** + * Indicates if this is a locally or remotely configured tunnel. If `local`, manage + * the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the + * tunnel on the Zero Trust dashboard. + */ + config_src?: 'local' | 'cloudflare'; + /** * @deprecated This field will start returning an empty array. To fetch the * connections of a given tunnel, please use the dedicated endpoint @@ -181,8 +188,7 @@ export interface CloudflareTunnel { name?: string; /** - * If `true`, the tunnel can be configured remotely from the Zero Trust dashboard. - * If `false`, the tunnel must be configured locally on the origin machine. + * @deprecated Use the config_src field instead. */ remote_config?: boolean; From f0030b337302508ecd45c06d9d217b46fd2a6353 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:32:34 +0000 Subject: [PATCH 402/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8789e979d1..242bc3a220 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b80363dff8a9093d4f64908a5266d96097c56e8b786850513ad10807e3f61441.yml -openapi_spec_hash: 03f0955df4a358d12749e4d530a17fa6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-81df1c653d6fdb36f28d1665004d5afd6c66fc178efc96b7ae78ba47cb00cb83.yml +openapi_spec_hash: 3f8505ae3ef693cb296eb0fa22d752c2 config_hash: de4c81cee29cd7dd907279e8916b334f From c7861c10cbd2b0790c6706ae2e2dc74e2e3b16dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 11:34:59 +0000 Subject: [PATCH 403/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 242bc3a220..298474e31d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-81df1c653d6fdb36f28d1665004d5afd6c66fc178efc96b7ae78ba47cb00cb83.yml -openapi_spec_hash: 3f8505ae3ef693cb296eb0fa22d752c2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864310c70a4007164530114216bd8179d9cce8c40cffd25035616a585cd02498.yml +openapi_spec_hash: 457082b59b9d9cc8586a3a4c1a1ff518 config_hash: de4c81cee29cd7dd907279e8916b334f From 95451dc94db0212b7328125ff6887d4829b37702 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 12:45:16 +0000 Subject: [PATCH 404/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 298474e31d..8b7592fdca 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864310c70a4007164530114216bd8179d9cce8c40cffd25035616a585cd02498.yml -openapi_spec_hash: 457082b59b9d9cc8586a3a4c1a1ff518 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8119c3d4e0b5591fed49657daed794c86d5317c404d11e1b6521f40a03ad5d26.yml +openapi_spec_hash: 27dc26758c4412e20e59c7ec1c02a5b2 config_hash: de4c81cee29cd7dd907279e8916b334f From 743b5f558fdd27da9eff739692ec041682875b07 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 12:49:36 +0000 Subject: [PATCH 405/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8b7592fdca..e3479e4364 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8119c3d4e0b5591fed49657daed794c86d5317c404d11e1b6521f40a03ad5d26.yml -openapi_spec_hash: 27dc26758c4412e20e59c7ec1c02a5b2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d72df5859ba836b51fee61afdf47a2ec1aa9cbdd801ccbe8f66a0cc7c275ed4e.yml +openapi_spec_hash: 6944cc97e5a76621639ffb2ef39635c3 config_hash: de4c81cee29cd7dd907279e8916b334f From 72ffaff1162e3eaebf00b2807ec498a460f5a279 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:03:47 +0000 Subject: [PATCH 406/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e3479e4364..298474e31d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d72df5859ba836b51fee61afdf47a2ec1aa9cbdd801ccbe8f66a0cc7c275ed4e.yml -openapi_spec_hash: 6944cc97e5a76621639ffb2ef39635c3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864310c70a4007164530114216bd8179d9cce8c40cffd25035616a585cd02498.yml +openapi_spec_hash: 457082b59b9d9cc8586a3a4c1a1ff518 config_hash: de4c81cee29cd7dd907279e8916b334f From 37a3b3cf1a25d0ca008c95a37c9353e3b2cf8a68 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:28:13 +0000 Subject: [PATCH 407/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 298474e31d..e1acf034b0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-864310c70a4007164530114216bd8179d9cce8c40cffd25035616a585cd02498.yml -openapi_spec_hash: 457082b59b9d9cc8586a3a4c1a1ff518 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-413c9fb5525b7770ec2d427f387949f81698c849808d1d6496be71ba23b9b8b2.yml +openapi_spec_hash: b7a0adea4c64c0a4c533c78599a2b3ae config_hash: de4c81cee29cd7dd907279e8916b334f From c17599a797bc127d1c85604a97827f68e16c9062 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:56:17 +0000 Subject: [PATCH 408/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e1acf034b0..b4bef27635 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-413c9fb5525b7770ec2d427f387949f81698c849808d1d6496be71ba23b9b8b2.yml -openapi_spec_hash: b7a0adea4c64c0a4c533c78599a2b3ae +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c2e871becd640b83c98fc108ae708c7fda15e341562b0f41668c7c720a98cae.yml +openapi_spec_hash: 3ac10225ed5294cad1552bf6a37e27f5 config_hash: de4c81cee29cd7dd907279e8916b334f From b18bdd6b63fae58aebdddf28a6348ed96ac4f646 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:05:15 +0000 Subject: [PATCH 409/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b4bef27635..50dbc3fc7f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4c2e871becd640b83c98fc108ae708c7fda15e341562b0f41668c7c720a98cae.yml -openapi_spec_hash: 3ac10225ed5294cad1552bf6a37e27f5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8b0fe2a9e2d510c9fcee8b00c382443543ad5981140eef844907fe126a052c53.yml +openapi_spec_hash: 989ffcf8def4fd5ded2b3ec2fcef9926 config_hash: de4c81cee29cd7dd907279e8916b334f From ae171cf867fe29a3cab0ecc0ccfc36779f5c790e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:10:16 +0000 Subject: [PATCH 410/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 50dbc3fc7f..e4ccfea217 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8b0fe2a9e2d510c9fcee8b00c382443543ad5981140eef844907fe126a052c53.yml -openapi_spec_hash: 989ffcf8def4fd5ded2b3ec2fcef9926 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d7b8c4de22d879facad480d97fd2183979a70d61db0f9ab48fc70facdd01151.yml +openapi_spec_hash: 3ec2c9f071523d5655cb95940027ea29 config_hash: de4c81cee29cd7dd907279e8916b334f From 6fbca7c42fe5cf50434c38f71e3f9167df445a97 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:15:18 +0000 Subject: [PATCH 411/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e4ccfea217..1a5c6b8ad7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6d7b8c4de22d879facad480d97fd2183979a70d61db0f9ab48fc70facdd01151.yml -openapi_spec_hash: 3ec2c9f071523d5655cb95940027ea29 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-65a0dd0f95b1ff742d46659a964859b5e6731e477acc0be891d3b21368db0468.yml +openapi_spec_hash: ba0dbcb18e51e7e3a43d692320b9aa5c config_hash: de4c81cee29cd7dd907279e8916b334f From 0dc2eabb020c4aa2206f76617b3de6e802102006 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:28:16 +0000 Subject: [PATCH 412/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1a5c6b8ad7..7657d24371 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-65a0dd0f95b1ff742d46659a964859b5e6731e477acc0be891d3b21368db0468.yml -openapi_spec_hash: ba0dbcb18e51e7e3a43d692320b9aa5c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-36ec321a3ab00ff8ab89836e2e365a0647c8e76574964c789e76a6e56debd57c.yml +openapi_spec_hash: 198fc4ec9c482cd80db331e4434e2a07 config_hash: de4c81cee29cd7dd907279e8916b334f From 2a1253fab1777ebc7aa639443544b6e440e08c12 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:50:24 +0000 Subject: [PATCH 413/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7657d24371..9d6397fe1e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-36ec321a3ab00ff8ab89836e2e365a0647c8e76574964c789e76a6e56debd57c.yml -openapi_spec_hash: 198fc4ec9c482cd80db331e4434e2a07 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de6f14467169605ca0279cc303e66c1704eafe0328a15a8c109be6d8f2e767cb.yml +openapi_spec_hash: 34dc001668d442bb4d55b38ec2828493 config_hash: de4c81cee29cd7dd907279e8916b334f From 42036736b0a7326015f3eb37073afda70d3b278c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:02:42 +0000 Subject: [PATCH 414/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/rules/lists/items.ts | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9d6397fe1e..828f647f12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-de6f14467169605ca0279cc303e66c1704eafe0328a15a8c109be6d8f2e767cb.yml -openapi_spec_hash: 34dc001668d442bb4d55b38ec2828493 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2af46353a729e62c9ea22ae849a211ed533e002d56b4f14766bf68e04b9c6336.yml +openapi_spec_hash: 16bc079d459c9276d81851af79946e46 config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/rules/lists/items.ts b/src/resources/rules/lists/items.ts index c8676b4b14..8f7000a7b2 100644 --- a/src/resources/rules/lists/items.ts +++ b/src/resources/rules/lists/items.ts @@ -190,7 +190,7 @@ export type ItemListResponse = export namespace ItemListResponse { export interface ListsListItemIPFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -217,7 +217,7 @@ export namespace ItemListResponse { export interface ListsListItemHostnameFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -245,7 +245,7 @@ export namespace ItemListResponse { export interface ListsListItemRedirectFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -272,7 +272,7 @@ export namespace ItemListResponse { export interface ListsListItemASNFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -314,7 +314,7 @@ export type ItemGetResponse = export namespace ItemGetResponse { export interface ListsListItemIPFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -341,7 +341,7 @@ export namespace ItemGetResponse { export interface ListsListItemHostnameFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -369,7 +369,7 @@ export namespace ItemGetResponse { export interface ListsListItemRedirectFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; @@ -396,7 +396,7 @@ export namespace ItemGetResponse { export interface ListsListItemASNFull { /** - * The unique ID of the list. + * Defines the unique ID of the item in the List. */ id: string; From d3cd15c3ab66bd52e0bb38dc43be3cf908b220b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:16:39 +0000 Subject: [PATCH 415/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 828f647f12..b5b9214b56 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-2af46353a729e62c9ea22ae849a211ed533e002d56b4f14766bf68e04b9c6336.yml -openapi_spec_hash: 16bc079d459c9276d81851af79946e46 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4df5ed8ddf60ddcd6a01870d3bddce00cefb42270d87ef9900e5e15e8055d0b2.yml +openapi_spec_hash: cabd4c35b0f8e0ccfa2a3d862a1df022 config_hash: de4c81cee29cd7dd907279e8916b334f From f0b514d3d7df84b8f30807a2c4519d5f723e2546 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:47:00 +0000 Subject: [PATCH 416/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b5b9214b56..ea372575e9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4df5ed8ddf60ddcd6a01870d3bddce00cefb42270d87ef9900e5e15e8055d0b2.yml -openapi_spec_hash: cabd4c35b0f8e0ccfa2a3d862a1df022 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ab374b168467e0684f371888405e1d9badb441306a835d1b05c52b29ad2d517.yml +openapi_spec_hash: d78e843560e1bc13e36437bdc41b9a02 config_hash: de4c81cee29cd7dd907279e8916b334f From e689d440c46cdf39a0a5c38c59e58d410fe10846 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 15:50:31 +0000 Subject: [PATCH 417/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index ea372575e9..9bb5dd71d3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1ab374b168467e0684f371888405e1d9badb441306a835d1b05c52b29ad2d517.yml -openapi_spec_hash: d78e843560e1bc13e36437bdc41b9a02 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-927b624ec26c57ffd94fc1e92bb60cee10c33a0a58e0c3bb44022ec7b9ddb702.yml +openapi_spec_hash: c81c5b86bb618da7eb0cfa499348fc10 config_hash: de4c81cee29cd7dd907279e8916b334f From 6c0b80efd2ed7a748beff7c1f71c7772428fca78 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:25:26 +0000 Subject: [PATCH 418/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9bb5dd71d3..611be99f89 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-927b624ec26c57ffd94fc1e92bb60cee10c33a0a58e0c3bb44022ec7b9ddb702.yml -openapi_spec_hash: c81c5b86bb618da7eb0cfa499348fc10 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee8c2cffcbe717617cb13252557a3de006816d9ed6b6aa8e054316663ef91c2b.yml +openapi_spec_hash: 64cb39b96abfd876a27e679f44bb1eef config_hash: de4c81cee29cd7dd907279e8916b334f From 5128329b279ee0936fbb18da8fe0177dcabeeb70 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:33:26 +0000 Subject: [PATCH 419/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/email-security/investigate/reclassify.ts | 7 ++++++- .../email-security/investigate/reclassify.test.ts | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 611be99f89..9ceb3f8e1a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ee8c2cffcbe717617cb13252557a3de006816d9ed6b6aa8e054316663ef91c2b.yml -openapi_spec_hash: 64cb39b96abfd876a27e679f44bb1eef +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-46ae98ac058f8748b8ce2ff270c37edc601a9980f18cebe115f7df45974e7b9e.yml +openapi_spec_hash: 48d63c6a54028125b8be56594f86f899 config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/email-security/investigate/reclassify.ts b/src/resources/email-security/investigate/reclassify.ts index 98aaabd7c1..2330f8cf94 100644 --- a/src/resources/email-security/investigate/reclassify.ts +++ b/src/resources/email-security/investigate/reclassify.ts @@ -50,7 +50,12 @@ export interface ReclassifyCreateParams { /** * Body param: Base64 encoded content of the EML file */ - eml_content?: string | null; + eml_content?: string; + + /** + * Body param: + */ + escalated_submission_id?: string; } export declare namespace Reclassify { diff --git a/tests/api-resources/email-security/investigate/reclassify.test.ts b/tests/api-resources/email-security/investigate/reclassify.test.ts index bb721e52bb..cce8ae36ef 100644 --- a/tests/api-resources/email-security/investigate/reclassify.test.ts +++ b/tests/api-resources/email-security/investigate/reclassify.test.ts @@ -29,6 +29,7 @@ describe('resource reclassify', () => { account_id: '023e105f4ecef8ad9ca31a8372d0c353', expected_disposition: 'NONE', eml_content: 'eml_content', + escalated_submission_id: 'escalated_submission_id', }); }); }); From f1abb2726ee7aa37f10dbf477f6251019d2f5a8f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:36:43 +0000 Subject: [PATCH 420/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/url-normalization.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9ceb3f8e1a..5307523528 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-46ae98ac058f8748b8ce2ff270c37edc601a9980f18cebe115f7df45974e7b9e.yml -openapi_spec_hash: 48d63c6a54028125b8be56594f86f899 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3215c3ed5946a8ca7b39032c155f200362787d90d9f4be82df9c471b379c451b.yml +openapi_spec_hash: 8ec2562cfbd4383c2767c3e16d63981c config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/url-normalization.ts b/src/resources/url-normalization.ts index 8da515294a..2392e79dd1 100644 --- a/src/resources/url-normalization.ts +++ b/src/resources/url-normalization.ts @@ -77,7 +77,7 @@ export interface URLNormalizationUpdateResponse { /** * The scope of the URL normalization. */ - scope: 'incoming' | 'both'; + scope: 'incoming' | 'both' | 'none'; /** * The type of URL normalization performed by Cloudflare. @@ -92,7 +92,7 @@ export interface URLNormalizationGetResponse { /** * The scope of the URL normalization. */ - scope: 'incoming' | 'both'; + scope: 'incoming' | 'both' | 'none'; /** * The type of URL normalization performed by Cloudflare. @@ -109,7 +109,7 @@ export interface URLNormalizationUpdateParams { /** * Body param: The scope of the URL normalization. */ - scope: 'incoming' | 'both'; + scope: 'incoming' | 'both' | 'none'; /** * Body param: The type of URL normalization performed by Cloudflare. From 707c8e8281b14ba1453d4995184f25835c1e7b48 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:48:14 +0000 Subject: [PATCH 421/423] feat(api): api update --- .stats.yml | 4 ++-- src/resources/logpush/datasets/fields.ts | 3 +++ src/resources/logpush/datasets/jobs.ts | 3 +++ src/resources/logpush/jobs.ts | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5307523528..06c5d874dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-3215c3ed5946a8ca7b39032c155f200362787d90d9f4be82df9c471b379c451b.yml -openapi_spec_hash: 8ec2562cfbd4383c2767c3e16d63981c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6c0a39af692b47198cb3cef26e8e6a328ee946222aec35a8f3e9678659c469f9.yml +openapi_spec_hash: 9b2941a1e9c3c3452a97121037b8b857 config_hash: de4c81cee29cd7dd907279e8916b334f diff --git a/src/resources/logpush/datasets/fields.ts b/src/resources/logpush/datasets/fields.ts index cf6c38a078..3ba1f069f7 100644 --- a/src/resources/logpush/datasets/fields.ts +++ b/src/resources/logpush/datasets/fields.ts @@ -22,6 +22,7 @@ export class Fields extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' @@ -52,6 +53,7 @@ export class Fields extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' @@ -81,6 +83,7 @@ export class Fields extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' diff --git a/src/resources/logpush/datasets/jobs.ts b/src/resources/logpush/datasets/jobs.ts index f8ef4ccbb0..90c7438608 100644 --- a/src/resources/logpush/datasets/jobs.ts +++ b/src/resources/logpush/datasets/jobs.ts @@ -26,6 +26,7 @@ export class Jobs extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' @@ -56,6 +57,7 @@ export class Jobs extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' @@ -85,6 +87,7 @@ export class Jobs extends APIResource { datasetId: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' diff --git a/src/resources/logpush/jobs.ts b/src/resources/logpush/jobs.ts index 9ffff8c7ea..4b6fba4fa1 100644 --- a/src/resources/logpush/jobs.ts +++ b/src/resources/logpush/jobs.ts @@ -288,6 +288,7 @@ export interface LogpushJob { dataset?: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' @@ -596,6 +597,7 @@ export interface JobCreateParams { dataset?: | 'access_requests' | 'audit_logs' + | 'audit_logs_v2' | 'biso_user_actions' | 'casb_findings' | 'device_posture_results' From c0e5331626e1b2ae5acd540b4f3aef71a33bb205 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:07:33 +0000 Subject: [PATCH 422/423] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 06c5d874dd..42f3fa44ce 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 1793 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6c0a39af692b47198cb3cef26e8e6a328ee946222aec35a8f3e9678659c469f9.yml -openapi_spec_hash: 9b2941a1e9c3c3452a97121037b8b857 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-4bbd402a61e0b42bf213df8e1360ca06dcf9c21d3a71471727023442b4402ad7.yml +openapi_spec_hash: fde4742eecb70a0ef6fb8896f7a4c2d2 config_hash: de4c81cee29cd7dd907279e8916b334f From 07abdbd5fb2cb29006ab0869d42b3f73269cbe57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 17:09:19 +0000 Subject: [PATCH 423/423] release: 4.6.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 98 +++++++++++++++++++++++++++++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 101 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7aa3d56709..fd087344cc 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.5.0" + ".": "4.6.0" } diff --git a/CHANGELOG.md b/CHANGELOG.md index cc9fa1398c..3e6c7a743d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,103 @@ # Changelog +## 4.6.0 (2025-08-11) + +Full Changelog: [v4.5.0...v4.6.0](https://github.com/cloudflare/cloudflare-typescript/compare/v4.5.0...v4.6.0) + +### Features + +* **api:** api update ([707c8e8](https://github.com/cloudflare/cloudflare-typescript/commit/707c8e8281b14ba1453d4995184f25835c1e7b48)) +* **api:** api update ([f1abb27](https://github.com/cloudflare/cloudflare-typescript/commit/f1abb2726ee7aa37f10dbf477f6251019d2f5a8f)) +* **api:** api update ([5128329](https://github.com/cloudflare/cloudflare-typescript/commit/5128329b279ee0936fbb18da8fe0177dcabeeb70)) +* **api:** api update ([4203673](https://github.com/cloudflare/cloudflare-typescript/commit/42036736b0a7326015f3eb37073afda70d3b278c)) +* **api:** api update ([8339d1b](https://github.com/cloudflare/cloudflare-typescript/commit/8339d1bf24de714a26fe110b2cd254f15bf43d5a)) +* **api:** api update ([56ec6a4](https://github.com/cloudflare/cloudflare-typescript/commit/56ec6a4da564399857e86ee89dfa3616425cb684)) +* **api:** api update ([455b40f](https://github.com/cloudflare/cloudflare-typescript/commit/455b40fbda3008fe61cfa605b6fb5fbfee50f9e1)) +* **api:** api update ([faca212](https://github.com/cloudflare/cloudflare-typescript/commit/faca212882af72073b7e5ff9dd474d6ed181013e)) +* **api:** api update ([7d842ba](https://github.com/cloudflare/cloudflare-typescript/commit/7d842babdf5ef180edf499fcb9691dc0f871b55c)) +* **api:** api update ([fef43ec](https://github.com/cloudflare/cloudflare-typescript/commit/fef43ec41c8edad0bd394a1d63a6bf974f9b1426)) +* **api:** api update ([0239b4f](https://github.com/cloudflare/cloudflare-typescript/commit/0239b4f5af23bc80f13cfab247250ea834e81de5)) +* **api:** api update ([b08950b](https://github.com/cloudflare/cloudflare-typescript/commit/b08950b360c0d5f62b2b464fefc779046e2fd95e)) +* **api:** api update ([7b8e864](https://github.com/cloudflare/cloudflare-typescript/commit/7b8e864ccd6a5113f0dc19c795c745e4276839dd)) +* **api:** api update ([67d59b8](https://github.com/cloudflare/cloudflare-typescript/commit/67d59b8e48eb61a8a6e8fc7a6d7865e435087605)) +* **api:** api update ([e75721c](https://github.com/cloudflare/cloudflare-typescript/commit/e75721c672a7f4a4ac6061f09c5896f3459537b7)) +* **api:** api update ([adb8ef5](https://github.com/cloudflare/cloudflare-typescript/commit/adb8ef593d8b62a2cd74c6aae39ce2760eb67a19)) +* **api:** api update ([b6ae6c8](https://github.com/cloudflare/cloudflare-typescript/commit/b6ae6c868b6a9f73bfed54f68187bf5c1a0a458e)) +* **api:** api update ([4e126f6](https://github.com/cloudflare/cloudflare-typescript/commit/4e126f6d036c9f4e581889de924aa48ed40b062d)) +* **api:** api update ([cf5423b](https://github.com/cloudflare/cloudflare-typescript/commit/cf5423bd6bc4eda20d8be971fe6f91b079759829)) +* **api:** api update ([2cf7645](https://github.com/cloudflare/cloudflare-typescript/commit/2cf76458a7900f98a6ff5ebf738a853e77cde10c)) +* **api:** api update ([db79b6e](https://github.com/cloudflare/cloudflare-typescript/commit/db79b6eff163e6d45de81ea5b6a7a74f5879db96)) +* **api:** api update ([1efe99b](https://github.com/cloudflare/cloudflare-typescript/commit/1efe99b7cc816478cfe2bcf8b8b029ee3cf0a8e0)) +* **api:** api update ([298d367](https://github.com/cloudflare/cloudflare-typescript/commit/298d367ca7b84e8e647554ee6143e7fd87aba4ff)) +* **api:** api update ([c7a6dfe](https://github.com/cloudflare/cloudflare-typescript/commit/c7a6dfeaf7c4c3d083d297d4fec22a6f52edbb2c)) +* **api:** api update ([278b0fc](https://github.com/cloudflare/cloudflare-typescript/commit/278b0fcab7ab5dcca86a8960dd05bb46d97634b5)) +* **api:** api update ([29a5177](https://github.com/cloudflare/cloudflare-typescript/commit/29a5177759404566a8c01c46988f57e7ec8f850f)) +* **api:** api update ([9d769e8](https://github.com/cloudflare/cloudflare-typescript/commit/9d769e8821e8b9c2c9ac56f432458c03d1789958)) +* **api:** api update ([2d545a0](https://github.com/cloudflare/cloudflare-typescript/commit/2d545a0f5ec14b641755888edd5526958f494161)) +* **api:** api update ([9e95597](https://github.com/cloudflare/cloudflare-typescript/commit/9e955973d0599b4d1eb3b11e01090dd40e7c3c14)) +* **api:** api update ([5f69e48](https://github.com/cloudflare/cloudflare-typescript/commit/5f69e4827a734597369cb9695a38529e7067f7f9)) +* **api:** api update ([686d461](https://github.com/cloudflare/cloudflare-typescript/commit/686d46139316ca172a934668d6043eb608f60ae7)) +* **api:** api update ([8069564](https://github.com/cloudflare/cloudflare-typescript/commit/8069564ea4cdd6094f0eb5c03b0e7ba9906ba4b0)) +* **api:** api update ([6760fad](https://github.com/cloudflare/cloudflare-typescript/commit/6760fad45f77594720e245eb14c02292273858ab)) +* **api:** api update ([b612a6b](https://github.com/cloudflare/cloudflare-typescript/commit/b612a6b3a9956b190cfa73263bcd8d7fcadd9e1f)) +* **api:** api update ([2a6608c](https://github.com/cloudflare/cloudflare-typescript/commit/2a6608c675a84da9791457ed12cf43fcb8c73d22)) +* **api:** api update ([0672db1](https://github.com/cloudflare/cloudflare-typescript/commit/0672db1eaaa43679f36b0b772b79ca6679783889)) +* **api:** api update ([0af28fa](https://github.com/cloudflare/cloudflare-typescript/commit/0af28fa5f637984c8e15df6b0f0a07b3329e8a7d)) +* **api:** api update ([f137333](https://github.com/cloudflare/cloudflare-typescript/commit/f137333345c22547290d25df05786a1c3b42f212)) +* **api:** api update ([650101c](https://github.com/cloudflare/cloudflare-typescript/commit/650101c9e51fa0ac85e4ed2d6bae56df1b9a602e)) +* **api:** api update ([b7e31b0](https://github.com/cloudflare/cloudflare-typescript/commit/b7e31b03815ae55e92fe394714d8e48d521520b4)) +* **client:** support file upload requests ([0a4e404](https://github.com/cloudflare/cloudflare-typescript/commit/0a4e4049bcf2d6ea77fd3e3776f297e95f8bd555)) + + +### Bug Fixes + +* **methods:** define methods with parameters and binary body correctly ([9e42614](https://github.com/cloudflare/cloudflare-typescript/commit/9e426141f704602afe31da83f5dad6a1babfcc44)) + + +### Chores + +* **api:** update composite API spec ([a1301f0](https://github.com/cloudflare/cloudflare-typescript/commit/a1301f033bec4e53d382744bc2ef5c22c2139595)) +* **api:** upload OpenAPI schema from api-schemas ([f30e927](https://github.com/cloudflare/cloudflare-typescript/commit/f30e927cf6d89e3580bdd77e0a8e2ae91bd9da56)) +* **api:** upload stainless config from cloudflare-config ([5f2237b](https://github.com/cloudflare/cloudflare-typescript/commit/5f2237bc35fb24a7c300d50f1fde80e019427934)) +* **api:** upload stainless config from cloudflare-config ([e6f0bcc](https://github.com/cloudflare/cloudflare-typescript/commit/e6f0bcc64c514667b751b85501bf17719be200c9)) +* **api:** upload stainless config from cloudflare-config ([6750686](https://github.com/cloudflare/cloudflare-typescript/commit/6750686b8c3d19bb3f486d741ad9550039dbad02)) +* **api:** upload stainless config from cloudflare-config ([e154418](https://github.com/cloudflare/cloudflare-typescript/commit/e1544186b24a6abcf13d974bcc58f0f2b6885de0)) +* **api:** upload stainless config from cloudflare-config ([b4e0415](https://github.com/cloudflare/cloudflare-typescript/commit/b4e04158da1bb348cfb08f692cfd64a10708c23f)) +* **api:** upload stainless config from cloudflare-config ([ccf8a40](https://github.com/cloudflare/cloudflare-typescript/commit/ccf8a40a0fa8ecff2b38dc6902a793313ed29e42)) +* **api:** upload stainless config from cloudflare-config ([26e5829](https://github.com/cloudflare/cloudflare-typescript/commit/26e58297407804597161880791d7ca8c541e88a8)) +* **api:** upload stainless config from cloudflare-config ([57c2584](https://github.com/cloudflare/cloudflare-typescript/commit/57c2584c49bca7da6c1475f6b8192e567434300f)) +* **api:** upload stainless config from cloudflare-config ([b80775e](https://github.com/cloudflare/cloudflare-typescript/commit/b80775eb66d13ac543c11645f34186cd00988852)) +* **api:** upload stainless config from cloudflare-config ([5a4fa8e](https://github.com/cloudflare/cloudflare-typescript/commit/5a4fa8e74a6043b5948c28a08e0d885ad5e94c55)) +* **api:** upload stainless config from cloudflare-config ([c79965d](https://github.com/cloudflare/cloudflare-typescript/commit/c79965da601db233f93527a350ea9eb6478b1595)) +* **api:** upload stainless config from cloudflare-config ([b97353d](https://github.com/cloudflare/cloudflare-typescript/commit/b97353dff144dc1c88de4a54ec8584fd322d43e3)) +* **api:** upload stainless config from cloudflare-config ([7c24b14](https://github.com/cloudflare/cloudflare-typescript/commit/7c24b14521f92d9c80bb1a5f039c43bb33c62c1b)) +* **api:** upload stainless config from cloudflare-config ([03790cc](https://github.com/cloudflare/cloudflare-typescript/commit/03790cc32ca9e8930a770468349f346d4fb0de26)) +* **api:** upload stainless config from cloudflare-config ([72c4336](https://github.com/cloudflare/cloudflare-typescript/commit/72c433647949e8c4aa7f2323fc1b0ebb94cacf64)) +* **api:** upload stainless config from cloudflare-config ([b816588](https://github.com/cloudflare/cloudflare-typescript/commit/b8165887056f71717deaf9f15083c4266c426267)) +* **api:** upload stainless config from cloudflare-config ([afaabaa](https://github.com/cloudflare/cloudflare-typescript/commit/afaabaad39785cfa99294a320dafbee54f1ca2e6)) +* **api:** upload stainless config from cloudflare-config ([651f179](https://github.com/cloudflare/cloudflare-typescript/commit/651f179a698a0da0d25376c538187e53697ec3c9)) +* **api:** upload stainless config from cloudflare-config ([2fa76d8](https://github.com/cloudflare/cloudflare-typescript/commit/2fa76d8a3dc756f1e8e4a8e7b83cee859dfc5251)) +* **api:** upload stainless config from cloudflare-config ([579fa30](https://github.com/cloudflare/cloudflare-typescript/commit/579fa30b2ef17be56ce87cf99f6ced0eea6943b4)) +* **api:** upload stainless config from cloudflare-config ([d409ced](https://github.com/cloudflare/cloudflare-typescript/commit/d409ced1739b16275d6a426023c1bf1a6a3f3efd)) +* **api:** upload stainless config from cloudflare-config ([e0100f9](https://github.com/cloudflare/cloudflare-typescript/commit/e0100f9ca4c50847707f96b8b34d9019592f7b11)) +* **api:** upload stainless config from cloudflare-config ([4b59fc5](https://github.com/cloudflare/cloudflare-typescript/commit/4b59fc5c37537eda888f981982cd89bca48bdbb8)) +* **api:** upload stainless config from cloudflare-config ([6f512ce](https://github.com/cloudflare/cloudflare-typescript/commit/6f512ce9a09acf86f8d99b11d497e9530d58cbef)) +* **api:** upload stainless config from cloudflare-config ([acdb02e](https://github.com/cloudflare/cloudflare-typescript/commit/acdb02eda7bf53c05fdda0d636beb2d132e54fec)) +* **api:** upload stainless config from cloudflare-config ([c2327a1](https://github.com/cloudflare/cloudflare-typescript/commit/c2327a1c83aa7deecce08a5eb1a9a966a4d22b5b)) +* **api:** upload stainless config from cloudflare-config ([5dc4f71](https://github.com/cloudflare/cloudflare-typescript/commit/5dc4f7124e95ab46f1ca4e00b418bef6e1586f55)) +* **api:** upload stainless config from cloudflare-config ([7b381d8](https://github.com/cloudflare/cloudflare-typescript/commit/7b381d8d1f15579e860390de3ca13a02f590d539)) +* **api:** upload stainless config from cloudflare-config ([4da7b68](https://github.com/cloudflare/cloudflare-typescript/commit/4da7b68f759ec954c163f8304be01a0253d8095f)) +* **api:** upload stainless config from cloudflare-config ([aab4c1f](https://github.com/cloudflare/cloudflare-typescript/commit/aab4c1fe6ba01d801376bba35279352495210fcb)) +* **api:** upload stainless config from cloudflare-config ([452be6b](https://github.com/cloudflare/cloudflare-typescript/commit/452be6b9b9a6d45894b3cee30c8931ced7fd2e86)) +* **api:** upload stainless config from cloudflare-config ([3b2317c](https://github.com/cloudflare/cloudflare-typescript/commit/3b2317c217af3f35c7352148dc41a0893885855f)) +* **api:** upload stainless config from cloudflare-config ([ecd1b0f](https://github.com/cloudflare/cloudflare-typescript/commit/ecd1b0f9beb71debc60adec2f1e833079b55e0f4)) +* **api:** upload stainless config from cloudflare-config ([602dffc](https://github.com/cloudflare/cloudflare-typescript/commit/602dffcf3740c0dfb8dfb190e15c3a76174d3760)) +* **api:** upload stainless config from cloudflare-config ([afdba32](https://github.com/cloudflare/cloudflare-typescript/commit/afdba327d64702324a88c179d15bdd9ebe0eddbc)) +* **internal:** move publish config ([2bfc1d9](https://github.com/cloudflare/cloudflare-typescript/commit/2bfc1d96b7e4b3ef0a5aaf786f60e91d46bbf4cd)) +* **internal:** remove redundant imports config ([07e9e91](https://github.com/cloudflare/cloudflare-typescript/commit/07e9e91b07d9774b8d150c6109aeeb6027bbfee3)) +* **internal:** update comment in script ([6114cd0](https://github.com/cloudflare/cloudflare-typescript/commit/6114cd05308867542a61d94158c70ad28deb7ae6)) +* update @stainless-api/prism-cli to v5.15.0 ([8e313d6](https://github.com/cloudflare/cloudflare-typescript/commit/8e313d66854ac6c476b20abd364d0b3a8308ed49)) + ## 4.5.0 (2025-07-16) Full Changelog: [v4.4.1...v4.5.0](https://github.com/cloudflare/cloudflare-typescript/compare/v4.4.1...v4.5.0) diff --git a/package.json b/package.json index 3d02585891..b237c80293 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cloudflare", - "version": "4.5.0", + "version": "4.6.0", "description": "The official TypeScript library for the Cloudflare API", "author": "Cloudflare ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index dc414ab9ea..b04b2bd0c8 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '4.5.0'; // x-release-please-version +export const VERSION = '4.6.0'; // x-release-please-version